Version Description
Update to get new features and better security.
Download this release
Release Info
Developer | sayful |
Plugin | Carousel Slider |
Version | 2.0.7 |
Comparing to | |
See all releases |
Code changes from version 1.10.2 to 2.0.7
- assets/css/admin.css +1 -15
- assets/css/divi-modules.css +1 -0
- assets/css/frontend.css +1 -1
- assets/css/gutenberg-block.css +1 -1
- assets/js/admin.js +2 -1
- assets/js/admin.js.LICENSE.txt +18 -0
- assets/js/divi-modules.js +1 -0
- assets/js/frontend.js +2 -1
- assets/js/frontend.js.LICENSE.txt +3 -0
- assets/js/gutenberg-block.js +1 -1
- assets/js/style-loader.js +1 -0
- assets/lib/magnific-popup/jquery.magnific-popup.js +0 -1860
- assets/lib/magnific-popup/jquery.magnific-popup.min.js +0 -4
- assets/lib/owl-carousel/owl.carousel.js +0 -3448
- assets/lib/owl-carousel/owl.carousel.min.js +0 -7
- assets/lib/select2/select2.js +0 -5746
- assets/lib/select2/select2.min.js +0 -1
- assets/lib/wp-color-picker-alpha/wp-color-picker-alpha.js +0 -496
- assets/lib/wp-color-picker-alpha/wp-color-picker-alpha.min.js +0 -11
- assets/static-images/logo.svg +59 -121
- carousel-slider.php +54 -94
- classes/Admin/Admin.php +0 -98
- classes/Admin/GutenbergBlock.php +0 -91
- classes/Admin/Setting.php +0 -66
- classes/Frontend/Frontend.php +0 -62
- classes/Frontend/Preview.php +0 -44
- classes/Frontend/Shortcode.php +0 -376
- classes/Integration/VisualComposerElement.php +0 -81
- includes/Abstracts/AbstractTemplate.php +126 -0
- includes/Abstracts/AbstractView.php +204 -0
- includes/Abstracts/Data.php +166 -0
- includes/Abstracts/OwlSetting.php +69 -0
- includes/Abstracts/SliderSetting.php +328 -0
- includes/Admin/Admin.php +327 -0
- includes/Admin/GutenbergBlock.php +105 -0
- includes/Admin/MetaBox.php +552 -0
- includes/Admin/Setting.php +150 -0
- {classes → includes}/Ajax.php +9 -1
- {classes → includes}/Assets.php +37 -45
- {classes → includes}/Autoloader.php +22 -18
- includes/CLI/Command.php +364 -0
- includes/Frontend/Frontend.php +130 -0
- includes/Frontend/Preview.php +102 -0
- {classes → includes}/Frontend/StructuredData.php +135 -84
- includes/Helper.php +253 -0
- includes/Integration/DiviBuilder/DiviBuilderModule.php +84 -0
- includes/Integration/DiviBuilder/Module.php +91 -0
- includes/Integration/Elementor/ElementorExtension.php +63 -0
- includes/Integration/Elementor/ElementorWidget.php +163 -0
- includes/Integration/VisualComposer/Element.php +88 -0
- includes/Interfaces/FieldInterface.php +39 -0
- includes/Interfaces/FormBuilderInterface.php +33 -0
- includes/Interfaces/SliderViewInterface.php +29 -0
- {classes → includes}/Plugin.php +37 -57
- includes/Supports/FormFields/BaseField.php +265 -0
- includes/Supports/FormFields/ButtonGroup.php +39 -0
- includes/Supports/FormFields/Checkbox.php +33 -0
- includes/Supports/FormFields/Color.php +32 -0
- includes/Supports/FormFields/ImagesGallery.php +50 -0
- includes/Supports/FormFields/Select.php +34 -0
- includes/Supports/FormFields/Spacing.php +45 -0
- includes/Supports/FormFields/Text.php +18 -0
- includes/Supports/FormFields/Textarea.php +20 -0
- includes/Supports/MetaBoxForm.php +328 -0
- includes/Supports/Sanitize.php +220 -0
- {classes → includes}/Supports/SettingAPI.php +74 -116
- includes/Supports/SettingApi/DefaultSettingApi.php +339 -0
- includes/Supports/SettingApi/FormBuilder.php +391 -0
- includes/Supports/SettingApi/SettingApi.php +418 -0
- includes/Supports/Validate.php +50 -0
- includes/Upgrader.php +185 -0
- includes/ViewHelper.php +65 -0
- {classes → includes}/Widget/CarouselSliderWidget.php +29 -28
- includes/class-carousel-slider-activator.php +0 -80
- includes/class-carousel-slider-admin.php +0 -189
assets/css/admin.css
CHANGED
@@ -1,15 +1 @@
|
|
1 |
-
div[id*=_carousel_slider] .widget-top{background:#dff!important;border:1px solid #2196f3!important}div[id*=_carousel_slider] .widget-top:hover{background:#fdd!important;border:1px solid #f44336!important}.shapla-toggle{margin:1em 0!important}.shapla-toggle-title{display:block;padding:15px 10px;outline:0;cursor:pointer;position:relative}.shapla-toggle-title:after{position:absolute;right:15px;font:400 20px/1 dashicons;margin-left:-1px;padding-right:3px;vertical-align:top;content:"\f132"}.shapla-toggle-title.ui-state-active:after{content:"\f460"}.shapla-toggle-content{padding:20px;background-color:#f1f1f1}.shapla-toggle--normal .shapla-toggle-title{background:#9e9e9e;color:#fff;font-weight:600}.shapla-toggle--stroke .shapla-toggle-title{border:1px solid #363f48;font-weight:600}.shapla-toggle--stroke .shapla-toggle-title:after{color:#363f48}.shapla-toggle--stroke .shapla-toggle-content{padding:20px;background-color:#fff;border:1px solid #363f48;border-top:none}.overflowHidden{overflow:hidden}.overflowVisible{overflow:visible}.sp-input-group{margin-bottom:10px}.sp-input-group:after{content:"";display:table;clear:both}.sp-input-label label{font-weight:600;margin-right:30px}.sp-input-field,.sp-input-label{float:left;width:100%}.sp-input-desc{color:#999;font-size:.9em;line-height:1.3em;margin:10px 30px 10px 0}.sp-input-text{width:100%;padding:8px 8px 8px 16px;height:35px!important}.sp-input-text option{padding:8px 4px}.spacing-text{width:62px}@media only screen and (min-width:600px){.sp-input-label{width:40%}.sp-input-field{width:60%}}@media only screen and (min-width:783px){.sp-input-label{width:30%}.sp-input-field{width:70%}.sp-input-text{width:25em}}@media only screen and (min-width:851px){.sp-input-field,.sp-input-label{width:100%}}@media only screen and (min-width:1200px){.sp-input-label{width:40%}.sp-input-field{width:60%}}@media only screen and (min-width:1600px){.sp-input-label{width:30%}.sp-input-field{width:70%}}.carousel_slider_images:after,.carousel_slider_images:before{display:table;content:""}.carousel_slider_images:after{clear:both}.carousel_slider_gallery_btn{border:1px solid #616161;color:#616161;background-color:#f1f1f1;padding:5px 15px;text-decoration:none}.carousel_slider_gallery_btn:hover{background-color:#fff;color:#616161}.carousel_slider_gallery_list{margin:15px 0 0;padding:0;list-style:none;box-sizing:border-box}.carousel_slider_gallery_list:after,.carousel_slider_gallery_list:before{display:table;content:""}.carousel_slider_gallery_list:after{clear:both}.carousel_slider_gallery_list li{float:left;margin:0;padding:0}.carousel_slider_gallery_list li>img{margin-right:10px;margin-bottom:10px;display:block;box-shadow:0 2px 4px 0 rgba(0,0,0,.16),0 2px 10px 0 rgba(0,0,0,.12)}#field-_post_categories,#field-_post_date_after,#field-_post_date_before,#field-_post_in,#field-_post_tags,#field-_product_categories,#field-_product_in,#field-_product_query,#field-_product_tags{display:none}#carousel-slider-autoplay-settings p,#carousel-slider-navigation-settings p,#carousel-slider-responsive-settings p{overflow:hidden}#carousel-slider-autoplay-settings input.small-text,#carousel-slider-autoplay-settings select.small-text,#carousel-slider-navigation-settings input.small-text,#carousel-slider-navigation-settings select.small-text,#carousel-slider-responsive-settings input.small-text,#carousel-slider-responsive-settings select.small-text{float:right}.tab-background .slide_bg_wrapper{display:flex;padding:1rem 0}.tab-background .slide_thumb{position:relative;float:left;margin-right:1rem;border:1px solid #e0e0e0;padding:5px}.tab-background .slide_thumb>div{width:320px;height:180px;background-color:#f1f1f1;background-repeat:no-repeat;background-position:0 0;background-size:100% auto}.tab-background .slide_thumb>span{display:inline-block;position:absolute;top:0;right:0;font-family:Arial,Helvetica,sans-serif;font-size:14px;line-height:14px;padding:3px;background-color:rgba(0,0,0,.5);color:#fff;cursor:pointer;transition:all .3s ease-in-out}.tab-background .slide_thumb>span.hidden{display:none!important}.tab-background .slide_image_settings_line{display:block;margin:.5rem 0}.tab-background .slide_image_settings_line>span{width:150px;display:inline-block}.ui-datepicker{background-color:#fff;border:1px solid #ccc;box-shadow:0 2px 4px 0 rgba(0,0,0,.16),0 2px 10px 0 rgba(0,0,0,.12);padding:8px;display:none}.ui-datepicker-header{background-color:#f1f1f1}.ui-datepicker-next,.ui-datepicker-prev{color:#000;padding:6px;cursor:pointer}.ui-datepicker-next:hover,.ui-datepicker-prev:hover{color:#000}.ui-datepicker-prev{float:left}.ui-datepicker-next{float:right}.ui-datepicker-calendar td>a{border:1px solid #ddd;display:block;padding:6px;text-decoration:none;color:#000;background-color:#f1f1f1}.ui-datepicker-calendar td.ui-datepicker-today>a{color:#000;background-color:#ffeb3b}.ui-datepicker-calendar td.ui-datepicker-current-day>a{color:#fff;background-color:#f44336}.sp-wp-editor-container{max-width:560px}.select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container[dir=rtl] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background-color:#fff;border:1px solid #aaa;border-radius:0;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;user-select:none;-webkit-user-select:none}.select2-results__option[aria-selected]{cursor:pointer}.select2-container--open .select2-dropdown{left:0}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0)}.select2-hidden-accessible{border:0!important;clip:rect(0 0 0 0)!important;height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;width:1px!important}.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:0}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:700}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px}.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent;border-style:solid;border-width:5px 4px 0;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--default[dir=rtl] .select2-selection--single .select2-selection__clear{float:left}.select2-container--default[dir=rtl] .select2-selection--single .select2-selection__arrow{left:1px;right:auto}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888;border-width:0 4px 5px}.select2-container--default .select2-selection--multiple{background-color:#fff;border:1px solid #aaa;border-radius:0;cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none}.select2-container--default .select2-selection--multiple .select2-selection__placeholder{color:#999;margin-top:5px;float:left}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:700;margin-top:5px;margin-right:10px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:0;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:700;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333}.select2-container--default[dir=rtl] .select2-selection--multiple .select2-search--inline,.select2-container--default[dir=rtl] .select2-selection--multiple .select2-selection__choice,.select2-container--default[dir=rtl] .select2-selection--multiple .select2-selection__placeholder{float:right}.select2-container--default[dir=rtl] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--default[dir=rtl] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--default.select2-container--focus .select2-selection--multiple{border:1px solid #000;outline:0}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple,.select2-container--default.select2-container--open.select2-container--above .select2-selection--single{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple,.select2-container--default.select2-container--open.select2-container--below .select2-selection--single{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa}.select2-container--default .select2-search--inline .select2-search__field{background:transparent;border:none;outline:0;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999}.select2-container--default .select2-results__option[aria-selected=true]{background-color:#ddd}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#5897fb;color:#fff}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:0;outline:0;background-image:linear-gradient(180deg,#fff 50%,#eee);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#FFFFFFFF",endColorstr="#FFEEEEEE",GradientType=0)}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:700;margin-right:10px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:linear-gradient(180deg,#eee 50%,#ccc);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#FFEEEEEE",endColorstr="#FFCCCCCC",GradientType=0)}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent;border-style:solid;border-width:5px 4px 0;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--classic[dir=rtl] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir=rtl] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:transparent;border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888;border-width:0 4px 5px}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:linear-gradient(180deg,#fff 0,#eee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#FFFFFFFF",endColorstr="#FFEEEEEE",GradientType=0)}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:linear-gradient(180deg,#eee 50%,#fff);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#FFEEEEEE",endColorstr="#FFFFFFFF",GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:#fff;border:1px solid #aaa;border-radius:0;cursor:text;outline:0}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:0;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:700;margin-right:2px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555}.select2-container--classic[dir=rtl] .select2-selection--multiple .select2-selection__choice{float:right;margin-left:5px;margin-right:auto}.select2-container--classic[dir=rtl] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;box-shadow:none}.select2-container--classic .select2-dropdown{background-color:#fff;border:1px solid transparent}.select2-container--classic .select2-dropdown--above{border-bottom:none}.select2-container--classic .select2-dropdown--below{border-top:none}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--classic .select2-results__option[role=group]{padding:0}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey}.select2-container--classic .select2-results__option--highlighted[aria-selected]{background-color:#3875d7;color:#fff}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb}.carousel_slider-modal{display:none;position:fixed;z-index:10000;left:0;top:0;width:100%;height:100%;overflow:hidden;background-color:#000;background-color:rgba(0,0,0,.8)}.carousel_slider-modal-content{position:relative;background-color:#fefefe;margin:50px auto 18px;padding:0;border:1px solid #23282d;min-height:300px;width:412px;box-shadow:0 4px 8px 0 rgba(0,0,0,.2),0 6px 20px 0 rgba(0,0,0,.19)}.carousel_slider-modal-header{background-color:#23282d;color:#fff;font-weight:700;padding:10px 16px}.carousel_slider-modal-body{overflow-x:hidden;overflow-y:scroll;padding:2px 16px}.carousel_slider-modal-footer{background-color:#23282d;color:#fff;font-weight:700;padding:10px 16px}.carousel_slider-modal-footer img{display:none;height:14px;vertical-align:middle;width:14px}.carousel_slider-form{margin-left:-15px;margin-right:-15px}.carousel_slider-fields{background-color:#f1f1f1;margin:15px;padding:15px 25px 15px 15px;position:relative;display:inline-block;float:left}.carousel_slider-fields label.setting{display:block;margin-bottom:5px}.carousel_slider-fields label.setting .name{display:inline-block;vertical-align:top;width:75px}.carousel_slider-fields label.setting input,.carousel_slider-fields label.setting textarea{width:250px}.carousel_slider-fields .actions{position:absolute;right:0;top:0}.carousel_slider-fields .actions>span{background:#fff none repeat scroll 0 0;display:block;float:none;cursor:pointer}.carousel_slider-fields .actions>span .dashicons-plus-alt:hover{color:green}.carousel_slider-fields .actions>span .dashicons-trash:hover{color:red}.carousel_slider-close{color:#f1f1f1;float:right;font-size:28px;font-weight:700}.carousel_slider-close:focus,.carousel_slider-close:hover{color:#fff;text-decoration:none;cursor:pointer}.carousel_slider_url_images_list{margin:15px 0 0;padding:0;list-style:none}.carousel_slider_url_images_list li{float:left;display:inline-block;margin:0 5px 5px 0}@media only screen and (min-width:820px){.carousel_slider-modal-content{width:810px}}@media only screen and (min-width:1230px){.carousel_slider-modal-content{width:1220px}}.modal{bottom:0;left:0;position:absolute;right:0;top:0;align-items:center;display:none;justify-content:center;overflow:hidden;position:fixed;z-index:10000}.admin-bar .modal{top:32px}.modal .delete-icon{-webkit-user-select:none;user-select:none;-moz-appearance:none;-webkit-appearance:none;background-color:rgba(0,0,0,.2);border:none;border-radius:32px;cursor:pointer;display:inline-block;flex-grow:0;flex-shrink:0;font-size:1rem;outline:none;position:relative;vertical-align:top;height:20px;width:20px}.modal .delete-icon:after,.modal .delete-icon:before{background-color:#fff;content:"";display:block;left:50%;position:absolute;top:50%;transform:translateX(-50%) translateY(-50%) rotate(45deg);transform-origin:center center}.modal .delete-icon:before{height:2px;width:50%}.modal .delete-icon:after{height:50%;width:2px}.modal .delete-icon:focus,.modal .delete-icon:hover{background-color:rgba(0,0,0,.3)}.modal .delete-icon:active{background-color:rgba(0,0,0,.4)}.modal .delete-icon.is-small{height:16px;width:16px}.modal .delete-icon.is-medium{height:24px;width:24px}.modal .delete-icon.is-large{height:32px;width:32px}.modal.is-active{display:flex}.modal-background{bottom:0;left:0;position:absolute;right:0;top:0;background-color:rgba(0,0,0,.86)}.modal-card,.modal-content{margin:0 20px;max-height:calc(100vh - 160px);overflow:auto;position:relative;width:100%}@media print,screen and (min-width:769px){.modal-card,.modal-content{margin:0 auto;max-height:calc(100vh - 40px);width:640px}}.modal-close{-webkit-user-select:none;user-select:none;-moz-appearance:none;-webkit-appearance:none;background-color:rgba(0,0,0,.2);border:none;border-radius:32px;cursor:pointer;display:inline-block;flex-grow:0;flex-shrink:0;font-size:1rem;outline:none;position:relative;vertical-align:top;height:20px;width:20px;background:none;height:40px;position:fixed;right:20px;top:20px;width:40px}.modal-close:after,.modal-close:before{background-color:#fff;content:"";display:block;left:50%;position:absolute;top:50%;transform:translateX(-50%) translateY(-50%) rotate(45deg);transform-origin:center center}.modal-close:before{height:2px;width:50%}.modal-close:after{height:50%;width:2px}.modal-close:focus,.modal-close:hover{background-color:rgba(0,0,0,.3)}.modal-close:active{background-color:rgba(0,0,0,.4)}.modal-close.is-small{height:16px;width:16px}.modal-close.is-medium{height:24px;width:24px}.modal-close.is-large{height:32px;width:32px}.modal-card{display:flex;flex-direction:column;max-height:calc(100vh - 40px);overflow:hidden}.modal-card-foot,.modal-card-head{align-items:center;background-color:#f5f5f5;display:flex;flex-shrink:0;justify-content:flex-start;margin:0;padding:20px;position:relative}.modal-card-head{border-bottom:1px solid #f5f5f5;border-top-left-radius:5px;border-top-right-radius:5px}.modal-card-title{color:#212121;flex-grow:1;flex-shrink:0;font-size:1.5rem;line-height:1;margin:0;padding:0}.modal-card-foot{border-bottom-left-radius:5px;border-bottom-right-radius:5px;border-top:1px solid #f5f5f5}.modal-card-foot .button:not(:last-child){margin-right:10px}.modal-card-body{-webkit-overflow-scrolling:touch;background-color:#fff;flex-grow:1;flex-shrink:1;overflow:auto;margin:0;padding:20px}.shapla-nav{list-style:none!important;margin:0;padding:0}.shapla-nav:after,.shapla-nav:before{display:table;content:" "}.shapla-nav:after{clear:both}.shapla-nav li{float:left;position:relative;margin:0 1px -1px 0!important;z-index:1;outline:0}.shapla-nav a{text-decoration:none;display:block;padding:15px 10px;line-height:1;outline:0}.shapla-tab{margin:0 0 2em;padding:21px 20px 20px}.shapla-tab p:first-of-type{margin-top:0}.shapla-tab p:last-of-type{margin-bottom:0}.shapla-tabs--normal .shapla-nav a{background:#323232;color:#fff}.shapla-tabs--normal .shapla-nav .ui-tabs-active a{background:#f1f1f1;color:#323232;outline:0}.shapla-tabs--normal .shapla-tab{background:#f1f1f1}.shapla-tabs--stroke .shapla-nav li{margin:0 -1px 0 0!important}.shapla-tabs--stroke .shapla-nav a{border:1px solid #323232;color:#323232}.shapla-tabs--stroke .shapla-nav .ui-tabs-active a{border-bottom-color:#fff}.shapla-tabs--stroke .shapla-tab{border:1px solid #323232;margin-top:-1px}.carousel_slider_iframe{position:relative;padding-bottom:56.25%;padding-top:25px;height:0}.carousel_slider_iframe>iframe{position:absolute;top:0;left:0;width:100%;height:100%}.carousel_slider_columns{display:flex;flex-wrap:wrap;box-sizing:border-box}.carousel_slider_column{flex:0 0 100%;padding:1rem;box-sizing:border-box}@media screen and (min-width:601px){.carousel_slider_column{flex:0 0 50%}}@media screen and (min-width:1025px){.carousel_slider_column{flex:0 0 33.333333%}}@media screen and (min-width:1400px){.carousel_slider_column{flex:0 0 25%}}.shapla-tooltip{transform:scale(0);transform-origin:top center;z-index:9999;border-radius:2px;display:inline-block;font-size:12px;font-weight:400;line-height:1.2;max-width:170px;position:fixed;top:-500px;left:-500px;padding:8px;text-align:center;box-shadow:0 3px 4px 0 rgba(0,0,0,.14),0 3px 3px -2px rgba(0,0,0,.2),0 1px 8px 0 rgba(0,0,0,.12);background-color:rgba(0,0,0,.92);background-image:linear-gradient(180deg,transparent,#000);color:#fff}.shapla-tooltip.is-light-theme{background-color:hsla(0,0%,96.1%,.92);background-image:linear-gradient(180deg,transparent,#f5f5f5);color:#323232}.shapla-tooltip.is-active{-webkit-animation:shapla-tooltip-pulse .2s cubic-bezier(0,0,.2,1) forwards;animation:shapla-tooltip-pulse .2s cubic-bezier(0,0,.2,1) forwards}.shapla-tooltip--large{line-height:14px;font-size:16px;padding:16px}@-webkit-keyframes shapla-tooltip-pulse{0%{transform:scale(0);opacity:0}50%{transform:scale(.99)}to{transform:scale(1);opacity:1;visibility:visible}}@keyframes shapla-tooltip-pulse{0%{transform:scale(0);opacity:0}50%{transform:scale(.99)}to{transform:scale(1);opacity:1;visibility:visible}}[data-tooltip-target]{display:inline-block;float:right;height:1.5em;position:relative;width:1.5em}[data-tooltip-target]:after{font-family:Dashicons;speak:none;font-weight:400;text-transform:none;-webkit-font-smoothing:antialiased;width:100%;height:100%;text-align:center;content:"\f223";cursor:help}
|
2 |
-
|
3 |
-
.cs_plugin_upgrade_notice.major_update {
|
4 |
-
border-top: 1px solid #dba617;
|
5 |
-
margin-top: 1rem;
|
6 |
-
padding: 1rem 0;
|
7 |
-
}
|
8 |
-
|
9 |
-
.cs_plugin_upgrade_notice__title {
|
10 |
-
font-size: 1.125em;
|
11 |
-
}
|
12 |
-
|
13 |
-
.cs_plugin_upgrade_notice__description {
|
14 |
-
padding-top: 1rem;
|
15 |
-
}
|
1 |
+
.select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;overflow:hidden;padding-left:8px;padding-right:20px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container[dir=rtl] .select2-selection--single .select2-selection__rendered{padding-left:20px;padding-right:8px}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{border:none;box-sizing:border-box;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background-color:#fff;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;left:-100000px;position:absolute;width:100%;z-index:1051}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;user-select:none;-webkit-user-select:none}.select2-results__option[aria-selected]{cursor:pointer}.select2-container--open .select2-dropdown{left:0}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{box-sizing:border-box;padding:4px;width:100%}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{background-color:#fff;border:0;display:block;filter:alpha(opacity=0);height:auto;left:0;margin:0;min-height:100%;min-width:100%;opacity:0;padding:0;position:fixed;top:0;width:auto;z-index:99}.select2-hidden-accessible{clip:rect(0 0 0 0)!important;border:0!important;-webkit-clip-path:inset(50%)!important;clip-path:inset(50%)!important;height:1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;white-space:nowrap!important;width:1px!important}.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:4px}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:700}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;right:1px;top:1px;width:20px}.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 #0000 #0000;border-style:solid;border-width:5px 4px 0;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--default[dir=rtl] .select2-selection--single .select2-selection__clear{float:left}.select2-container--default[dir=rtl] .select2-selection--single .select2-selection__arrow{left:1px;right:auto}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:#0000 #0000 #888;border-width:0 4px 5px}.select2-container--default .select2-selection--multiple{background-color:#fff;border:1px solid #aaa;border-radius:4px;cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:700;margin-right:10px;margin-top:5px;padding:1px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:700;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333}.select2-container--default[dir=rtl] .select2-selection--multiple .select2-search--inline,.select2-container--default[dir=rtl] .select2-selection--multiple .select2-selection__choice{float:right}.select2-container--default[dir=rtl] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--default[dir=rtl] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--default.select2-container--focus .select2-selection--multiple{border:1px solid #000;outline:0}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple,.select2-container--default.select2-container--open.select2-container--above .select2-selection--single{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple,.select2-container--default.select2-container--open.select2-container--below .select2-selection--single{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa}.select2-container--default .select2-search--inline .select2-search__field{-webkit-appearance:textfield;background:#0000;border:none;box-shadow:none;outline:0}.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999}.select2-container--default .select2-results__option[aria-selected=true]{background-color:#ddd}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#5897fb;color:#fff}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;background-image:linear-gradient(180deg,#fff 50%,#eee);background-repeat:repeat-x;border:1px solid #aaa;border-radius:4px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#FFFFFFFF",endColorstr="#FFEEEEEE",GradientType=0);outline:0}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:700;margin-right:10px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;background-image:linear-gradient(180deg,#eee 50%,#ccc);background-repeat:repeat-x;border:none;border-bottom-right-radius:4px;border-left:1px solid #aaa;border-top-right-radius:4px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#FFEEEEEE",endColorstr="#FFCCCCCC",GradientType=0);height:26px;position:absolute;right:1px;top:1px;width:20px}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 #0000 #0000;border-style:solid;border-width:5px 4px 0;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--classic[dir=rtl] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir=rtl] .select2-selection--single .select2-selection__arrow{border:none;border-radius:0;border-bottom-left-radius:4px;border-right:1px solid #aaa;border-top-left-radius:4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:#0000;border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:#0000 #0000 #888;border-width:0 4px 5px}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{background-image:linear-gradient(180deg,#fff 0,#eee 50%);background-repeat:repeat-x;border-top:none;border-top-left-radius:0;border-top-right-radius:0;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#FFFFFFFF",endColorstr="#FFEEEEEE",GradientType=0)}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{background-image:linear-gradient(180deg,#eee 50%,#fff);background-repeat:repeat-x;border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#FFEEEEEE",endColorstr="#FFFFFFFF",GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:#fff;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:700;margin-right:2px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555}.select2-container--classic[dir=rtl] .select2-selection--multiple .select2-selection__choice{float:right;margin-left:5px;margin-right:auto}.select2-container--classic[dir=rtl] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0}.select2-container--classic .select2-search--inline .select2-search__field{box-shadow:none;outline:0}.select2-container--classic .select2-dropdown{background-color:#fff;border:1px solid #0000}.select2-container--classic .select2-dropdown--above{border-bottom:none}.select2-container--classic .select2-dropdown--below{border-top:none}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--classic .select2-results__option[role=group]{padding:0}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey}.select2-container--classic .select2-results__option--highlighted[aria-selected]{background-color:#3875d7;color:#fff}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb}.shapla-column{display:block;flex:1 1 0}.shapla-column[class*=is-]{flex:none}.shapla-columns.is-mobile>.shapla-column.is-1{width:8.3333333333%}.shapla-columns.is-mobile>.shapla-column.is-2{width:16.6666666667%}.shapla-columns.is-mobile>.shapla-column.is-3{width:25%}.shapla-columns.is-mobile>.shapla-column.is-4{width:33.3333333333%}.shapla-columns.is-mobile>.shapla-column.is-5{width:41.6666666667%}.shapla-columns.is-mobile>.shapla-column.is-6{width:50%}.shapla-columns.is-mobile>.shapla-column.is-7{width:58.3333333333%}.shapla-columns.is-mobile>.shapla-column.is-8{width:66.6666666667%}.shapla-columns.is-mobile>.shapla-column.is-9{width:75%}.shapla-columns.is-mobile>.shapla-column.is-10{width:83.3333333333%}.shapla-columns.is-mobile>.shapla-column.is-11{width:91.6666666667%}.shapla-columns.is-mobile>.shapla-column.is-12{width:100%}@media screen and (max-width:767px){.shapla-column.is-1-mobile{width:8.3333333333%}.shapla-column.is-2-mobile{width:16.6666666667%}.shapla-column.is-3-mobile{width:25%}.shapla-column.is-4-mobile{width:33.3333333333%}.shapla-column.is-5-mobile{width:41.6666666667%}.shapla-column.is-6-mobile{width:50%}.shapla-column.is-7-mobile{width:58.3333333333%}.shapla-column.is-8-mobile{width:66.6666666667%}.shapla-column.is-9-mobile{width:75%}.shapla-column.is-10-mobile{width:83.3333333333%}.shapla-column.is-11-mobile{width:91.6666666667%}.shapla-column.is-12-mobile{width:100%}}@media print,screen and (min-width:768px){.shapla-column.is-1,.shapla-column.is-1-tablet{width:8.3333333333%}.shapla-column.is-2,.shapla-column.is-2-tablet{width:16.6666666667%}.shapla-column.is-3,.shapla-column.is-3-tablet{width:25%}.shapla-column.is-4,.shapla-column.is-4-tablet{width:33.3333333333%}.shapla-column.is-5,.shapla-column.is-5-tablet{width:41.6666666667%}.shapla-column.is-6,.shapla-column.is-6-tablet{width:50%}.shapla-column.is-7,.shapla-column.is-7-tablet{width:58.3333333333%}.shapla-column.is-8,.shapla-column.is-8-tablet{width:66.6666666667%}.shapla-column.is-9,.shapla-column.is-9-tablet{width:75%}.shapla-column.is-10,.shapla-column.is-10-tablet{width:83.3333333333%}.shapla-column.is-11,.shapla-column.is-11-tablet{width:91.6666666667%}.shapla-column.is-12,.shapla-column.is-12-tablet{width:100%}}@media screen and (min-width:1024px){.shapla-column.is-1-desktop{width:8.3333333333%}.shapla-column.is-2-desktop{width:16.6666666667%}.shapla-column.is-3-desktop{width:25%}.shapla-column.is-4-desktop{width:33.3333333333%}.shapla-column.is-5-desktop{width:41.6666666667%}.shapla-column.is-6-desktop{width:50%}.shapla-column.is-7-desktop{width:58.3333333333%}.shapla-column.is-8-desktop{width:66.6666666667%}.shapla-column.is-9-desktop{width:75%}.shapla-column.is-10-desktop{width:83.3333333333%}.shapla-column.is-11-desktop{width:91.6666666667%}.shapla-column.is-12-desktop{width:100%}}@media screen and (min-width:1280px){.shapla-column.is-1-widescreen{width:8.3333333333%}.shapla-column.is-2-widescreen{width:16.6666666667%}.shapla-column.is-3-widescreen{width:25%}.shapla-column.is-4-widescreen{width:33.3333333333%}.shapla-column.is-5-widescreen{width:41.6666666667%}.shapla-column.is-6-widescreen{width:50%}.shapla-column.is-7-widescreen{width:58.3333333333%}.shapla-column.is-8-widescreen{width:66.6666666667%}.shapla-column.is-9-widescreen{width:75%}.shapla-column.is-10-widescreen{width:83.3333333333%}.shapla-column.is-11-widescreen{width:91.6666666667%}.shapla-column.is-12-widescreen{width:100%}}@media screen and (min-width:1400px){.shapla-column.is-1-fullhd{width:8.3333333333%}.shapla-column.is-2-fullhd{width:16.6666666667%}.shapla-column.is-3-fullhd{width:25%}.shapla-column.is-4-fullhd{width:33.3333333333%}.shapla-column.is-5-fullhd{width:41.6666666667%}.shapla-column.is-6-fullhd{width:50%}.shapla-column.is-7-fullhd{width:58.3333333333%}.shapla-column.is-8-fullhd{width:66.6666666667%}.shapla-column.is-9-fullhd{width:75%}.shapla-column.is-10-fullhd{width:83.3333333333%}.shapla-column.is-11-fullhd{width:91.6666666667%}.shapla-column.is-12-fullhd{width:100%}}.shapla-columns.is-centered{justify-content:center}.shapla-columns.is-mobile{display:flex}.shapla-columns.is-multiline{flex-wrap:wrap}.shapla-columns.is-vcentered{align-items:center}@media print,screen and (min-width:768px){.shapla-columns:not(.is-desktop){display:flex}}@media screen and (min-width:1024px){.shapla-columns.is-desktop{display:flex}}.shapla-columns{--shapla-column-gap:0.75rem;margin:calc(var(--shapla-column-gap, .75rem)*-1)}.shapla-columns:not(:last-child){margin-bottom:calc(1.5rem - var(--shapla-column-gap, .75rem))}.shapla-columns.is-gapless{--shapla-column-gap:0}.shapla-columns .shapla-column{padding:var(--shapla-column-gap,.75rem)}.shapla-delete-icon{--shapla-delete-icon-dimensions:20px;-webkit-appearance:none;appearance:none;background-color:#0003;border:none;border-radius:290486px;cursor:pointer;display:inline-block;flex-grow:0;flex-shrink:0;font-size:0;height:var(--shapla-delete-icon-dimensions,20px);outline:none;pointer-events:auto;position:relative;-webkit-user-select:none;user-select:none;vertical-align:top;width:var(--shapla-delete-icon-dimensions,20px)}.shapla-delete-icon:after,.shapla-delete-icon:before{background-color:#fff;content:"";display:block;left:50%;position:absolute;top:50%;transform:translateX(-50%) translateY(-50%) rotate(45deg);transform-origin:center center}.shapla-delete-icon:before{height:2px;width:50%}.shapla-delete-icon:after{height:50%;width:2px}.shapla-delete-icon:focus,.shapla-delete-icon:hover{background-color:#0000004d}.shapla-delete-icon:active{background-color:#0006}.shapla-delete-icon.is-small{--shapla-delete-icon-dimensions:16px}.shapla-delete-icon.is-medium{--shapla-delete-icon-dimensions:24px}.shapla-delete-icon.is-large{--shapla-delete-icon-dimensions:32px}.shapla-modal,.shapla-modal-background{bottom:0;left:0;position:absolute;right:0;top:0}.shapla-modal{align-items:center;display:none;flex-direction:column;justify-content:center;overflow:hidden;position:fixed;z-index:100000}.shapla-modal.is-active{display:flex}.shapla-modal-background{background-color:#00000080}.shapla-modal-background.is-light{background-color:#ffffff80}.shapla-modal .shapla-delete-icon.is-fixed{position:fixed;right:1.25rem;top:1.25rem}.shapla-modal-content{margin:0 20px;max-height:calc(100vh - 160px);overflow:auto;position:relative;width:calc(100% - 40px)}.shapla-modal-content.is-small{width:320px}.shapla-modal-content.is-full{height:calc(100vh - 40px);width:calc(100vw - 40px)}@media print,screen and (min-width:768px){.shapla-modal-content{margin:0 auto;max-height:calc(100vh - 40px)}.shapla-modal-content:not(.is-small):not(.is-full):not(.is-large){width:640px}}@media screen and (min-width:1024px){.shapla-modal-content.is-large{width:960px}}.shapla-modal-card{display:flex;flex-direction:column;max-height:calc(100vh - 40px);overflow:hidden}.shapla-modal-card__footer,.shapla-modal-card__header{align-items:center;background-color:#fff;display:flex;flex-shrink:0;justify-content:flex-start;padding:1rem;position:relative}.shapla-modal-card__header{border-bottom:1px solid #0000001f;border-top-left-radius:4px;border-top-right-radius:4px}.shapla-modal-card__title{flex-grow:1;flex-shrink:0;font-size:1.5rem;line-height:1;margin:0}.shapla-modal-card__footer{border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-top:1px solid #0000001f}.shapla-modal-card__footer.is-pulled-right{justify-content:flex-end}.shapla-modal-card__footer>*+*{margin-left:.5rem}.shapla-modal-card__body{background-color:#fff;flex-grow:1;flex-shrink:1;overflow:auto;padding:1rem}.shapla-modal-box,.shapla-modal-confirm{background-color:#fff;border-radius:4px;box-shadow:0 9px 46px 8px #00000024,0 11px 15px -7px #0000001f,0 24px 38px 3px #0003;padding:1rem}.shapla-modal-confirm__content{padding:1rem;text-align:center}.shapla-modal-confirm__icon{border:.25em solid var(--shapla-primary,#00d1b2);border-radius:50%;color:var(--shapla-primary,#00d1b2);cursor:default;display:flex;height:5em;justify-content:center;margin:1.25em auto 1.875em;-webkit-user-select:none;user-select:none;width:5em}.shapla-modal-confirm__icon.is-success{border-color:var(--shapla-success,#48c774);color:var(--shapla-success,#48c774)}.shapla-modal-confirm__icon.is-error{border-color:var(--shapla-error,#f14668);color:var(--shapla-error,#f14668)}.shapla-modal-confirm__icon-content{align-items:center;display:flex;font-size:3.75em}.shapla-modal-confirm__title{font-size:1.875em;margin:0 0 .4em;text-align:center}.shapla-modal-confirm__actions{display:flex;justify-content:center;padding:1rem}.shapla-modal-confirm__actions>*+*{margin-left:.5rem}div[id*=_carousel_slider] .widget-top{background:#dff!important;border:1px solid #2196f3!important}div[id*=_carousel_slider] .widget-top:hover{background:#fdd!important;border:1px solid #f44336!important}.overflowHidden{overflow:hidden}.overflowVisible{overflow:visible}.sp-input-group{margin-bottom:10px}.sp-input-group:after{clear:both;content:"";display:table}.sp-input-label label{font-weight:600;margin-right:30px}.sp-input-field,.sp-input-label{float:left;width:100%}.sp-input-desc{color:#999;font-size:.9em;line-height:1.3em;margin:10px 30px 10px 0}.sp-input-text{height:35px!important;padding:8px 8px 8px 16px;width:100%}.sp-input-text option{padding:8px 4px}.spacing-text{width:62px}@media only screen and (min-width:600px){.sp-input-label{width:40%}.sp-input-field{width:60%}}@media only screen and (min-width:783px){.sp-input-label{width:30%}.sp-input-field{width:70%}.sp-input-text{width:25em}}@media only screen and (min-width:851px){.sp-input-field,.sp-input-label{width:100%}}@media only screen and (min-width:1200px){.sp-input-label{width:40%}.sp-input-field{width:60%}}@media only screen and (min-width:1600px){.sp-input-label{width:30%}.sp-input-field{width:70%}}.carousel_slider_images:after,.carousel_slider_images:before{content:"";display:table}.carousel_slider_images:after{clear:both}.carousel_slider_gallery_btn{background-color:#f1f1f1;border:1px solid #616161;color:#616161;padding:5px 15px;text-decoration:none}.carousel_slider_gallery_btn:hover{background-color:#fff;color:#616161}.carousel_slider_gallery_list{box-sizing:border-box;list-style:none;margin:15px 0 0;padding:0}.carousel_slider_gallery_list:after,.carousel_slider_gallery_list:before{content:"";display:table}.carousel_slider_gallery_list:after{clear:both}.carousel_slider_gallery_list li{float:left;margin:0;padding:0}.carousel_slider_gallery_list li>img{box-shadow:0 2px 4px 0 #00000029,0 2px 10px 0 #0000001f;display:block;margin-bottom:10px;margin-right:10px}#field-_post_categories,#field-_post_date_after,#field-_post_date_before,#field-_post_in,#field-_post_tags,#field-_product_categories,#field-_product_in,#field-_product_query,#field-_product_tags{display:none}#carousel-slider-autoplay-settings p,#carousel-slider-navigation-settings p,#carousel-slider-responsive-settings p{overflow:hidden}#carousel-slider-autoplay-settings input.small-text,#carousel-slider-autoplay-settings select.small-text,#carousel-slider-navigation-settings input.small-text,#carousel-slider-navigation-settings select.small-text,#carousel-slider-responsive-settings input.small-text,#carousel-slider-responsive-settings select.small-text{float:right}.tab-background .slide_bg_wrapper{display:flex;padding:1rem 0}.tab-background .slide_thumb{border:1px solid #e0e0e0;float:left;margin-right:1rem;padding:5px;position:relative}.tab-background .slide_thumb>div{background-color:#f1f1f1;background-position:0 0;background-repeat:no-repeat;background-size:100% auto;height:180px;width:320px}.tab-background .slide_thumb>span{background-color:#00000080;color:#fff;cursor:pointer;display:inline-block;font-family:Arial,Helvetica,sans-serif;font-size:14px;line-height:14px;padding:3px;position:absolute;right:0;top:0;transition:all .3s ease-in-out}.tab-background .slide_thumb>span.hidden{display:none!important}.tab-background .slide_image_settings_line{display:block;margin:.5rem 0}.tab-background .slide_image_settings_line>span{display:inline-block;width:150px}.shapla-toggle{margin:1em 0!important}.shapla-toggle-title{cursor:pointer;display:block;outline:0;padding:15px 10px;position:relative}.shapla-toggle-title:after{content:"";font:400 20px/1 dashicons;margin-left:-1px;padding-right:3px;position:absolute;right:15px;vertical-align:top}.shapla-toggle-title.ui-state-active:after{content:""}.shapla-toggle-content{background-color:#f1f1f1;padding:20px}.shapla-toggle--normal .shapla-toggle-title{background:#9e9e9e;color:#fff;font-weight:600}.shapla-toggle--stroke .shapla-toggle-title{border:1px solid #363f48;font-weight:600}.shapla-toggle--stroke .shapla-toggle-title:after{color:#363f48}.shapla-toggle--stroke .shapla-toggle-content{background-color:#fff;border:1px solid #363f48;border-top:none;padding:20px}.shapla-nav{list-style:none!important;margin:0;padding:0}.shapla-nav:after,.shapla-nav:before{content:" ";display:table}.shapla-nav:after{clear:both}.shapla-nav li{float:left;margin:0 1px -1px 0!important;outline:0;position:relative;z-index:1}.shapla-nav a{display:block;line-height:1;outline:0;padding:15px 10px;text-decoration:none}.shapla-tab{margin:0 0 2em;padding:21px 20px 20px}.shapla-tab p:first-of-type{margin-top:0}.shapla-tab p:last-of-type{margin-bottom:0}.shapla-tabs--normal .shapla-nav a{background:#323232;color:#fff}.shapla-tabs--normal .shapla-nav .ui-tabs-active a{background:#f1f1f1;color:#323232;outline:0}.shapla-tabs--normal .shapla-tab{background:#f1f1f1}.shapla-tabs--stroke .shapla-nav li{margin:0 -1px 0 0!important}.shapla-tabs--stroke .shapla-nav a{border:1px solid #323232;color:#323232}.shapla-tabs--stroke .shapla-nav .ui-tabs-active a{border-bottom-color:#fff}.shapla-tabs--stroke .shapla-tab{border:1px solid #323232;margin-top:-1px}.media-url-form-field{background-color:#f1f1f1;border:1px solid #0000001f;display:flex}.media-url-form-field__content{display:flex;flex-direction:column;flex-grow:1;padding:.5rem}.media-url-form-field__item{display:flex;margin-bottom:.5rem}.media-url-form-field__item .name{display:inline-flex;width:20%}.media-url-form-field__item input,.media-url-form-field__item textarea{width:75%}.media-url-form-field__actions{display:flex;flex-direction:column;padding:.5rem}.media-url-form-field__actions>span{align-items:center;border:1px solid #0000001f;border-radius:4px;cursor:pointer;display:inline-flex;height:calc(48px - .5rem);justify-content:center;margin-bottom:.5rem;width:calc(48px - .5rem)}.media-url-form-field__actions>span:hover{border-color:#0003;border-radius:50%}.carousel_slider_url_images_list{list-style:none;margin:15px 0 0;padding:0}.carousel_slider_url_images_list li{display:inline-block;float:left;margin:0 5px 5px 0}.carousel_slider_iframe{height:0;padding-bottom:56.25%;padding-top:25px;position:relative}.carousel_slider_iframe>iframe{height:100%;left:0;position:absolute;top:0;width:100%}.carousel_slider_columns{box-sizing:border-box;display:flex;flex-wrap:wrap}.carousel_slider_column{box-sizing:border-box;flex:0 0 100%;padding:1rem}@media screen and (min-width:601px){.carousel_slider_column{flex:0 0 50%}}@media screen and (min-width:1025px){.carousel_slider_column{flex:0 0 33.333333%}}@media screen and (min-width:1400px){.carousel_slider_column{flex:0 0 25%}}.shapla-modal{box-sizing:border-box}.shapla-modal *,.shapla-modal :after,.shapla-modal :before{box-sizing:inherit}.cs_plugin_upgrade_notice{border-top:1px solid #dba617;margin-top:1rem;padding:1rem 0}.cs_plugin_upgrade_notice__title{font-size:1.125em}.cs_plugin_upgrade_notice__description{padding-top:1rem}.shapla-tooltip{background-color:#000000eb;background-image:linear-gradient(180deg,#0000,#000);box-shadow:0 3px 4px 0 #00000024,0 3px 3px -2px #0003,0 1px 8px 0 #0000001f;color:#fff;display:none}.shapla-tooltip.is-theme-light{background-color:#f5f5f5eb;background-image:linear-gradient(180deg,#0000,#f5f5f5);color:#323232}.shapla-tooltip__inner{word-wrap:break-word;border-radius:3px;font-size:12px;font-weight:400;max-width:200px;padding:4px 8px}.shapla-tooltip.is-active{display:block}.shapla-tooltip__arrow,.shapla-tooltip__arrow:before{background-color:inherit;height:.4rem;position:absolute;width:.8rem}.shapla-tooltip__arrow{visibility:hidden}.shapla-tooltip__arrow:before{content:"";transform:rotate(45deg);visibility:visible}.shapla-tooltip[data-popper-placement^=top]>.shapla-tooltip__arrow{bottom:0}.shapla-tooltip[data-popper-placement^=bottom]>.shapla-tooltip__arrow{top:0}.shapla-tooltip[data-popper-placement^=left]>.shapla-tooltip__arrow{right:0}.shapla-tooltip[data-popper-placement^=right]>.shapla-tooltip__arrow{left:0}[data-tooltip-target]{display:inline-block;float:right;height:1.5em;position:relative;width:1.5em}[data-tooltip-target]:after{speak:none;-webkit-font-smoothing:antialiased;content:"";cursor:help;font-family:Dashicons;font-weight:400;height:100%;text-align:center;text-transform:none;width:100%}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/css/divi-modules.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.carousel-slider-iframe{width:100%}.carousel-slider-iframe-container{position:relative}.carousel-slider-iframe-overlay{bottom:0;left:0;position:absolute;right:0;top:0}
|
assets/css/frontend.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.carousel-slider{display:none;width:100%;-webkit-tap-highlight-color:transparent;position:relative;z-index:1}.carousel-slider .owl-stage{position:relative;touch-action:manipulation;-webkit-backface-visibility:hidden;backface-visibility:hidden}.carousel-slider .owl-stage:after{content:".";display:block;clear:both;visibility:hidden;line-height:0;height:0}.carousel-slider .owl-stage-outer{position:relative;overflow:hidden;transform:translateZ(0)}.carousel-slider .owl-carousel .owl-item,.carousel-slider .owl-carousel .owl-wrapper{-webkit-backface-visibility:hidden;backface-visibility:hidden;transform:translateZ(0)}.carousel-slider .owl-item{position:relative;min-height:1px;float:left;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none}.carousel-slider .owl-item img{display:block;width:100%}.carousel-slider .owl-dots.disabled,.carousel-slider .owl-nav.disabled{display:none}.carousel-slider .owl-dot,.carousel-slider .owl-nav .owl-next,.carousel-slider .owl-nav .owl-prev{cursor:pointer;-webkit-user-select:none;user-select:none}.carousel-slider .owl-nav button.owl-next,.carousel-slider .owl-nav button.owl-prev,.carousel-slider button.owl-dot{background:none;color:inherit;border:none;padding:0!important;font:inherit}.carousel-slider.owl-loaded{display:block}.carousel-slider.owl-loading{opacity:0;display:block}.carousel-slider.owl-hidden{opacity:0}.carousel-slider.owl-refresh .owl-item{visibility:hidden}.carousel-slider.owl-drag .owl-item{touch-action:pan-y;-webkit-user-select:none;user-select:none}.carousel-slider.owl-grab{cursor:move;cursor:-webkit-grab;cursor:grab}.carousel-slider.owl-rtl{direction:rtl}.carousel-slider.owl-rtl .owl-item{float:right}.no-js .carousel-slider{display:block}.carousel-slider .animated{-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-fill-mode:both;animation-fill-mode:both}.carousel-slider .owl-animated-in{z-index:0}.carousel-slider .owl-animated-out{z-index:1}.carousel-slider .fadeOut{-webkit-animation-name:fadeOut;animation-name:fadeOut}.carousel-slider .fadeInDown{-webkit-animation-name:fadeInDown;animation-name:fadeInDown}.carousel-slider .fadeInUp{-webkit-animation-name:fadeInUp;animation-name:fadeInUp}.carousel-slider .fadeInRight{-webkit-animation-name:fadeInRight;animation-name:fadeInRight}.carousel-slider .fadeInLeft{-webkit-animation-name:fadeInLeft;animation-name:fadeInLeft}.carousel-slider .zoomIn{-webkit-animation-name:zoomIn;animation-name:zoomIn}@-webkit-keyframes fadeOut{0%{opacity:1}to{opacity:0}}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}@-webkit-keyframes fadeInDown{0%{opacity:0;transform:translate3d(0,-100%,0)}to{opacity:1;transform:none}}@keyframes fadeInDown{0%{opacity:0;transform:translate3d(0,-100%,0)}to{opacity:1;transform:none}}@-webkit-keyframes fadeInUp{0%{opacity:0;transform:translate3d(0,100%,0)}to{opacity:1;transform:none}}@keyframes fadeInUp{0%{opacity:0;transform:translate3d(0,100%,0)}to{opacity:1;transform:none}}@-webkit-keyframes fadeInRight{0%{opacity:0;transform:translate3d(100%,0,0)}to{opacity:1;transform:none}}@keyframes fadeInRight{0%{opacity:0;transform:translate3d(100%,0,0)}to{opacity:1;transform:none}}@-webkit-keyframes fadeInLeft{0%{opacity:0;transform:translate3d(-100%,0,0)}to{opacity:1;transform:none}}@keyframes fadeInLeft{0%{opacity:0;transform:translate3d(-100%,0,0)}to{opacity:1;transform:none}}@-webkit-keyframes zoomIn{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes zoomIn{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}.owl-height{transition:height .5s ease-in-out}.carousel-slider .owl-item img.owl-lazy{background:url(data:image/gif;base64,R0lGODlhIAAgAPMAAP///5aWlufn58zMzODg4NXV1aysrLm5ue7u7vPz8+Li4qKiopeXlwAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCgAAACwAAAAAIAAgAAAE5xDISWlhperN52JLhSSdRgwVo1ICQZRUsiwHpTJT4iowNS8vyW2icCF6k8HMMBkCEDskxTBDAZwuAkkqIfxIQyhBQBFvAQSDITM5VDW6XNE4KagNh6Bgwe60smQUB3d4Rz1ZBApnFASDd0hihh12BkE9kjAJVlycXIg7CQIFA6SlnJ87paqbSKiKoqusnbMdmDC2tXQlkUhziYtyWTxIfy6BE8WJt5YJvpJivxNaGmLHT0VnOgSYf0dZXS7APdpB309RnHOG5gDqXGLDaC457D1zZ/V/nmOM82XiHRLYKhKP1oZmADdEAAAh+QQJCgAAACwAAAAAIAAgAAAE6hDISWlZpOrNp1lGNRSdRpDUolIGw5RUYhhHukqFu8DsrEyqnWThGvAmhVlteBvojpTDDBUEIFwMFBRAmBkSgOrBFZogCASwBDEY/CZSg7GSE0gSCjQBMVG023xWBhklAnoEdhQEfyNqMIcKjhRsjEdnezB+A4k8gTwJhFuiW4dokXiloUepBAp5qaKpp6+Ho7aWW54wl7obvEe0kRuoplCGepwSx2jJvqHEmGt6whJpGpfJCHmOoNHKaHx61WiSR92E4lbFoq+B6QDtuetcaBPnW6+O7wDHpIiK9SaVK5GgV543tzjgGcghAgAh+QQJCgAAACwAAAAAIAAgAAAE7hDISSkxpOrN5zFHNWRdhSiVoVLHspRUMoyUakyEe8PTPCATW9A14E0UvuAKMNAZKYUZCiBMuBakSQKG8G2FzUWox2AUtAQFcBKlVQoLgQReZhQlCIJesQXI5B0CBnUMOxMCenoCfTCEWBsJColTMANldx15BGs8B5wlCZ9Po6OJkwmRpnqkqnuSrayqfKmqpLajoiW5HJq7FL1Gr2mMMcKUMIiJgIemy7xZtJsTmsM4xHiKv5KMCXqfyUCJEonXPN2rAOIAmsfB3uPoAK++G+w48edZPK+M6hLJpQg484enXIdQFSS1u6UhksENEQAAIfkECQoAAAAsAAAAACAAIAAABOcQyEmpGKLqzWcZRVUQnZYg1aBSh2GUVEIQ2aQOE+G+cD4ntpWkZQj1JIiZIogDFFyHI0UxQwFugMSOFIPJftfVAEoZLBbcLEFhlQiqGp1Vd140AUklUN3eCA51C1EWMzMCezCBBmkxVIVHBWd3HHl9JQOIJSdSnJ0TDKChCwUJjoWMPaGqDKannasMo6WnM562R5YluZRwur0wpgqZE7NKUm+FNRPIhjBJxKZteWuIBMN4zRMIVIhffcgojwCF117i4nlLnY5ztRLsnOk+aV+oJY7V7m76PdkS4trKcdg0Zc0tTcKkRAAAIfkECQoAAAAsAAAAACAAIAAABO4QyEkpKqjqzScpRaVkXZWQEximw1BSCUEIlDohrft6cpKCk5xid5MNJTaAIkekKGQkWyKHkvhKsR7ARmitkAYDYRIbUQRQjWBwJRzChi9CRlBcY1UN4g0/VNB0AlcvcAYHRyZPdEQFYV8ccwR5HWxEJ02YmRMLnJ1xCYp0Y5idpQuhopmmC2KgojKasUQDk5BNAwwMOh2RtRq5uQuPZKGIJQIGwAwGf6I0JXMpC8C7kXWDBINFMxS4DKMAWVWAGYsAdNqW5uaRxkSKJOZKaU3tPOBZ4DuK2LATgJhkPJMgTwKCdFjyPHEnKxFCDhEAACH5BAkKAAAALAAAAAAgACAAAATzEMhJaVKp6s2nIkolIJ2WkBShpkVRWqqQrhLSEu9MZJKK9y1ZrqYK9WiClmvoUaF8gIQSNeF1Er4MNFn4SRSDARWroAIETg1iVwuHjYB1kYc1mwruwXKC9gmsJXliGxc+XiUCby9ydh1sOSdMkpMTBpaXBzsfhoc5l58Gm5yToAaZhaOUqjkDgCWNHAULCwOLaTmzswadEqggQwgHuQsHIoZCHQMMQgQGubVEcxOPFAcMDAYUA85eWARmfSRQCdcMe0zeP1AAygwLlJtPNAAL19DARdPzBOWSm1brJBi45soRAWQAAkrQIykShQ9wVhHCwCQCACH5BAkKAAAALAAAAAAgACAAAATrEMhJaVKp6s2nIkqFZF2VIBWhUsJaTokqUCoBq+E71SRQeyqUToLA7VxF0JDyIQh/MVVPMt1ECZlfcjZJ9mIKoaTl1MRIl5o4CUKXOwmyrCInCKqcWtvadL2SYhyASyNDJ0uIiRMDjI0Fd30/iI2UA5GSS5UDj2l6NoqgOgN4gksEBgYFf0FDqKgHnyZ9OX8HrgYHdHpcHQULXAS2qKpENRg7eAMLC7kTBaixUYFkKAzWAAnLC7FLVxLWDBLKCwaKTULgEwbLA4hJtOkSBNqITT3xEgfLpBtzE/jiuL04RGEBgwWhShRgQExHBAAh+QQJCgAAACwAAAAAIAAgAAAE7xDISWlSqerNpyJKhWRdlSAVoVLCWk6JKlAqAavhO9UkUHsqlE6CwO1cRdCQ8iEIfzFVTzLdRAmZX3I2SfZiCqGk5dTESJeaOAlClzsJsqwiJwiqnFrb2nS9kmIcgEsjQydLiIlHehhpejaIjzh9eomSjZR+ipslWIRLAgMDOR2DOqKogTB9pCUJBagDBXR6XB0EBkIIsaRsGGMMAxoDBgYHTKJiUYEGDAzHC9EACcUGkIgFzgwZ0QsSBcXHiQvOwgDdEwfFs0sDzt4S6BK4xYjkDOzn0unFeBzOBijIm1Dgmg5YFQwsCMjp1oJ8LyIAACH5BAkKAAAALAAAAAAgACAAAATwEMhJaVKp6s2nIkqFZF2VIBWhUsJaTokqUCoBq+E71SRQeyqUToLA7VxF0JDyIQh/MVVPMt1ECZlfcjZJ9mIKoaTl1MRIl5o4CUKXOwmyrCInCKqcWtvadL2SYhyASyNDJ0uIiUd6GGl6NoiPOH16iZKNlH6KmyWFOggHhEEvAwwMA0N9GBsEC6amhnVcEwavDAazGwIDaH1ipaYLBUTCGgQDA8NdHz0FpqgTBwsLqAbWAAnIA4FWKdMLGdYGEgraigbT0OITBcg5QwPT4xLrROZL6AuQAPUS7bxLpoWidY0JtxLHKhwwMJBTHgPKdEQAACH5BAkKAAAALAAAAAAgACAAAATrEMhJaVKp6s2nIkqFZF2VIBWhUsJaTokqUCoBq+E71SRQeyqUToLA7VxF0JDyIQh/MVVPMt1ECZlfcjZJ9mIKoaTl1MRIl5o4CUKXOwmyrCInCKqcWtvadL2SYhyASyNDJ0uIiUd6GAULDJCRiXo1CpGXDJOUjY+Yip9DhToJA4RBLwMLCwVDfRgbBAaqqoZ1XBMHswsHtxtFaH1iqaoGNgAIxRpbFAgfPQSqpbgGBqUD1wBXeCYp1AYZ19JJOYgH1KwA4UBvQwXUBxPqVD9L3sbp2BNk2xvvFPJd+MFCN6HAAIKgNggY0KtEBAAh+QQJCgAAACwAAAAAIAAgAAAE6BDISWlSqerNpyJKhWRdlSAVoVLCWk6JKlAqAavhO9UkUHsqlE6CwO1cRdCQ8iEIfzFVTzLdRAmZX3I2SfYIDMaAFdTESJeaEDAIMxYFqrOUaNW4E4ObYcCXaiBVEgULe0NJaxxtYksjh2NLkZISgDgJhHthkpU4mW6blRiYmZOlh4JWkDqILwUGBnE6TYEbCgevr0N1gH4At7gHiRpFaLNrrq8HNgAJA70AWxQIH1+vsYMDAzZQPC9VCNkDWUhGkuE5PxJNwiUK4UfLzOlD4WvzAHaoG9nxPi5d+jYUqfAhhykOFwJWiAAAIfkECQoAAAAsAAAAACAAIAAABPAQyElpUqnqzaciSoVkXVUMFaFSwlpOCcMYlErAavhOMnNLNo8KsZsMZItJEIDIFSkLGQoQTNhIsFehRww2CQLKF0tYGKYSg+ygsZIuNqJksKgbfgIGepNo2cIUB3V1B3IvNiBYNQaDSTtfhhx0CwVPI0UJe0+bm4g5VgcGoqOcnjmjqDSdnhgEoamcsZuXO1aWQy8KAwOAuTYYGwi7w5h+Kr0SJ8MFihpNbx+4Erq7BYBuzsdiH1jCAzoSfl0rVirNbRXlBBlLX+BP0XJLAPGzTkAuAOqb0WT5AH7OcdCm5B8TgRwSRKIHQtaLCwg1RAAAOwAAAAAAAAAAAA==) no-repeat 50%;min-width:32px;min-height:32px}.carousel-slider .carousel-slider-video-wrapper{position:relative;height:100%;background:#000}.carousel-slider .carousel-slider-video-play-icon{position:absolute;height:40px;width:40px;left:50%;top:50%;margin-left:-20px;margin-top:-20px;background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' fill='%23f1f1f1'%3E%3Cpath d='M12.1 6.7l23 13.5-23 13.5V6.8z'/%3E%3Cpath d='M19.7 40c-11 0-20-9-20-20s9-20 20-20 20 9 20 20-9 20-20 20zm0-38c-9.9 0-18 8.1-18 18s8.1 18 18 18 18-8.1 18-18-8.1-18-18-18z'/%3E%3C/svg%3E") no-repeat;cursor:pointer;z-index:2;-webkit-backface-visibility:hidden;transition:transform .1s ease}.carousel-slider .carousel-slider-video-overlay{position:absolute;height:100%;width:100%;left:0;top:0;background-color:rgba(0,0,0,.5);z-index:1}.carousel-slider .carousel-slider-video-play-icon:hover{transform:scale(1.3)}.carousel-slider .owl-nav .owl-next,.carousel-slider .owl-nav .owl-prev{height:48px;width:48px;display:inline-block;position:absolute;top:50%;transform:translateY(-50%);opacity:0;margin:0;padding:0;transition:all .3s ease-in-out}.carousel-slider .owl-nav .owl-prev{left:0}.carousel-slider .owl-nav .owl-next{right:0}.carousel-slider.arrows-visible-always .owl-next,.carousel-slider.arrows-visible-always .owl-prev,.carousel-slider:hover .owl-nav .owl-next,.carousel-slider:hover .owl-nav .owl-prev{opacity:1}.carousel-slider.arrows-outside .owl-nav .owl-prev{left:-48px}.carousel-slider.arrows-outside .owl-nav .owl-next{right:-48px}.carousel-slider .owl-dots{text-align:center;-webkit-tap-highlight-color:transparent;margin-top:10px}.carousel-slider .owl-dots .owl-dot{display:inline-block;zoom:1;*display:inline}.carousel-slider .owl-dots .owl-dot span{width:10px;height:10px;margin:4px 8px;background-color:#9e9e9e;display:block;-webkit-backface-visibility:visible;transition:opacity .2s ease}.carousel-slider .owl-dots .owl-dot.active span,.carousel-slider .owl-dots .owl-dot:hover span{background-color:#4caf50}.carousel-slider.dots-center .owl-dots{text-align:center}.carousel-slider.dots-left .owl-dots{text-align:left}.carousel-slider.dots-left .owl-dots:first-child span{margin-left:0}.carousel-slider.dots-right .owl-dots{text-align:right}.carousel-slider.dots-right .owl-dots:last-child span{margin-right:0}.carousel-slider.dots-visible-hover .owl-dots{opacity:0}.carousel-slider.dots-visible-hover:hover .owl-dots{opacity:1}.carousel-slider.dots-circle .owl-dots .owl-dot span{border-radius:9999px}.carousel-slider[data-slide-type=post-carousel] .owl-stage{display:flex;flex-wrap:wrap}.carousel-slider[data-slide-type=post-carousel] .owl-item{display:flex;height:auto}.carousel-slider__post{border-radius:4px;box-shadow:0 1px 2px rgba(0,0,0,.1),0 0 0 1px rgba(0,0,0,.1);margin:2px;position:relative;width:100%}.carousel-slider__post-content{display:flex;flex-direction:column;height:100%;justify-content:space-between}.carousel-slider__post-image{background-color:#f1f1f1;background-size:cover;background-position:50%;border-top-left-radius:4px;border-top-right-radius:4px;display:block;line-height:0;margin:0 auto;overflow:hidden;padding-top:66.6666%;position:relative;text-align:center;width:100%}.carousel-slider__post-title{display:block;margin:1rem;min-height:3.75em}.carousel-slider__post-title h1{font-size:1.25rem;margin:0}.carousel-slider__post-excerpt{font-size:1rem;line-height:1.6;margin:1rem 1rem 2rem;text-align:left}.carousel-slider__post-meta{align-items:flex-end;display:flex;font-size:.75rem;justify-content:space-between;margin:auto 1rem 1rem}.carousel-slider__post-author,.carousel-slider__post-publication-meta{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.carousel-slider__post-author{font-style:normal;line-height:1.6}.carousel-slider__post-author-link{display:inline-block;max-width:175px;overflow:hidden;text-overflow:ellipsis;vertical-align:middle;white-space:nowrap}.carousel-slider__post-category{text-transform:uppercase}.carousel-slider[data-slide-type=product-carousel] .owl-stage{display:flex;flex-wrap:wrap}.carousel-slider[data-slide-type=product-carousel] .owl-item{display:flex;height:auto}.carousel-slider .woocommerce-loop-category__title{font-size:1.25rem;margin:1rem}.carousel-slider__product{position:relative;text-align:center;box-shadow:0 1px 2px rgba(0,0,0,.1),0 0 0 1px rgba(0,0,0,.1);margin:2px;width:100%}.carousel-slider__product .woocommerce-LoopProduct-link{display:block;overflow:hidden;margin:0}.carousel-slider__product .onsale{border:0;line-height:1;margin:0;padding:.5rem;color:#f1f1f1;background-color:#96588a;position:absolute;left:1rem;top:1rem}.carousel-slider__product h3{padding:0;text-align:left;margin:1rem;font-size:1.25rem;color:#333}.carousel-slider__product a{text-decoration:none;box-shadow:none}.carousel-slider__product a img{width:100%;height:auto;display:block;box-shadow:none}.carousel-slider__product strong{display:block}.carousel-slider__product .price{color:#333;display:inline-block;font-weight:400;margin:0 .5rem 0 1rem;font-size:.875rem;float:left}.carousel-slider__product .price del{color:inherit;background-color:initial;opacity:.5;display:inline-block}.carousel-slider__product .price ins{color:inherit;background-color:initial;font-weight:700}.carousel-slider__product .star-rating{display:inline-block;margin:0 1rem 0 .5rem;float:right;overflow:hidden;position:relative;height:1em;line-height:1;font-size:1em;width:5.4em;font-family:star}.carousel-slider__product .star-rating:before{content:"\73\73\73\73\73";float:left;top:0;left:0;position:absolute}.carousel-slider__product .star-rating span{overflow:hidden;float:left;top:0;left:0;position:absolute;padding-top:1.5em}.carousel-slider__product .star-rating span:before{color:#96588a;content:"\53\53\53\53\53";top:0;position:absolute;left:0}.carousel-slider__product a.add_to_cart_button,.carousel-slider__product a.added_to_cart,.carousel-slider__product a.quick_view{color:#f1f1f1;background-color:#96588a;margin:1rem;line-height:1;cursor:pointer;position:relative;text-decoration:none;overflow:visible;padding:.5em 1em;font-weight:400;border-radius:3px;left:auto;border:0;white-space:nowrap;display:block;background-image:none;box-shadow:none;-webkit-box-shadow:none;text-shadow:none}.carousel-slider__product a.add_to_cart_button:hover,.carousel-slider__product a.added_to_cart:hover,.carousel-slider__product a.quick_view:hover{color:#f1f1f1;background-color:#96588a;text-decoration:none;background-image:none}.carousel-slider__product a.add_to_cart_button.loading{opacity:.25;padding-right:2.618em}.carousel-slider__product a.add_to_cart_button.loading:after{font-family:WooCommerce;content:"\e01c";vertical-align:top;-webkit-font-smoothing:antialiased;font-weight:400;position:absolute;top:.618em;right:1em;-webkit-animation:spin 2s linear infinite;animation:spin 2s linear infinite}.carousel-slider__product a.add_to_cart_button.added:after{font-family:WooCommerce;content:"\e017";margin-left:.53em;vertical-align:bottom}.carousel-slider-hero__cell__background{background-size:cover;background-position:50%;background-repeat:no-repeat;min-width:100%;min-height:100%;transition-property:transform;transition-duration:10s}.carousel-slider-hero__cell__background.carousel-slider-hero-ken-out{transform:scale(1.3)}.carousel-slider .active .carousel-slider-hero__cell__background{-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-duration:20s;animation-duration:20s}.carousel-slider .active .carousel-slider-hero__cell__background.carousel-slider-hero-ken-in{transform:scale(1.3);-webkit-animation-name:ken-burns-in;animation-name:ken-burns-in}.carousel-slider .active .carousel-slider-hero__cell__background.carousel-slider-hero-ken-out{transform:scale(1);-webkit-animation-name:ken-burns-out;animation-name:ken-burns-out}.carousel-slider-hero__cell{display:flex;justify-content:center;align-items:center;position:relative;overflow:hidden;height:400px}.carousel-slider-hero__cell:focus{outline:0}.carousel-slider-hero__cell__inner{background-repeat:no-repeat;background-position:50%;position:absolute;top:0;left:0;bottom:0;right:0;padding:50px}.carousel-slider-hero__cell__inner,.carousel-slider-hero__cell__inner:hover{color:#fff;display:flex}.carousel-slider-hero__cell__background_overlay{position:absolute;z-index:0;top:0;bottom:0;left:0;right:0}.carousel-slider-hero__cell__content{position:relative;z-index:1;width:100%;max-width:1140px}.carousel-slider-hero__cell__heading{font-size:40px;font-weight:700;line-height:1}.carousel-slider-hero__cell__description{font-size:20px;line-height:1.4}.carousel-slider-hero__cell__description:not(:last-child),.carousel-slider-hero__cell__heading:not(:last-child){margin-bottom:30px}.carousel-slider-hero__cell__button__one{margin-right:5px}.carousel-slider-hero__cell__button__two{margin-left:5px}.carousel-slider-hero__cell__button__one,.carousel-slider-hero__cell__button__two{display:inline-flex}.carousel-slider-hero__cell__inner.carousel-slider--v-position-top{align-items:flex-start}.carousel-slider-hero__cell__inner.carousel-slider--v-position-bottom{align-items:flex-end}.carousel-slider-hero__cell__inner.carousel-slider--v-position-middle{align-items:center}.carousel-slider-hero__cell__inner.carousel-slider--h-position-left{justify-content:flex-start}.carousel-slider-hero__cell__inner.carousel-slider--h-position-right{justify-content:flex-end}.carousel-slider-hero__cell__inner.carousel-slider--h-position-center{justify-content:center}.carousel-slider-hero__cell__inner.carousel-slider--text-left{text-align:left}.carousel-slider-hero__cell__inner.carousel-slider--text-right{text-align:right}.carousel-slider-hero__cell__inner.carousel-slider--text-center{text-align:center}@media (max-width:767px){.carousel-slider-hero__cell__inner{padding:30px}.carousel-slider-hero__cell__heading{font-size:24px;line-height:1;margin-bottom:15px}.carousel-slider-hero__cell__description{font-size:14px;line-height:1.4;margin-bottom:15px}}.carousel-slider .carousel-slider__item{position:relative}.carousel-slider .carousel-slider__item img{display:block;margin-left:auto;margin-right:auto;max-width:100%;height:auto}.carousel-slider .carousel-slider__caption{position:relative}.carousel-slider .carousel-slider__caption .title{overflow:hidden;text-overflow:ellipsis;color:#474747;font-size:16px;font-weight:500;margin:10px 0 0;text-align:center}.carousel-slider .carousel-slider__caption .caption{font-size:14px;font-weight:300;margin:10px 0 0;text-align:center}.cs-hero-button{-webkit-appearance:none;-webkit-font-smoothing:inherit;display:inline-block;font-size:1rem;line-height:1;padding:.75em 1em;border-radius:0;text-align:center;box-sizing:border-box;transition:all .2s ease-in-out}.cs-hero-button,.cs-hero-button:hover{text-decoration:none}.cs-hero-button--normal{opacity:.9;filter:alpha(opacity=90)}.cs-hero-button--stroke{background:transparent;border:1px solid transparent}.cs-hero-button--medium{font-size:1.2rem;padding:.9em 1.2em}.cs-hero-button--large{font-size:1.5rem;padding:.9em 1.6em}.mfp-bg{z-index:1042;overflow:hidden;background:#0b0b0b;opacity:.8}.mfp-bg,.mfp-wrap{top:0;left:0;width:100%;height:100%;position:fixed}.mfp-wrap{z-index:1043;outline:none!important;-webkit-backface-visibility:hidden}.mfp-container{text-align:center;position:absolute;width:100%;height:100%;left:0;top:0;padding:0 8px;box-sizing:border-box}.mfp-container:before{content:"";display:inline-block;height:100%;vertical-align:middle}.mfp-align-top .mfp-container:before{display:none}.mfp-content{position:relative;display:inline-block;vertical-align:middle;margin:0 auto;text-align:left;z-index:1045}.mfp-ajax-holder .mfp-content,.mfp-inline-holder .mfp-content{width:100%;cursor:auto}.mfp-ajax-cur{cursor:progress}.mfp-zoom-out-cur,.mfp-zoom-out-cur .mfp-image-holder .mfp-close{cursor:zoom-out}.mfp-zoom{cursor:pointer;cursor:zoom-in}.mfp-auto-cursor .mfp-content{cursor:auto}.mfp-arrow,.mfp-close,.mfp-counter,.mfp-preloader{-webkit-user-select:none;user-select:none}.mfp-loading.mfp-figure{display:none}.mfp-hide{display:none!important}.mfp-preloader{color:#ccc;position:absolute;top:50%;width:auto;text-align:center;margin-top:-.8em;left:8px;right:8px;z-index:1044}.mfp-preloader a{color:#ccc}.mfp-preloader a:hover{color:#fff}.mfp-s-error .mfp-content,.mfp-s-ready .mfp-preloader{display:none}button.mfp-arrow,button.mfp-close{overflow:visible;cursor:pointer;background:transparent;border:0;-webkit-appearance:none;display:block;outline:none;padding:0;z-index:1046;box-shadow:none;touch-action:manipulation}button::-moz-focus-inner{padding:0;border:0}.mfp-close{width:44px;height:44px;line-height:44px;position:absolute;right:0;top:0;text-decoration:none;text-align:center;opacity:.65;padding:0 0 18px 10px;color:#fff;font-style:normal;font-size:28px;font-family:Arial,Baskerville,monospace}.mfp-close:focus,.mfp-close:hover{opacity:1}.mfp-close:active{top:1px}.mfp-close-btn-in .mfp-close{color:#333}.mfp-iframe-holder .mfp-close,.mfp-image-holder .mfp-close{color:#fff;right:-6px;text-align:right;padding-right:6px;width:100%}.mfp-counter{position:absolute;top:0;right:0;color:#ccc;font-size:12px;line-height:18px;white-space:nowrap}.mfp-arrow{position:absolute;opacity:.65;top:50%;margin:-55px 0 0;padding:0;width:90px;height:110px;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mfp-arrow:active{margin-top:-54px}.mfp-arrow:focus,.mfp-arrow:hover{opacity:1}.mfp-arrow:after,.mfp-arrow:before{content:"";display:block;width:0;height:0;position:absolute;left:0;top:0;margin-top:35px;margin-left:35px;border:inset transparent}.mfp-arrow:after{border-top-width:13px;border-bottom-width:13px;top:8px}.mfp-arrow:before{border-top-width:21px;border-bottom-width:21px;opacity:.7}.mfp-arrow-left{left:0}.mfp-arrow-left:after{border-right:17px solid #fff;margin-left:31px}.mfp-arrow-left:before{margin-left:25px;border-right:27px solid #3f3f3f}.mfp-arrow-right{right:0}.mfp-arrow-right:after{border-left:17px solid #fff;margin-left:39px}.mfp-arrow-right:before{border-left:27px solid #3f3f3f}.mfp-iframe-holder{padding-top:40px;padding-bottom:40px}.mfp-iframe-holder .mfp-content{line-height:0;width:100%;max-width:900px}.mfp-iframe-holder .mfp-close{top:-40px}.mfp-iframe-scaler{width:100%;height:0;overflow:hidden;padding-top:56.25%}.mfp-iframe-scaler iframe{position:absolute;display:block;top:0;left:0;width:100%;height:100%;box-shadow:0 0 8px rgba(0,0,0,.6);background:#000}img.mfp-img{width:auto;max-width:100%;height:auto;display:block;box-sizing:border-box;padding:40px 0;margin:0 auto}.mfp-figure,img.mfp-img{line-height:0}.mfp-figure:after{content:"";position:absolute;left:0;top:40px;bottom:40px;display:block;right:0;width:auto;height:auto;z-index:-1;box-shadow:0 0 8px rgba(0,0,0,.6);background:#444}.mfp-figure small{color:#bdbdbd;display:block;font-size:12px;line-height:14px}.mfp-figure figure{margin:0}.mfp-bottom-bar{margin-top:-36px;position:absolute;top:100%;left:0;width:100%;cursor:auto}.mfp-title{text-align:left;line-height:18px;color:#f3f3f3;word-wrap:break-word;padding-right:36px}.mfp-image-holder .mfp-content{max-width:100%}.mfp-gallery .mfp-image-holder .mfp-figure{cursor:pointer}@media screen and (max-height:300px),screen and (max-width:800px) and (orientation:landscape){.mfp-img-mobile .mfp-image-holder{padding-left:0;padding-right:0}.mfp-img-mobile img.mfp-img{padding:0}.mfp-img-mobile .mfp-figure:after{top:0;bottom:0}.mfp-img-mobile .mfp-figure small{display:inline;margin-left:5px}.mfp-img-mobile .mfp-bottom-bar{background:rgba(0,0,0,.6);bottom:0;margin:0;top:auto;padding:3px 5px;position:fixed;box-sizing:border-box}.mfp-img-mobile .mfp-bottom-bar:empty{padding:0}.mfp-img-mobile .mfp-counter{right:5px;top:3px}.mfp-img-mobile .mfp-close{top:0;right:0;width:35px;height:35px;line-height:35px;background:rgba(0,0,0,.6);position:fixed;text-align:center;padding:0}}@media (max-width:900px){.mfp-arrow{transform:scale(.75)}.mfp-arrow-left{transform-origin:0}.mfp-arrow-right{transform-origin:100%}.mfp-container{padding-left:6px;padding-right:6px}}.mfp-with-zoom.mfp-bg,.mfp-with-zoom .mfp-container{opacity:0;-webkit-backface-visibility:hidden;transition:all .3s ease-out}.mfp-with-zoom.mfp-ready .mfp-container{opacity:1}.mfp-with-zoom.mfp-ready.mfp-bg{opacity:.8}.mfp-with-zoom.mfp-removing.mfp-bg,.mfp-with-zoom.mfp-removing .mfp-container{opacity:0}.mfp-content .product{background-color:#fff;display:table;margin:0 auto;padding:15px}.mfp-content .product .images{display:inline-block;float:left;max-width:600px}.mfp-content .product .images img{display:block}.mfp-content .product .onsale{left:24px;top:24px;position:absolute}.mfp-content .product .summary{display:inline-block;margin-left:15px;width:300px}.mfp-content .product .description,.mfp-content .product .product_title{margin:1em 0}.mfp-content .product .price{display:inline-block;font-weight:400;margin:.5em 1em;font-size:.857em;float:left}.mfp-content .product .price del{color:inherit;background-color:initial;opacity:.5;display:inline-block}.mfp-content .product .price ins{color:inherit;background-color:initial;font-weight:700}.mfp-content .product .star-rating{display:inline-block;margin:.5em 1em;float:right;overflow:hidden;position:relative;height:1em;line-height:1;font-size:1em;width:5.4em;font-family:star}.mfp-content .product .star-rating:before{content:"\73\73\73\73\73";float:left;top:0;left:0;position:absolute}.mfp-content .product .star-rating span{overflow:hidden;float:left;top:0;left:0;position:absolute;padding-top:1.5em}.mfp-content .product .star-rating span:before{content:"\53\53\53\53\53";top:0;position:absolute;left:0}.mfp-content .product a.add_to_cart_button,.mfp-content .product a.added_to_cart{margin:0;line-height:1;cursor:pointer;position:relative;text-decoration:none;overflow:visible;padding:.5em 1em;font-weight:400;border-radius:3px;left:auto;border:0;white-space:nowrap;display:inline-block;background-image:none;box-shadow:none;-webkit-box-shadow:none;text-shadow:none}.mfp-content .product a.add_to_cart_button:hover,.mfp-content .product a.added_to_cart:hover{text-decoration:none;background-image:none}.mfp-content .product a.add_to_cart_button.loading{opacity:.25;padding-right:2.618em}.mfp-content .product a.add_to_cart_button.loading:after{font-family:WooCommerce;content:"\e01c";vertical-align:top;-webkit-font-smoothing:antialiased;font-weight:400;position:absolute;top:.618em;right:1em;-webkit-animation:spin 2s linear infinite;animation:spin 2s linear infinite}.mfp-content .product a.add_to_cart_button.added:after{font-family:WooCommerce;content:"\e017";margin-left:.53em;vertical-align:bottom}.mfp-ajax-holder .mfp-content,.mfp-inline-holder .mfp-content{max-width:945px;margin-top:40px;margin-bottom:40px}@media (max-width:600px){.mfp-content .product .images{margin-bottom:30px}.mfp-content .product .summary{display:block;margin:0;width:100%}}@media (min-width:601px){.mfp-content .product .images{display:inline-block;width:49%}.mfp-content .product .summary{display:inline-block;margin:0 0 0 1%;width:49%}}.mfp-counter{display:none}
|
1 |
+
.mfp-bg{background:#0b0b0b;opacity:.8;overflow:hidden;z-index:1042}.mfp-bg,.mfp-wrap{height:100%;left:0;position:fixed;top:0;width:100%}.mfp-wrap{-webkit-backface-visibility:hidden;outline:none!important;z-index:1043}.mfp-container{box-sizing:border-box;height:100%;left:0;padding:0 8px;position:absolute;text-align:center;top:0;width:100%}.mfp-container:before{content:"";display:inline-block;height:100%;vertical-align:middle}.mfp-align-top .mfp-container:before{display:none}.mfp-content{display:inline-block;margin:0 auto;position:relative;text-align:left;vertical-align:middle;z-index:1045}.mfp-ajax-holder .mfp-content,.mfp-inline-holder .mfp-content{cursor:auto;width:100%}.mfp-ajax-cur{cursor:progress}.mfp-zoom-out-cur,.mfp-zoom-out-cur .mfp-image-holder .mfp-close{cursor:zoom-out}.mfp-zoom{cursor:pointer;cursor:zoom-in}.mfp-auto-cursor .mfp-content{cursor:auto}.mfp-arrow,.mfp-close,.mfp-counter,.mfp-preloader{-webkit-user-select:none;user-select:none}.mfp-loading.mfp-figure{display:none}.mfp-hide{display:none!important}.mfp-preloader{color:#ccc;left:8px;margin-top:-.8em;position:absolute;right:8px;text-align:center;top:50%;width:auto;z-index:1044}.mfp-preloader a{color:#ccc}.mfp-preloader a:hover{color:#fff}.mfp-s-error .mfp-content,.mfp-s-ready .mfp-preloader{display:none}button.mfp-arrow,button.mfp-close{-webkit-appearance:none;background:#0000;border:0;box-shadow:none;cursor:pointer;display:block;outline:none;overflow:visible;padding:0;touch-action:manipulation;z-index:1046}button::-moz-focus-inner{border:0;padding:0}.mfp-close{color:#fff;font-family:Arial,Baskerville,monospace;font-size:28px;font-style:normal;height:44px;line-height:44px;opacity:.65;padding:0 0 18px 10px;position:absolute;right:0;text-align:center;text-decoration:none;top:0;width:44px}.mfp-close:focus,.mfp-close:hover{opacity:1}.mfp-close:active{top:1px}.mfp-close-btn-in .mfp-close{color:#333}.mfp-iframe-holder .mfp-close,.mfp-image-holder .mfp-close{color:#fff;padding-right:6px;right:-6px;text-align:right;width:100%}.mfp-counter{color:#ccc;font-size:12px;line-height:18px;position:absolute;right:0;top:0;white-space:nowrap}.mfp-arrow{-webkit-tap-highlight-color:transparent;height:110px;margin:-55px 0 0;opacity:.65;padding:0;position:absolute;top:50%;width:90px}.mfp-arrow:active{margin-top:-54px}.mfp-arrow:focus,.mfp-arrow:hover{opacity:1}.mfp-arrow:after,.mfp-arrow:before{border:inset #0000;content:"";display:block;height:0;left:0;margin-left:35px;margin-top:35px;position:absolute;top:0;width:0}.mfp-arrow:after{border-bottom-width:13px;border-top-width:13px;top:8px}.mfp-arrow:before{border-bottom-width:21px;border-top-width:21px;opacity:.7}.mfp-arrow-left{left:0}.mfp-arrow-left:after{border-right:17px solid #fff;margin-left:31px}.mfp-arrow-left:before{border-right:27px solid #3f3f3f;margin-left:25px}.mfp-arrow-right{right:0}.mfp-arrow-right:after{border-left:17px solid #fff;margin-left:39px}.mfp-arrow-right:before{border-left:27px solid #3f3f3f}.mfp-iframe-holder{padding-bottom:40px;padding-top:40px}.mfp-iframe-holder .mfp-content{line-height:0;max-width:900px;width:100%}.mfp-iframe-holder .mfp-close{top:-40px}.mfp-iframe-scaler{height:0;overflow:hidden;padding-top:56.25%;width:100%}.mfp-iframe-scaler iframe{background:#000;box-shadow:0 0 8px #0009;display:block;height:100%;left:0;position:absolute;top:0;width:100%}img.mfp-img{box-sizing:border-box;display:block;height:auto;margin:0 auto;max-width:100%;padding:40px 0;width:auto}.mfp-figure,img.mfp-img{line-height:0}.mfp-figure:after{background:#444;bottom:40px;box-shadow:0 0 8px #0009;content:"";display:block;height:auto;left:0;position:absolute;right:0;top:40px;width:auto;z-index:-1}.mfp-figure small{color:#bdbdbd;display:block;font-size:12px;line-height:14px}.mfp-figure figure{margin:0}.mfp-bottom-bar{cursor:auto;left:0;margin-top:-36px;position:absolute;top:100%;width:100%}.mfp-title{word-wrap:break-word;color:#f3f3f3;line-height:18px;padding-right:36px;text-align:left}.mfp-image-holder .mfp-content{max-width:100%}.mfp-gallery .mfp-image-holder .mfp-figure{cursor:pointer}@media screen and (max-height:300px),screen and (max-width:800px) and (orientation:landscape){.mfp-img-mobile .mfp-image-holder{padding-left:0;padding-right:0}.mfp-img-mobile img.mfp-img{padding:0}.mfp-img-mobile .mfp-figure:after{bottom:0;top:0}.mfp-img-mobile .mfp-figure small{display:inline;margin-left:5px}.mfp-img-mobile .mfp-bottom-bar{background:#0009;bottom:0;box-sizing:border-box;margin:0;padding:3px 5px;position:fixed;top:auto}.mfp-img-mobile .mfp-bottom-bar:empty{padding:0}.mfp-img-mobile .mfp-counter{right:5px;top:3px}.mfp-img-mobile .mfp-close{background:#0009;height:35px;line-height:35px;padding:0;position:fixed;right:0;text-align:center;top:0;width:35px}}@media (max-width:900px){.mfp-arrow{transform:scale(.75)}.mfp-arrow-left{transform-origin:0}.mfp-arrow-right{transform-origin:100%}.mfp-container{padding-left:6px;padding-right:6px}}.carousel-slider{-webkit-tap-highlight-color:transparent;display:none;position:relative;width:100%;z-index:1}.carousel-slider .owl-stage{-webkit-backface-visibility:hidden;backface-visibility:hidden;position:relative;touch-action:manipulation}.carousel-slider .owl-stage:after{clear:both;content:".";display:block;height:0;line-height:0;visibility:hidden}.carousel-slider .owl-stage-outer{overflow:hidden;position:relative;transform:translateZ(0)}.carousel-slider .owl-carousel .owl-item,.carousel-slider .owl-carousel .owl-wrapper{-webkit-backface-visibility:hidden;backface-visibility:hidden;transform:translateZ(0)}.carousel-slider .owl-item{-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;-webkit-backface-visibility:hidden;backface-visibility:hidden;float:left;min-height:1px;position:relative}.carousel-slider .owl-item img{display:block;width:100%}.carousel-slider .owl-dots.disabled,.carousel-slider .owl-nav.disabled{display:none}.carousel-slider .owl-dot,.carousel-slider .owl-nav .owl-next,.carousel-slider .owl-nav .owl-prev{cursor:pointer;-webkit-user-select:none;user-select:none}.carousel-slider .owl-nav button.owl-next,.carousel-slider .owl-nav button.owl-prev,.carousel-slider button.owl-dot{background:none;border:none;font:inherit;padding:0!important}.carousel-slider.owl-loaded{display:block}.carousel-slider.owl-loading{display:block;opacity:0}.carousel-slider.owl-hidden{opacity:0}.carousel-slider.owl-refresh .owl-item{visibility:hidden}.carousel-slider.owl-drag .owl-item{touch-action:pan-y;-webkit-user-select:none;user-select:none}.carousel-slider.owl-grab{cursor:move;cursor:grab}.carousel-slider.owl-rtl{direction:rtl}.carousel-slider.owl-rtl .owl-item{float:right}.no-js .carousel-slider{display:block}.carousel-slider .animated{animation-duration:1s;animation-fill-mode:both}.carousel-slider .owl-animated-in{z-index:0}.carousel-slider .owl-animated-out{z-index:1}.carousel-slider .fadeOut{animation-name:fadeOut}.carousel-slider .fadeInDown{animation-name:fadeInDown}.carousel-slider .fadeInUp{animation-name:fadeInUp}.carousel-slider .fadeInRight{animation-name:fadeInRight}.carousel-slider .fadeInLeft{animation-name:fadeInLeft}.carousel-slider .zoomIn{animation-name:zoomIn}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}@keyframes fadeInDown{0%{opacity:0;transform:translate3d(0,-100%,0)}to{opacity:1;transform:none}}@keyframes fadeInUp{0%{opacity:0;transform:translate3d(0,100%,0)}to{opacity:1;transform:none}}@keyframes fadeInRight{0%{opacity:0;transform:translate3d(100%,0,0)}to{opacity:1;transform:none}}@keyframes fadeInLeft{0%{opacity:0;transform:translate3d(-100%,0,0)}to{opacity:1;transform:none}}@keyframes zoomIn{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}.owl-height{transition:height .5s ease-in-out}.carousel-slider .owl-item img.owl-lazy{background:url(data:image/gif;base64,R0lGODlhIAAgAPMAAP///5aWlufn58zMzODg4NXV1aysrLm5ue7u7vPz8+Li4qKiopeXlwAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCgAAACwAAAAAIAAgAAAE5xDISWlhperN52JLhSSdRgwVo1ICQZRUsiwHpTJT4iowNS8vyW2icCF6k8HMMBkCEDskxTBDAZwuAkkqIfxIQyhBQBFvAQSDITM5VDW6XNE4KagNh6Bgwe60smQUB3d4Rz1ZBApnFASDd0hihh12BkE9kjAJVlycXIg7CQIFA6SlnJ87paqbSKiKoqusnbMdmDC2tXQlkUhziYtyWTxIfy6BE8WJt5YJvpJivxNaGmLHT0VnOgSYf0dZXS7APdpB309RnHOG5gDqXGLDaC457D1zZ/V/nmOM82XiHRLYKhKP1oZmADdEAAAh+QQJCgAAACwAAAAAIAAgAAAE6hDISWlZpOrNp1lGNRSdRpDUolIGw5RUYhhHukqFu8DsrEyqnWThGvAmhVlteBvojpTDDBUEIFwMFBRAmBkSgOrBFZogCASwBDEY/CZSg7GSE0gSCjQBMVG023xWBhklAnoEdhQEfyNqMIcKjhRsjEdnezB+A4k8gTwJhFuiW4dokXiloUepBAp5qaKpp6+Ho7aWW54wl7obvEe0kRuoplCGepwSx2jJvqHEmGt6whJpGpfJCHmOoNHKaHx61WiSR92E4lbFoq+B6QDtuetcaBPnW6+O7wDHpIiK9SaVK5GgV543tzjgGcghAgAh+QQJCgAAACwAAAAAIAAgAAAE7hDISSkxpOrN5zFHNWRdhSiVoVLHspRUMoyUakyEe8PTPCATW9A14E0UvuAKMNAZKYUZCiBMuBakSQKG8G2FzUWox2AUtAQFcBKlVQoLgQReZhQlCIJesQXI5B0CBnUMOxMCenoCfTCEWBsJColTMANldx15BGs8B5wlCZ9Po6OJkwmRpnqkqnuSrayqfKmqpLajoiW5HJq7FL1Gr2mMMcKUMIiJgIemy7xZtJsTmsM4xHiKv5KMCXqfyUCJEonXPN2rAOIAmsfB3uPoAK++G+w48edZPK+M6hLJpQg484enXIdQFSS1u6UhksENEQAAIfkECQoAAAAsAAAAACAAIAAABOcQyEmpGKLqzWcZRVUQnZYg1aBSh2GUVEIQ2aQOE+G+cD4ntpWkZQj1JIiZIogDFFyHI0UxQwFugMSOFIPJftfVAEoZLBbcLEFhlQiqGp1Vd140AUklUN3eCA51C1EWMzMCezCBBmkxVIVHBWd3HHl9JQOIJSdSnJ0TDKChCwUJjoWMPaGqDKannasMo6WnM562R5YluZRwur0wpgqZE7NKUm+FNRPIhjBJxKZteWuIBMN4zRMIVIhffcgojwCF117i4nlLnY5ztRLsnOk+aV+oJY7V7m76PdkS4trKcdg0Zc0tTcKkRAAAIfkECQoAAAAsAAAAACAAIAAABO4QyEkpKqjqzScpRaVkXZWQEximw1BSCUEIlDohrft6cpKCk5xid5MNJTaAIkekKGQkWyKHkvhKsR7ARmitkAYDYRIbUQRQjWBwJRzChi9CRlBcY1UN4g0/VNB0AlcvcAYHRyZPdEQFYV8ccwR5HWxEJ02YmRMLnJ1xCYp0Y5idpQuhopmmC2KgojKasUQDk5BNAwwMOh2RtRq5uQuPZKGIJQIGwAwGf6I0JXMpC8C7kXWDBINFMxS4DKMAWVWAGYsAdNqW5uaRxkSKJOZKaU3tPOBZ4DuK2LATgJhkPJMgTwKCdFjyPHEnKxFCDhEAACH5BAkKAAAALAAAAAAgACAAAATzEMhJaVKp6s2nIkolIJ2WkBShpkVRWqqQrhLSEu9MZJKK9y1ZrqYK9WiClmvoUaF8gIQSNeF1Er4MNFn4SRSDARWroAIETg1iVwuHjYB1kYc1mwruwXKC9gmsJXliGxc+XiUCby9ydh1sOSdMkpMTBpaXBzsfhoc5l58Gm5yToAaZhaOUqjkDgCWNHAULCwOLaTmzswadEqggQwgHuQsHIoZCHQMMQgQGubVEcxOPFAcMDAYUA85eWARmfSRQCdcMe0zeP1AAygwLlJtPNAAL19DARdPzBOWSm1brJBi45soRAWQAAkrQIykShQ9wVhHCwCQCACH5BAkKAAAALAAAAAAgACAAAATrEMhJaVKp6s2nIkqFZF2VIBWhUsJaTokqUCoBq+E71SRQeyqUToLA7VxF0JDyIQh/MVVPMt1ECZlfcjZJ9mIKoaTl1MRIl5o4CUKXOwmyrCInCKqcWtvadL2SYhyASyNDJ0uIiRMDjI0Fd30/iI2UA5GSS5UDj2l6NoqgOgN4gksEBgYFf0FDqKgHnyZ9OX8HrgYHdHpcHQULXAS2qKpENRg7eAMLC7kTBaixUYFkKAzWAAnLC7FLVxLWDBLKCwaKTULgEwbLA4hJtOkSBNqITT3xEgfLpBtzE/jiuL04RGEBgwWhShRgQExHBAAh+QQJCgAAACwAAAAAIAAgAAAE7xDISWlSqerNpyJKhWRdlSAVoVLCWk6JKlAqAavhO9UkUHsqlE6CwO1cRdCQ8iEIfzFVTzLdRAmZX3I2SfZiCqGk5dTESJeaOAlClzsJsqwiJwiqnFrb2nS9kmIcgEsjQydLiIlHehhpejaIjzh9eomSjZR+ipslWIRLAgMDOR2DOqKogTB9pCUJBagDBXR6XB0EBkIIsaRsGGMMAxoDBgYHTKJiUYEGDAzHC9EACcUGkIgFzgwZ0QsSBcXHiQvOwgDdEwfFs0sDzt4S6BK4xYjkDOzn0unFeBzOBijIm1Dgmg5YFQwsCMjp1oJ8LyIAACH5BAkKAAAALAAAAAAgACAAAATwEMhJaVKp6s2nIkqFZF2VIBWhUsJaTokqUCoBq+E71SRQeyqUToLA7VxF0JDyIQh/MVVPMt1ECZlfcjZJ9mIKoaTl1MRIl5o4CUKXOwmyrCInCKqcWtvadL2SYhyASyNDJ0uIiUd6GGl6NoiPOH16iZKNlH6KmyWFOggHhEEvAwwMA0N9GBsEC6amhnVcEwavDAazGwIDaH1ipaYLBUTCGgQDA8NdHz0FpqgTBwsLqAbWAAnIA4FWKdMLGdYGEgraigbT0OITBcg5QwPT4xLrROZL6AuQAPUS7bxLpoWidY0JtxLHKhwwMJBTHgPKdEQAACH5BAkKAAAALAAAAAAgACAAAATrEMhJaVKp6s2nIkqFZF2VIBWhUsJaTokqUCoBq+E71SRQeyqUToLA7VxF0JDyIQh/MVVPMt1ECZlfcjZJ9mIKoaTl1MRIl5o4CUKXOwmyrCInCKqcWtvadL2SYhyASyNDJ0uIiUd6GAULDJCRiXo1CpGXDJOUjY+Yip9DhToJA4RBLwMLCwVDfRgbBAaqqoZ1XBMHswsHtxtFaH1iqaoGNgAIxRpbFAgfPQSqpbgGBqUD1wBXeCYp1AYZ19JJOYgH1KwA4UBvQwXUBxPqVD9L3sbp2BNk2xvvFPJd+MFCN6HAAIKgNggY0KtEBAAh+QQJCgAAACwAAAAAIAAgAAAE6BDISWlSqerNpyJKhWRdlSAVoVLCWk6JKlAqAavhO9UkUHsqlE6CwO1cRdCQ8iEIfzFVTzLdRAmZX3I2SfYIDMaAFdTESJeaEDAIMxYFqrOUaNW4E4ObYcCXaiBVEgULe0NJaxxtYksjh2NLkZISgDgJhHthkpU4mW6blRiYmZOlh4JWkDqILwUGBnE6TYEbCgevr0N1gH4At7gHiRpFaLNrrq8HNgAJA70AWxQIH1+vsYMDAzZQPC9VCNkDWUhGkuE5PxJNwiUK4UfLzOlD4WvzAHaoG9nxPi5d+jYUqfAhhykOFwJWiAAAIfkECQoAAAAsAAAAACAAIAAABPAQyElpUqnqzaciSoVkXVUMFaFSwlpOCcMYlErAavhOMnNLNo8KsZsMZItJEIDIFSkLGQoQTNhIsFehRww2CQLKF0tYGKYSg+ygsZIuNqJksKgbfgIGepNo2cIUB3V1B3IvNiBYNQaDSTtfhhx0CwVPI0UJe0+bm4g5VgcGoqOcnjmjqDSdnhgEoamcsZuXO1aWQy8KAwOAuTYYGwi7w5h+Kr0SJ8MFihpNbx+4Erq7BYBuzsdiH1jCAzoSfl0rVirNbRXlBBlLX+BP0XJLAPGzTkAuAOqb0WT5AH7OcdCm5B8TgRwSRKIHQtaLCwg1RAAAOwAAAAAAAAAAAA==) no-repeat 50%;min-height:32px;min-width:32px}.carousel-slider .owl-nav .owl-next,.carousel-slider .owl-nav .owl-prev{color:var(--carousel-slider-nav-color,#9e9e9e);display:inline-block;height:var(--carousel-slider-arrow-size,48px);margin:0;opacity:0;padding:0;position:absolute;top:50%;transform:translateY(-50%);transition:all .3s ease-in-out;width:var(--carousel-slider-arrow-size,48px)}.carousel-slider .owl-nav .owl-next:hover,.carousel-slider .owl-nav .owl-prev:hover{color:var(--carousel-slider-active-nav-color,#4caf50)}.carousel-slider .owl-nav .owl-next svg,.carousel-slider .owl-nav .owl-prev svg{fill:currentColor}.carousel-slider .owl-nav .owl-prev{left:0}.carousel-slider .owl-nav .owl-next{right:0}.carousel-slider.arrows-visibility-always .owl-next,.carousel-slider.arrows-visibility-always .owl-prev,.carousel-slider:hover .owl-nav .owl-next,.carousel-slider:hover .owl-nav .owl-prev{opacity:1}.carousel-slider.arrows-outside .owl-nav .owl-prev{left:calc(var(--carousel-slider-arrow-size, 48px)*-1)}.carousel-slider.arrows-outside .owl-nav .owl-next{right:calc(var(--carousel-slider-arrow-size, 48px)*-1)}.carousel-slider .owl-dots{-webkit-tap-highlight-color:transparent;margin-top:10px;text-align:center}.carousel-slider .owl-dots .owl-dot{zoom:1;display:inline-block;*display:inline}.carousel-slider .owl-dots .owl-dot span{-webkit-backface-visibility:visible;background-color:var(--carousel-slider-nav-color,#9e9e9e);display:block;height:var(--carousel-slider-bullet-size,10px);margin:4px 8px;transition:opacity .2s ease;width:var(--carousel-slider-bullet-size,10px)}.carousel-slider .owl-dots .owl-dot.active span,.carousel-slider .owl-dots .owl-dot:hover span{background-color:var(--carousel-slider-active-nav-color,#4caf50)}.carousel-slider.dots-center .owl-dots{text-align:center}.carousel-slider.dots-left .owl-dots{text-align:left}.carousel-slider.dots-left .owl-dots:first-child span{margin-left:0}.carousel-slider.dots-right .owl-dots{text-align:right}.carousel-slider.dots-right .owl-dots:last-child span{margin-right:0}.carousel-slider.dots-visibility-hover .owl-dots{opacity:0}.carousel-slider.dots-visibility-hover:hover .owl-dots{opacity:1}.carousel-slider.dots-circle .owl-dots .owl-dot span{border-radius:9999px}.cs-hero-button{-webkit-font-smoothing:inherit;-webkit-appearance:none;border-radius:0;box-sizing:border-box;display:inline-block;font-size:1rem;line-height:1;padding:.75em 1em;text-align:center;transition:all .2s ease-in-out}.cs-hero-button,.cs-hero-button:hover{text-decoration:none}.cs-hero-button--normal{filter:alpha(opacity=90);opacity:.9}.cs-hero-button--stroke{background:#0000;border:1px solid #0000}.cs-hero-button--medium{font-size:1.2rem;padding:.9em 1.2em}.cs-hero-button--large{font-size:1.5rem;padding:.9em 1.6em}.carousel-slider-hero__cell__background{background-position:50%;background-repeat:no-repeat;background-size:cover;min-height:100%;min-width:100%;transition-duration:10s;transition-property:transform}.carousel-slider-hero__cell__background.carousel-slider-hero-ken-out{transform:scale(1.3)}.carousel-slider .active .carousel-slider-hero__cell__background{animation-duration:20s;animation-timing-function:linear}.carousel-slider .active .carousel-slider-hero__cell__background.carousel-slider-hero-ken-in{animation-name:ken-burns-in;transform:scale(1.3)}.carousel-slider .active .carousel-slider-hero__cell__background.carousel-slider-hero-ken-out{animation-name:ken-burns-out;transform:scale(1)}.carousel-slider-hero__cell{align-items:center;display:flex;height:var(--cell-height,400px);justify-content:center;overflow:hidden;position:relative}.carousel-slider-hero__cell:focus{outline:0}.carousel-slider-hero__cell__inner{background-position:50%;background-repeat:no-repeat;bottom:0;left:0;padding:50px;position:absolute;right:0;top:0}.carousel-slider-hero__cell__inner,.carousel-slider-hero__cell__inner:hover{color:#fff;display:flex}.carousel-slider-hero__cell__background_overlay{bottom:0;left:0;position:absolute;right:0;top:0;z-index:0}.carousel-slider-hero__cell__content{max-width:1140px;position:relative;width:100%;z-index:1}.carousel-slider-hero__cell__heading{color:var(--cs-heading-color,#fff);font-size:var(--cs-heading-font-size,40px);font-weight:700;line-height:1;margin-bottom:var(--cs-heading-gutter,30px)}.carousel-slider-hero__cell__description{color:var(--cs-description-color,#fff);font-size:var(--cs-description-font-size,20px);line-height:1.4;margin-bottom:var(--cs-description-gutter,30px)}.carousel-slider-hero__cell__button__one{margin-right:5px}.carousel-slider-hero__cell__button__two{margin-left:5px}.carousel-slider-hero__cell__button__one,.carousel-slider-hero__cell__button__two{display:inline-flex}.button.cs-hero-button{border:var(--cs-button-border-width,0) solid var(--cs-button-bg-color,#00d1b2);border-radius:var(--cs-button-border-radius,3px)}.button.cs-hero-button,.button.cs-hero-button:hover{background-color:var(--cs-button-bg-color,#00d1b2);color:var(--cs-button-color,#fff)}.button.cs-hero-button.cs-hero-button-stroke,.button.cs-hero-button:hover{border-color:var(--cs-button-bg-color,#00d1b2)}.button.cs-hero-button.cs-hero-button-stroke{background-color:initial;color:var(--cs-button-bg-color,#00d1b2)}.button.cs-hero-button.cs-hero-button-stroke:hover{background-color:var(--cs-button-bg-color,#00d1b2);color:var(--cs-button-color,#fff)}.carousel-slider-hero__cell__inner.carousel-slider--v-position-top{align-items:flex-start}.carousel-slider-hero__cell__inner.carousel-slider--v-position-bottom{align-items:flex-end}.carousel-slider-hero__cell__inner.carousel-slider--v-position-middle{align-items:center}.carousel-slider-hero__cell__inner.carousel-slider--h-position-left{justify-content:flex-start}.carousel-slider-hero__cell__inner.carousel-slider--h-position-right{justify-content:flex-end}.carousel-slider-hero__cell__inner.carousel-slider--h-position-center{justify-content:center}.carousel-slider-hero__cell__inner.carousel-slider--text-left{text-align:left}.carousel-slider-hero__cell__inner.carousel-slider--text-right{text-align:right}.carousel-slider-hero__cell__inner.carousel-slider--text-center{text-align:center}@media(max-width:767px){.carousel-slider-hero__cell__inner{padding:30px}.carousel-slider-hero__cell__heading{font-size:24px;line-height:1;margin-bottom:15px}.carousel-slider-hero__cell__description{font-size:14px;line-height:1.4;margin-bottom:15px}}.carousel-slider .carousel-slider__item{position:relative}.carousel-slider .carousel-slider__item img{display:block;height:auto;margin-left:auto;margin-right:auto;max-width:100%}.carousel-slider .carousel-slider__caption{position:relative}.carousel-slider .carousel-slider__caption .title{color:#474747;font-size:16px;font-weight:500;margin:10px 0 0;overflow:hidden;text-align:center;text-overflow:ellipsis}.carousel-slider .carousel-slider__caption .caption{font-size:14px;font-weight:300;margin:10px 0 0;text-align:center}.carousel-slider .carousel-slider__caption .caption:empty,.carousel-slider .carousel-slider__caption .title:empty{display:none}.carousel-slider[data-slide-type=post-carousel] .owl-stage{display:flex;flex-wrap:wrap}.carousel-slider[data-slide-type=post-carousel] .owl-item{display:flex;height:auto}.carousel-slider__post{border-radius:4px;box-shadow:0 1px 2px #0000001a,0 0 0 1px #0000001a;margin:2px;position:relative;width:100%}.carousel-slider__post-content{display:flex;flex-direction:column;height:100%;justify-content:space-between}.carousel-slider__post-image{background-color:#f1f1f1;background-position:50%;background-size:cover;border-top-left-radius:4px;border-top-right-radius:4px;display:block;line-height:0;margin:0 auto;overflow:hidden;padding-top:66.6666%;position:relative;text-align:center;width:100%}.carousel-slider__post-title{display:block;margin:1rem;min-height:3.75em}.carousel-slider__post-title h1{font-size:1.25rem;margin:0}.carousel-slider__post-excerpt{font-size:1rem;line-height:1.6;margin:1rem 1rem 2rem;text-align:left}.carousel-slider__post-meta{align-items:flex-end;display:flex;font-size:.75rem;justify-content:space-between;margin:auto 1rem 1rem}.carousel-slider__post-author,.carousel-slider__post-publication-meta{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.carousel-slider__post-author{font-style:normal;line-height:1.6}.carousel-slider__post-author-link{display:inline-block;max-width:175px;overflow:hidden;text-overflow:ellipsis;vertical-align:middle;white-space:nowrap}.carousel-slider__post-category{text-transform:uppercase}.carousel-slider[data-slide-type=product-carousel] .owl-stage{display:flex;flex-wrap:wrap}.carousel-slider[data-slide-type=product-carousel] .owl-item{display:flex;height:auto}.carousel-slider__product{box-shadow:0 1px 2px #0000001a,0 0 0 1px #0000001a;margin:2px;position:relative;text-align:center;width:100%}.carousel-slider .woocommerce-loop-category__title,.carousel-slider .woocommerce-loop-product__title{color:var(--cs-product-text,#333);font-size:1.25rem;margin:1rem;padding:0}.carousel-slider .woocommerce-loop-product__link{display:block;margin:0;overflow:hidden;text-decoration:none!important}.carousel-slider .price{color:var(--cs-product-text,#333);display:inline-block;font-size:.875rem;font-weight:400;margin:0 .5rem 0 1rem}.carousel-slider .price del{background-color:initial;color:inherit;display:inline-block;opacity:.5}.carousel-slider .price ins{background-color:initial;color:inherit;font-weight:700}.carousel-slider .onsale{background-color:var(--cs-product-primary,#96588a);color:var(--cs-product-on-primary,#f1f1f1);left:1rem;position:absolute;top:1rem}.carousel-slider .star-rating span:before{color:var(--cs-product-primary,#96588a)}.carousel-slider a.add_to_cart_button,.carousel-slider a.add_to_cart_read_more,.carousel-slider a.added_to_cart,.carousel-slider a.quick_view{background-color:var(--cs-product-primary,#96588a);color:var(--cs-product-on-primary,#f1f1f1);margin-bottom:.5rem;position:relative}.carousel-slider a.add_to_cart_button:hover,.carousel-slider a.add_to_cart_read_more:hover,.carousel-slider a.added_to_cart:hover,.carousel-slider a.quick_view:hover{background-color:var(--cs-product-primary,#96588a);color:var(--cs-product-on-primary,#f1f1f1);text-decoration:none}.mfp-content .product{background-color:#fff;display:table;margin:0 auto;padding:15px}.mfp-content .product .images{display:inline-block;float:left;max-width:600px}.mfp-content .product .images img{display:block}.mfp-content .product .onsale{left:24px;position:absolute;top:24px}.mfp-content .product .summary{display:inline-block;margin-left:15px;width:300px}.mfp-content .product .description,.mfp-content .product .product_title{margin:1em 0}.mfp-content .product .price{display:inline-block;float:left;font-size:.857em;font-weight:400;margin:.5em 1em}.mfp-content .product .price del{background-color:initial;color:inherit;display:inline-block;opacity:.5}.mfp-content .product .price ins{background-color:initial;color:inherit;font-weight:700}.mfp-content .product .star-rating{display:inline-block;float:right;font-family:star;font-size:1em;height:1em;line-height:1;margin:.5em 1em;overflow:hidden;position:relative;width:5.4em}.mfp-content .product .star-rating:before{content:"sssss";float:left;left:0;position:absolute;top:0}.mfp-content .product .star-rating span{float:left;left:0;overflow:hidden;padding-top:1.5em;position:absolute;top:0}.mfp-content .product .star-rating span:before{content:"SSSSS";left:0;position:absolute;top:0}.mfp-content .product a.add_to_cart_button,.mfp-content .product a.added_to_cart{background-image:none;border:0;border-radius:3px;box-shadow:none;-webkit-box-shadow:none;cursor:pointer;display:inline-block;font-weight:400;left:auto;line-height:1;margin:0;overflow:visible;padding:.5em 1em;position:relative;text-decoration:none;text-shadow:none;white-space:nowrap}.mfp-content .product a.add_to_cart_button:hover,.mfp-content .product a.added_to_cart:hover{background-image:none;text-decoration:none}.mfp-content .product a.add_to_cart_button.loading{opacity:.25;padding-right:2.618em}.mfp-content .product a.add_to_cart_button.loading:after{-webkit-font-smoothing:antialiased;animation:spin 2s linear infinite;content:"";font-family:WooCommerce;font-weight:400;position:absolute;right:1em;top:.618em;vertical-align:top}.mfp-content .product a.add_to_cart_button.added:after{content:"";font-family:WooCommerce;margin-left:.53em;vertical-align:bottom}.mfp-ajax-holder .mfp-content,.mfp-inline-holder .mfp-content{margin-bottom:40px;margin-top:40px;max-width:945px}@media(max-width:600px){.mfp-content .product .images{margin-bottom:30px}.mfp-content .product .summary{display:block;margin:0;width:100%}}@media(min-width:601px){.mfp-content .product .images{display:inline-block;width:49%}.mfp-content .product .summary{display:inline-block;margin:0 0 0 1%;width:49%}}.carousel-slider .carousel-slider-video-wrapper{background:#000;height:100%;position:relative}.carousel-slider .carousel-slider-video-play-icon{-webkit-backface-visibility:hidden;background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' fill='%23f1f1f1'%3E%3Cpath d='m12.1 6.7 23 13.5-23 13.5V6.8z'/%3E%3Cpath d='M19.7 40c-11 0-20-9-20-20s9-20 20-20 20 9 20 20-9 20-20 20zm0-38c-9.9 0-18 8.1-18 18s8.1 18 18 18 18-8.1 18-18-8.1-18-18-18z'/%3E%3C/svg%3E") no-repeat;cursor:pointer;height:40px;left:50%;margin-left:-20px;margin-top:-20px;position:absolute;top:50%;transition:transform .1s ease;width:40px;z-index:2}.carousel-slider .carousel-slider-video-overlay{background-color:#00000080;height:100%;left:0;position:absolute;top:0;width:100%;z-index:1}.carousel-slider .carousel-slider-video-play-icon:hover{transform:scale(1.3)}.mfp-counter{display:none}
|
assets/css/gutenberg-block.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.carousel-slider-
|
1 |
+
.carousel-slider-iframe-container{position:relative}.carousel-slider-iframe-overlay{bottom:0;left:0;position:absolute;right:0;top:0}.carousel-slider-editor-controls{padding-right:1rem;width:100%}.carousel-slider-editor-controls__logo{float:left;margin-bottom:10px;margin-right:15px;max-height:50px;max-width:50px!important}.carousel-slider-editor-controls__input{padding-bottom:1rem}.carousel-slider-inspector-controls{padding-left:1rem;padding-right:1rem}
|
assets/js/admin.js
CHANGED
@@ -1 +1,2 @@
|
|
1 |
-
(()=>{"use strict";class t{constructor(t){this.element=t,this.cssClasses={IS_ACTIVE:"is-active",MAIN:"shapla-tooltip",BOTTOM:"shapla-tooltip--bottom",LEFT:"shapla-tooltip--left",RIGHT:"shapla-tooltip--right",TOP:"shapla-tooltip--top"},this.init()}handleMouseEnter_(t){let e=t.target.getBoundingClientRect(),s=e.left+e.width/2,i=e.top+e.height/2,o=this.element.offsetWidth/2*-1,a=this.element.offsetHeight/2*-1;this.element.classList.contains(this.cssClasses.LEFT)||this.element.classList.contains(this.cssClasses.RIGHT)?i+a<0?(this.element.style.top="0",this.element.style.marginTop="0"):(this.element.style.top=i+"px",this.element.style.marginTop=a+"px"):s+o<0?(this.element.style.left="0",this.element.style.marginLeft="0"):(this.element.style.left=s+"px",this.element.style.marginLeft=o+"px"),this.element.classList.contains(this.cssClasses.TOP)?this.element.style.top=e.top-this.element.offsetHeight-10+"px":this.element.classList.contains(this.cssClasses.RIGHT)?this.element.style.left=e.left+e.width+10+"px":this.element.classList.contains(this.cssClasses.LEFT)?this.element.style.left=e.left-this.element.offsetWidth-10+"px":this.element.style.top=e.top+e.height+10+"px",this.element.classList.add(this.cssClasses.IS_ACTIVE)}hideTooltip_(){this.element.classList.remove(this.cssClasses.IS_ACTIVE)}init(){if(!this.element)return;let e=this.element.getAttribute("data-tooltip-for");if(e)this.forElement_=document.getElementById(e);else{let e=this.element.getAttribute("data-tooltip")||this.element.getAttribute("title"),s=t.createUUID(),i=document.createElement("div");i.classList.add(this.cssClasses.MAIN),i.setAttribute("data-tooltip-for",s),i.setAttribute("role","tooltip"),i.innerText=e,document.body.appendChild(i),this.forElement_=this.element,this.forElement_.setAttribute("data-tooltip-target",s),this.forElement_.removeAttribute("data-tooltip"),this.forElement_.removeAttribute("title"),this.element=i}this.forElement_&&(this.forElement_.hasAttribute("tabindex")||this.forElement_.setAttribute("tabindex","0"),this.boundMouseEnterHandler=this.handleMouseEnter_.bind(this),this.boundMouseLeaveAndScrollHandler=this.hideTooltip_.bind(this),this.forElement_.addEventListener("mouseenter",this.boundMouseEnterHandler,!1),this.forElement_.addEventListener("touchend",this.boundMouseEnterHandler,!1),this.forElement_.addEventListener("mouseleave",this.boundMouseLeaveAndScrollHandler,!1),window.addEventListener("scroll",this.boundMouseLeaveAndScrollHandler,!0),window.addEventListener("touchstart",this.boundMouseLeaveAndScrollHandler))}static createUUID(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(t=>{const e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))}static register(){let e=document.querySelectorAll("[data-tooltip-for], [data-tooltip]");e.length&&e.forEach((e=>new t(e)))}}const e=t;let s=document.querySelectorAll(".cs-tooltip");s.length&&s.forEach((t=>new e(t)))})(),function(t){"use strict";t(document).on("click",".accordion-header",(function(){t(this).toggleClass("active");var e=t(this).next();parseInt(e.css("max-height"))>0?(e.css("max-height","0"),e.css("overflow","hidden")):(e.css("max-height",e.prop("scrollHeight")+"px"),e.css("overflow","visible"))}))}(jQuery),function(t){"use strict";var e,s,i,o,a,n,l=t("body"),d=t("#contentButtonModal");l.on("click",".carousel-slider__add-slide",(function(e){e.preventDefault(),t.ajax({url:ajaxurl,method:"POST",data:{action:"add_content_slide",task:"add-slide",post_id:t(this).data("post-id")},success:function(){window.location.reload(!0)}})})),l.on("click",".carousel_slider__delete_slide",(function(e){e.preventDefault(),t.ajax({url:ajaxurl,method:"POST",data:{action:"add_content_slide",task:"delete-slide",post_id:t(this).data("post-id"),slide_pos:t(this).data("slide-pos")},success:function(){window.location.reload(!0)}})})),l.on("click",".carousel_slider__move_top",(function(e){e.preventDefault(),t.ajax({url:ajaxurl,method:"POST",data:{action:"add_content_slide",task:"move-slide-top",post_id:t(this).data("post-id"),slide_pos:t(this).data("slide-pos")},success:function(){window.location.reload(!0)}})})),l.on("click",".carousel_slider__move_up",(function(e){e.preventDefault(),t.ajax({url:ajaxurl,method:"POST",data:{action:"add_content_slide",task:"move-slide-up",post_id:t(this).data("post-id"),slide_pos:t(this).data("slide-pos")},success:function(){window.location.reload(!0)}})})),l.on("click",".carousel_slider__move_down",(function(e){e.preventDefault(),t.ajax({url:ajaxurl,method:"POST",data:{action:"add_content_slide",task:"move-slide-down",post_id:t(this).data("post-id"),slide_pos:t(this).data("slide-pos")},success:function(){window.location.reload(!0)}})})),l.on("click",".carousel_slider__move_bottom",(function(e){e.preventDefault(),t.ajax({url:ajaxurl,method:"POST",data:{action:"add_content_slide",task:"move-slide-bottom",post_id:t(this).data("post-id"),slide_pos:t(this).data("slide-pos")},success:function(){window.location.reload(!0)}})})),l.on("click",".slide_image_add",(function(n){n.preventDefault();var l=t(this);s=l.closest(".slide_bg_wrapper"),o=s.find(".content_slide_canvas"),i=s.find(".background_image_id"),a=s.find(".delete-bg-img"),e||(e=wp.media({title:l.data("title"),button:{text:l.data("button-text")},multiple:!1})).on("select",(function(){var t=e.state().get("selection").first().toJSON();o.css("background-image","url("+t.url+")"),i.val(t.id),a.removeClass("hidden")})),e.open()})),l.on("click",".delete-bg-img",(function(e){e.preventDefault(),s=t(this).closest(".slide_bg_wrapper"),o=s.find(".content_slide_canvas"),i=s.find(".background_image_id"),a=s.find(".delete-bg-img"),o.css("background-image",""),i.val("0"),a.addClass("hidden")})),l.on("change",".background_image_position",(function(){var e=t(this).val();s=t(this).closest(".slide_bg_wrapper"),(o=s.find(".content_slide_canvas")).css("background-position",e)})),l.on("change",".background_image_size",(function(){var e=t(this).val();s=t(this).closest(".slide_bg_wrapper"),(o=s.find(".content_slide_canvas")).css("background-size",e)})),t(".addContentButton").on("click",(function(e){e.preventDefault();var s=(n=t(this).closest(".button_config")).find(".button_text").val(),i=n.find(".button_url").val(),o=n.find(".button_target").val(),a=n.find(".button_type").val(),l=n.find(".button_size").val(),r=n.find(".button_color").val();d.find("#_button_text").val(s),d.find("#_button_url").val(i),d.find("#_button_target").val(o),d.find("#_button_type").val(a),d.find("#_button_size").val(l),d.find("#_button_color").val(r),d.addClass("is-active")})),t("#saveContentButton").on("click",(function(t){if(t.preventDefault(),!n)return d.removeClass("is-active"),!1;var e=d.find("#_button_text").val(),s=d.find("#_button_url").val(),i=d.find("#_button_target").val(),o=d.find("#_button_type").val(),a=d.find("#_button_size").val(),l=d.find("#_button_color").val();n.find(".button_text").val(e),n.find(".button_url").val(s),n.find(".button_target").val(i),n.find(".button_type").val(o),n.find(".button_size").val(a),n.find(".button_color").val(l),d.removeClass("is-active")})),t(".slide-color-picker").each((function(){s=t(this).closest(".slide_bg_wrapper"),o=s.find(".content_slide_canvas"),t(this).wpColorPicker({palettes:["#2196F3","#009688","#4CAF50","#F44336","#FFEB3B","#00D1B2","#000000","#ffffff"],change:function(t,e){o.css("background-color",e.color.toString())}})})),t(document).on("change",".link_type",(function(e){var s=t(this),i=s.val(),o=s.closest(".tab-content-link"),a=o.find(".ContentCarouselLinkFull"),n=o.find(".ContentCarouselLinkButtons");"full"===i?(n.hide(),a.show()):"button"===i?(a.hide(),n.show()):(a.hide(),n.hide())}))}(jQuery),function(t){"use strict";var e,s=t("#carousel_slider_gallery_btn"),i=o(s.data("ids"));function o(t){if(t){var e=new wp.shortcode({tag:"gallery",attrs:{ids:t},type:"single"}),s=wp.media.gallery.attachments(e),i=new wp.media.model.Selection(s.models,{props:s.props.toJSON(),multiple:!0});return i.gallery=s.gallery,i.more().done((function(){i.props.set({query:!1}),i.unmirror(),i.props.unset("orderby")})),i}return!1}s.on("click",(function(a){a.preventDefault();var n={title:s.data("create"),state:"gallery-edit",frame:"post",selection:i};function l(){e.toolbar.get("view").set({insert:{style:"primary",text:s.data("save"),click:function(){var a=e.state().get("library"),n="";a.each((function(t){n+=t.id+","})),this.el.innerHTML=s.data("progress"),t.ajax({type:"POST",url:ajaxurl,data:{ids:n,action:"carousel_slider_save_images",post_id:s.data("id")},success:function(){i=o(n),t("#_carousel_slider_images_ids").val(n),e.close()},dataType:"html"}).done((function(e){t(".carousel_slider_gallery_list").html(e)}))}}})}(e||i)&&(n.title=s.data("edit")),(e=wp.media(n).open()).menu.get("view").unset("cancel"),e.menu.get("view").unset("separateCancel"),e.menu.get("view").get("gallery-edit").el.innerHTML=s.data("edit"),e.content.get("view").sidebar.unset("gallery"),l(),e.on("toolbar:render:gallery-edit",(function(){l()})),e.on("content:render:browse",(function(t){t&&(t.sidebar.on("ready",(function(){t.sidebar.unset("gallery")})),t.toolbar.on("ready",(function(){"gallery-library"===t.toolbar.controller._state&&t.toolbar.$el.hide()})))})),e.state().get("library").on("remove",(function(){0===e.state().get("library").length&&(i=!1,t.post(ajaxurl,{ids:"",action:"carousel_slider_save_images",post_id:s.data("id")}))}))}))}(jQuery),function(t){"use strict";var e=t("body"),s=t("#CarouselSliderModal"),i=t("#_images_urls_btn"),o=t("#carouselSliderGalleryUrlTemplate").html();i.on("click",(function(e){e.preventDefault(),s.css("display","block"),t("body").addClass("overflowHidden")})),s.on("click",".carousel_slider-close",(function(e){e.preventDefault(),s.css("display","none"),t("body").removeClass("overflowHidden")}));var a=t(window).height()-148;t(".carousel_slider-modal-body").css("height",a+"px"),e.on("click",".add_row",(function(){t(this).closest(".carousel_slider-fields").after(o)})),e.on("click",".delete_row",(function(){t(this).closest(".carousel_slider-fields").remove()})),t("#carousel_slider_form").sortable()}(jQuery),function(t){"use strict";t(document).on("click",'[data-toggle="modal"]',(function(e){e.preventDefault(),t(t(this).data("target")).addClass("is-active")})),t(document).on("click",'[data-dismiss="modal"]',(function(e){e.preventDefault(),t(this).closest(".modal").removeClass("is-active")}))}(jQuery),function(t){"use strict";var e=t("#_carousel_slider_slide_type"),s=t("#section_images_settings"),i=t("#section_url_images_settings"),o=t("#section_images_general_settings"),a=t("#section_post_query"),n=t("#section_video_settings"),l=t("#section_product_query"),d=t("#section_content_carousel"),r=t("#_post_query_type"),c=t("#field-_post_date_after"),u=t("#field-_post_date_before"),h=t("#field-_post_categories"),_=t("#field-_post_tags"),f=t("#field-_post_in"),p=t("#field-_posts_per_page"),v=t("#_product_query_type"),m=t("#field-_product_query"),g=t("#field-_product_categories"),b=t("#field-_product_tags"),w=t("#field-_product_in"),y=t("#field-_products_per_page");if(e.on("change",(function(){s.hide("fast"),i.hide("fast"),o.hide("fast"),a.hide("fast"),n.hide("fast"),l.hide("fast"),d.hide("fast"),"image-carousel"===this.value&&(s.slideDown(),o.slideDown()),"image-carousel-url"===this.value&&(i.slideDown(),o.slideDown()),"post-carousel"===this.value&&a.slideDown(),"video-carousel"===this.value&&n.slideDown(),"product-carousel"===this.value&&(l.slideDown(),m.show()),"hero-banner-slider"===this.value&&d.slideDown()})),"post-carousel"===e.val()){var x=r.val();"date_range"===x&&(c.show(),u.show()),"post_categories"===x&&h.show(),"post_tags"===x&&_.show(),"specific_posts"===x&&(f.show(),p.hide())}if(r.on("change",(function(){c.hide("fast"),u.hide("fast"),h.hide("fast"),_.hide("fast"),f.hide("fast"),p.show("fast"),"date_range"===this.value&&(c.slideDown(),u.slideDown()),"post_categories"===this.value&&h.slideDown(),"post_tags"===this.value&&_.slideDown(),"specific_posts"===this.value&&(f.slideDown(),p.hide("fast"))})),"product-carousel"===e.val()){var k=v.val();"query_porduct"===k&&m.show(),"product_categories"===k&&g.show(),"product_tags"===k&&b.show(),"specific_products"===k&&w.show()}v.on("change",(function(){m.hide("fast"),g.hide("fast"),b.hide("fast"),w.hide("fast"),y.show("fast"),"query_porduct"===this.value&&m.slideDown(),"product_categories"===this.value&&g.slideDown(),"product_tags"===this.value&&b.slideDown(),"specific_products"===this.value&&(w.slideDown(),y.hide("fast"))}))}(jQuery),function(t){"use strict";t(".cs-tooltip").each((function(){})),t("select.select2").each((function(){t(this).select2()})),t(".shapla-toggle").each((function(){"closed"===t(this).attr("data-id")?t(this).accordion({collapsible:!0,heightStyle:"content",active:!1}):t(this).accordion({collapsible:!0,heightStyle:"content"})})),t(".shapla-tabs").tabs({hide:{effect:"fadeOut",duration:200},show:{effect:"fadeIn",duration:200}}),t(".datepicker").each((function(){t(this).datepicker({dateFormat:"MM dd, yy",changeMonth:!0,changeYear:!0,onClose:function(e){t(this).datepicker("option","minDate",e)}})})),t(".color-picker").each((function(){t(this).wpColorPicker({palettes:["#2196F3","#009688","#4CAF50","#F44336","#FFEB3B","#00D1B2","#000000","#ffffff"]})}))}(jQuery);
|
|
1 |
+
/*! For license information please see admin.js.LICENSE.txt */
|
2 |
+
(()=>{var e={462:(e,t,n)=>{var o,i,r;i=[n(311)],o=function(e){var t=function(){if(e&&e.fn&&e.fn.select2&&e.fn.select2.amd)var t=e.fn.select2.amd;var n,o,i;return t&&t.requirejs||(t?o=t:t={},function(e){var t,r,s,a,l={},c={},u={},d={},p=Object.prototype.hasOwnProperty,h=[].slice,f=/\.js$/;function g(e,t){return p.call(e,t)}function m(e,t){var n,o,i,r,s,a,l,c,d,p,h,g=t&&t.split("/"),m=u.map,v=m&&m["*"]||{};if(e){for(s=(e=e.split("/")).length-1,u.nodeIdCompat&&f.test(e[s])&&(e[s]=e[s].replace(f,"")),"."===e[0].charAt(0)&&g&&(e=g.slice(0,g.length-1).concat(e)),d=0;d<e.length;d++)if("."===(h=e[d]))e.splice(d,1),d-=1;else if(".."===h){if(0===d||1===d&&".."===e[2]||".."===e[d-1])continue;d>0&&(e.splice(d-1,2),d-=2)}e=e.join("/")}if((g||v)&&m){for(d=(n=e.split("/")).length;d>0;d-=1){if(o=n.slice(0,d).join("/"),g)for(p=g.length;p>0;p-=1)if((i=m[g.slice(0,p).join("/")])&&(i=i[o])){r=i,a=d;break}if(r)break;!l&&v&&v[o]&&(l=v[o],c=d)}!r&&l&&(r=l,a=c),r&&(n.splice(0,a,r),e=n.join("/"))}return e}function v(t,n){return function(){var o=h.call(arguments,0);return"string"!=typeof o[0]&&1===o.length&&o.push(null),r.apply(e,o.concat([t,n]))}}function y(e){return function(t){return m(t,e)}}function _(e){return function(t){l[e]=t}}function b(n){if(g(c,n)){var o=c[n];delete c[n],d[n]=!0,t.apply(e,o)}if(!g(l,n)&&!g(d,n))throw new Error("No "+n);return l[n]}function w(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function x(e){return e?w(e):[]}function A(e){return function(){return u&&u.config&&u.config[e]||{}}}s=function(e,t){var n,o=w(e),i=o[0],r=t[1];return e=o[1],i&&(n=b(i=m(i,r))),i?e=n&&n.normalize?n.normalize(e,y(r)):m(e,r):(i=(o=w(e=m(e,r)))[0],e=o[1],i&&(n=b(i))),{f:i?i+"!"+e:e,n:e,pr:i,p:n}},a={require:function(e){return v(e)},exports:function(e){var t=l[e];return void 0!==t?t:l[e]={}},module:function(e){return{id:e,uri:"",exports:l[e],config:A(e)}}},t=function(t,n,o,i){var r,u,p,h,f,m,y,w=[],A=typeof o;if(m=x(i=i||t),"undefined"===A||"function"===A){for(n=!n.length&&o.length?["require","exports","module"]:n,f=0;f<n.length;f+=1)if("require"===(u=(h=s(n[f],m)).f))w[f]=a.require(t);else if("exports"===u)w[f]=a.exports(t),y=!0;else if("module"===u)r=w[f]=a.module(t);else if(g(l,u)||g(c,u)||g(d,u))w[f]=b(u);else{if(!h.p)throw new Error(t+" missing "+u);h.p.load(h.n,v(i,!0),_(u),{}),w[f]=l[u]}p=o?o.apply(l[t],w):void 0,t&&(r&&r.exports!==e&&r.exports!==l[t]?l[t]=r.exports:p===e&&y||(l[t]=p))}else t&&(l[t]=o)},n=o=r=function(n,o,i,l,c){if("string"==typeof n)return a[n]?a[n](o):b(s(n,x(o)).f);if(!n.splice){if((u=n).deps&&r(u.deps,u.callback),!o)return;o.splice?(n=o,o=i,i=null):n=e}return o=o||function(){},"function"==typeof i&&(i=l,l=c),l?t(e,n,o,i):setTimeout((function(){t(e,n,o,i)}),4),r},r.config=function(e){return r(e)},n._defined=l,(i=function(e,t,n){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");t.splice||(n=t,t=[]),g(l,e)||g(c,e)||(c[e]=[e,t,n])}).amd={jQuery:!0}}(),t.requirejs=n,t.require=o,t.define=i),t.define("almond",(function(){})),t.define("jquery",[],(function(){var t=e||$;return null==t&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),t})),t.define("select2/utils",["jquery"],(function(e){var t={};function n(e){var t=e.prototype,n=[];for(var o in t)"function"==typeof t[o]&&"constructor"!==o&&n.push(o);return n}t.Extend=function(e,t){var n={}.hasOwnProperty;function o(){this.constructor=e}for(var i in t)n.call(t,i)&&(e[i]=t[i]);return o.prototype=t.prototype,e.prototype=new o,e.__super__=t.prototype,e},t.Decorate=function(e,t){var o=n(t),i=n(e);function r(){var n=Array.prototype.unshift,o=t.prototype.constructor.length,i=e.prototype.constructor;o>0&&(n.call(arguments,e.prototype.constructor),i=t.prototype.constructor),i.apply(this,arguments)}function s(){this.constructor=r}t.displayName=e.displayName,r.prototype=new s;for(var a=0;a<i.length;a++){var l=i[a];r.prototype[l]=e.prototype[l]}for(var c=function(e){var n=function(){};e in r.prototype&&(n=r.prototype[e]);var o=t.prototype[e];return function(){return Array.prototype.unshift.call(arguments,n),o.apply(this,arguments)}},u=0;u<o.length;u++){var d=o[u];r.prototype[d]=c(d)}return r};var o=function(){this.listeners={}};o.prototype.on=function(e,t){this.listeners=this.listeners||{},e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t]},o.prototype.trigger=function(e){var t=Array.prototype.slice,n=t.call(arguments,1);this.listeners=this.listeners||{},null==n&&(n=[]),0===n.length&&n.push({}),n[0]._type=e,e in this.listeners&&this.invoke(this.listeners[e],t.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},o.prototype.invoke=function(e,t){for(var n=0,o=e.length;n<o;n++)e[n].apply(this,t)},t.Observable=o,t.generateChars=function(e){for(var t="",n=0;n<e;n++)t+=Math.floor(36*Math.random()).toString(36);return t},t.bind=function(e,t){return function(){e.apply(t,arguments)}},t._convertData=function(e){for(var t in e){var n=t.split("-"),o=e;if(1!==n.length){for(var i=0;i<n.length;i++){var r=n[i];(r=r.substring(0,1).toLowerCase()+r.substring(1))in o||(o[r]={}),i==n.length-1&&(o[r]=e[t]),o=o[r]}delete e[t]}}return e},t.hasScroll=function(t,n){var o=e(n),i=n.style.overflowX,r=n.style.overflowY;return(i!==r||"hidden"!==r&&"visible"!==r)&&("scroll"===i||"scroll"===r||o.innerHeight()<n.scrollHeight||o.innerWidth()<n.scrollWidth)},t.escapeMarkup=function(e){var t={"\\":"\","&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return"string"!=typeof e?e:String(e).replace(/[&<>"'\/\\]/g,(function(e){return t[e]}))},t.appendMany=function(t,n){if("1.7"===e.fn.jquery.substr(0,3)){var o=e();e.map(n,(function(e){o=o.add(e)})),n=o}t.append(n)},t.__cache={};var i=0;return t.GetUniqueElementId=function(e){var t=e.getAttribute("data-select2-id");return null==t&&(e.id?(t=e.id,e.setAttribute("data-select2-id",t)):(e.setAttribute("data-select2-id",++i),t=i.toString())),t},t.StoreData=function(e,n,o){var i=t.GetUniqueElementId(e);t.__cache[i]||(t.__cache[i]={}),t.__cache[i][n]=o},t.GetData=function(n,o){var i=t.GetUniqueElementId(n);return o?t.__cache[i]&&null!=t.__cache[i][o]?t.__cache[i][o]:e(n).data(o):t.__cache[i]},t.RemoveData=function(e){var n=t.GetUniqueElementId(e);null!=t.__cache[n]&&delete t.__cache[n],e.removeAttribute("data-select2-id")},t})),t.define("select2/results",["jquery","./utils"],(function(e,t){function n(e,t,o){this.$element=e,this.data=o,this.options=t,n.__super__.constructor.call(this)}return t.Extend(n,t.Observable),n.prototype.render=function(){var t=e('<ul class="select2-results__options" role="listbox"></ul>');return this.options.get("multiple")&&t.attr("aria-multiselectable","true"),this.$results=t,t},n.prototype.clear=function(){this.$results.empty()},n.prototype.displayMessage=function(t){var n=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var o=e('<li role="alert" aria-live="assertive" class="select2-results__option"></li>'),i=this.options.get("translations").get(t.message);o.append(n(i(t.args))),o[0].className+=" select2-results__message",this.$results.append(o)},n.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},n.prototype.append=function(e){this.hideLoading();var t=[];if(null!=e.results&&0!==e.results.length){e.results=this.sort(e.results);for(var n=0;n<e.results.length;n++){var o=e.results[n],i=this.option(o);t.push(i)}this.$results.append(t)}else 0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"})},n.prototype.position=function(e,t){t.find(".select2-results").append(e)},n.prototype.sort=function(e){return this.options.get("sorter")(e)},n.prototype.highlightFirstItem=function(){var e=this.$results.find(".select2-results__option[aria-selected]"),t=e.filter("[aria-selected=true]");t.length>0?t.first().trigger("mouseenter"):e.first().trigger("mouseenter"),this.ensureHighlightVisible()},n.prototype.setClasses=function(){var n=this;this.data.current((function(o){var i=e.map(o,(function(e){return e.id.toString()}));n.$results.find(".select2-results__option[aria-selected]").each((function(){var n=e(this),o=t.GetData(this,"data"),r=""+o.id;null!=o.element&&o.element.selected||null==o.element&&e.inArray(r,i)>-1?n.attr("aria-selected","true"):n.attr("aria-selected","false")}))}))},n.prototype.showLoading=function(e){this.hideLoading();var t={disabled:!0,loading:!0,text:this.options.get("translations").get("searching")(e)},n=this.option(t);n.className+=" loading-results",this.$results.prepend(n)},n.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},n.prototype.option=function(n){var o=document.createElement("li");o.className="select2-results__option";var i={role:"option","aria-selected":"false"},r=window.Element.prototype.matches||window.Element.prototype.msMatchesSelector||window.Element.prototype.webkitMatchesSelector;for(var s in(null!=n.element&&r.call(n.element,":disabled")||null==n.element&&n.disabled)&&(delete i["aria-selected"],i["aria-disabled"]="true"),null==n.id&&delete i["aria-selected"],null!=n._resultId&&(o.id=n._resultId),n.title&&(o.title=n.title),n.children&&(i.role="group",i["aria-label"]=n.text,delete i["aria-selected"]),i){var a=i[s];o.setAttribute(s,a)}if(n.children){var l=e(o),c=document.createElement("strong");c.className="select2-results__group",e(c),this.template(n,c);for(var u=[],d=0;d<n.children.length;d++){var p=n.children[d],h=this.option(p);u.push(h)}var f=e("<ul></ul>",{class:"select2-results__options select2-results__options--nested"});f.append(u),l.append(c),l.append(f)}else this.template(n,o);return t.StoreData(o,"data",n),o},n.prototype.bind=function(n,o){var i=this,r=n.id+"-results";this.$results.attr("id",r),n.on("results:all",(function(e){i.clear(),i.append(e.data),n.isOpen()&&(i.setClasses(),i.highlightFirstItem())})),n.on("results:append",(function(e){i.append(e.data),n.isOpen()&&i.setClasses()})),n.on("query",(function(e){i.hideMessages(),i.showLoading(e)})),n.on("select",(function(){n.isOpen()&&(i.setClasses(),i.options.get("scrollAfterSelect")&&i.highlightFirstItem())})),n.on("unselect",(function(){n.isOpen()&&(i.setClasses(),i.options.get("scrollAfterSelect")&&i.highlightFirstItem())})),n.on("open",(function(){i.$results.attr("aria-expanded","true"),i.$results.attr("aria-hidden","false"),i.setClasses(),i.ensureHighlightVisible()})),n.on("close",(function(){i.$results.attr("aria-expanded","false"),i.$results.attr("aria-hidden","true"),i.$results.removeAttr("aria-activedescendant")})),n.on("results:toggle",(function(){var e=i.getHighlightedResults();0!==e.length&&e.trigger("mouseup")})),n.on("results:select",(function(){var e=i.getHighlightedResults();if(0!==e.length){var n=t.GetData(e[0],"data");"true"==e.attr("aria-selected")?i.trigger("close",{}):i.trigger("select",{data:n})}})),n.on("results:previous",(function(){var e=i.getHighlightedResults(),t=i.$results.find("[aria-selected]"),n=t.index(e);if(!(n<=0)){var o=n-1;0===e.length&&(o=0);var r=t.eq(o);r.trigger("mouseenter");var s=i.$results.offset().top,a=r.offset().top,l=i.$results.scrollTop()+(a-s);0===o?i.$results.scrollTop(0):a-s<0&&i.$results.scrollTop(l)}})),n.on("results:next",(function(){var e=i.getHighlightedResults(),t=i.$results.find("[aria-selected]"),n=t.index(e)+1;if(!(n>=t.length)){var o=t.eq(n);o.trigger("mouseenter");var r=i.$results.offset().top+i.$results.outerHeight(!1),s=o.offset().top+o.outerHeight(!1),a=i.$results.scrollTop()+s-r;0===n?i.$results.scrollTop(0):s>r&&i.$results.scrollTop(a)}})),n.on("results:focus",(function(e){e.element.addClass("select2-results__option--highlighted")})),n.on("results:message",(function(e){i.displayMessage(e)})),e.fn.mousewheel&&this.$results.on("mousewheel",(function(e){var t=i.$results.scrollTop(),n=i.$results.get(0).scrollHeight-t+e.deltaY,o=e.deltaY>0&&t-e.deltaY<=0,r=e.deltaY<0&&n<=i.$results.height();o?(i.$results.scrollTop(0),e.preventDefault(),e.stopPropagation()):r&&(i.$results.scrollTop(i.$results.get(0).scrollHeight-i.$results.height()),e.preventDefault(),e.stopPropagation())})),this.$results.on("mouseup",".select2-results__option[aria-selected]",(function(n){var o=e(this),r=t.GetData(this,"data");"true"!==o.attr("aria-selected")?i.trigger("select",{originalEvent:n,data:r}):i.options.get("multiple")?i.trigger("unselect",{originalEvent:n,data:r}):i.trigger("close",{})})),this.$results.on("mouseenter",".select2-results__option[aria-selected]",(function(n){var o=t.GetData(this,"data");i.getHighlightedResults().removeClass("select2-results__option--highlighted"),i.trigger("results:focus",{data:o,element:e(this)})}))},n.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},n.prototype.destroy=function(){this.$results.remove()},n.prototype.ensureHighlightVisible=function(){var e=this.getHighlightedResults();if(0!==e.length){var t=this.$results.find("[aria-selected]").index(e),n=this.$results.offset().top,o=e.offset().top,i=this.$results.scrollTop()+(o-n),r=o-n;i-=2*e.outerHeight(!1),t<=2?this.$results.scrollTop(0):(r>this.$results.outerHeight()||r<0)&&this.$results.scrollTop(i)}},n.prototype.template=function(t,n){var o=this.options.get("templateResult"),i=this.options.get("escapeMarkup"),r=o(t,n);null==r?n.style.display="none":"string"==typeof r?n.innerHTML=i(r):e(n).append(r)},n})),t.define("select2/keys",[],(function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}})),t.define("select2/selection/base",["jquery","../utils","../keys"],(function(e,t,n){function o(e,t){this.$element=e,this.options=t,o.__super__.constructor.call(this)}return t.Extend(o,t.Observable),o.prototype.render=function(){var n=e('<span class="select2-selection" role="combobox" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=t.GetData(this.$element[0],"old-tabindex")?this._tabindex=t.GetData(this.$element[0],"old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),n.attr("title",this.$element.attr("title")),n.attr("tabindex",this._tabindex),n.attr("aria-disabled","false"),this.$selection=n,n},o.prototype.bind=function(e,t){var o=this,i=e.id+"-results";this.container=e,this.$selection.on("focus",(function(e){o.trigger("focus",e)})),this.$selection.on("blur",(function(e){o._handleBlur(e)})),this.$selection.on("keydown",(function(e){o.trigger("keypress",e),e.which===n.SPACE&&e.preventDefault()})),e.on("results:focus",(function(e){o.$selection.attr("aria-activedescendant",e.data._resultId)})),e.on("selection:update",(function(e){o.update(e.data)})),e.on("open",(function(){o.$selection.attr("aria-expanded","true"),o.$selection.attr("aria-owns",i),o._attachCloseHandler(e)})),e.on("close",(function(){o.$selection.attr("aria-expanded","false"),o.$selection.removeAttr("aria-activedescendant"),o.$selection.removeAttr("aria-owns"),o.$selection.trigger("focus"),o._detachCloseHandler(e)})),e.on("enable",(function(){o.$selection.attr("tabindex",o._tabindex),o.$selection.attr("aria-disabled","false")})),e.on("disable",(function(){o.$selection.attr("tabindex","-1"),o.$selection.attr("aria-disabled","true")}))},o.prototype._handleBlur=function(t){var n=this;window.setTimeout((function(){document.activeElement==n.$selection[0]||e.contains(n.$selection[0],document.activeElement)||n.trigger("blur",t)}),1)},o.prototype._attachCloseHandler=function(n){e(document.body).on("mousedown.select2."+n.id,(function(n){var o=e(n.target).closest(".select2");e(".select2.select2-container--open").each((function(){this!=o[0]&&t.GetData(this,"element").select2("close")}))}))},o.prototype._detachCloseHandler=function(t){e(document.body).off("mousedown.select2."+t.id)},o.prototype.position=function(e,t){t.find(".selection").append(e)},o.prototype.destroy=function(){this._detachCloseHandler(this.container)},o.prototype.update=function(e){throw new Error("The `update` method must be defined in child classes.")},o.prototype.isEnabled=function(){return!this.isDisabled()},o.prototype.isDisabled=function(){return this.options.get("disabled")},o})),t.define("select2/selection/single",["jquery","./base","../utils","../keys"],(function(e,t,n,o){function i(){i.__super__.constructor.apply(this,arguments)}return n.Extend(i,t),i.prototype.render=function(){var e=i.__super__.render.call(this);return e.addClass("select2-selection--single"),e.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),e},i.prototype.bind=function(e,t){var n=this;i.__super__.bind.apply(this,arguments);var o=e.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",o).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",o),this.$selection.on("mousedown",(function(e){1===e.which&&n.trigger("toggle",{originalEvent:e})})),this.$selection.on("focus",(function(e){})),this.$selection.on("blur",(function(e){})),e.on("focus",(function(t){e.isOpen()||n.$selection.trigger("focus")}))},i.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},i.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},i.prototype.selectionContainer=function(){return e("<span></span>")},i.prototype.update=function(e){if(0!==e.length){var t=e[0],n=this.$selection.find(".select2-selection__rendered"),o=this.display(t,n);n.empty().append(o);var i=t.title||t.text;i?n.attr("title",i):n.removeAttr("title")}else this.clear()},i})),t.define("select2/selection/multiple",["jquery","./base","../utils"],(function(e,t,n){function o(e,t){o.__super__.constructor.apply(this,arguments)}return n.Extend(o,t),o.prototype.render=function(){var e=o.__super__.render.call(this);return e.addClass("select2-selection--multiple"),e.html('<ul class="select2-selection__rendered"></ul>'),e},o.prototype.bind=function(t,i){var r=this;o.__super__.bind.apply(this,arguments),this.$selection.on("click",(function(e){r.trigger("toggle",{originalEvent:e})})),this.$selection.on("click",".select2-selection__choice__remove",(function(t){if(!r.isDisabled()){var o=e(this).parent(),i=n.GetData(o[0],"data");r.trigger("unselect",{originalEvent:t,data:i})}}))},o.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},o.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},o.prototype.selectionContainer=function(){return e('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">×</span></li>')},o.prototype.update=function(e){if(this.clear(),0!==e.length){for(var t=[],o=0;o<e.length;o++){var i=e[o],r=this.selectionContainer(),s=this.display(i,r);r.append(s);var a=i.title||i.text;a&&r.attr("title",a),n.StoreData(r[0],"data",i),t.push(r)}var l=this.$selection.find(".select2-selection__rendered");n.appendMany(l,t)}},o})),t.define("select2/selection/placeholder",["../utils"],(function(e){function t(e,t,n){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n)}return t.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},t.prototype.createPlaceholder=function(e,t){var n=this.selectionContainer();return n.html(this.display(t)),n.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),n},t.prototype.update=function(e,t){var n=1==t.length&&t[0].id!=this.placeholder.id;if(t.length>1||n)return e.call(this,t);this.clear();var o=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(o)},t})),t.define("select2/selection/allowClear",["jquery","../keys","../utils"],(function(e,t,n){function o(){}return o.prototype.bind=function(e,t,n){var o=this;e.call(this,t,n),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",(function(e){o._handleClear(e)})),t.on("keypress",(function(e){o._handleKeyboardClear(e,t)}))},o.prototype._handleClear=function(e,t){if(!this.isDisabled()){var o=this.$selection.find(".select2-selection__clear");if(0!==o.length){t.stopPropagation();var i=n.GetData(o[0],"data"),r=this.$element.val();this.$element.val(this.placeholder.id);var s={data:i};if(this.trigger("clear",s),s.prevented)this.$element.val(r);else{for(var a=0;a<i.length;a++)if(s={data:i[a]},this.trigger("unselect",s),s.prevented)return void this.$element.val(r);this.$element.trigger("input").trigger("change"),this.trigger("toggle",{})}}}},o.prototype._handleKeyboardClear=function(e,n,o){o.isOpen()||n.which!=t.DELETE&&n.which!=t.BACKSPACE||this._handleClear(n)},o.prototype.update=function(t,o){if(t.call(this,o),!(this.$selection.find(".select2-selection__placeholder").length>0||0===o.length)){var i=this.options.get("translations").get("removeAllItems"),r=e('<span class="select2-selection__clear" title="'+i()+'">×</span>');n.StoreData(r[0],"data",o),this.$selection.find(".select2-selection__rendered").prepend(r)}},o})),t.define("select2/selection/search",["jquery","../utils","../keys"],(function(e,t,n){function o(e,t,n){e.call(this,t,n)}return o.prototype.render=function(t){var n=e('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" /></li>');this.$searchContainer=n,this.$search=n.find("input");var o=t.call(this);return this._transferTabIndex(),o},o.prototype.bind=function(e,o,i){var r=this,s=o.id+"-results";e.call(this,o,i),o.on("open",(function(){r.$search.attr("aria-controls",s),r.$search.trigger("focus")})),o.on("close",(function(){r.$search.val(""),r.$search.removeAttr("aria-controls"),r.$search.removeAttr("aria-activedescendant"),r.$search.trigger("focus")})),o.on("enable",(function(){r.$search.prop("disabled",!1),r._transferTabIndex()})),o.on("disable",(function(){r.$search.prop("disabled",!0)})),o.on("focus",(function(e){r.$search.trigger("focus")})),o.on("results:focus",(function(e){e.data._resultId?r.$search.attr("aria-activedescendant",e.data._resultId):r.$search.removeAttr("aria-activedescendant")})),this.$selection.on("focusin",".select2-search--inline",(function(e){r.trigger("focus",e)})),this.$selection.on("focusout",".select2-search--inline",(function(e){r._handleBlur(e)})),this.$selection.on("keydown",".select2-search--inline",(function(e){if(e.stopPropagation(),r.trigger("keypress",e),r._keyUpPrevented=e.isDefaultPrevented(),e.which===n.BACKSPACE&&""===r.$search.val()){var o=r.$searchContainer.prev(".select2-selection__choice");if(o.length>0){var i=t.GetData(o[0],"data");r.searchRemoveChoice(i),e.preventDefault()}}})),this.$selection.on("click",".select2-search--inline",(function(e){r.$search.val()&&e.stopPropagation()}));var a=document.documentMode,l=a&&a<=11;this.$selection.on("input.searchcheck",".select2-search--inline",(function(e){l?r.$selection.off("input.search input.searchcheck"):r.$selection.off("keyup.search")})),this.$selection.on("keyup.search input.search",".select2-search--inline",(function(e){if(l&&"input"===e.type)r.$selection.off("input.search input.searchcheck");else{var t=e.which;t!=n.SHIFT&&t!=n.CTRL&&t!=n.ALT&&t!=n.TAB&&r.handleSearch(e)}}))},o.prototype._transferTabIndex=function(e){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},o.prototype.createPlaceholder=function(e,t){this.$search.attr("placeholder",t.text)},o.prototype.update=function(e,t){var n=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),e.call(this,t),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),n&&this.$search.trigger("focus")},o.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var e=this.$search.val();this.trigger("query",{term:e})}this._keyUpPrevented=!1},o.prototype.searchRemoveChoice=function(e,t){this.trigger("unselect",{data:t}),this.$search.val(t.text),this.handleSearch()},o.prototype.resizeSearch=function(){this.$search.css("width","25px");var e="";e=""!==this.$search.attr("placeholder")?this.$selection.find(".select2-selection__rendered").width():.75*(this.$search.val().length+1)+"em",this.$search.css("width",e)},o})),t.define("select2/selection/eventRelay",["jquery"],(function(e){function t(){}return t.prototype.bind=function(t,n,o){var i=this,r=["open","opening","close","closing","select","selecting","unselect","unselecting","clear","clearing"],s=["opening","closing","selecting","unselecting","clearing"];t.call(this,n,o),n.on("*",(function(t,n){if(-1!==e.inArray(t,r)){n=n||{};var o=e.Event("select2:"+t,{params:n});i.$element.trigger(o),-1!==e.inArray(t,s)&&(n.prevented=o.isDefaultPrevented())}}))},t})),t.define("select2/translation",["jquery","require"],(function(e,t){function n(e){this.dict=e||{}}return n.prototype.all=function(){return this.dict},n.prototype.get=function(e){return this.dict[e]},n.prototype.extend=function(t){this.dict=e.extend({},t.all(),this.dict)},n._cache={},n.loadPath=function(e){if(!(e in n._cache)){var o=t(e);n._cache[e]=o}return new n(n._cache[e])},n})),t.define("select2/diacritics",[],(function(){return{"Ⓐ":"A",A:"A",À:"A",Á:"A",Â:"A",Ầ:"A",Ấ:"A",Ẫ:"A",Ẩ:"A",Ã:"A",Ā:"A",Ă:"A",Ằ:"A",Ắ:"A",Ẵ:"A",Ẳ:"A",Ȧ:"A",Ǡ:"A",Ä:"A",Ǟ:"A",Ả:"A",Å:"A",Ǻ:"A",Ǎ:"A",Ȁ:"A",Ȃ:"A",Ạ:"A",Ậ:"A",Ặ:"A",Ḁ:"A",Ą:"A",Ⱥ:"A",Ɐ:"A",Ꜳ:"AA",Æ:"AE",Ǽ:"AE",Ǣ:"AE",Ꜵ:"AO",Ꜷ:"AU",Ꜹ:"AV",Ꜻ:"AV",Ꜽ:"AY","Ⓑ":"B",B:"B",Ḃ:"B",Ḅ:"B",Ḇ:"B",Ƀ:"B",Ƃ:"B",Ɓ:"B","Ⓒ":"C",C:"C",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",Ç:"C",Ḉ:"C",Ƈ:"C",Ȼ:"C",Ꜿ:"C","Ⓓ":"D",D:"D",Ḋ:"D",Ď:"D",Ḍ:"D",Ḑ:"D",Ḓ:"D",Ḏ:"D",Đ:"D",Ƌ:"D",Ɗ:"D",Ɖ:"D",Ꝺ:"D",DZ:"DZ",DŽ:"DZ",Dz:"Dz",Dž:"Dz","Ⓔ":"E",E:"E",È:"E",É:"E",Ê:"E",Ề:"E",Ế:"E",Ễ:"E",Ể:"E",Ẽ:"E",Ē:"E",Ḕ:"E",Ḗ:"E",Ĕ:"E",Ė:"E",Ë:"E",Ẻ:"E",Ě:"E",Ȅ:"E",Ȇ:"E",Ẹ:"E",Ệ:"E",Ȩ:"E",Ḝ:"E",Ę:"E",Ḙ:"E",Ḛ:"E",Ɛ:"E",Ǝ:"E","Ⓕ":"F",F:"F",Ḟ:"F",Ƒ:"F",Ꝼ:"F","Ⓖ":"G",G:"G",Ǵ:"G",Ĝ:"G",Ḡ:"G",Ğ:"G",Ġ:"G",Ǧ:"G",Ģ:"G",Ǥ:"G",Ɠ:"G",Ꞡ:"G",Ᵹ:"G",Ꝿ:"G","Ⓗ":"H",H:"H",Ĥ:"H",Ḣ:"H",Ḧ:"H",Ȟ:"H",Ḥ:"H",Ḩ:"H",Ḫ:"H",Ħ:"H",Ⱨ:"H",Ⱶ:"H",Ɥ:"H","Ⓘ":"I",I:"I",Ì:"I",Í:"I",Î:"I",Ĩ:"I",Ī:"I",Ĭ:"I",İ:"I",Ï:"I",Ḯ:"I",Ỉ:"I",Ǐ:"I",Ȉ:"I",Ȋ:"I",Ị:"I",Į:"I",Ḭ:"I",Ɨ:"I","Ⓙ":"J",J:"J",Ĵ:"J",Ɉ:"J","Ⓚ":"K",K:"K",Ḱ:"K",Ǩ:"K",Ḳ:"K",Ķ:"K",Ḵ:"K",Ƙ:"K",Ⱪ:"K",Ꝁ:"K",Ꝃ:"K",Ꝅ:"K",Ꞣ:"K","Ⓛ":"L",L:"L",Ŀ:"L",Ĺ:"L",Ľ:"L",Ḷ:"L",Ḹ:"L",Ļ:"L",Ḽ:"L",Ḻ:"L",Ł:"L",Ƚ:"L",Ɫ:"L",Ⱡ:"L",Ꝉ:"L",Ꝇ:"L",Ꞁ:"L",LJ:"LJ",Lj:"Lj","Ⓜ":"M",M:"M",Ḿ:"M",Ṁ:"M",Ṃ:"M",Ɱ:"M",Ɯ:"M","Ⓝ":"N",N:"N",Ǹ:"N",Ń:"N",Ñ:"N",Ṅ:"N",Ň:"N",Ṇ:"N",Ņ:"N",Ṋ:"N",Ṉ:"N",Ƞ:"N",Ɲ:"N",Ꞑ:"N",Ꞥ:"N",NJ:"NJ",Nj:"Nj","Ⓞ":"O",O:"O",Ò:"O",Ó:"O",Ô:"O",Ồ:"O",Ố:"O",Ỗ:"O",Ổ:"O",Õ:"O",Ṍ:"O",Ȭ:"O",Ṏ:"O",Ō:"O",Ṑ:"O",Ṓ:"O",Ŏ:"O",Ȯ:"O",Ȱ:"O",Ö:"O",Ȫ:"O",Ỏ:"O",Ő:"O",Ǒ:"O",Ȍ:"O",Ȏ:"O",Ơ:"O",Ờ:"O",Ớ:"O",Ỡ:"O",Ở:"O",Ợ:"O",Ọ:"O",Ộ:"O",Ǫ:"O",Ǭ:"O",Ø:"O",Ǿ:"O",Ɔ:"O",Ɵ:"O",Ꝋ:"O",Ꝍ:"O",Œ:"OE",Ƣ:"OI",Ꝏ:"OO",Ȣ:"OU","Ⓟ":"P",P:"P",Ṕ:"P",Ṗ:"P",Ƥ:"P",Ᵽ:"P",Ꝑ:"P",Ꝓ:"P",Ꝕ:"P","Ⓠ":"Q",Q:"Q",Ꝗ:"Q",Ꝙ:"Q",Ɋ:"Q","Ⓡ":"R",R:"R",Ŕ:"R",Ṙ:"R",Ř:"R",Ȑ:"R",Ȓ:"R",Ṛ:"R",Ṝ:"R",Ŗ:"R",Ṟ:"R",Ɍ:"R",Ɽ:"R",Ꝛ:"R",Ꞧ:"R",Ꞃ:"R","Ⓢ":"S",S:"S",ẞ:"S",Ś:"S",Ṥ:"S",Ŝ:"S",Ṡ:"S",Š:"S",Ṧ:"S",Ṣ:"S",Ṩ:"S",Ș:"S",Ş:"S",Ȿ:"S",Ꞩ:"S",Ꞅ:"S","Ⓣ":"T",T:"T",Ṫ:"T",Ť:"T",Ṭ:"T",Ț:"T",Ţ:"T",Ṱ:"T",Ṯ:"T",Ŧ:"T",Ƭ:"T",Ʈ:"T",Ⱦ:"T",Ꞇ:"T",Ꜩ:"TZ","Ⓤ":"U",U:"U",Ù:"U",Ú:"U",Û:"U",Ũ:"U",Ṹ:"U",Ū:"U",Ṻ:"U",Ŭ:"U",Ü:"U",Ǜ:"U",Ǘ:"U",Ǖ:"U",Ǚ:"U",Ủ:"U",Ů:"U",Ű:"U",Ǔ:"U",Ȕ:"U",Ȗ:"U",Ư:"U",Ừ:"U",Ứ:"U",Ữ:"U",Ử:"U",Ự:"U",Ụ:"U",Ṳ:"U",Ų:"U",Ṷ:"U",Ṵ:"U",Ʉ:"U","Ⓥ":"V",V:"V",Ṽ:"V",Ṿ:"V",Ʋ:"V",Ꝟ:"V",Ʌ:"V",Ꝡ:"VY","Ⓦ":"W",W:"W",Ẁ:"W",Ẃ:"W",Ŵ:"W",Ẇ:"W",Ẅ:"W",Ẉ:"W",Ⱳ:"W","Ⓧ":"X",X:"X",Ẋ:"X",Ẍ:"X","Ⓨ":"Y",Y:"Y",Ỳ:"Y",Ý:"Y",Ŷ:"Y",Ỹ:"Y",Ȳ:"Y",Ẏ:"Y",Ÿ:"Y",Ỷ:"Y",Ỵ:"Y",Ƴ:"Y",Ɏ:"Y",Ỿ:"Y","Ⓩ":"Z",Z:"Z",Ź:"Z",Ẑ:"Z",Ż:"Z",Ž:"Z",Ẓ:"Z",Ẕ:"Z",Ƶ:"Z",Ȥ:"Z",Ɀ:"Z",Ⱬ:"Z",Ꝣ:"Z","ⓐ":"a",a:"a",ẚ:"a",à:"a",á:"a",â:"a",ầ:"a",ấ:"a",ẫ:"a",ẩ:"a",ã:"a",ā:"a",ă:"a",ằ:"a",ắ:"a",ẵ:"a",ẳ:"a",ȧ:"a",ǡ:"a",ä:"a",ǟ:"a",ả:"a",å:"a",ǻ:"a",ǎ:"a",ȁ:"a",ȃ:"a",ạ:"a",ậ:"a",ặ:"a",ḁ:"a",ą:"a",ⱥ:"a",ɐ:"a",ꜳ:"aa",æ:"ae",ǽ:"ae",ǣ:"ae",ꜵ:"ao",ꜷ:"au",ꜹ:"av",ꜻ:"av",ꜽ:"ay","ⓑ":"b",b:"b",ḃ:"b",ḅ:"b",ḇ:"b",ƀ:"b",ƃ:"b",ɓ:"b","ⓒ":"c",c:"c",ć:"c",ĉ:"c",ċ:"c",č:"c",ç:"c",ḉ:"c",ƈ:"c",ȼ:"c",ꜿ:"c",ↄ:"c","ⓓ":"d",d:"d",ḋ:"d",ď:"d",ḍ:"d",ḑ:"d",ḓ:"d",ḏ:"d",đ:"d",ƌ:"d",ɖ:"d",ɗ:"d",ꝺ:"d",dz:"dz",dž:"dz","ⓔ":"e",e:"e",è:"e",é:"e",ê:"e",ề:"e",ế:"e",ễ:"e",ể:"e",ẽ:"e",ē:"e",ḕ:"e",ḗ:"e",ĕ:"e",ė:"e",ë:"e",ẻ:"e",ě:"e",ȅ:"e",ȇ:"e",ẹ:"e",ệ:"e",ȩ:"e",ḝ:"e",ę:"e",ḙ:"e",ḛ:"e",ɇ:"e",ɛ:"e",ǝ:"e","ⓕ":"f",f:"f",ḟ:"f",ƒ:"f",ꝼ:"f","ⓖ":"g",g:"g",ǵ:"g",ĝ:"g",ḡ:"g",ğ:"g",ġ:"g",ǧ:"g",ģ:"g",ǥ:"g",ɠ:"g",ꞡ:"g",ᵹ:"g",ꝿ:"g","ⓗ":"h",h:"h",ĥ:"h",ḣ:"h",ḧ:"h",ȟ:"h",ḥ:"h",ḩ:"h",ḫ:"h",ẖ:"h",ħ:"h",ⱨ:"h",ⱶ:"h",ɥ:"h",ƕ:"hv","ⓘ":"i",i:"i",ì:"i",í:"i",î:"i",ĩ:"i",ī:"i",ĭ:"i",ï:"i",ḯ:"i",ỉ:"i",ǐ:"i",ȉ:"i",ȋ:"i",ị:"i",į:"i",ḭ:"i",ɨ:"i",ı:"i","ⓙ":"j",j:"j",ĵ:"j",ǰ:"j",ɉ:"j","ⓚ":"k",k:"k",ḱ:"k",ǩ:"k",ḳ:"k",ķ:"k",ḵ:"k",ƙ:"k",ⱪ:"k",ꝁ:"k",ꝃ:"k",ꝅ:"k",ꞣ:"k","ⓛ":"l",l:"l",ŀ:"l",ĺ:"l",ľ:"l",ḷ:"l",ḹ:"l",ļ:"l",ḽ:"l",ḻ:"l",ſ:"l",ł:"l",ƚ:"l",ɫ:"l",ⱡ:"l",ꝉ:"l",ꞁ:"l",ꝇ:"l",lj:"lj","ⓜ":"m",m:"m",ḿ:"m",ṁ:"m",ṃ:"m",ɱ:"m",ɯ:"m","ⓝ":"n",n:"n",ǹ:"n",ń:"n",ñ:"n",ṅ:"n",ň:"n",ṇ:"n",ņ:"n",ṋ:"n",ṉ:"n",ƞ:"n",ɲ:"n",ʼn:"n",ꞑ:"n",ꞥ:"n",nj:"nj","ⓞ":"o",o:"o",ò:"o",ó:"o",ô:"o",ồ:"o",ố:"o",ỗ:"o",ổ:"o",õ:"o",ṍ:"o",ȭ:"o",ṏ:"o",ō:"o",ṑ:"o",ṓ:"o",ŏ:"o",ȯ:"o",ȱ:"o",ö:"o",ȫ:"o",ỏ:"o",ő:"o",ǒ:"o",ȍ:"o",ȏ:"o",ơ:"o",ờ:"o",ớ:"o",ỡ:"o",ở:"o",ợ:"o",ọ:"o",ộ:"o",ǫ:"o",ǭ:"o",ø:"o",ǿ:"o",ɔ:"o",ꝋ:"o",ꝍ:"o",ɵ:"o",œ:"oe",ƣ:"oi",ȣ:"ou",ꝏ:"oo","ⓟ":"p",p:"p",ṕ:"p",ṗ:"p",ƥ:"p",ᵽ:"p",ꝑ:"p",ꝓ:"p",ꝕ:"p","ⓠ":"q",q:"q",ɋ:"q",ꝗ:"q",ꝙ:"q","ⓡ":"r",r:"r",ŕ:"r",ṙ:"r",ř:"r",ȑ:"r",ȓ:"r",ṛ:"r",ṝ:"r",ŗ:"r",ṟ:"r",ɍ:"r",ɽ:"r",ꝛ:"r",ꞧ:"r",ꞃ:"r","ⓢ":"s",s:"s",ß:"s",ś:"s",ṥ:"s",ŝ:"s",ṡ:"s",š:"s",ṧ:"s",ṣ:"s",ṩ:"s",ș:"s",ş:"s",ȿ:"s",ꞩ:"s",ꞅ:"s",ẛ:"s","ⓣ":"t",t:"t",ṫ:"t",ẗ:"t",ť:"t",ṭ:"t",ț:"t",ţ:"t",ṱ:"t",ṯ:"t",ŧ:"t",ƭ:"t",ʈ:"t",ⱦ:"t",ꞇ:"t",ꜩ:"tz","ⓤ":"u",u:"u",ù:"u",ú:"u",û:"u",ũ:"u",ṹ:"u",ū:"u",ṻ:"u",ŭ:"u",ü:"u",ǜ:"u",ǘ:"u",ǖ:"u",ǚ:"u",ủ:"u",ů:"u",ű:"u",ǔ:"u",ȕ:"u",ȗ:"u",ư:"u",ừ:"u",ứ:"u",ữ:"u",ử:"u",ự:"u",ụ:"u",ṳ:"u",ų:"u",ṷ:"u",ṵ:"u",ʉ:"u","ⓥ":"v",v:"v",ṽ:"v",ṿ:"v",ʋ:"v",ꝟ:"v",ʌ:"v",ꝡ:"vy","ⓦ":"w",w:"w",ẁ:"w",ẃ:"w",ŵ:"w",ẇ:"w",ẅ:"w",ẘ:"w",ẉ:"w",ⱳ:"w","ⓧ":"x",x:"x",ẋ:"x",ẍ:"x","ⓨ":"y",y:"y",ỳ:"y",ý:"y",ŷ:"y",ỹ:"y",ȳ:"y",ẏ:"y",ÿ:"y",ỷ:"y",ẙ:"y",ỵ:"y",ƴ:"y",ɏ:"y",ỿ:"y","ⓩ":"z",z:"z",ź:"z",ẑ:"z",ż:"z",ž:"z",ẓ:"z",ẕ:"z",ƶ:"z",ȥ:"z",ɀ:"z",ⱬ:"z",ꝣ:"z",Ά:"Α",Έ:"Ε",Ή:"Η",Ί:"Ι",Ϊ:"Ι",Ό:"Ο",Ύ:"Υ",Ϋ:"Υ",Ώ:"Ω",ά:"α",έ:"ε",ή:"η",ί:"ι",ϊ:"ι",ΐ:"ι",ό:"ο",ύ:"υ",ϋ:"υ",ΰ:"υ",ώ:"ω",ς:"σ","’":"'"}})),t.define("select2/data/base",["../utils"],(function(e){function t(e,n){t.__super__.constructor.call(this)}return e.Extend(t,e.Observable),t.prototype.current=function(e){throw new Error("The `current` method must be defined in child classes.")},t.prototype.query=function(e,t){throw new Error("The `query` method must be defined in child classes.")},t.prototype.bind=function(e,t){},t.prototype.destroy=function(){},t.prototype.generateResultId=function(t,n){var o=t.id+"-result-";return o+=e.generateChars(4),null!=n.id?o+="-"+n.id.toString():o+="-"+e.generateChars(4),o},t})),t.define("select2/data/select",["./base","../utils","jquery"],(function(e,t,n){function o(e,t){this.$element=e,this.options=t,o.__super__.constructor.call(this)}return t.Extend(o,e),o.prototype.current=function(e){var t=[],o=this;this.$element.find(":selected").each((function(){var e=n(this),i=o.item(e);t.push(i)})),e(t)},o.prototype.select=function(e){var t=this;if(e.selected=!0,n(e.element).is("option"))return e.element.selected=!0,void this.$element.trigger("input").trigger("change");if(this.$element.prop("multiple"))this.current((function(o){var i=[];(e=[e]).push.apply(e,o);for(var r=0;r<e.length;r++){var s=e[r].id;-1===n.inArray(s,i)&&i.push(s)}t.$element.val(i),t.$element.trigger("input").trigger("change")}));else{var o=e.id;this.$element.val(o),this.$element.trigger("input").trigger("change")}},o.prototype.unselect=function(e){var t=this;if(this.$element.prop("multiple")){if(e.selected=!1,n(e.element).is("option"))return e.element.selected=!1,void this.$element.trigger("input").trigger("change");this.current((function(o){for(var i=[],r=0;r<o.length;r++){var s=o[r].id;s!==e.id&&-1===n.inArray(s,i)&&i.push(s)}t.$element.val(i),t.$element.trigger("input").trigger("change")}))}},o.prototype.bind=function(e,t){var n=this;this.container=e,e.on("select",(function(e){n.select(e.data)})),e.on("unselect",(function(e){n.unselect(e.data)}))},o.prototype.destroy=function(){this.$element.find("*").each((function(){t.RemoveData(this)}))},o.prototype.query=function(e,t){var o=[],i=this;this.$element.children().each((function(){var t=n(this);if(t.is("option")||t.is("optgroup")){var r=i.item(t),s=i.matches(e,r);null!==s&&o.push(s)}})),t({results:o})},o.prototype.addOptions=function(e){t.appendMany(this.$element,e)},o.prototype.option=function(e){var o;e.children?(o=document.createElement("optgroup")).label=e.text:void 0!==(o=document.createElement("option")).textContent?o.textContent=e.text:o.innerText=e.text,void 0!==e.id&&(o.value=e.id),e.disabled&&(o.disabled=!0),e.selected&&(o.selected=!0),e.title&&(o.title=e.title);var i=n(o),r=this._normalizeItem(e);return r.element=o,t.StoreData(o,"data",r),i},o.prototype.item=function(e){var o={};if(null!=(o=t.GetData(e[0],"data")))return o;if(e.is("option"))o={id:e.val(),text:e.text(),disabled:e.prop("disabled"),selected:e.prop("selected"),title:e.prop("title")};else if(e.is("optgroup")){o={text:e.prop("label"),children:[],title:e.prop("title")};for(var i=e.children("option"),r=[],s=0;s<i.length;s++){var a=n(i[s]),l=this.item(a);r.push(l)}o.children=r}return(o=this._normalizeItem(o)).element=e[0],t.StoreData(e[0],"data",o),o},o.prototype._normalizeItem=function(e){e!==Object(e)&&(e={id:e,text:e});var t={selected:!1,disabled:!1};return null!=(e=n.extend({},{text:""},e)).id&&(e.id=e.id.toString()),null!=e.text&&(e.text=e.text.toString()),null==e._resultId&&e.id&&null!=this.container&&(e._resultId=this.generateResultId(this.container,e)),n.extend({},t,e)},o.prototype.matches=function(e,t){return this.options.get("matcher")(e,t)},o})),t.define("select2/data/array",["./select","../utils","jquery"],(function(e,t,n){function o(e,t){this._dataToConvert=t.get("data")||[],o.__super__.constructor.call(this,e,t)}return t.Extend(o,e),o.prototype.bind=function(e,t){o.__super__.bind.call(this,e,t),this.addOptions(this.convertToOptions(this._dataToConvert))},o.prototype.select=function(e){var t=this.$element.find("option").filter((function(t,n){return n.value==e.id.toString()}));0===t.length&&(t=this.option(e),this.addOptions(t)),o.__super__.select.call(this,e)},o.prototype.convertToOptions=function(e){var o=this,i=this.$element.find("option"),r=i.map((function(){return o.item(n(this)).id})).get(),s=[];function a(e){return function(){return n(this).val()==e.id}}for(var l=0;l<e.length;l++){var c=this._normalizeItem(e[l]);if(n.inArray(c.id,r)>=0){var u=i.filter(a(c)),d=this.item(u),p=n.extend(!0,{},c,d),h=this.option(p);u.replaceWith(h)}else{var f=this.option(c);if(c.children){var g=this.convertToOptions(c.children);t.appendMany(f,g)}s.push(f)}}return s},o})),t.define("select2/data/ajax",["./array","../utils","jquery"],(function(e,t,n){function o(e,t){this.ajaxOptions=this._applyDefaults(t.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),o.__super__.constructor.call(this,e,t)}return t.Extend(o,e),o.prototype._applyDefaults=function(e){var t={data:function(e){return n.extend({},e,{q:e.term})},transport:function(e,t,o){var i=n.ajax(e);return i.then(t),i.fail(o),i}};return n.extend({},t,e,!0)},o.prototype.processResults=function(e){return e},o.prototype.query=function(e,t){var o=this;null!=this._request&&(n.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var i=n.extend({type:"GET"},this.ajaxOptions);function r(){var r=i.transport(i,(function(i){var r=o.processResults(i,e);o.options.get("debug")&&window.console&&console.error&&(r&&r.results&&n.isArray(r.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),t(r)}),(function(){(!("status"in r)||0!==r.status&&"0"!==r.status)&&o.trigger("results:message",{message:"errorLoading"})}));o._request=r}"function"==typeof i.url&&(i.url=i.url.call(this.$element,e)),"function"==typeof i.data&&(i.data=i.data.call(this.$element,e)),this.ajaxOptions.delay&&null!=e.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(r,this.ajaxOptions.delay)):r()},o})),t.define("select2/data/tags",["jquery"],(function(e){function t(t,n,o){var i=o.get("tags"),r=o.get("createTag");void 0!==r&&(this.createTag=r);var s=o.get("insertTag");if(void 0!==s&&(this.insertTag=s),t.call(this,n,o),e.isArray(i))for(var a=0;a<i.length;a++){var l=i[a],c=this._normalizeItem(l),u=this.option(c);this.$element.append(u)}}return t.prototype.query=function(e,t,n){var o=this;function i(e,r){for(var s=e.results,a=0;a<s.length;a++){var l=s[a],c=null!=l.children&&!i({results:l.children},!0);if((l.text||"").toUpperCase()===(t.term||"").toUpperCase()||c)return!r&&(e.data=s,void n(e))}if(r)return!0;var u=o.createTag(t);if(null!=u){var d=o.option(u);d.attr("data-select2-tag",!0),o.addOptions([d]),o.insertTag(s,u)}e.results=s,n(e)}this._removeOldTags(),null!=t.term&&null==t.page?e.call(this,t,i):e.call(this,t,n)},t.prototype.createTag=function(t,n){var o=e.trim(n.term);return""===o?null:{id:o,text:o}},t.prototype.insertTag=function(e,t,n){t.unshift(n)},t.prototype._removeOldTags=function(t){this.$element.find("option[data-select2-tag]").each((function(){this.selected||e(this).remove()}))},t})),t.define("select2/data/tokenizer",["jquery"],(function(e){function t(e,t,n){var o=n.get("tokenizer");void 0!==o&&(this.tokenizer=o),e.call(this,t,n)}return t.prototype.bind=function(e,t,n){e.call(this,t,n),this.$search=t.dropdown.$search||t.selection.$search||n.find(".select2-search__field")},t.prototype.query=function(t,n,o){var i=this;function r(t){var n=i._normalizeItem(t);if(!i.$element.find("option").filter((function(){return e(this).val()===n.id})).length){var o=i.option(n);o.attr("data-select2-tag",!0),i._removeOldTags(),i.addOptions([o])}s(n)}function s(e){i.trigger("select",{data:e})}n.term=n.term||"";var a=this.tokenizer(n,this.options,r);a.term!==n.term&&(this.$search.length&&(this.$search.val(a.term),this.$search.trigger("focus")),n.term=a.term),t.call(this,n,o)},t.prototype.tokenizer=function(t,n,o,i){for(var r=o.get("tokenSeparators")||[],s=n.term,a=0,l=this.createTag||function(e){return{id:e.term,text:e.term}};a<s.length;){var c=s[a];if(-1!==e.inArray(c,r)){var u=s.substr(0,a),d=l(e.extend({},n,{term:u}));null!=d?(i(d),s=s.substr(a+1)||"",a=0):a++}else a++}return{term:s}},t})),t.define("select2/data/minimumInputLength",[],(function(){function e(e,t,n){this.minimumInputLength=n.get("minimumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.term=t.term||"",t.term.length<this.minimumInputLength?this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e})),t.define("select2/data/maximumInputLength",[],(function(){function e(e,t,n){this.maximumInputLength=n.get("maximumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.term=t.term||"",this.maximumInputLength>0&&t.term.length>this.maximumInputLength?this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e})),t.define("select2/data/maximumSelectionLength",[],(function(){function e(e,t,n){this.maximumSelectionLength=n.get("maximumSelectionLength"),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var o=this;e.call(this,t,n),t.on("select",(function(){o._checkIfMaximumSelected()}))},e.prototype.query=function(e,t,n){var o=this;this._checkIfMaximumSelected((function(){e.call(o,t,n)}))},e.prototype._checkIfMaximumSelected=function(e,t){var n=this;this.current((function(e){var o=null!=e?e.length:0;n.maximumSelectionLength>0&&o>=n.maximumSelectionLength?n.trigger("results:message",{message:"maximumSelected",args:{maximum:n.maximumSelectionLength}}):t&&t()}))},e})),t.define("select2/dropdown",["jquery","./utils"],(function(e,t){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return t.Extend(n,t.Observable),n.prototype.render=function(){var t=e('<span class="select2-dropdown"><span class="select2-results"></span></span>');return t.attr("dir",this.options.get("dir")),this.$dropdown=t,t},n.prototype.bind=function(){},n.prototype.position=function(e,t){},n.prototype.destroy=function(){this.$dropdown.remove()},n})),t.define("select2/dropdown/search",["jquery","../utils"],(function(e,t){function n(){}return n.prototype.render=function(t){var n=t.call(this),o=e('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" /></span>');return this.$searchContainer=o,this.$search=o.find("input"),n.prepend(o),n},n.prototype.bind=function(t,n,o){var i=this,r=n.id+"-results";t.call(this,n,o),this.$search.on("keydown",(function(e){i.trigger("keypress",e),i._keyUpPrevented=e.isDefaultPrevented()})),this.$search.on("input",(function(t){e(this).off("keyup")})),this.$search.on("keyup input",(function(e){i.handleSearch(e)})),n.on("open",(function(){i.$search.attr("tabindex",0),i.$search.attr("aria-controls",r),i.$search.trigger("focus"),window.setTimeout((function(){i.$search.trigger("focus")}),0)})),n.on("close",(function(){i.$search.attr("tabindex",-1),i.$search.removeAttr("aria-controls"),i.$search.removeAttr("aria-activedescendant"),i.$search.val(""),i.$search.trigger("blur")})),n.on("focus",(function(){n.isOpen()||i.$search.trigger("focus")})),n.on("results:all",(function(e){null!=e.query.term&&""!==e.query.term||(i.showSearch(e)?i.$searchContainer.removeClass("select2-search--hide"):i.$searchContainer.addClass("select2-search--hide"))})),n.on("results:focus",(function(e){e.data._resultId?i.$search.attr("aria-activedescendant",e.data._resultId):i.$search.removeAttr("aria-activedescendant")}))},n.prototype.handleSearch=function(e){if(!this._keyUpPrevented){var t=this.$search.val();this.trigger("query",{term:t})}this._keyUpPrevented=!1},n.prototype.showSearch=function(e,t){return!0},n})),t.define("select2/dropdown/hidePlaceholder",[],(function(){function e(e,t,n,o){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n,o)}return e.prototype.append=function(e,t){t.results=this.removePlaceholder(t.results),e.call(this,t)},e.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},e.prototype.removePlaceholder=function(e,t){for(var n=t.slice(0),o=t.length-1;o>=0;o--){var i=t[o];this.placeholder.id===i.id&&n.splice(o,1)}return n},e})),t.define("select2/dropdown/infiniteScroll",["jquery"],(function(e){function t(e,t,n,o){this.lastParams={},e.call(this,t,n,o),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return t.prototype.append=function(e,t){this.$loadingMore.remove(),this.loading=!1,e.call(this,t),this.showLoadingMore(t)&&(this.$results.append(this.$loadingMore),this.loadMoreIfNeeded())},t.prototype.bind=function(e,t,n){var o=this;e.call(this,t,n),t.on("query",(function(e){o.lastParams=e,o.loading=!0})),t.on("query:append",(function(e){o.lastParams=e,o.loading=!0})),this.$results.on("scroll",this.loadMoreIfNeeded.bind(this))},t.prototype.loadMoreIfNeeded=function(){var t=e.contains(document.documentElement,this.$loadingMore[0]);!this.loading&&t&&this.$results.offset().top+this.$results.outerHeight(!1)+50>=this.$loadingMore.offset().top+this.$loadingMore.outerHeight(!1)&&this.loadMore()},t.prototype.loadMore=function(){this.loading=!0;var t=e.extend({},{page:1},this.lastParams);t.page++,this.trigger("query:append",t)},t.prototype.showLoadingMore=function(e,t){return t.pagination&&t.pagination.more},t.prototype.createLoadingMore=function(){var t=e('<li class="select2-results__option select2-results__option--load-more"role="option" aria-disabled="true"></li>'),n=this.options.get("translations").get("loadingMore");return t.html(n(this.lastParams)),t},t})),t.define("select2/dropdown/attachBody",["jquery","../utils"],(function(e,t){function n(t,n,o){this.$dropdownParent=e(o.get("dropdownParent")||document.body),t.call(this,n,o)}return n.prototype.bind=function(e,t,n){var o=this;e.call(this,t,n),t.on("open",(function(){o._showDropdown(),o._attachPositioningHandler(t),o._bindContainerResultHandlers(t)})),t.on("close",(function(){o._hideDropdown(),o._detachPositioningHandler(t)})),this.$dropdownContainer.on("mousedown",(function(e){e.stopPropagation()}))},n.prototype.destroy=function(e){e.call(this),this.$dropdownContainer.remove()},n.prototype.position=function(e,t,n){t.attr("class",n.attr("class")),t.removeClass("select2"),t.addClass("select2-container--open"),t.css({position:"absolute",top:-999999}),this.$container=n},n.prototype.render=function(t){var n=e("<span></span>"),o=t.call(this);return n.append(o),this.$dropdownContainer=n,n},n.prototype._hideDropdown=function(e){this.$dropdownContainer.detach()},n.prototype._bindContainerResultHandlers=function(e,t){if(!this._containerResultsHandlersBound){var n=this;t.on("results:all",(function(){n._positionDropdown(),n._resizeDropdown()})),t.on("results:append",(function(){n._positionDropdown(),n._resizeDropdown()})),t.on("results:message",(function(){n._positionDropdown(),n._resizeDropdown()})),t.on("select",(function(){n._positionDropdown(),n._resizeDropdown()})),t.on("unselect",(function(){n._positionDropdown(),n._resizeDropdown()})),this._containerResultsHandlersBound=!0}},n.prototype._attachPositioningHandler=function(n,o){var i=this,r="scroll.select2."+o.id,s="resize.select2."+o.id,a="orientationchange.select2."+o.id,l=this.$container.parents().filter(t.hasScroll);l.each((function(){t.StoreData(this,"select2-scroll-position",{x:e(this).scrollLeft(),y:e(this).scrollTop()})})),l.on(r,(function(n){var o=t.GetData(this,"select2-scroll-position");e(this).scrollTop(o.y)})),e(window).on(r+" "+s+" "+a,(function(e){i._positionDropdown(),i._resizeDropdown()}))},n.prototype._detachPositioningHandler=function(n,o){var i="scroll.select2."+o.id,r="resize.select2."+o.id,s="orientationchange.select2."+o.id;this.$container.parents().filter(t.hasScroll).off(i),e(window).off(i+" "+r+" "+s)},n.prototype._positionDropdown=function(){var t=e(window),n=this.$dropdown.hasClass("select2-dropdown--above"),o=this.$dropdown.hasClass("select2-dropdown--below"),i=null,r=this.$container.offset();r.bottom=r.top+this.$container.outerHeight(!1);var s={height:this.$container.outerHeight(!1)};s.top=r.top,s.bottom=r.top+s.height;var a={height:this.$dropdown.outerHeight(!1)},l={top:t.scrollTop(),bottom:t.scrollTop()+t.height()},c=l.top<r.top-a.height,u=l.bottom>r.bottom+a.height,d={left:r.left,top:s.bottom},p=this.$dropdownParent;"static"===p.css("position")&&(p=p.offsetParent());var h={top:0,left:0};(e.contains(document.body,p[0])||p[0].isConnected)&&(h=p.offset()),d.top-=h.top,d.left-=h.left,n||o||(i="below"),u||!c||n?!c&&u&&n&&(i="below"):i="above",("above"==i||n&&"below"!==i)&&(d.top=s.top-h.top-a.height),null!=i&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+i),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+i)),this.$dropdownContainer.css(d)},n.prototype._resizeDropdown=function(){var e={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(e.minWidth=e.width,e.position="relative",e.width="auto"),this.$dropdown.css(e)},n.prototype._showDropdown=function(e){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},n})),t.define("select2/dropdown/minimumResultsForSearch",[],(function(){function e(t){for(var n=0,o=0;o<t.length;o++){var i=t[o];i.children?n+=e(i.children):n++}return n}function t(e,t,n,o){this.minimumResultsForSearch=n.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),e.call(this,t,n,o)}return t.prototype.showSearch=function(t,n){return!(e(n.data.results)<this.minimumResultsForSearch)&&t.call(this,n)},t})),t.define("select2/dropdown/selectOnClose",["../utils"],(function(e){function t(){}return t.prototype.bind=function(e,t,n){var o=this;e.call(this,t,n),t.on("close",(function(e){o._handleSelectOnClose(e)}))},t.prototype._handleSelectOnClose=function(t,n){if(n&&null!=n.originalSelect2Event){var o=n.originalSelect2Event;if("select"===o._type||"unselect"===o._type)return}var i=this.getHighlightedResults();if(!(i.length<1)){var r=e.GetData(i[0],"data");null!=r.element&&r.element.selected||null==r.element&&r.selected||this.trigger("select",{data:r})}},t})),t.define("select2/dropdown/closeOnSelect",[],(function(){function e(){}return e.prototype.bind=function(e,t,n){var o=this;e.call(this,t,n),t.on("select",(function(e){o._selectTriggered(e)})),t.on("unselect",(function(e){o._selectTriggered(e)}))},e.prototype._selectTriggered=function(e,t){var n=t.originalEvent;n&&(n.ctrlKey||n.metaKey)||this.trigger("close",{originalEvent:n,originalSelect2Event:t})},e})),t.define("select2/i18n/en",[],(function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Please delete "+t+" character";return 1!=t&&(n+="s"),n},inputTooShort:function(e){return"Please enter "+(e.minimum-e.input.length)+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(e){var t="You can only select "+e.maximum+" item";return 1!=e.maximum&&(t+="s"),t},noResults:function(){return"No results found"},searching:function(){return"Searching…"},removeAllItems:function(){return"Remove all items"}}})),t.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],(function(e,t,n,o,i,r,s,a,l,c,u,d,p,h,f,g,m,v,y,_,b,w,x,A,$,O,C,E,D){function S(){this.reset()}return S.prototype.apply=function(u){if(null==(u=e.extend(!0,{},this.defaults,u)).dataAdapter){if(null!=u.ajax?u.dataAdapter=f:null!=u.data?u.dataAdapter=h:u.dataAdapter=p,u.minimumInputLength>0&&(u.dataAdapter=c.Decorate(u.dataAdapter,v)),u.maximumInputLength>0&&(u.dataAdapter=c.Decorate(u.dataAdapter,y)),u.maximumSelectionLength>0&&(u.dataAdapter=c.Decorate(u.dataAdapter,_)),u.tags&&(u.dataAdapter=c.Decorate(u.dataAdapter,g)),null==u.tokenSeparators&&null==u.tokenizer||(u.dataAdapter=c.Decorate(u.dataAdapter,m)),null!=u.query){var d=t(u.amdBase+"compat/query");u.dataAdapter=c.Decorate(u.dataAdapter,d)}if(null!=u.initSelection){var D=t(u.amdBase+"compat/initSelection");u.dataAdapter=c.Decorate(u.dataAdapter,D)}}if(null==u.resultsAdapter&&(u.resultsAdapter=n,null!=u.ajax&&(u.resultsAdapter=c.Decorate(u.resultsAdapter,A)),null!=u.placeholder&&(u.resultsAdapter=c.Decorate(u.resultsAdapter,x)),u.selectOnClose&&(u.resultsAdapter=c.Decorate(u.resultsAdapter,C))),null==u.dropdownAdapter){if(u.multiple)u.dropdownAdapter=b;else{var S=c.Decorate(b,w);u.dropdownAdapter=S}if(0!==u.minimumResultsForSearch&&(u.dropdownAdapter=c.Decorate(u.dropdownAdapter,O)),u.closeOnSelect&&(u.dropdownAdapter=c.Decorate(u.dropdownAdapter,E)),null!=u.dropdownCssClass||null!=u.dropdownCss||null!=u.adaptDropdownCssClass){var k=t(u.amdBase+"compat/dropdownCss");u.dropdownAdapter=c.Decorate(u.dropdownAdapter,k)}u.dropdownAdapter=c.Decorate(u.dropdownAdapter,$)}if(null==u.selectionAdapter){if(u.multiple?u.selectionAdapter=i:u.selectionAdapter=o,null!=u.placeholder&&(u.selectionAdapter=c.Decorate(u.selectionAdapter,r)),u.allowClear&&(u.selectionAdapter=c.Decorate(u.selectionAdapter,s)),u.multiple&&(u.selectionAdapter=c.Decorate(u.selectionAdapter,a)),null!=u.containerCssClass||null!=u.containerCss||null!=u.adaptContainerCssClass){var T=t(u.amdBase+"compat/containerCss");u.selectionAdapter=c.Decorate(u.selectionAdapter,T)}u.selectionAdapter=c.Decorate(u.selectionAdapter,l)}u.language=this._resolveLanguage(u.language),u.language.push("en");for(var j=[],L=0;L<u.language.length;L++){var P=u.language[L];-1===j.indexOf(P)&&j.push(P)}return u.language=j,u.translations=this._processTranslations(u.language,u.debug),u},S.prototype.reset=function(){function t(e){function t(e){return d[e]||e}return e.replace(/[^\u0000-\u007E]/g,t)}function n(o,i){if(""===e.trim(o.term))return i;if(i.children&&i.children.length>0){for(var r=e.extend(!0,{},i),s=i.children.length-1;s>=0;s--)null==n(o,i.children[s])&&r.children.splice(s,1);return r.children.length>0?r:n(o,r)}var a=t(i.text).toUpperCase(),l=t(o.term).toUpperCase();return a.indexOf(l)>-1?i:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:c.escapeMarkup,language:{},matcher:n,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,scrollAfterSelect:!1,sorter:function(e){return e},templateResult:function(e){return e.text},templateSelection:function(e){return e.text},theme:"default",width:"resolve"}},S.prototype.applyFromElement=function(e,t){var n=e.language,o=this.defaults.language,i=t.prop("lang"),r=t.closest("[lang]").prop("lang"),s=Array.prototype.concat.call(this._resolveLanguage(i),this._resolveLanguage(n),this._resolveLanguage(o),this._resolveLanguage(r));return e.language=s,e},S.prototype._resolveLanguage=function(t){if(!t)return[];if(e.isEmptyObject(t))return[];if(e.isPlainObject(t))return[t];var n;n=e.isArray(t)?t:[t];for(var o=[],i=0;i<n.length;i++)if(o.push(n[i]),"string"==typeof n[i]&&n[i].indexOf("-")>0){var r=n[i].split("-")[0];o.push(r)}return o},S.prototype._processTranslations=function(t,n){for(var o=new u,i=0;i<t.length;i++){var r=new u,s=t[i];if("string"==typeof s)try{r=u.loadPath(s)}catch(e){try{s=this.defaults.amdLanguageBase+s,r=u.loadPath(s)}catch(e){n&&window.console&&console.warn&&console.warn('Select2: The language file for "'+s+'" could not be automatically loaded. A fallback will be used instead.')}}else r=e.isPlainObject(s)?new u(s):s;o.extend(r)}return o},S.prototype.set=function(t,n){var o={};o[e.camelCase(t)]=n;var i=c._convertData(o);e.extend(!0,this.defaults,i)},new S})),t.define("select2/options",["require","jquery","./defaults","./utils"],(function(e,t,n,o){function i(t,i){if(this.options=t,null!=i&&this.fromElement(i),null!=i&&(this.options=n.applyFromElement(this.options,i)),this.options=n.apply(this.options),i&&i.is("input")){var r=e(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=o.Decorate(this.options.dataAdapter,r)}}return i.prototype.fromElement=function(e){var n=["select2"];null==this.options.multiple&&(this.options.multiple=e.prop("multiple")),null==this.options.disabled&&(this.options.disabled=e.prop("disabled")),null==this.options.dir&&(e.prop("dir")?this.options.dir=e.prop("dir"):e.closest("[dir]").prop("dir")?this.options.dir=e.closest("[dir]").prop("dir"):this.options.dir="ltr"),e.prop("disabled",this.options.disabled),e.prop("multiple",this.options.multiple),o.GetData(e[0],"select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),o.StoreData(e[0],"data",o.GetData(e[0],"select2Tags")),o.StoreData(e[0],"tags",!0)),o.GetData(e[0],"ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),e.attr("ajax--url",o.GetData(e[0],"ajaxUrl")),o.StoreData(e[0],"ajax-Url",o.GetData(e[0],"ajaxUrl")));var i={};function r(e,t){return t.toUpperCase()}for(var s=0;s<e[0].attributes.length;s++){var a=e[0].attributes[s].name,l="data-";if(a.substr(0,l.length)==l){var c=a.substring(l.length),u=o.GetData(e[0],c);i[c.replace(/-([a-z])/g,r)]=u}}t.fn.jquery&&"1."==t.fn.jquery.substr(0,2)&&e[0].dataset&&(i=t.extend(!0,{},e[0].dataset,i));var d=t.extend(!0,{},o.GetData(e[0]),i);for(var p in d=o._convertData(d))t.inArray(p,n)>-1||(t.isPlainObject(this.options[p])?t.extend(this.options[p],d[p]):this.options[p]=d[p]);return this},i.prototype.get=function(e){return this.options[e]},i.prototype.set=function(e,t){this.options[e]=t},i})),t.define("select2/core",["jquery","./options","./utils","./keys"],(function(e,t,n,o){var i=function(e,o){null!=n.GetData(e[0],"select2")&&n.GetData(e[0],"select2").destroy(),this.$element=e,this.id=this._generateId(e),o=o||{},this.options=new t(o,e),i.__super__.constructor.call(this);var r=e.attr("tabindex")||0;n.StoreData(e[0],"old-tabindex",r),e.attr("tabindex","-1");var s=this.options.get("dataAdapter");this.dataAdapter=new s(e,this.options);var a=this.render();this._placeContainer(a);var l=this.options.get("selectionAdapter");this.selection=new l(e,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,a);var c=this.options.get("dropdownAdapter");this.dropdown=new c(e,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,a);var u=this.options.get("resultsAdapter");this.results=new u(e,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var d=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current((function(e){d.trigger("selection:update",{data:e})})),e.addClass("select2-hidden-accessible"),e.attr("aria-hidden","true"),this._syncAttributes(),n.StoreData(e[0],"select2",this),e.data("select2",this)};return n.Extend(i,n.Observable),i.prototype._generateId=function(e){return"select2-"+(null!=e.attr("id")?e.attr("id"):null!=e.attr("name")?e.attr("name")+"-"+n.generateChars(2):n.generateChars(4)).replace(/(:|\.|\[|\]|,)/g,"")},i.prototype._placeContainer=function(e){e.insertAfter(this.$element);var t=this._resolveWidth(this.$element,this.options.get("width"));null!=t&&e.css("width",t)},i.prototype._resolveWidth=function(e,t){var n=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==t){var o=this._resolveWidth(e,"style");return null!=o?o:this._resolveWidth(e,"element")}if("element"==t){var i=e.outerWidth(!1);return i<=0?"auto":i+"px"}if("style"==t){var r=e.attr("style");if("string"!=typeof r)return null;for(var s=r.split(";"),a=0,l=s.length;a<l;a+=1){var c=s[a].replace(/\s/g,"").match(n);if(null!==c&&c.length>=1)return c[1]}return null}return"computedstyle"==t?window.getComputedStyle(e[0]).width:t},i.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},i.prototype._registerDomEvents=function(){var e=this;this.$element.on("change.select2",(function(){e.dataAdapter.current((function(t){e.trigger("selection:update",{data:t})}))})),this.$element.on("focus.select2",(function(t){e.trigger("focus",t)})),this._syncA=n.bind(this._syncAttributes,this),this._syncS=n.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var t=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=t?(this._observer=new t((function(t){e._syncA(),e._syncS(null,t)})),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",e._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",e._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",e._syncS,!1))},i.prototype._registerDataEvents=function(){var e=this;this.dataAdapter.on("*",(function(t,n){e.trigger(t,n)}))},i.prototype._registerSelectionEvents=function(){var t=this,n=["toggle","focus"];this.selection.on("toggle",(function(){t.toggleDropdown()})),this.selection.on("focus",(function(e){t.focus(e)})),this.selection.on("*",(function(o,i){-1===e.inArray(o,n)&&t.trigger(o,i)}))},i.prototype._registerDropdownEvents=function(){var e=this;this.dropdown.on("*",(function(t,n){e.trigger(t,n)}))},i.prototype._registerResultsEvents=function(){var e=this;this.results.on("*",(function(t,n){e.trigger(t,n)}))},i.prototype._registerEvents=function(){var e=this;this.on("open",(function(){e.$container.addClass("select2-container--open")})),this.on("close",(function(){e.$container.removeClass("select2-container--open")})),this.on("enable",(function(){e.$container.removeClass("select2-container--disabled")})),this.on("disable",(function(){e.$container.addClass("select2-container--disabled")})),this.on("blur",(function(){e.$container.removeClass("select2-container--focus")})),this.on("query",(function(t){e.isOpen()||e.trigger("open",{}),this.dataAdapter.query(t,(function(n){e.trigger("results:all",{data:n,query:t})}))})),this.on("query:append",(function(t){this.dataAdapter.query(t,(function(n){e.trigger("results:append",{data:n,query:t})}))})),this.on("keypress",(function(t){var n=t.which;e.isOpen()?n===o.ESC||n===o.TAB||n===o.UP&&t.altKey?(e.close(t),t.preventDefault()):n===o.ENTER?(e.trigger("results:select",{}),t.preventDefault()):n===o.SPACE&&t.ctrlKey?(e.trigger("results:toggle",{}),t.preventDefault()):n===o.UP?(e.trigger("results:previous",{}),t.preventDefault()):n===o.DOWN&&(e.trigger("results:next",{}),t.preventDefault()):(n===o.ENTER||n===o.SPACE||n===o.DOWN&&t.altKey)&&(e.open(),t.preventDefault())}))},i.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.isDisabled()?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},i.prototype._isChangeMutation=function(t,n){var o=!1,i=this;if(!t||!t.target||"OPTION"===t.target.nodeName||"OPTGROUP"===t.target.nodeName){if(n)if(n.addedNodes&&n.addedNodes.length>0)for(var r=0;r<n.addedNodes.length;r++)n.addedNodes[r].selected&&(o=!0);else n.removedNodes&&n.removedNodes.length>0?o=!0:e.isArray(n)&&e.each(n,(function(e,t){if(i._isChangeMutation(e,t))return o=!0,!1}));else o=!0;return o}},i.prototype._syncSubtree=function(e,t){var n=this._isChangeMutation(e,t),o=this;n&&this.dataAdapter.current((function(e){o.trigger("selection:update",{data:e})}))},i.prototype.trigger=function(e,t){var n=i.__super__.trigger,o={open:"opening",close:"closing",select:"selecting",unselect:"unselecting",clear:"clearing"};if(void 0===t&&(t={}),e in o){var r=o[e],s={prevented:!1,name:e,args:t};if(n.call(this,r,s),s.prevented)return void(t.prevented=!0)}n.call(this,e,t)},i.prototype.toggleDropdown=function(){this.isDisabled()||(this.isOpen()?this.close():this.open())},i.prototype.open=function(){this.isOpen()||this.isDisabled()||this.trigger("query",{})},i.prototype.close=function(e){this.isOpen()&&this.trigger("close",{originalEvent:e})},i.prototype.isEnabled=function(){return!this.isDisabled()},i.prototype.isDisabled=function(){return this.options.get("disabled")},i.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},i.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},i.prototype.focus=function(e){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},i.prototype.enable=function(e){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=e&&0!==e.length||(e=[!0]);var t=!e[0];this.$element.prop("disabled",t)},i.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var e=[];return this.dataAdapter.current((function(t){e=t})),e},i.prototype.val=function(t){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==t||0===t.length)return this.$element.val();var n=t[0];e.isArray(n)&&(n=e.map(n,(function(e){return e.toString()}))),this.$element.val(n).trigger("input").trigger("change")},i.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",n.GetData(this.$element[0],"old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),n.RemoveData(this.$element[0]),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},i.prototype.render=function(){var t=e('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return t.attr("dir",this.options.get("dir")),this.$container=t,this.$container.addClass("select2-container--"+this.options.get("theme")),n.StoreData(t[0],"element",this.$element),t},i})),t.define("jquery-mousewheel",["jquery"],(function(e){return e})),t.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults","./select2/utils"],(function(e,t,n,o,i){if(null==e.fn.select2){var r=["open","close","destroy"];e.fn.select2=function(t){if("object"==typeof(t=t||{}))return this.each((function(){var o=e.extend(!0,{},t);new n(e(this),o)})),this;if("string"==typeof t){var o,s=Array.prototype.slice.call(arguments,1);return this.each((function(){var e=i.GetData(this,"select2");null==e&&window.console&&console.error&&console.error("The select2('"+t+"') method was called on an element that is not using Select2."),o=e[t].apply(e,s)})),e.inArray(t,r)>-1?this:o}throw new Error("Invalid arguments for Select2: "+t)}}return null==e.fn.select2.defaults&&(e.fn.select2.defaults=o),n})),{define:t.define,require:t.require}}(),n=t.require("jquery.select2");return e.fn.select2.amd=t,n},void 0===(r="function"==typeof o?o.apply(t,i):o)||(e.exports=r)},456:()=>{!function(e,t){var n={version:300};if("wpColorPickerAlpha"in window&&"version"in window.wpColorPickerAlpha){var o=parseInt(window.wpColorPickerAlpha.version,10);if(!isNaN(o)&&o>=n.version)return}if(!Color.fn.hasOwnProperty("to_s")){Color.fn.to_s=function(e){"hex"===(e=e||"hex")&&this._alpha<1&&(e="rgba");var t="";return"hex"===e?t=this.toString():this.error||(t=this.toCSS(e).replace(/\(\s+/,"(").replace(/\s+\)/,")")),t},window.wpColorPickerAlpha=n;var i="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAAHnlligAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNpi+P///4EDBxiAGMgCCCAGFB5AADGCRBgYDh48CCRZIJS9vT2QBAggFBkmBiSAogxFBiCAoHogAKIKAlBUYTELAiAmEtABEECk20G6BOmuIl0CIMBQ/IEMkO0myiSSraaaBhZcbkUOs0HuBwDplz5uFJ3Z4gAAAABJRU5ErkJggg==";e.widget("a8c.iris",e.a8c.iris,{alphaOptions:{alphaEnabled:!1},_getColor:function(e){return e===t&&(e=this._color),this.alphaOptions.alphaEnabled?(e=e.to_s(this.alphaOptions.alphaColorType),this.alphaOptions.alphaColorWithSpace||(e=e.replace(/\s+/g,"")),e):e.toString()},_create:function(){try{this.alphaOptions=this.element.wpColorPicker("instance").alphaOptions}catch(e){}e.extend({},this.alphaOptions,{alphaEnabled:!1,alphaCustomWidth:130,alphaReset:!1,alphaColorType:"hex",alphaColorWithSpace:!1}),this._super()},_addInputListeners:function(e){var t=this,n=function(n){var o=e.val(),i=new Color(o),r=(o=o.replace(/^(#|(rgb|hsl)a?)/,""),t.alphaOptions.alphaColorType);e.removeClass("iris-error"),i.error?""!==o&&e.addClass("iris-error"):"hex"===r&&"keyup"===n.type&&o.match(/^[0-9a-fA-F]{3}$/)||i.toIEOctoHex()!==t._color.toIEOctoHex()&&t._setOption("color",t._getColor(i))};e.on("change",n).on("keyup",t._debounce(n,100)),t.options.hide&&e.one("focus",(function(){t.show()}))},_initControls:function(){if(this._super(),this.alphaOptions.alphaEnabled){var t=this,n=t.controls.strip.clone(!1,!1),o=n.find(".iris-slider-offset"),i={stripAlpha:n,stripAlphaSlider:o};n.addClass("iris-strip-alpha"),o.addClass("iris-slider-offset-alpha"),n.appendTo(t.picker.find(".iris-picker-inner")),e.each(i,(function(e,n){t.controls[e]=n})),t.controls.stripAlphaSlider.slider({orientation:"vertical",min:0,max:100,step:1,value:parseInt(100*t._color._alpha),slide:function(e,n){t.active="strip",t._color._alpha=parseFloat(n.value/100),t._change.apply(t,arguments)}})}},_dimensions:function(e){if(this._super(e),this.alphaOptions.alphaEnabled){var t,n,o,i,r,s=this,a=s.options,l=s.controls.square,c=s.picker.find(".iris-strip");for(t=Math.round(s.picker.outerWidth(!0)-(a.border?22:0)),n=Math.round(l.outerWidth()),o=Math.round((t-n)/2),i=Math.round(o/2),r=Math.round(n+2*o+2*i);r>t;)o=Math.round(o-2),i=Math.round(i-1),r=Math.round(n+2*o+2*i);l.css("margin","0"),c.width(o).css("margin-left",i+"px")}},_change:function(){var t=this,n=t.active;if(t._super(),t.alphaOptions.alphaEnabled){var o=t.controls,r=parseInt(100*t._color._alpha),s=t._color.toRgb(),a=["rgb("+s.r+","+s.g+","+s.b+") 0%","rgba("+s.r+","+s.g+","+s.b+", 0) 100%"];t.picker.closest(".wp-picker-container").find(".wp-color-result");t.options.color=t._getColor(),o.stripAlpha.css({background:"linear-gradient(to bottom, "+a.join(", ")+"), url("+i+")"}),n&&o.stripAlphaSlider.slider("value",r),t._color.error||t.element.removeClass("iris-error").val(t.options.color),t.picker.find(".iris-palette-container").on("click.palette",".iris-palette",(function(){var n=e(this).data("color");t.alphaOptions.alphaReset&&(t._color._alpha=1,n=t._getColor()),t._setOption("color",n)}))}},_paintDimension:function(e,t){var n=this,o=!1;n.alphaOptions.alphaEnabled&&"strip"===t&&(o=n._color,n._color=new Color(o.toString()),n.hue=n._color.h()),n._super(e,t),o&&(n._color=o)},_setOption:function(e,t){var n=this;if("color"!==e||!n.alphaOptions.alphaEnabled)return n._super(e,t);t=""+t,newColor=new Color(t).setHSpace(n.options.mode),newColor.error||n._getColor(newColor)===n._getColor()||(n._color=newColor,n.options.color=n._getColor(),n.active="external",n._change())},color:function(e){return!0===e?this._color.clone():e===t?this._getColor():void this.option("color",e)}}),e.widget("wp.wpColorPicker",e.wp.wpColorPicker,{alphaOptions:{alphaEnabled:!1},_getAlphaOptions:function(){var t=this.element,n=t.data("type")||this.options.type,o=t.data("defaultColor")||t.val(),i={alphaEnabled:t.data("alphaEnabled")||!1,alphaCustomWidth:130,alphaReset:!1,alphaColorType:"rgb",alphaColorWithSpace:!1};return i.alphaEnabled&&(i.alphaEnabled=t.is("input")&&"full"===n),i.alphaEnabled?(i.alphaColorWithSpace=o&&o.match(/\s/),e.each(i,(function(e,n){var r=t.data(e)||n;switch(e){case"alphaCustomWidth":r=r?parseInt(r,10):0,r=isNaN(r)?n:r;break;case"alphaColorType":r.match(/^(hex|(rgb|hsl)a?)$/)||(r=o&&o.match(/^#/)?"hex":o&&o.match(/^hsla?/)?"hsl":n);break;default:r=!!r}i[e]=r})),i):i},_create:function(){e.support.iris&&(this.alphaOptions=this._getAlphaOptions(),this._super())},_addListeners:function(){if(!this.alphaOptions.alphaEnabled)return this._super();var t=this,n=t.element,o=t.toggler.is("a");this.alphaOptions.defaultWidth=n.width(),this.alphaOptions.alphaCustomWidth&&n.width(parseInt(this.alphaOptions.defaultWidth+this.alphaOptions.alphaCustomWidth,10)),t.toggler.css({position:"relative","background-image":"url("+i+")"}),o?t.toggler.html('<span class="color-alpha" />'):t.toggler.append('<span class="color-alpha" />'),t.colorAlpha=t.toggler.find("span.color-alpha").css({width:"30px",height:"100%",position:"absolute",top:0,"background-color":n.val()}),"ltr"===t.colorAlpha.css("direction")?t.colorAlpha.css({"border-bottom-left-radius":"2px","border-top-left-radius":"2px",left:0}):t.colorAlpha.css({"border-bottom-right-radius":"2px","border-top-right-radius":"2px",right:0}),n.iris({change:function(n,o){t.colorAlpha.css({"background-color":o.color.to_s(t.alphaOptions.alphaColorType)}),e.isFunction(t.options.change)&&t.options.change.call(this,n,o)}}),t.wrap.on("click.wpcolorpicker",(function(e){e.stopPropagation()})),t.toggler.click((function(){t.toggler.hasClass("wp-picker-open")?t.close():t.open()})),n.change((function(i){var r=e(this).val();(n.hasClass("iris-error")||""===r||r.match(/^(#|(rgb|hsl)a?)$/))&&(o&&t.toggler.removeAttr("style"),t.colorAlpha.css("background-color",""),e.isFunction(t.options.clear)&&t.options.clear.call(this,i))})),t.button.click((function(i){e(this).hasClass("wp-picker-default")?n.val(t.options.defaultColor).change():e(this).hasClass("wp-picker-clear")&&(n.val(""),o&&t.toggler.removeAttr("style"),t.colorAlpha.css("background-color",""),e.isFunction(t.options.clear)&&t.options.clear.call(this,i),n.trigger("change"))}))}})}}(jQuery)},311:e=>{"use strict";e.exports=jQuery}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var r=t[o]={exports:{}};return e[o](r,r.exports,n),r.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";var e=n(311),t=n.n(e);class o{static on(e,t){document.addEventListener(e,(e=>t(e.detail)))}static dispatch(e,t){document.dispatchEvent(new CustomEvent(e,{detail:t}))}static changeSlideType(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o.dispatch("change.CarouselSlider.SlideType",e)}static onChangeSlideType(e){o.on("change.CarouselSlider.SlideType",(t=>e(t)))}}const i=o;function r(e,t){void 0===t&&(t=!1);var n=e.getBoundingClientRect();return{width:n.width/1,height:n.height/1,top:n.top/1,right:n.right/1,bottom:n.bottom/1,left:n.left/1,x:n.left/1,y:n.top/1}}function s(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function a(e){var t=s(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function l(e){return e instanceof s(e).Element||e instanceof Element}function c(e){return e instanceof s(e).HTMLElement||e instanceof HTMLElement}function u(e){return"undefined"!=typeof ShadowRoot&&(e instanceof s(e).ShadowRoot||e instanceof ShadowRoot)}function d(e){return e?(e.nodeName||"").toLowerCase():null}function p(e){return((l(e)?e.ownerDocument:e.document)||window.document).documentElement}function h(e){return r(p(e)).left+a(e).scrollLeft}function f(e){return s(e).getComputedStyle(e)}function g(e){var t=f(e),n=t.overflow,o=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+o)}function m(e,t,n){void 0===n&&(n=!1);var o,i,l=c(t),u=c(t)&&function(e){var t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,o=t.height/e.offsetHeight||1;return 1!==n||1!==o}(t),f=p(t),m=r(e,u),v={scrollLeft:0,scrollTop:0},y={x:0,y:0};return(l||!l&&!n)&&(("body"!==d(t)||g(f))&&(v=(o=t)!==s(o)&&c(o)?{scrollLeft:(i=o).scrollLeft,scrollTop:i.scrollTop}:a(o)),c(t)?((y=r(t,!0)).x+=t.clientLeft,y.y+=t.clientTop):f&&(y.x=h(f))),{x:m.left+v.scrollLeft-y.x,y:m.top+v.scrollTop-y.y,width:m.width,height:m.height}}function v(e){var t=r(e),n=e.offsetWidth,o=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-o)<=1&&(o=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:o}}function y(e){return"html"===d(e)?e:e.assignedSlot||e.parentNode||(u(e)?e.host:null)||p(e)}function _(e){return["html","body","#document"].indexOf(d(e))>=0?e.ownerDocument.body:c(e)&&g(e)?e:_(y(e))}function b(e,t){var n;void 0===t&&(t=[]);var o=_(e),i=o===(null==(n=e.ownerDocument)?void 0:n.body),r=s(o),a=i?[r].concat(r.visualViewport||[],g(o)?o:[]):o,l=t.concat(a);return i?l:l.concat(b(y(a)))}function w(e){return["table","td","th"].indexOf(d(e))>=0}function x(e){return c(e)&&"fixed"!==f(e).position?e.offsetParent:null}function A(e){for(var t=s(e),n=x(e);n&&w(n)&&"static"===f(n).position;)n=x(n);return n&&("html"===d(n)||"body"===d(n)&&"static"===f(n).position)?t:n||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&c(e)&&"fixed"===f(e).position)return null;for(var n=y(e);c(n)&&["html","body"].indexOf(d(n))<0;){var o=f(n);if("none"!==o.transform||"none"!==o.perspective||"paint"===o.contain||-1!==["transform","perspective"].indexOf(o.willChange)||t&&"filter"===o.willChange||t&&o.filter&&"none"!==o.filter)return n;n=n.parentNode}return null}(e)||t}var $="top",O="bottom",C="right",E="left",D="auto",S=[$,O,C,E],k="start",T="end",j="viewport",L="popper",P=S.reduce((function(e,t){return e.concat([t+"-"+k,t+"-"+T])}),[]),q=[].concat(S,[D]).reduce((function(e,t){return e.concat([t,t+"-"+k,t+"-"+T])}),[]),I=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function M(e){var t=new Map,n=new Set,o=[];function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var o=t.get(e);o&&i(o)}})),o.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||i(e)})),o}var R={placement:"bottom",modifiers:[],strategy:"absolute"};function H(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function U(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,o=void 0===n?[]:n,i=t.defaultOptions,r=void 0===i?R:i;return function(e,t,n){void 0===n&&(n=r);var i,s,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},R,r),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},c=[],u=!1,d={state:a,setOptions:function(n){var i="function"==typeof n?n(a.options):n;p(),a.options=Object.assign({},r,a.options,i),a.scrollParents={reference:l(e)?b(e):e.contextElement?b(e.contextElement):[],popper:b(t)};var s=function(e){var t=M(e);return I.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}(function(e){var t=e.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{});return Object.keys(t).map((function(e){return t[e]}))}([].concat(o,a.options.modifiers)));return a.orderedModifiers=s.filter((function(e){return e.enabled})),a.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,o=void 0===n?{}:n,i=e.effect;if("function"==typeof i){var r=i({state:a,name:t,instance:d,options:o}),s=function(){};c.push(r||s)}})),d.update()},forceUpdate:function(){if(!u){var e=a.elements,t=e.reference,n=e.popper;if(H(t,n)){a.rects={reference:m(t,A(n),"fixed"===a.options.strategy),popper:v(n)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach((function(e){return a.modifiersData[e.name]=Object.assign({},e.data)}));for(var o=0;o<a.orderedModifiers.length;o++)if(!0!==a.reset){var i=a.orderedModifiers[o],r=i.fn,s=i.options,l=void 0===s?{}:s,c=i.name;"function"==typeof r&&(a=r({state:a,options:l,name:c,instance:d})||a)}else a.reset=!1,o=-1}}},update:(i=function(){return new Promise((function(e){d.forceUpdate(),e(a)}))},function(){return s||(s=new Promise((function(e){Promise.resolve().then((function(){s=void 0,e(i())}))}))),s}),destroy:function(){p(),u=!0}};if(!H(e,t))return d;function p(){c.forEach((function(e){return e()})),c=[]}return d.setOptions(n).then((function(e){!u&&n.onFirstUpdate&&n.onFirstUpdate(e)})),d}}var B={passive:!0};const z={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,o=e.options,i=o.scroll,r=void 0===i||i,a=o.resize,l=void 0===a||a,c=s(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return r&&u.forEach((function(e){e.addEventListener("scroll",n.update,B)})),l&&c.addEventListener("resize",n.update,B),function(){r&&u.forEach((function(e){e.removeEventListener("scroll",n.update,B)})),l&&c.removeEventListener("resize",n.update,B)}},data:{}};function N(e){return e.split("-")[0]}function W(e){return e.split("-")[1]}function G(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function F(e){var t,n=e.reference,o=e.element,i=e.placement,r=i?N(i):null,s=i?W(i):null,a=n.x+n.width/2-o.width/2,l=n.y+n.height/2-o.height/2;switch(r){case $:t={x:a,y:n.y-o.height};break;case O:t={x:a,y:n.y+n.height};break;case C:t={x:n.x+n.width,y:l};break;case E:t={x:n.x-o.width,y:l};break;default:t={x:n.x,y:n.y}}var c=r?G(r):null;if(null!=c){var u="y"===c?"height":"width";switch(s){case k:t[c]=t[c]-(n[u]/2-o[u]/2);break;case T:t[c]=t[c]+(n[u]/2-o[u]/2)}}return t}const Y={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=F({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}};var K=Math.max,Z=Math.min,V=Math.round,J={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Q(e){var t,n=e.popper,o=e.popperRect,i=e.placement,r=e.variation,a=e.offsets,l=e.position,c=e.gpuAcceleration,u=e.adaptive,d=e.roundOffsets,h=!0===d?function(e){var t=e.x,n=e.y,o=window.devicePixelRatio||1;return{x:V(V(t*o)/o)||0,y:V(V(n*o)/o)||0}}(a):"function"==typeof d?d(a):a,g=h.x,m=void 0===g?0:g,v=h.y,y=void 0===v?0:v,_=a.hasOwnProperty("x"),b=a.hasOwnProperty("y"),w=E,x=$,D=window;if(u){var S=A(n),k="clientHeight",j="clientWidth";S===s(n)&&"static"!==f(S=p(n)).position&&"absolute"===l&&(k="scrollHeight",j="scrollWidth"),S=S,i!==$&&(i!==E&&i!==C||r!==T)||(x=O,y-=S[k]-o.height,y*=c?1:-1),i!==E&&(i!==$&&i!==O||r!==T)||(w=C,m-=S[j]-o.width,m*=c?1:-1)}var L,P=Object.assign({position:l},u&&J);return c?Object.assign({},P,((L={})[x]=b?"0":"",L[w]=_?"0":"",L.transform=(D.devicePixelRatio||1)<=1?"translate("+m+"px, "+y+"px)":"translate3d("+m+"px, "+y+"px, 0)",L)):Object.assign({},P,((t={})[x]=b?y+"px":"",t[w]=_?m+"px":"",t.transform="",t))}const X={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,o=e.name,i=n.offset,r=void 0===i?[0,0]:i,s=q.reduce((function(e,n){return e[n]=function(e,t,n){var o=N(e),i=[E,$].indexOf(o)>=0?-1:1,r="function"==typeof n?n(Object.assign({},t,{placement:e})):n,s=r[0],a=r[1];return s=s||0,a=(a||0)*i,[E,C].indexOf(o)>=0?{x:a,y:s}:{x:s,y:a}}(n,t.rects,r),e}),{}),a=s[t.placement],l=a.x,c=a.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[o]=s}};var ee={left:"right",right:"left",bottom:"top",top:"bottom"};function te(e){return e.replace(/left|right|bottom|top/g,(function(e){return ee[e]}))}var ne={start:"end",end:"start"};function oe(e){return e.replace(/start|end/g,(function(e){return ne[e]}))}function ie(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&u(n)){var o=t;do{if(o&&e.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function re(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function se(e,t){return t===j?re(function(e){var t=s(e),n=p(e),o=t.visualViewport,i=n.clientWidth,r=n.clientHeight,a=0,l=0;return o&&(i=o.width,r=o.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=o.offsetLeft,l=o.offsetTop)),{width:i,height:r,x:a+h(e),y:l}}(e)):c(t)?function(e){var t=r(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):re(function(e){var t,n=p(e),o=a(e),i=null==(t=e.ownerDocument)?void 0:t.body,r=K(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=K(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),l=-o.scrollLeft+h(e),c=-o.scrollTop;return"rtl"===f(i||n).direction&&(l+=K(n.clientWidth,i?i.clientWidth:0)-r),{width:r,height:s,x:l,y:c}}(p(e)))}function ae(e,t,n){var o="clippingParents"===t?function(e){var t=b(y(e)),n=["absolute","fixed"].indexOf(f(e).position)>=0&&c(e)?A(e):e;return l(n)?t.filter((function(e){return l(e)&&ie(e,n)&&"body"!==d(e)})):[]}(e):[].concat(t),i=[].concat(o,[n]),r=i[0],s=i.reduce((function(t,n){var o=se(e,n);return t.top=K(o.top,t.top),t.right=Z(o.right,t.right),t.bottom=Z(o.bottom,t.bottom),t.left=K(o.left,t.left),t}),se(e,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function le(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function ce(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function ue(e,t){void 0===t&&(t={});var n=t,o=n.placement,i=void 0===o?e.placement:o,s=n.boundary,a=void 0===s?"clippingParents":s,c=n.rootBoundary,u=void 0===c?j:c,d=n.elementContext,h=void 0===d?L:d,f=n.altBoundary,g=void 0!==f&&f,m=n.padding,v=void 0===m?0:m,y=le("number"!=typeof v?v:ce(v,S)),_=h===L?"reference":L,b=e.rects.popper,w=e.elements[g?_:h],x=ae(l(w)?w:w.contextElement||p(e.elements.popper),a,u),A=r(e.elements.reference),E=F({reference:A,element:b,strategy:"absolute",placement:i}),D=re(Object.assign({},b,E)),k=h===L?D:A,T={top:x.top-k.top+y.top,bottom:k.bottom-x.bottom+y.bottom,left:x.left-k.left+y.left,right:k.right-x.right+y.right},P=e.modifiersData.offset;if(h===L&&P){var q=P[i];Object.keys(T).forEach((function(e){var t=[C,O].indexOf(e)>=0?1:-1,n=[$,O].indexOf(e)>=0?"y":"x";T[e]+=q[n]*t}))}return T}function de(e,t,n){return K(e,Z(t,n))}const pe={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,o=e.name,i=n.mainAxis,r=void 0===i||i,s=n.altAxis,a=void 0!==s&&s,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,d=n.padding,p=n.tether,h=void 0===p||p,f=n.tetherOffset,g=void 0===f?0:f,m=ue(t,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),y=N(t.placement),_=W(t.placement),b=!_,w=G(y),x="x"===w?"y":"x",D=t.modifiersData.popperOffsets,S=t.rects.reference,T=t.rects.popper,j="function"==typeof g?g(Object.assign({},t.rects,{placement:t.placement})):g,L={x:0,y:0};if(D){if(r||a){var P="y"===w?$:E,q="y"===w?O:C,I="y"===w?"height":"width",M=D[w],R=D[w]+m[P],H=D[w]-m[q],U=h?-T[I]/2:0,B=_===k?S[I]:T[I],z=_===k?-T[I]:-S[I],F=t.elements.arrow,Y=h&&F?v(F):{width:0,height:0},V=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},J=V[P],Q=V[q],X=de(0,S[I],Y[I]),ee=b?S[I]/2-U-X-J-j:B-X-J-j,te=b?-S[I]/2+U+X+Q+j:z+X+Q+j,ne=t.elements.arrow&&A(t.elements.arrow),oe=ne?"y"===w?ne.clientTop||0:ne.clientLeft||0:0,ie=t.modifiersData.offset?t.modifiersData.offset[t.placement][w]:0,re=D[w]+ee-ie-oe,se=D[w]+te-ie;if(r){var ae=de(h?Z(R,re):R,M,h?K(H,se):H);D[w]=ae,L[w]=ae-M}if(a){var le="x"===w?$:E,ce="x"===w?O:C,pe=D[x],he=pe+m[le],fe=pe-m[ce],ge=de(h?Z(he,re):he,pe,h?K(fe,se):fe);D[x]=ge,L[x]=ge-pe}}t.modifiersData[o]=L}},requiresIfExists:["offset"]};const he={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,o=e.name,i=e.options,r=n.elements.arrow,s=n.modifiersData.popperOffsets,a=N(n.placement),l=G(a),c=[E,C].indexOf(a)>=0?"height":"width";if(r&&s){var u=function(e,t){return le("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:ce(e,S))}(i.padding,n),d=v(r),p="y"===l?$:E,h="y"===l?O:C,f=n.rects.reference[c]+n.rects.reference[l]-s[l]-n.rects.popper[c],g=s[l]-n.rects.reference[l],m=A(r),y=m?"y"===l?m.clientHeight||0:m.clientWidth||0:0,_=f/2-g/2,b=u[p],w=y-d[c]-u[h],x=y/2-d[c]/2+_,D=de(b,x,w),k=l;n.modifiersData[o]=((t={})[k]=D,t.centerOffset=D-x,t)}},effect:function(e){var t=e.state,n=e.options.element,o=void 0===n?"[data-popper-arrow]":n;null!=o&&("string"!=typeof o||(o=t.elements.popper.querySelector(o)))&&ie(t.elements.popper,o)&&(t.elements.arrow=o)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function fe(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function ge(e){return[$,C,O,E].some((function(t){return e[t]>=0}))}var me=U({defaultModifiers:[z,Y,{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,o=n.gpuAcceleration,i=void 0===o||o,r=n.adaptive,s=void 0===r||r,a=n.roundOffsets,l=void 0===a||a,c={placement:N(t.placement),variation:W(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,Q(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,Q(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},{name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},o=t.attributes[e]||{},i=t.elements[e];c(i)&&d(i)&&(Object.assign(i.style,n),Object.keys(o).forEach((function(e){var t=o[e];!1===t?i.removeAttribute(e):i.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var o=t.elements[e],i=t.attributes[e]||{},r=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});c(o)&&d(o)&&(Object.assign(o.style,r),Object.keys(i).forEach((function(e){o.removeAttribute(e)})))}))}},requires:["computeStyles"]},X,{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,o=e.name;if(!t.modifiersData[o]._skip){for(var i=n.mainAxis,r=void 0===i||i,s=n.altAxis,a=void 0===s||s,l=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,p=n.altBoundary,h=n.flipVariations,f=void 0===h||h,g=n.allowedAutoPlacements,m=t.options.placement,v=N(m),y=l||(v===m||!f?[te(m)]:function(e){if(N(e)===D)return[];var t=te(e);return[oe(e),t,oe(t)]}(m)),_=[m].concat(y).reduce((function(e,n){return e.concat(N(n)===D?function(e,t){void 0===t&&(t={});var n=t,o=n.placement,i=n.boundary,r=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=void 0===l?q:l,u=W(o),d=u?a?P:P.filter((function(e){return W(e)===u})):S,p=d.filter((function(e){return c.indexOf(e)>=0}));0===p.length&&(p=d);var h=p.reduce((function(t,n){return t[n]=ue(e,{placement:n,boundary:i,rootBoundary:r,padding:s})[N(n)],t}),{});return Object.keys(h).sort((function(e,t){return h[e]-h[t]}))}(t,{placement:n,boundary:u,rootBoundary:d,padding:c,flipVariations:f,allowedAutoPlacements:g}):n)}),[]),b=t.rects.reference,w=t.rects.popper,x=new Map,A=!0,T=_[0],j=0;j<_.length;j++){var L=_[j],I=N(L),M=W(L)===k,R=[$,O].indexOf(I)>=0,H=R?"width":"height",U=ue(t,{placement:L,boundary:u,rootBoundary:d,altBoundary:p,padding:c}),B=R?M?C:E:M?O:$;b[H]>w[H]&&(B=te(B));var z=te(B),G=[];if(r&&G.push(U[I]<=0),a&&G.push(U[B]<=0,U[z]<=0),G.every((function(e){return e}))){T=L,A=!1;break}x.set(L,G)}if(A)for(var F=function(e){var t=_.find((function(t){var n=x.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return T=t,"break"},Y=f?3:1;Y>0;Y--){if("break"===F(Y))break}t.placement!==T&&(t.modifiersData[o]._skip=!0,t.placement=T,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},pe,he,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,o=t.rects.reference,i=t.rects.popper,r=t.modifiersData.preventOverflow,s=ue(t,{elementContext:"reference"}),a=ue(t,{altBoundary:!0}),l=fe(s,o),c=fe(a,i,r),u=ge(l),d=ge(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}}]});function ve(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function ye(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ve(Object(n),!0).forEach((function(t){_e(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ve(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class be{static register(){let e=document.querySelectorAll(".cs-tooltip, [data-tooltip-target], [data-tooltip]");e.length&&e.forEach((e=>new be(e)))}constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.uuid=this.createUUID(),this.forElement=this.updateTooltipTargetElement(e),this.element=null,this.options=Object.assign({theme:"dark",html:!0,container:"body",mainClass:"shapla-tooltip",activeClass:"is-active",removeOnClose:!0},t),this.popperInstance=null,this.init()}init(){["mouseenter","focus"].forEach((e=>{this.forElement.addEventListener(e,(()=>this.show()))})),["mouseleave","blur"].forEach((e=>{this.forElement.addEventListener(e,(()=>this.hide()))}))}show(){this.createTooltipElementIfNotExists(),this.element.classList.add(this.options.activeClass),this.popperInstance=me(this.forElement,this.element,{modifiers:[{name:"offset",options:{offset:[0,8]}}]}),this.popperInstance.setOptions((e=>ye(ye({},e),{},{modifiers:[...e.modifiers,{name:"eventListeners",enabled:!0}]}))),this.popperInstance.update()}hide(){this.element.classList.remove(this.options.activeClass),this.popperInstance&&this.popperInstance.setOptions((e=>ye(ye({},e),{},{modifiers:[...e.modifiers,{name:"eventListeners",enabled:!1}]}))),this.options.removeOnClose&&setTimeout((()=>this.element.remove()),10)}createTooltipElementIfNotExists(){if(this.element=document.querySelector(`[data-tooltip-for="${this.uuid}"]`),!this.element){let e=this.forElement.getAttribute("data-tooltip")||this.forElement.getAttribute("title");this.element=this.createTooltipElement(e)}}createTooltipElement(e){let t=document.createElement("div");t.setAttribute("data-popper-arrow",""),t.classList.add(this.options.mainClass+"__arrow");let n=document.createElement("div");n.classList.add(this.options.mainClass+"__inner"),this.options.html?n.innerHTML=e:n.innerText=e;let o=document.createElement("div");return o.classList.add(this.options.mainClass),o.classList.add(`is-theme-${this.options.theme}`),o.setAttribute("data-tooltip-for",this.uuid),o.setAttribute("data-remove-on-close",""),o.setAttribute("role","tooltip"),o.appendChild(t),o.appendChild(n),document.querySelector(this.options.container).appendChild(o),o}updateTooltipTargetElement(e){let t=e.getAttribute("data-tooltip")||e.getAttribute("title");return e.setAttribute("aria-describedby","tooltip"),e.setAttribute("data-tooltip-target",this.uuid),e.setAttribute("data-tooltip",t),e.hasAttribute("title")&&e.removeAttribute("title"),e}createUUID(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}}const we=be;n(456),n(462);let xe=t()("#section_content_carousel");i.onChangeSlideType((e=>{"hero-banner-slider"===e?xe.slideDown():xe.hide("fast")}));let Ae,$e,Oe,Ce,Ee,De,Se=t()("body"),ke=t()("#contentButtonModal");Se.on("click",".carousel-slider__add-slide",(function(e){e.preventDefault(),t().ajax({url:ajaxurl,method:"POST",data:{action:"add_content_slide",task:"add-slide",post_id:t()(this).data("post-id")},success:function(){window.location.reload(!0)}})})),Se.on("click",".carousel_slider__delete_slide",(function(e){e.preventDefault(),t().ajax({url:ajaxurl,method:"POST",data:{action:"add_content_slide",task:"delete-slide",post_id:t()(this).data("post-id"),slide_pos:t()(this).data("slide-pos")},success:function(){window.location.reload(!0)}})})),Se.on("click",".carousel_slider__move_top",(function(e){e.preventDefault(),t().ajax({url:ajaxurl,method:"POST",data:{action:"add_content_slide",task:"move-slide-top",post_id:t()(this).data("post-id"),slide_pos:t()(this).data("slide-pos")},success:function(){window.location.reload(!0)}})})),Se.on("click",".carousel_slider__move_up",(function(e){e.preventDefault(),t().ajax({url:ajaxurl,method:"POST",data:{action:"add_content_slide",task:"move-slide-up",post_id:t()(this).data("post-id"),slide_pos:t()(this).data("slide-pos")},success:function(){window.location.reload(!0)}})})),Se.on("click",".carousel_slider__move_down",(function(e){e.preventDefault(),t().ajax({url:ajaxurl,method:"POST",data:{action:"add_content_slide",task:"move-slide-down",post_id:t()(this).data("post-id"),slide_pos:t()(this).data("slide-pos")},success:function(){window.location.reload(!0)}})})),Se.on("click",".carousel_slider__move_bottom",(function(e){e.preventDefault(),t().ajax({url:ajaxurl,method:"POST",data:{action:"add_content_slide",task:"move-slide-bottom",post_id:t()(this).data("post-id"),slide_pos:t()(this).data("slide-pos")},success:function(){window.location.reload(!0)}})})),Se.on("click",".slide_image_add",(function(e){e.preventDefault();var n=t()(this);$e=n.closest(".slide_bg_wrapper"),Ce=$e.find(".content_slide_canvas"),Oe=$e.find(".background_image_id"),Ee=$e.find(".delete-bg-img"),Ae||(Ae=wp.media({title:n.data("title"),button:{text:n.data("button-text")},multiple:!1}),Ae.on("select",(function(){var e=Ae.state().get("selection").first().toJSON();Ce.css("background-image","url("+e.url+")"),Oe.val(e.id),Ee.removeClass("hidden")}))),Ae.open()})),Se.on("click",".delete-bg-img",(function(e){e.preventDefault(),$e=t()(this).closest(".slide_bg_wrapper"),Ce=$e.find(".content_slide_canvas"),Oe=$e.find(".background_image_id"),Ee=$e.find(".delete-bg-img"),Ce.css("background-image",""),Oe.val("0"),Ee.addClass("hidden")})),Se.on("change",".background_image_position",(function(){var e=t()(this).val();$e=t()(this).closest(".slide_bg_wrapper"),Ce=$e.find(".content_slide_canvas"),Ce.css("background-position",e)})),Se.on("change",".background_image_size",(function(){var e=t()(this).val();$e=t()(this).closest(".slide_bg_wrapper"),Ce=$e.find(".content_slide_canvas"),Ce.css("background-size",e)})),t()(".addContentButton").on("click",(function(e){e.preventDefault(),De=t()(this).closest(".button_config");var n=De.find(".button_text").val(),o=De.find(".button_url").val(),i=De.find(".button_target").val(),r=De.find(".button_type").val(),s=De.find(".button_size").val(),a=De.find(".button_color").val();ke.find("#_button_text").val(n),ke.find("#_button_url").val(o),ke.find("#_button_target").val(i),ke.find("#_button_type").val(r),ke.find("#_button_size").val(s),ke.find("#_button_color").val(a),ke.addClass("is-active")})),t()("#saveContentButton").on("click",(function(e){if(e.preventDefault(),!De)return ke.removeClass("is-active"),!1;var t=ke.find("#_button_text").val(),n=ke.find("#_button_url").val(),o=ke.find("#_button_target").val(),i=ke.find("#_button_type").val(),r=ke.find("#_button_size").val(),s=ke.find("#_button_color").val();De.find(".button_text").val(t),De.find(".button_url").val(n),De.find(".button_target").val(o),De.find(".button_type").val(i),De.find(".button_size").val(r),De.find(".button_color").val(s),ke.removeClass("is-active")})),t()(".slide-color-picker").each((function(){$e=t()(this).closest(".slide_bg_wrapper"),Ce=$e.find(".content_slide_canvas"),t()(this).wpColorPicker({change:function(e,t){Ce.css("background-color",t.color.toString())}})})),t()(document).on("change",".link_type",(function(e){var n=t()(this),o=n.val(),i=n.closest(".tab-content-link"),r=i.find(".ContentCarouselLinkFull"),s=i.find(".ContentCarouselLinkButtons");"full"===o?(s.hide(),r.show()):"button"===o?(r.hide(),s.show()):(r.hide(),s.hide())}));let Te,je=t()("#carousel_slider_gallery_btn"),Le=t()("#section_images_settings"),Pe=t()("#section_url_images_settings"),qe=t()("#section_images_general_settings"),Ie=He(je.data("ids"));i.onChangeSlideType((e=>{"image-carousel"===e?(Pe.hide("fast"),Le.slideDown(),qe.slideDown()):"image-carousel-url"===e?(Le.hide("fast"),Pe.slideDown(),qe.slideDown()):(Le.hide("fast"),Pe.hide("fast"),qe.hide("fast"))}));const Me=(e,n)=>{t()("#_carousel_slider_images_ids").val(e),t()(".carousel_slider_gallery_list").html(n)};je.on("click",(function(e){e.preventDefault();let t={title:je.data("create"),state:"gallery-edit",frame:"post",selection:Ie};(Te||Ie)&&(t.title=je.data("edit")),Te=wp.media(t).open(),Te.menu.get("view").unset("cancel"),Te.menu.get("view").unset("separateCancel"),Te.menu.get("view").get("gallery-edit").el.innerHTML=je.data("edit"),Te.content.get("view").sidebar.unset("gallery"),Re(),Te.on("toolbar:render:gallery-edit",(function(){Re()})),Te.on("content:render:browse",(function(e){e&&(e.sidebar.on("ready",(function(){e.sidebar.unset("gallery")})),e.toolbar.on("ready",(function(){"gallery-library"===e.toolbar.controller._state&&e.toolbar.$el.hide()})))})),Te.state().get("library").on("remove",(function(){0===Te.state().get("library").length&&(Ie=!1,Me("",""))}))}));function Re(){Te.toolbar.get("view").set({insert:{style:"primary",text:je.data("save"),click:()=>(()=>{let e=Te.state().get("library"),t=[],n="";e.each((function(e){t.push(e.id);let o=e.attributes.sizes.thumbnail||e.attributes.sizes.full;n+=`<li><img src="${o.url}" width="50" height="50" class="attachment-50x50 size-50x50" loading="lazy"></li>`})),Ie=He(t.toString()),Te.close(),Me(t.toString(),n)})()}})}function He(e){if(!e)return!1;let t=new wp.shortcode({tag:"gallery",attrs:{ids:e},type:"single"}),n=wp.media.gallery.attachments(t),o=new wp.media.model.Selection(n.models,{props:n.props.toJSON(),multiple:!0});return o.gallery=n.gallery,o.more().done((function(){o.props.set({query:!1}),o.unmirror(),o.props.unset("orderby")})),o}const Ue=window.CarouselSliderAdminL10n,Be=t()("#CarouselSliderModal");let ze=`<div class="media-url--column shapla-column is-12">\n<div class="carousel_slider-fields media-url-form-field">\n\t<div class="media-url-form-field__content">\n\t\t<label class="setting media-url-form-field__item">\n\t\t\t<span class="name">${Ue.url}</span>\n\t\t\t<input type="url" name="_images_urls[url][]" value="" autocomplete="off">\n\t\t</label>\n\t\t<label class="setting media-url-form-field__item">\n\t\t\t<span class="name">${Ue.title}</span>\n\t\t\t<input type="text" name="_images_urls[title][]" value="" autocomplete="off">\n\t\t</label>\n\t\t<label class="setting media-url-form-field__item">\n\t\t\t<span class="name">${Ue.caption}</span>\n\t\t\t<textarea name="_images_urls[caption][]"></textarea>\n\t\t</label>\n\t\t<label class="setting media-url-form-field__item">\n\t\t\t<span class="name">${Ue.altText}</span>\n\t\t\t<input type="text" name="_images_urls[alt][]" value="" autocomplete="off">\n\t\t</label>\n\t\t<label class="setting media-url-form-field__item">\n\t\t\t<span class="name">${Ue.linkToUrl}</span>\n\t\t\t<input type="text" name="_images_urls[link_url][]" value="" autocomplete="off">\n\t\t</label>\n\t</div>\n\t<div class="media-url-form-field__actions">\n\t\t<span class="move_row"><span class="dashicons dashicons-move"></span></span>\n\t\t<span class="add_row"><span class="dashicons dashicons-plus-alt"></span></span>\n\t\t<span class="delete_row"><span class="dashicons dashicons-trash"></span></span>\n\t</div>\n</div>\n</div>`;t()(document).on("click","#_images_urls_btn",(e=>{e.preventDefault(),t()(document).find(".shapla-modal").addClass("is-active"),t()("body").addClass("overflowHidden")})),t()(document).on("click",'[data-dismiss="shapla-modal"]',(e=>{e.preventDefault(),t()(e.target).closest(".shapla-modal").removeClass("is-active"),t()("body").removeClass("overflowHidden")})),t()(document).on("click",".add_row",(function(e){e.preventDefault();let n=t()(this).closest(".media-url--column");if(n.length)n.after(ze);else{let e=Be.find(".media-url--column");e.length?e.last().after(ze):Be.find("#carousel_slider_form").prepend(ze)}})),t()(document).on("click",".delete_row",(function(){confirm("Are you sure to delete")&&t()(this).closest(".media-url--column").remove()})),t()("#carousel_slider_form").sortable();let Ne=t()("#section_post_query");const We=()=>{let e=t()("#_post_query_type").val(),n=t()("#field-_post_date_after"),o=t()("#field-_post_date_before"),i=t()("#field-_post_categories"),r=t()("#field-_post_tags"),s=t()("#field-_post_in"),a=t()("#field-_posts_per_page");n.hide("fast"),o.hide("fast"),i.hide("fast"),r.hide("fast"),s.hide("fast"),a.show("fast"),"date_range"===e&&(n.slideDown(),o.slideDown()),"post_categories"===e&&i.slideDown(),"post_tags"===e&&r.slideDown(),"specific_posts"===e&&(s.slideDown(),a.hide("fast"))};i.onChangeSlideType((e=>{"post-carousel"===e?Ne.slideDown():Ne.hide("fast")})),t()("#_post_query_type").on("change",(()=>We())),t()(document).ready((()=>We()));let Ge=t()("#section_product_query");i.onChangeSlideType((e=>{"product-carousel"===e?Ge.slideDown():Ge.hide("fast")}));const Fe=()=>{let e=t()("#_product_query_type").val(),n=t()("#field-_product_query"),o=t()("#field-_product_categories"),i=t()("#field-_product_tags"),r=t()("#field-_product_in"),s=t()("#field-_products_per_page");n.hide("fast"),o.hide("fast"),i.hide("fast"),r.hide("fast"),s.show("fast"),"query_product"===e&&n.slideDown(),"product_categories"===e&&o.slideDown(),"product_tags"===e&&i.slideDown(),"specific_products"===e&&(r.slideDown(),s.hide("fast"))};t()("#_product_query_type").on("change",(()=>Fe())),t()(document).ready((()=>Fe()));let Ye=t()("#section_video_settings");i.onChangeSlideType((e=>{"video-carousel"===e?Ye.slideDown():Ye.hide("fast")}));let Ke=t()("#_carousel_slider_slide_type");Ke.on("change",(()=>i.changeSlideType(Ke.val())));let Ze=document.querySelectorAll(".cs-tooltip");Ze.length&&Ze.forEach((e=>new we(e))),t()(".color-picker").each((function(){t()(this).wpColorPicker()})),t()("select.select2").each((function(){t()(this).select2()})),t()(".shapla-toggle").each((function(){"closed"===t()(this).attr("data-id")?t()(this).accordion({collapsible:!0,heightStyle:"content",active:!1}):t()(this).accordion({collapsible:!0,heightStyle:"content"})})),t()(".shapla-tabs").tabs({hide:{effect:"fadeOut",duration:200},show:{effect:"fadeIn",duration:200}})})()})();
|
assets/js/admin.js.LICENSE.txt
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
* Select2 4.0.13
|
3 |
+
* https://select2.github.io
|
4 |
+
*
|
5 |
+
* Released under the MIT license
|
6 |
+
* https://github.com/select2/select2/blob/master/LICENSE.md
|
7 |
+
*/
|
8 |
+
|
9 |
+
/**!
|
10 |
+
* wp-color-picker-alpha
|
11 |
+
*
|
12 |
+
* Overwrite Automattic Iris for enabled Alpha Channel in wpColorPicker
|
13 |
+
* Only run in input and is defined data alpha in true
|
14 |
+
*
|
15 |
+
* Version: 3.0.0
|
16 |
+
* https://github.com/kallookoo/wp-color-picker-alpha
|
17 |
+
* Licensed under the GPLv2 license or later.
|
18 |
+
*/
|
assets/js/divi-modules.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(()=>{"use strict";var e={n:r=>{var a=r&&r.__esModule?()=>r.default:()=>r;return e.d(a,{a}),a},d:(r,a)=>{for(var i in a)e.o(a,i)&&!e.o(r,i)&&Object.defineProperty(r,i,{enumerable:!0,get:a[i]})},o:(e,r)=>Object.prototype.hasOwnProperty.call(e,r)};(()=>{const r=React;var a=e.n(r);const i=jQuery;var s,l,n,o=e.n(i);class t extends r.Component{render(){const e=this.props.slider_id;if(!e)return null;let r=new URL(window.csDivi.site_url);r.searchParams.append("carousel_slider_preview","1"),r.searchParams.append("carousel_slider_iframe","1"),r.searchParams.append("slider_id",e);let i=r.toString();return console.log(window.location.origin,window.csDivi.site_url,e,i),a().createElement("div",{className:"carousel-slider-iframe-container"},a().createElement("div",{className:"carousel-slider-iframe-overlay"}),a().createElement("iframe",{className:"carousel-slider-iframe",scrolling:"no",src:i,height:"0",width:"500"}))}}n="carousel_slider_divi_module",(l="slug")in(s=t)?Object.defineProperty(s,l,{value:n,enumerable:!0,configurable:!0,writable:!0}):s[l]=n;o()(window).on("et_builder_api_ready",((e,r)=>{r.registerModules([t])}))})()})();
|
assets/js/frontend.js
CHANGED
@@ -1 +1,2 @@
|
|
1 |
-
|
|
1 |
+
/*! For license information please see frontend.js.LICENSE.txt */
|
2 |
+
(()=>{var t={112:(t,e,i)=>{var s,n,o;n=[i(311)],s=function(t){var e,i,s,n,o,r,a="Close",l="BeforeClose",h="AfterClose",c="BeforeAppend",p="MarkupParse",d="Open",u="Change",g="mfp",m="."+g,f="mfp-ready",v="mfp-removing",_="mfp-prevent-close",y=function(){},w=!!window.jQuery,x=t(window),C=function(t,i){e.ev.on(g+t+m,i)},b=function(e,i,s,n){var o=document.createElement("div");return o.className="mfp-"+e,s&&(o.innerHTML=s),n?i&&i.appendChild(o):(o=t(o),i&&o.appendTo(i)),o},z=function(i,s){e.ev.triggerHandler(g+i,s),e.st.callbacks&&(i=i.charAt(0).toLowerCase()+i.slice(1),e.st.callbacks[i]&&e.st.callbacks[i].apply(e,t.isArray(s)?s:[s]))},T=function(i){return i===r&&e.currTemplate.closeBtn||(e.currTemplate.closeBtn=t(e.st.closeMarkup.replace("%title%",e.st.tClose)),r=i),e.currTemplate.closeBtn},$=function(){t.magnificPopup.instance||((e=new y).init(),t.magnificPopup.instance=e)},I=function(){var t=document.createElement("p").style,e=["ms","O","Moz","Webkit"];if(void 0!==t.transition)return!0;for(;e.length;)if(e.pop()+"Transition"in t)return!0;return!1};y.prototype={constructor:y,init:function(){var i=navigator.appVersion;e.isLowIE=e.isIE8=document.all&&!document.addEventListener,e.isAndroid=/android/gi.test(i),e.isIOS=/iphone|ipad|ipod/gi.test(i),e.supportsTransition=I(),e.probablyMobile=e.isAndroid||e.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),s=t(document),e.popupsCache={}},open:function(i){var n;if(!1===i.isObj){e.items=i.items.toArray(),e.index=0;var r,a=i.items;for(n=0;n<a.length;n++)if((r=a[n]).parsed&&(r=r.el[0]),r===i.el[0]){e.index=n;break}}else e.items=t.isArray(i.items)?i.items:[i.items],e.index=i.index||0;if(!e.isOpen){e.types=[],o="",i.mainEl&&i.mainEl.length?e.ev=i.mainEl.eq(0):e.ev=s,i.key?(e.popupsCache[i.key]||(e.popupsCache[i.key]={}),e.currTemplate=e.popupsCache[i.key]):e.currTemplate={},e.st=t.extend(!0,{},t.magnificPopup.defaults,i),e.fixedContentPos="auto"===e.st.fixedContentPos?!e.probablyMobile:e.st.fixedContentPos,e.st.modal&&(e.st.closeOnContentClick=!1,e.st.closeOnBgClick=!1,e.st.showCloseBtn=!1,e.st.enableEscapeKey=!1),e.bgOverlay||(e.bgOverlay=b("bg").on("click"+m,(function(){e.close()})),e.wrap=b("wrap").attr("tabindex",-1).on("click"+m,(function(t){e._checkIfClose(t.target)&&e.close()})),e.container=b("container",e.wrap)),e.contentContainer=b("content"),e.st.preloader&&(e.preloader=b("preloader",e.container,e.st.tLoading));var l=t.magnificPopup.modules;for(n=0;n<l.length;n++){var h=l[n];h=h.charAt(0).toUpperCase()+h.slice(1),e["init"+h].call(e)}z("BeforeOpen"),e.st.showCloseBtn&&(e.st.closeBtnInside?(C(p,(function(t,e,i,s){i.close_replaceWith=T(s.type)})),o+=" mfp-close-btn-in"):e.wrap.append(T())),e.st.alignTop&&(o+=" mfp-align-top"),e.fixedContentPos?e.wrap.css({overflow:e.st.overflowY,overflowX:"hidden",overflowY:e.st.overflowY}):e.wrap.css({top:x.scrollTop(),position:"absolute"}),(!1===e.st.fixedBgPos||"auto"===e.st.fixedBgPos&&!e.fixedContentPos)&&e.bgOverlay.css({height:s.height(),position:"absolute"}),e.st.enableEscapeKey&&s.on("keyup"+m,(function(t){27===t.keyCode&&e.close()})),x.on("resize"+m,(function(){e.updateSize()})),e.st.closeOnContentClick||(o+=" mfp-auto-cursor"),o&&e.wrap.addClass(o);var c=e.wH=x.height(),u={};if(e.fixedContentPos&&e._hasScrollBar(c)){var g=e._getScrollbarSize();g&&(u.marginRight=g)}e.fixedContentPos&&(e.isIE7?t("body, html").css("overflow","hidden"):u.overflow="hidden");var v=e.st.mainClass;return e.isIE7&&(v+=" mfp-ie7"),v&&e._addClassToMFP(v),e.updateItemHTML(),z("BuildControls"),t("html").css(u),e.bgOverlay.add(e.wrap).prependTo(e.st.prependTo||t(document.body)),e._lastFocusedEl=document.activeElement,setTimeout((function(){e.content?(e._addClassToMFP(f),e._setFocus()):e.bgOverlay.addClass(f),s.on("focusin"+m,e._onFocusIn)}),16),e.isOpen=!0,e.updateSize(c),z(d),i}e.updateItemHTML()},close:function(){e.isOpen&&(z(l),e.isOpen=!1,e.st.removalDelay&&!e.isLowIE&&e.supportsTransition?(e._addClassToMFP(v),setTimeout((function(){e._close()}),e.st.removalDelay)):e._close())},_close:function(){z(a);var i=v+" "+f+" ";if(e.bgOverlay.detach(),e.wrap.detach(),e.container.empty(),e.st.mainClass&&(i+=e.st.mainClass+" "),e._removeClassFromMFP(i),e.fixedContentPos){var n={marginRight:""};e.isIE7?t("body, html").css("overflow",""):n.overflow="",t("html").css(n)}s.off("keyup"+m+" focusin"+m),e.ev.off(m),e.wrap.attr("class","mfp-wrap").removeAttr("style"),e.bgOverlay.attr("class","mfp-bg"),e.container.attr("class","mfp-container"),!e.st.showCloseBtn||e.st.closeBtnInside&&!0!==e.currTemplate[e.currItem.type]||e.currTemplate.closeBtn&&e.currTemplate.closeBtn.detach(),e.st.autoFocusLast&&e._lastFocusedEl&&t(e._lastFocusedEl).focus(),e.currItem=null,e.content=null,e.currTemplate=null,e.prevHeight=0,z(h)},updateSize:function(t){if(e.isIOS){var i=document.documentElement.clientWidth/window.innerWidth,s=window.innerHeight*i;e.wrap.css("height",s),e.wH=s}else e.wH=t||x.height();e.fixedContentPos||e.wrap.css("height",e.wH),z("Resize")},updateItemHTML:function(){var i=e.items[e.index];e.contentContainer.detach(),e.content&&e.content.detach(),i.parsed||(i=e.parseEl(e.index));var s=i.type;if(z("BeforeChange",[e.currItem?e.currItem.type:"",s]),e.currItem=i,!e.currTemplate[s]){var o=!!e.st[s]&&e.st[s].markup;z("FirstMarkupParse",o),e.currTemplate[s]=!o||t(o)}n&&n!==i.type&&e.container.removeClass("mfp-"+n+"-holder");var r=e["get"+s.charAt(0).toUpperCase()+s.slice(1)](i,e.currTemplate[s]);e.appendContent(r,s),i.preloaded=!0,z(u,i),n=i.type,e.container.prepend(e.contentContainer),z("AfterChange")},appendContent:function(t,i){e.content=t,t?e.st.showCloseBtn&&e.st.closeBtnInside&&!0===e.currTemplate[i]?e.content.find(".mfp-close").length||e.content.append(T()):e.content=t:e.content="",z(c),e.container.addClass("mfp-"+i+"-holder"),e.contentContainer.append(e.content)},parseEl:function(i){var s,n=e.items[i];if(n.tagName?n={el:t(n)}:(s=n.type,n={data:n,src:n.src}),n.el){for(var o=e.types,r=0;r<o.length;r++)if(n.el.hasClass("mfp-"+o[r])){s=o[r];break}n.src=n.el.attr("data-mfp-src"),n.src||(n.src=n.el.attr("href"))}return n.type=s||e.st.type||"inline",n.index=i,n.parsed=!0,e.items[i]=n,z("ElementParse",n),e.items[i]},addGroup:function(t,i){var s=function(s){s.mfpEl=this,e._openClick(s,t,i)};i||(i={});var n="click.magnificPopup";i.mainEl=t,i.items?(i.isObj=!0,t.off(n).on(n,s)):(i.isObj=!1,i.delegate?t.off(n).on(n,i.delegate,s):(i.items=t,t.off(n).on(n,s)))},_openClick:function(i,s,n){if((void 0!==n.midClick?n.midClick:t.magnificPopup.defaults.midClick)||!(2===i.which||i.ctrlKey||i.metaKey||i.altKey||i.shiftKey)){var o=void 0!==n.disableOn?n.disableOn:t.magnificPopup.defaults.disableOn;if(o)if(t.isFunction(o)){if(!o.call(e))return!0}else if(x.width()<o)return!0;i.type&&(i.preventDefault(),e.isOpen&&i.stopPropagation()),n.el=t(i.mfpEl),n.delegate&&(n.items=s.find(n.delegate)),e.open(n)}},updateStatus:function(t,s){if(e.preloader){i!==t&&e.container.removeClass("mfp-s-"+i),s||"loading"!==t||(s=e.st.tLoading);var n={status:t,text:s};z("UpdateStatus",n),t=n.status,s=n.text,e.preloader.html(s),e.preloader.find("a").on("click",(function(t){t.stopImmediatePropagation()})),e.container.addClass("mfp-s-"+t),i=t}},_checkIfClose:function(i){if(!t(i).hasClass(_)){var s=e.st.closeOnContentClick,n=e.st.closeOnBgClick;if(s&&n)return!0;if(!e.content||t(i).hasClass("mfp-close")||e.preloader&&i===e.preloader[0])return!0;if(i===e.content[0]||t.contains(e.content[0],i)){if(s)return!0}else if(n&&t.contains(document,i))return!0;return!1}},_addClassToMFP:function(t){e.bgOverlay.addClass(t),e.wrap.addClass(t)},_removeClassFromMFP:function(t){this.bgOverlay.removeClass(t),e.wrap.removeClass(t)},_hasScrollBar:function(t){return(e.isIE7?s.height():document.body.scrollHeight)>(t||x.height())},_setFocus:function(){(e.st.focus?e.content.find(e.st.focus).eq(0):e.wrap).focus()},_onFocusIn:function(i){if(i.target!==e.wrap[0]&&!t.contains(e.wrap[0],i.target))return e._setFocus(),!1},_parseMarkup:function(e,i,s){var n;s.data&&(i=t.extend(s.data,i)),z(p,[e,i,s]),t.each(i,(function(i,s){if(void 0===s||!1===s)return!0;if((n=i.split("_")).length>1){var o=e.find(m+"-"+n[0]);if(o.length>0){var r=n[1];"replaceWith"===r?o[0]!==s[0]&&o.replaceWith(s):"img"===r?o.is("img")?o.attr("src",s):o.replaceWith(t("<img>").attr("src",s).attr("class",o.attr("class"))):o.attr(n[1],s)}}else e.find(m+"-"+i).html(s)}))},_getScrollbarSize:function(){if(void 0===e.scrollbarSize){var t=document.createElement("div");t.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(t),e.scrollbarSize=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return e.scrollbarSize}},t.magnificPopup={instance:null,proto:y.prototype,modules:[],open:function(e,i){return $(),(e=e?t.extend(!0,{},e):{}).isObj=!0,e.index=i||0,this.instance.open(e)},close:function(){return t.magnificPopup.instance&&t.magnificPopup.instance.close()},registerModule:function(e,i){i.options&&(t.magnificPopup.defaults[e]=i.options),t.extend(this.proto,i.proto),this.modules.push(e)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'<button title="%title%" type="button" class="mfp-close">×</button>',tClose:"Close (Esc)",tLoading:"Loading...",autoFocusLast:!0}},t.fn.magnificPopup=function(i){$();var s=t(this);if("string"==typeof i)if("open"===i){var n,o=w?s.data("magnificPopup"):s[0].magnificPopup,r=parseInt(arguments[1],10)||0;o.items?n=o.items[r]:(n=s,o.delegate&&(n=n.find(o.delegate)),n=n.eq(r)),e._openClick({mfpEl:n},s,o)}else e.isOpen&&e[i].apply(e,Array.prototype.slice.call(arguments,1));else i=t.extend(!0,{},i),w?s.data("magnificPopup",i):s[0].magnificPopup=i,e.addGroup(s,i);return s};var E,P,k,S="inline",M=function(){k&&(P.after(k.addClass(E)).detach(),k=null)};t.magnificPopup.registerModule(S,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){e.types.push(S),C(a+"."+S,(function(){M()}))},getInline:function(i,s){if(M(),i.src){var n=e.st.inline,o=t(i.src);if(o.length){var r=o[0].parentNode;r&&r.tagName&&(P||(E=n.hiddenClass,P=b(E),E="mfp-"+E),k=o.after(P).detach().removeClass(E)),e.updateStatus("ready")}else e.updateStatus("error",n.tNotFound),o=t("<div>");return i.inlineElement=o,o}return e.updateStatus("ready"),e._parseMarkup(s,{},i),s}}});var O,j="ajax",D=function(){O&&t(document.body).removeClass(O)},L=function(){D(),e.req&&e.req.abort()};t.magnificPopup.registerModule(j,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'<a href="%url%">The content</a> could not be loaded.'},proto:{initAjax:function(){e.types.push(j),O=e.st.ajax.cursor,C(a+"."+j,L),C("BeforeChange."+j,L)},getAjax:function(i){O&&t(document.body).addClass(O),e.updateStatus("loading");var s=t.extend({url:i.src,success:function(s,n,o){var r={data:s,xhr:o};z("ParseAjax",r),e.appendContent(t(r.data),j),i.finished=!0,D(),e._setFocus(),setTimeout((function(){e.wrap.addClass(f)}),16),e.updateStatus("ready"),z("AjaxContentAdded")},error:function(){D(),i.finished=i.loadError=!0,e.updateStatus("error",e.st.ajax.tError.replace("%url%",i.src))}},e.st.ajax.settings);return e.req=t.ajax(s),""}}});var H,B=function(i){if(i.data&&void 0!==i.data.title)return i.data.title;var s=e.st.image.titleSrc;if(s){if(t.isFunction(s))return s.call(e,i);if(i.el)return i.el.attr(s)||""}return""};t.magnificPopup.registerModule("image",{options:{markup:'<div class="mfp-figure"><div class="mfp-close"></div><figure><div class="mfp-img"></div><figcaption><div class="mfp-bottom-bar"><div class="mfp-title"></div><div class="mfp-counter"></div></div></figcaption></figure></div>',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'<a href="%url%">The image</a> could not be loaded.'},proto:{initImage:function(){var i=e.st.image,s=".image";e.types.push("image"),C(d+s,(function(){"image"===e.currItem.type&&i.cursor&&t(document.body).addClass(i.cursor)})),C(a+s,(function(){i.cursor&&t(document.body).removeClass(i.cursor),x.off("resize"+m)})),C("Resize"+s,e.resizeImage),e.isLowIE&&C("AfterChange",e.resizeImage)},resizeImage:function(){var t=e.currItem;if(t&&t.img&&e.st.image.verticalFit){var i=0;e.isLowIE&&(i=parseInt(t.img.css("padding-top"),10)+parseInt(t.img.css("padding-bottom"),10)),t.img.css("max-height",e.wH-i)}},_onImageHasSize:function(t){t.img&&(t.hasSize=!0,H&&clearInterval(H),t.isCheckingImgSize=!1,z("ImageHasSize",t),t.imgHidden&&(e.content&&e.content.removeClass("mfp-loading"),t.imgHidden=!1))},findImageSize:function(t){var i=0,s=t.img[0],n=function(o){H&&clearInterval(H),H=setInterval((function(){s.naturalWidth>0?e._onImageHasSize(t):(i>200&&clearInterval(H),3==++i?n(10):40===i?n(50):100===i&&n(500))}),o)};n(1)},getImage:function(i,s){var n=0,o=function(){i&&(i.img[0].complete?(i.img.off(".mfploader"),i===e.currItem&&(e._onImageHasSize(i),e.updateStatus("ready")),i.hasSize=!0,i.loaded=!0,z("ImageLoadComplete")):++n<200?setTimeout(o,100):r())},r=function(){i&&(i.img.off(".mfploader"),i===e.currItem&&(e._onImageHasSize(i),e.updateStatus("error",a.tError.replace("%url%",i.src))),i.hasSize=!0,i.loaded=!0,i.loadError=!0)},a=e.st.image,l=s.find(".mfp-img");if(l.length){var h=document.createElement("img");h.className="mfp-img",i.el&&i.el.find("img").length&&(h.alt=i.el.find("img").attr("alt")),i.img=t(h).on("load.mfploader",o).on("error.mfploader",r),h.src=i.src,l.is("img")&&(i.img=i.img.clone()),(h=i.img[0]).naturalWidth>0?i.hasSize=!0:h.width||(i.hasSize=!1)}return e._parseMarkup(s,{title:B(i),img_replaceWith:i.img},i),e.resizeImage(),i.hasSize?(H&&clearInterval(H),i.loadError?(s.addClass("mfp-loading"),e.updateStatus("error",a.tError.replace("%url%",i.src))):(s.removeClass("mfp-loading"),e.updateStatus("ready")),s):(e.updateStatus("loading"),i.loading=!0,i.hasSize||(i.imgHidden=!0,s.addClass("mfp-loading"),e.findImageSize(i)),s)}}});var A,W=function(){return void 0===A&&(A=void 0!==document.createElement("p").style.MozTransform),A};t.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(t){return t.is("img")?t:t.find("img")}},proto:{initZoom:function(){var t,i=e.st.zoom,s=".zoom";if(i.enabled&&e.supportsTransition){var n,o,r=i.duration,h=function(t){var e=t.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),s="all "+i.duration/1e3+"s "+i.easing,n={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},o="transition";return n["-webkit-"+o]=n["-moz-"+o]=n["-o-"+o]=n[o]=s,e.css(n),e},c=function(){e.content.css("visibility","visible")};C("BuildControls"+s,(function(){if(e._allowZoom()){if(clearTimeout(n),e.content.css("visibility","hidden"),!(t=e._getItemToZoom()))return void c();(o=h(t)).css(e._getOffset()),e.wrap.append(o),n=setTimeout((function(){o.css(e._getOffset(!0)),n=setTimeout((function(){c(),setTimeout((function(){o.remove(),t=o=null,z("ZoomAnimationEnded")}),16)}),r)}),16)}})),C(l+s,(function(){if(e._allowZoom()){if(clearTimeout(n),e.st.removalDelay=r,!t){if(!(t=e._getItemToZoom()))return;o=h(t)}o.css(e._getOffset(!0)),e.wrap.append(o),e.content.css("visibility","hidden"),setTimeout((function(){o.css(e._getOffset())}),16)}})),C(a+s,(function(){e._allowZoom()&&(c(),o&&o.remove(),t=null)}))}},_allowZoom:function(){return"image"===e.currItem.type},_getItemToZoom:function(){return!!e.currItem.hasSize&&e.currItem.img},_getOffset:function(i){var s,n=(s=i?e.currItem.img:e.st.zoom.opener(e.currItem.el||e.currItem)).offset(),o=parseInt(s.css("padding-top"),10),r=parseInt(s.css("padding-bottom"),10);n.top-=t(window).scrollTop()-o;var a={width:s.width(),height:(w?s.innerHeight():s[0].offsetHeight)-r-o};return W()?a["-moz-transform"]=a.transform="translate("+n.left+"px,"+n.top+"px)":(a.left=n.left,a.top=n.top),a}}});var F="iframe",R="//about:blank",N=function(t){if(e.currTemplate[F]){var i=e.currTemplate[F].find("iframe");i.length&&(t||(i[0].src=R),e.isIE8&&i.css("display",t?"block":"none"))}};t.magnificPopup.registerModule(F,{options:{markup:'<div class="mfp-iframe-scaler"><div class="mfp-close"></div><iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe></div>',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){e.types.push(F),C("BeforeChange",(function(t,e,i){e!==i&&(e===F?N():i===F&&N(!0))})),C(a+"."+F,(function(){N()}))},getIframe:function(i,s){var n=i.src,o=e.st.iframe;t.each(o.patterns,(function(){if(n.indexOf(this.index)>-1)return this.id&&(n="string"==typeof this.id?n.substr(n.lastIndexOf(this.id)+this.id.length,n.length):this.id.call(this,n)),n=this.src.replace("%id%",n),!1}));var r={};return o.srcAction&&(r[o.srcAction]=n),e._parseMarkup(s,r,i),e.updateStatus("ready"),s}}});var Z=function(t){var i=e.items.length;return t>i-1?t-i:t<0?i+t:t},q=function(t,e,i){return t.replace(/%curr%/gi,e+1).replace(/%total%/gi,i)};t.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var i=e.st.gallery,n=".mfp-gallery";if(e.direction=!0,!i||!i.enabled)return!1;o+=" mfp-gallery",C(d+n,(function(){i.navigateByImgClick&&e.wrap.on("click"+n,".mfp-img",(function(){if(e.items.length>1)return e.next(),!1})),s.on("keydown"+n,(function(t){37===t.keyCode?e.prev():39===t.keyCode&&e.next()}))})),C("UpdateStatus"+n,(function(t,i){i.text&&(i.text=q(i.text,e.currItem.index,e.items.length))})),C(p+n,(function(t,s,n,o){var r=e.items.length;n.counter=r>1?q(i.tCounter,o.index,r):""})),C("BuildControls"+n,(function(){if(e.items.length>1&&i.arrows&&!e.arrowLeft){var s=i.arrowMarkup,n=e.arrowLeft=t(s.replace(/%title%/gi,i.tPrev).replace(/%dir%/gi,"left")).addClass(_),o=e.arrowRight=t(s.replace(/%title%/gi,i.tNext).replace(/%dir%/gi,"right")).addClass(_);n.click((function(){e.prev()})),o.click((function(){e.next()})),e.container.append(n.add(o))}})),C(u+n,(function(){e._preloadTimeout&&clearTimeout(e._preloadTimeout),e._preloadTimeout=setTimeout((function(){e.preloadNearbyImages(),e._preloadTimeout=null}),16)})),C(a+n,(function(){s.off(n),e.wrap.off("click"+n),e.arrowRight=e.arrowLeft=null}))},next:function(){e.direction=!0,e.index=Z(e.index+1),e.updateItemHTML()},prev:function(){e.direction=!1,e.index=Z(e.index-1),e.updateItemHTML()},goTo:function(t){e.direction=t>=e.index,e.index=t,e.updateItemHTML()},preloadNearbyImages:function(){var t,i=e.st.gallery.preload,s=Math.min(i[0],e.items.length),n=Math.min(i[1],e.items.length);for(t=1;t<=(e.direction?n:s);t++)e._preloadItem(e.index+t);for(t=1;t<=(e.direction?s:n);t++)e._preloadItem(e.index-t)},_preloadItem:function(i){if(i=Z(i),!e.items[i].preloaded){var s=e.items[i];s.parsed||(s=e.parseEl(i)),z("LazyLoad",s),"image"===s.type&&(s.img=t('<img class="mfp-img" />').on("load.mfploader",(function(){s.hasSize=!0})).on("error.mfploader",(function(){s.hasSize=!0,s.loadError=!0,z("LazyLoadError",s)})).attr("src",s.src)),s.preloaded=!0}}}});var Q="retina";t.magnificPopup.registerModule(Q,{options:{replaceSrc:function(t){return t.src.replace(/\.\w+$/,(function(t){return"@2x"+t}))},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var t=e.st.retina,i=t.ratio;(i=isNaN(i)?i():i)>1&&(C("ImageHasSize."+Q,(function(t,e){e.img.css({"max-width":e.img[0].naturalWidth/i,width:"100%"})})),C("ElementParse."+Q,(function(e,s){s.src=t.replaceSrc(s,i)})))}}}}),$()},void 0===(o="function"==typeof s?s.apply(e,n):s)||(t.exports=o)},213:()=>{!function(t,e,i,s){function n(e,i){this.settings=null,this.options=t.extend({},n.Defaults,i),this.$element=t(e),this._handlers={},this._plugins={},this._supress={},this._current=null,this._speed=null,this._coordinates=[],this._breakpoint=null,this._width=null,this._items=[],this._clones=[],this._mergers=[],this._widths=[],this._invalidated={},this._pipe=[],this._drag={time:null,target:null,pointer:null,stage:{start:null,current:null},direction:null},this._states={current:{},tags:{initializing:["busy"],animating:["busy"],dragging:["interacting"]}},t.each(["onResize","onThrottledResize"],t.proxy((function(e,i){this._handlers[i]=t.proxy(this[i],this)}),this)),t.each(n.Plugins,t.proxy((function(t,e){this._plugins[t.charAt(0).toLowerCase()+t.slice(1)]=new e(this)}),this)),t.each(n.Workers,t.proxy((function(e,i){this._pipe.push({filter:i.filter,run:t.proxy(i.run,this)})}),this)),this.setup(),this.initialize()}n.Defaults={items:3,loop:!1,center:!1,rewind:!1,checkVisibility:!0,mouseDrag:!0,touchDrag:!0,pullDrag:!0,freeDrag:!1,margin:0,stagePadding:0,merge:!1,mergeFit:!0,autoWidth:!1,startPosition:0,rtl:!1,smartSpeed:250,fluidSpeed:!1,dragEndSpeed:!1,responsive:{},responsiveRefreshRate:200,responsiveBaseElement:e,fallbackEasing:"swing",slideTransition:"",info:!1,nestedItemSelector:!1,itemElement:"div",stageElement:"div",refreshClass:"owl-refresh",loadedClass:"owl-loaded",loadingClass:"owl-loading",rtlClass:"owl-rtl",responsiveClass:"owl-responsive",dragClass:"owl-drag",itemClass:"owl-item",stageClass:"owl-stage",stageOuterClass:"owl-stage-outer",grabClass:"owl-grab"},n.Width={Default:"default",Inner:"inner",Outer:"outer"},n.Type={Event:"event",State:"state"},n.Plugins={},n.Workers=[{filter:["width","settings"],run:function(){this._width=this.$element.width()}},{filter:["width","items","settings"],run:function(t){t.current=this._items&&this._items[this.relative(this._current)]}},{filter:["items","settings"],run:function(){this.$stage.children(".cloned").remove()}},{filter:["width","items","settings"],run:function(t){var e=this.settings.margin||"",i=!this.settings.autoWidth,s=this.settings.rtl,n={width:"auto","margin-left":s?e:"","margin-right":s?"":e};!i&&this.$stage.children().css(n),t.css=n}},{filter:["width","items","settings"],run:function(t){var e=(this.width()/this.settings.items).toFixed(3)-this.settings.margin,i=null,s=this._items.length,n=!this.settings.autoWidth,o=[];for(t.items={merge:!1,width:e};s--;)i=this._mergers[s],i=this.settings.mergeFit&&Math.min(i,this.settings.items)||i,t.items.merge=i>1||t.items.merge,o[s]=n?e*i:this._items[s].width();this._widths=o}},{filter:["items","settings"],run:function(){var e=[],i=this._items,s=this.settings,n=Math.max(2*s.items,4),o=2*Math.ceil(i.length/2),r=s.loop&&i.length?s.rewind?n:Math.max(n,o):0,a="",l="";for(r/=2;r>0;)e.push(this.normalize(e.length/2,!0)),a+=i[e[e.length-1]][0].outerHTML,e.push(this.normalize(i.length-1-(e.length-1)/2,!0)),l=i[e[e.length-1]][0].outerHTML+l,r-=1;this._clones=e,t(a).addClass("cloned").appendTo(this.$stage),t(l).addClass("cloned").prependTo(this.$stage)}},{filter:["width","items","settings"],run:function(){for(var t=this.settings.rtl?1:-1,e=this._clones.length+this._items.length,i=-1,s=0,n=0,o=[];++i<e;)s=o[i-1]||0,n=this._widths[this.relative(i)]+this.settings.margin,o.push(s+n*t);this._coordinates=o}},{filter:["width","items","settings"],run:function(){var t=this.settings.stagePadding,e=this._coordinates,i={width:Math.ceil(Math.abs(e[e.length-1]))+2*t,"padding-left":t||"","padding-right":t||""};this.$stage.css(i)}},{filter:["width","items","settings"],run:function(t){var e=this._coordinates.length,i=!this.settings.autoWidth,s=this.$stage.children();if(i&&t.items.merge)for(;e--;)t.css.width=this._widths[this.relative(e)],s.eq(e).css(t.css);else i&&(t.css.width=t.items.width,s.css(t.css))}},{filter:["items"],run:function(){this._coordinates.length<1&&this.$stage.removeAttr("style")}},{filter:["width","items","settings"],run:function(t){t.current=t.current?this.$stage.children().index(t.current):0,t.current=Math.max(this.minimum(),Math.min(this.maximum(),t.current)),this.reset(t.current)}},{filter:["position"],run:function(){this.animate(this.coordinates(this._current))}},{filter:["width","position","items","settings"],run:function(){var t,e,i,s,n=this.settings.rtl?1:-1,o=2*this.settings.stagePadding,r=this.coordinates(this.current())+o,a=r+this.width()*n,l=[];for(i=0,s=this._coordinates.length;i<s;i++)t=this._coordinates[i-1]||0,e=Math.abs(this._coordinates[i])+o*n,(this.op(t,"<=",r)&&this.op(t,">",a)||this.op(e,"<",r)&&this.op(e,">",a))&&l.push(i);this.$stage.children(".active").removeClass("active"),this.$stage.children(":eq("+l.join("), :eq(")+")").addClass("active"),this.$stage.children(".center").removeClass("center"),this.settings.center&&this.$stage.children().eq(this.current()).addClass("center")}}],n.prototype.initializeStage=function(){this.$stage=this.$element.find("."+this.settings.stageClass),this.$stage.length||(this.$element.addClass(this.options.loadingClass),this.$stage=t("<"+this.settings.stageElement+">",{class:this.settings.stageClass}).wrap(t("<div/>",{class:this.settings.stageOuterClass})),this.$element.append(this.$stage.parent()))},n.prototype.initializeItems=function(){var e=this.$element.find(".owl-item");if(e.length)return this._items=e.get().map((function(e){return t(e)})),this._mergers=this._items.map((function(){return 1})),void this.refresh();this.replace(this.$element.children().not(this.$stage.parent())),this.isVisible()?this.refresh():this.invalidate("width"),this.$element.removeClass(this.options.loadingClass).addClass(this.options.loadedClass)},n.prototype.initialize=function(){var t,e,i;(this.enter("initializing"),this.trigger("initialize"),this.$element.toggleClass(this.settings.rtlClass,this.settings.rtl),this.settings.autoWidth&&!this.is("pre-loading"))&&(t=this.$element.find("img"),e=this.settings.nestedItemSelector?"."+this.settings.nestedItemSelector:s,i=this.$element.children(e).width(),t.length&&i<=0&&this.preloadAutoWidthImages(t));this.initializeStage(),this.initializeItems(),this.registerEventHandlers(),this.leave("initializing"),this.trigger("initialized")},n.prototype.isVisible=function(){return!this.settings.checkVisibility||this.$element.is(":visible")},n.prototype.setup=function(){var e=this.viewport(),i=this.options.responsive,s=-1,n=null;i?(t.each(i,(function(t){t<=e&&t>s&&(s=Number(t))})),"function"==typeof(n=t.extend({},this.options,i[s])).stagePadding&&(n.stagePadding=n.stagePadding()),delete n.responsive,n.responsiveClass&&this.$element.attr("class",this.$element.attr("class").replace(new RegExp("("+this.options.responsiveClass+"-)\\S+\\s","g"),"$1"+s))):n=t.extend({},this.options),this.trigger("change",{property:{name:"settings",value:n}}),this._breakpoint=s,this.settings=n,this.invalidate("settings"),this.trigger("changed",{property:{name:"settings",value:this.settings}})},n.prototype.optionsLogic=function(){this.settings.autoWidth&&(this.settings.stagePadding=!1,this.settings.merge=!1)},n.prototype.prepare=function(e){var i=this.trigger("prepare",{content:e});return i.data||(i.data=t("<"+this.settings.itemElement+"/>").addClass(this.options.itemClass).append(e)),this.trigger("prepared",{content:i.data}),i.data},n.prototype.update=function(){for(var e=0,i=this._pipe.length,s=t.proxy((function(t){return this[t]}),this._invalidated),n={};e<i;)(this._invalidated.all||t.grep(this._pipe[e].filter,s).length>0)&&this._pipe[e].run(n),e++;this._invalidated={},!this.is("valid")&&this.enter("valid")},n.prototype.width=function(t){switch(t=t||n.Width.Default){case n.Width.Inner:case n.Width.Outer:return this._width;default:return this._width-2*this.settings.stagePadding+this.settings.margin}},n.prototype.refresh=function(){this.enter("refreshing"),this.trigger("refresh"),this.setup(),this.optionsLogic(),this.$element.addClass(this.options.refreshClass),this.update(),this.$element.removeClass(this.options.refreshClass),this.leave("refreshing"),this.trigger("refreshed")},n.prototype.onThrottledResize=function(){e.clearTimeout(this.resizeTimer),this.resizeTimer=e.setTimeout(this._handlers.onResize,this.settings.responsiveRefreshRate)},n.prototype.onResize=function(){return!!this._items.length&&(this._width!==this.$element.width()&&(!!this.isVisible()&&(this.enter("resizing"),this.trigger("resize").isDefaultPrevented()?(this.leave("resizing"),!1):(this.invalidate("width"),this.refresh(),this.leave("resizing"),void this.trigger("resized")))))},n.prototype.registerEventHandlers=function(){t.support.transition&&this.$stage.on(t.support.transition.end+".owl.core",t.proxy(this.onTransitionEnd,this)),!1!==this.settings.responsive&&this.on(e,"resize",this._handlers.onThrottledResize),this.settings.mouseDrag&&(this.$element.addClass(this.options.dragClass),this.$stage.on("mousedown.owl.core",t.proxy(this.onDragStart,this)),this.$stage.on("dragstart.owl.core selectstart.owl.core",(function(){return!1}))),this.settings.touchDrag&&(this.$stage.on("touchstart.owl.core",t.proxy(this.onDragStart,this)),this.$stage.on("touchcancel.owl.core",t.proxy(this.onDragEnd,this)))},n.prototype.onDragStart=function(e){var s=null;3!==e.which&&(t.support.transform?s={x:(s=this.$stage.css("transform").replace(/.*\(|\)| /g,"").split(","))[16===s.length?12:4],y:s[16===s.length?13:5]}:(s=this.$stage.position(),s={x:this.settings.rtl?s.left+this.$stage.width()-this.width()+this.settings.margin:s.left,y:s.top}),this.is("animating")&&(t.support.transform?this.animate(s.x):this.$stage.stop(),this.invalidate("position")),this.$element.toggleClass(this.options.grabClass,"mousedown"===e.type),this.speed(0),this._drag.time=(new Date).getTime(),this._drag.target=t(e.target),this._drag.stage.start=s,this._drag.stage.current=s,this._drag.pointer=this.pointer(e),t(i).on("mouseup.owl.core touchend.owl.core",t.proxy(this.onDragEnd,this)),t(i).one("mousemove.owl.core touchmove.owl.core",t.proxy((function(e){var s=this.difference(this._drag.pointer,this.pointer(e));t(i).on("mousemove.owl.core touchmove.owl.core",t.proxy(this.onDragMove,this)),Math.abs(s.x)<Math.abs(s.y)&&this.is("valid")||(e.preventDefault(),this.enter("dragging"),this.trigger("drag"))}),this)))},n.prototype.onDragMove=function(t){var e=null,i=null,s=null,n=this.difference(this._drag.pointer,this.pointer(t)),o=this.difference(this._drag.stage.start,n);this.is("dragging")&&(t.preventDefault(),this.settings.loop?(e=this.coordinates(this.minimum()),i=this.coordinates(this.maximum()+1)-e,o.x=((o.x-e)%i+i)%i+e):(e=this.settings.rtl?this.coordinates(this.maximum()):this.coordinates(this.minimum()),i=this.settings.rtl?this.coordinates(this.minimum()):this.coordinates(this.maximum()),s=this.settings.pullDrag?-1*n.x/5:0,o.x=Math.max(Math.min(o.x,e+s),i+s)),this._drag.stage.current=o,this.animate(o.x))},n.prototype.onDragEnd=function(e){var s=this.difference(this._drag.pointer,this.pointer(e)),n=this._drag.stage.current,o=s.x>0^this.settings.rtl?"left":"right";t(i).off(".owl.core"),this.$element.removeClass(this.options.grabClass),(0!==s.x&&this.is("dragging")||!this.is("valid"))&&(this.speed(this.settings.dragEndSpeed||this.settings.smartSpeed),this.current(this.closest(n.x,0!==s.x?o:this._drag.direction)),this.invalidate("position"),this.update(),this._drag.direction=o,(Math.abs(s.x)>3||(new Date).getTime()-this._drag.time>300)&&this._drag.target.one("click.owl.core",(function(){return!1}))),this.is("dragging")&&(this.leave("dragging"),this.trigger("dragged"))},n.prototype.closest=function(e,i){var n=-1,o=this.width(),r=this.coordinates();return this.settings.freeDrag||t.each(r,t.proxy((function(t,a){return"left"===i&&e>a-30&&e<a+30?n=t:"right"===i&&e>a-o-30&&e<a-o+30?n=t+1:this.op(e,"<",a)&&this.op(e,">",r[t+1]!==s?r[t+1]:a-o)&&(n="left"===i?t+1:t),-1===n}),this)),this.settings.loop||(this.op(e,">",r[this.minimum()])?n=e=this.minimum():this.op(e,"<",r[this.maximum()])&&(n=e=this.maximum())),n},n.prototype.animate=function(e){var i=this.speed()>0;this.is("animating")&&this.onTransitionEnd(),i&&(this.enter("animating"),this.trigger("translate")),t.support.transform3d&&t.support.transition?this.$stage.css({transform:"translate3d("+e+"px,0px,0px)",transition:this.speed()/1e3+"s"+(this.settings.slideTransition?" "+this.settings.slideTransition:"")}):i?this.$stage.animate({left:e+"px"},this.speed(),this.settings.fallbackEasing,t.proxy(this.onTransitionEnd,this)):this.$stage.css({left:e+"px"})},n.prototype.is=function(t){return this._states.current[t]&&this._states.current[t]>0},n.prototype.current=function(t){if(t===s)return this._current;if(0===this._items.length)return s;if(t=this.normalize(t),this._current!==t){var e=this.trigger("change",{property:{name:"position",value:t}});e.data!==s&&(t=this.normalize(e.data)),this._current=t,this.invalidate("position"),this.trigger("changed",{property:{name:"position",value:this._current}})}return this._current},n.prototype.invalidate=function(e){return"string"===t.type(e)&&(this._invalidated[e]=!0,this.is("valid")&&this.leave("valid")),t.map(this._invalidated,(function(t,e){return e}))},n.prototype.reset=function(t){(t=this.normalize(t))!==s&&(this._speed=0,this._current=t,this.suppress(["translate","translated"]),this.animate(this.coordinates(t)),this.release(["translate","translated"]))},n.prototype.normalize=function(t,e){var i=this._items.length,n=e?0:this._clones.length;return!this.isNumeric(t)||i<1?t=s:(t<0||t>=i+n)&&(t=((t-n/2)%i+i)%i+n/2),t},n.prototype.relative=function(t){return t-=this._clones.length/2,this.normalize(t,!0)},n.prototype.maximum=function(t){var e,i,s,n=this.settings,o=this._coordinates.length;if(n.loop)o=this._clones.length/2+this._items.length-1;else if(n.autoWidth||n.merge){if(e=this._items.length)for(i=this._items[--e].width(),s=this.$element.width();e--&&!((i+=this._items[e].width()+this.settings.margin)>s););o=e+1}else o=n.center?this._items.length-1:this._items.length-n.items;return t&&(o-=this._clones.length/2),Math.max(o,0)},n.prototype.minimum=function(t){return t?0:this._clones.length/2},n.prototype.items=function(t){return t===s?this._items.slice():(t=this.normalize(t,!0),this._items[t])},n.prototype.mergers=function(t){return t===s?this._mergers.slice():(t=this.normalize(t,!0),this._mergers[t])},n.prototype.clones=function(e){var i=this._clones.length/2,n=i+this._items.length,o=function(t){return t%2==0?n+t/2:i-(t+1)/2};return e===s?t.map(this._clones,(function(t,e){return o(e)})):t.map(this._clones,(function(t,i){return t===e?o(i):null}))},n.prototype.speed=function(t){return t!==s&&(this._speed=t),this._speed},n.prototype.coordinates=function(e){var i,n=1,o=e-1;return e===s?t.map(this._coordinates,t.proxy((function(t,e){return this.coordinates(e)}),this)):(this.settings.center?(this.settings.rtl&&(n=-1,o=e+1),i=this._coordinates[e],i+=(this.width()-i+(this._coordinates[o]||0))/2*n):i=this._coordinates[o]||0,i=Math.ceil(i))},n.prototype.duration=function(t,e,i){return 0===i?0:Math.min(Math.max(Math.abs(e-t),1),6)*Math.abs(i||this.settings.smartSpeed)},n.prototype.to=function(t,e){var i=this.current(),s=null,n=t-this.relative(i),o=(n>0)-(n<0),r=this._items.length,a=this.minimum(),l=this.maximum();this.settings.loop?(!this.settings.rewind&&Math.abs(n)>r/2&&(n+=-1*o*r),(s=(((t=i+n)-a)%r+r)%r+a)!==t&&s-n<=l&&s-n>0&&(i=s-n,t=s,this.reset(i))):t=this.settings.rewind?(t%(l+=1)+l)%l:Math.max(a,Math.min(l,t)),this.speed(this.duration(i,t,e)),this.current(t),this.isVisible()&&this.update()},n.prototype.next=function(t){t=t||!1,this.to(this.relative(this.current())+1,t)},n.prototype.prev=function(t){t=t||!1,this.to(this.relative(this.current())-1,t)},n.prototype.onTransitionEnd=function(t){if(t!==s&&(t.stopPropagation(),(t.target||t.srcElement||t.originalTarget)!==this.$stage.get(0)))return!1;this.leave("animating"),this.trigger("translated")},n.prototype.viewport=function(){var s;return this.options.responsiveBaseElement!==e?s=t(this.options.responsiveBaseElement).width():e.innerWidth?s=e.innerWidth:i.documentElement&&i.documentElement.clientWidth?s=i.documentElement.clientWidth:console.warn("Can not detect viewport width."),s},n.prototype.replace=function(e){this.$stage.empty(),this._items=[],e&&(e=e instanceof jQuery?e:t(e)),this.settings.nestedItemSelector&&(e=e.find("."+this.settings.nestedItemSelector)),e.filter((function(){return 1===this.nodeType})).each(t.proxy((function(t,e){e=this.prepare(e),this.$stage.append(e),this._items.push(e),this._mergers.push(1*e.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)}),this)),this.reset(this.isNumeric(this.settings.startPosition)?this.settings.startPosition:0),this.invalidate("items")},n.prototype.add=function(e,i){var n=this.relative(this._current);i=i===s?this._items.length:this.normalize(i,!0),e=e instanceof jQuery?e:t(e),this.trigger("add",{content:e,position:i}),e=this.prepare(e),0===this._items.length||i===this._items.length?(0===this._items.length&&this.$stage.append(e),0!==this._items.length&&this._items[i-1].after(e),this._items.push(e),this._mergers.push(1*e.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)):(this._items[i].before(e),this._items.splice(i,0,e),this._mergers.splice(i,0,1*e.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)),this._items[n]&&this.reset(this._items[n].index()),this.invalidate("items"),this.trigger("added",{content:e,position:i})},n.prototype.remove=function(t){(t=this.normalize(t,!0))!==s&&(this.trigger("remove",{content:this._items[t],position:t}),this._items[t].remove(),this._items.splice(t,1),this._mergers.splice(t,1),this.invalidate("items"),this.trigger("removed",{content:null,position:t}))},n.prototype.preloadAutoWidthImages=function(e){e.each(t.proxy((function(e,i){this.enter("pre-loading"),i=t(i),t(new Image).one("load",t.proxy((function(t){i.attr("src",t.target.src),i.css("opacity",1),this.leave("pre-loading"),!this.is("pre-loading")&&!this.is("initializing")&&this.refresh()}),this)).attr("src",i.attr("src")||i.attr("data-src")||i.attr("data-src-retina"))}),this))},n.prototype.destroy=function(){for(var s in this.$element.off(".owl.core"),this.$stage.off(".owl.core"),t(i).off(".owl.core"),!1!==this.settings.responsive&&(e.clearTimeout(this.resizeTimer),this.off(e,"resize",this._handlers.onThrottledResize)),this._plugins)this._plugins[s].destroy();this.$stage.children(".cloned").remove(),this.$stage.unwrap(),this.$stage.children().contents().unwrap(),this.$stage.children().unwrap(),this.$stage.remove(),this.$element.removeClass(this.options.refreshClass).removeClass(this.options.loadingClass).removeClass(this.options.loadedClass).removeClass(this.options.rtlClass).removeClass(this.options.dragClass).removeClass(this.options.grabClass).attr("class",this.$element.attr("class").replace(new RegExp(this.options.responsiveClass+"-\\S+\\s","g"),"")).removeData("owl.carousel")},n.prototype.op=function(t,e,i){var s=this.settings.rtl;switch(e){case"<":return s?t>i:t<i;case">":return s?t<i:t>i;case">=":return s?t<=i:t>=i;case"<=":return s?t>=i:t<=i}},n.prototype.on=function(t,e,i,s){t.addEventListener?t.addEventListener(e,i,s):t.attachEvent&&t.attachEvent("on"+e,i)},n.prototype.off=function(t,e,i,s){t.removeEventListener?t.removeEventListener(e,i,s):t.detachEvent&&t.detachEvent("on"+e,i)},n.prototype.trigger=function(e,i,s,o,r){var a={item:{count:this._items.length,index:this.current()}},l=t.camelCase(t.grep(["on",e,s],(function(t){return t})).join("-").toLowerCase()),h=t.Event([e,"owl",s||"carousel"].join(".").toLowerCase(),t.extend({relatedTarget:this},a,i));return this._supress[e]||(t.each(this._plugins,(function(t,e){e.onTrigger&&e.onTrigger(h)})),this.register({type:n.Type.Event,name:e}),this.$element.trigger(h),this.settings&&"function"==typeof this.settings[l]&&this.settings[l].call(this,h)),h},n.prototype.enter=function(e){t.each([e].concat(this._states.tags[e]||[]),t.proxy((function(t,e){this._states.current[e]===s&&(this._states.current[e]=0),this._states.current[e]++}),this))},n.prototype.leave=function(e){t.each([e].concat(this._states.tags[e]||[]),t.proxy((function(t,e){this._states.current[e]--}),this))},n.prototype.register=function(e){if(e.type===n.Type.Event){if(t.event.special[e.name]||(t.event.special[e.name]={}),!t.event.special[e.name].owl){var i=t.event.special[e.name]._default;t.event.special[e.name]._default=function(t){return!i||!i.apply||t.namespace&&-1!==t.namespace.indexOf("owl")?t.namespace&&t.namespace.indexOf("owl")>-1:i.apply(this,arguments)},t.event.special[e.name].owl=!0}}else e.type===n.Type.State&&(this._states.tags[e.name]?this._states.tags[e.name]=this._states.tags[e.name].concat(e.tags):this._states.tags[e.name]=e.tags,this._states.tags[e.name]=t.grep(this._states.tags[e.name],t.proxy((function(i,s){return t.inArray(i,this._states.tags[e.name])===s}),this)))},n.prototype.suppress=function(e){t.each(e,t.proxy((function(t,e){this._supress[e]=!0}),this))},n.prototype.release=function(e){t.each(e,t.proxy((function(t,e){delete this._supress[e]}),this))},n.prototype.pointer=function(t){var i={x:null,y:null};return(t=(t=t.originalEvent||t||e.event).touches&&t.touches.length?t.touches[0]:t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t).pageX?(i.x=t.pageX,i.y=t.pageY):(i.x=t.clientX,i.y=t.clientY),i},n.prototype.isNumeric=function(t){return!isNaN(parseFloat(t))},n.prototype.difference=function(t,e){return{x:t.x-e.x,y:t.y-e.y}},t.fn.owlCarousel=function(e){var i=Array.prototype.slice.call(arguments,1);return this.each((function(){var s=t(this),o=s.data("owl.carousel");o||(o=new n(this,"object"==typeof e&&e),s.data("owl.carousel",o),t.each(["next","prev","to","destroy","refresh","replace","add","remove"],(function(e,i){o.register({type:n.Type.Event,name:i}),o.$element.on(i+".owl.carousel.core",t.proxy((function(t){t.namespace&&t.relatedTarget!==this&&(this.suppress([i]),o[i].apply(this,[].slice.call(arguments,1)),this.release([i]))}),o))}))),"string"==typeof e&&"_"!==e.charAt(0)&&o[e].apply(o,i)}))},t.fn.owlCarousel.Constructor=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){var n=function(e){this._core=e,this._interval=null,this._visible=null,this._handlers={"initialized.owl.carousel":t.proxy((function(t){t.namespace&&this._core.settings.autoRefresh&&this.watch()}),this)},this._core.options=t.extend({},n.Defaults,this._core.options),this._core.$element.on(this._handlers)};n.Defaults={autoRefresh:!0,autoRefreshInterval:500},n.prototype.watch=function(){this._interval||(this._visible=this._core.isVisible(),this._interval=e.setInterval(t.proxy(this.refresh,this),this._core.settings.autoRefreshInterval))},n.prototype.refresh=function(){this._core.isVisible()!==this._visible&&(this._visible=!this._visible,this._core.$element.toggleClass("owl-hidden",!this._visible),this._visible&&this._core.invalidate("width")&&this._core.refresh())},n.prototype.destroy=function(){var t,i;for(t in e.clearInterval(this._interval),this._handlers)this._core.$element.off(t,this._handlers[t]);for(i in Object.getOwnPropertyNames(this))"function"!=typeof this[i]&&(this[i]=null)},t.fn.owlCarousel.Constructor.Plugins.AutoRefresh=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){var n=function(e){this._core=e,this._loaded=[],this._handlers={"initialized.owl.carousel change.owl.carousel resized.owl.carousel":t.proxy((function(e){if(e.namespace&&this._core.settings&&this._core.settings.lazyLoad&&(e.property&&"position"==e.property.name||"initialized"==e.type)){var i=this._core.settings,s=i.center&&Math.ceil(i.items/2)||i.items,n=i.center&&-1*s||0,o=(e.property&&undefined!==e.property.value?e.property.value:this._core.current())+n,r=this._core.clones().length,a=t.proxy((function(t,e){this.load(e)}),this);for(i.lazyLoadEager>0&&(s+=i.lazyLoadEager,i.loop&&(o-=i.lazyLoadEager,s++));n++<s;)this.load(r/2+this._core.relative(o)),r&&t.each(this._core.clones(this._core.relative(o)),a),o++}}),this)},this._core.options=t.extend({},n.Defaults,this._core.options),this._core.$element.on(this._handlers)};n.Defaults={lazyLoad:!1,lazyLoadEager:0},n.prototype.load=function(i){var s=this._core.$stage.children().eq(i),n=s&&s.find(".owl-lazy");!n||t.inArray(s.get(0),this._loaded)>-1||(n.each(t.proxy((function(i,s){var n,o=t(s),r=e.devicePixelRatio>1&&o.attr("data-src-retina")||o.attr("data-src")||o.attr("data-srcset");this._core.trigger("load",{element:o,url:r},"lazy"),o.is("img")?o.one("load.owl.lazy",t.proxy((function(){o.css("opacity",1),this._core.trigger("loaded",{element:o,url:r},"lazy")}),this)).attr("src",r):o.is("source")?o.one("load.owl.lazy",t.proxy((function(){this._core.trigger("loaded",{element:o,url:r},"lazy")}),this)).attr("srcset",r):((n=new Image).onload=t.proxy((function(){o.css({"background-image":'url("'+r+'")',opacity:"1"}),this._core.trigger("loaded",{element:o,url:r},"lazy")}),this),n.src=r)}),this)),this._loaded.push(s.get(0)))},n.prototype.destroy=function(){var t,e;for(t in this.handlers)this._core.$element.off(t,this.handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},t.fn.owlCarousel.Constructor.Plugins.Lazy=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){var n=function(i){this._core=i,this._previousHeight=null,this._handlers={"initialized.owl.carousel refreshed.owl.carousel":t.proxy((function(t){t.namespace&&this._core.settings.autoHeight&&this.update()}),this),"changed.owl.carousel":t.proxy((function(t){t.namespace&&this._core.settings.autoHeight&&"position"===t.property.name&&this.update()}),this),"loaded.owl.lazy":t.proxy((function(t){t.namespace&&this._core.settings.autoHeight&&t.element.closest("."+this._core.settings.itemClass).index()===this._core.current()&&this.update()}),this)},this._core.options=t.extend({},n.Defaults,this._core.options),this._core.$element.on(this._handlers),this._intervalId=null;var s=this;t(e).on("load",(function(){s._core.settings.autoHeight&&s.update()})),t(e).resize((function(){s._core.settings.autoHeight&&(null!=s._intervalId&&clearTimeout(s._intervalId),s._intervalId=setTimeout((function(){s.update()}),250))}))};n.Defaults={autoHeight:!1,autoHeightClass:"owl-height"},n.prototype.update=function(){var e=this._core._current,i=e+this._core.settings.items,s=this._core.settings.lazyLoad,n=this._core.$stage.children().toArray().slice(e,i),o=[],r=0;t.each(n,(function(e,i){o.push(t(i).height())})),(r=Math.max.apply(null,o))<=1&&s&&this._previousHeight&&(r=this._previousHeight),this._previousHeight=r,this._core.$stage.parent().height(r).addClass(this._core.settings.autoHeightClass)},n.prototype.destroy=function(){var t,e;for(t in this._handlers)this._core.$element.off(t,this._handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},t.fn.owlCarousel.Constructor.Plugins.AutoHeight=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){var n=function(e){this._core=e,this._videos={},this._playing=null,this._handlers={"initialized.owl.carousel":t.proxy((function(t){t.namespace&&this._core.register({type:"state",name:"playing",tags:["interacting"]})}),this),"resize.owl.carousel":t.proxy((function(t){t.namespace&&this._core.settings.video&&this.isInFullScreen()&&t.preventDefault()}),this),"refreshed.owl.carousel":t.proxy((function(t){t.namespace&&this._core.is("resizing")&&this._core.$stage.find(".cloned .owl-video-frame").remove()}),this),"changed.owl.carousel":t.proxy((function(t){t.namespace&&"position"===t.property.name&&this._playing&&this.stop()}),this),"prepared.owl.carousel":t.proxy((function(e){if(e.namespace){var i=t(e.content).find(".owl-video");i.length&&(i.css("display","none"),this.fetch(i,t(e.content)))}}),this)},this._core.options=t.extend({},n.Defaults,this._core.options),this._core.$element.on(this._handlers),this._core.$element.on("click.owl.video",".owl-video-play-icon",t.proxy((function(t){this.play(t)}),this))};n.Defaults={video:!1,videoHeight:!1,videoWidth:!1},n.prototype.fetch=function(t,e){var i=t.attr("data-vimeo-id")?"vimeo":t.attr("data-vzaar-id")?"vzaar":"youtube",s=t.attr("data-vimeo-id")||t.attr("data-youtube-id")||t.attr("data-vzaar-id"),n=t.attr("data-width")||this._core.settings.videoWidth,o=t.attr("data-height")||this._core.settings.videoHeight,r=t.attr("href");if(!r)throw new Error("Missing video URL.");if((s=r.match(/(http:|https:|)\/\/(player.|www.|app.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com|be\-nocookie\.com)|vzaar\.com)\/(video\/|videos\/|embed\/|channels\/.+\/|groups\/.+\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/))[3].indexOf("youtu")>-1)i="youtube";else if(s[3].indexOf("vimeo")>-1)i="vimeo";else{if(!(s[3].indexOf("vzaar")>-1))throw new Error("Video URL not supported.");i="vzaar"}s=s[6],this._videos[r]={type:i,id:s,width:n,height:o},e.attr("data-video",r),this.thumbnail(t,this._videos[r])},n.prototype.thumbnail=function(e,i){var s,n,o=i.width&&i.height?"width:"+i.width+"px;height:"+i.height+"px;":"",r=e.find("img"),a="src",l="",h=this._core.settings,c=function(i){'<div class="owl-video-play-icon"></div>',s=h.lazyLoad?t("<div/>",{class:"owl-video-tn "+l,srcType:i}):t("<div/>",{class:"owl-video-tn",style:"opacity:1;background-image:url("+i+")"}),e.after(s),e.after('<div class="owl-video-play-icon"></div>')};if(e.wrap(t("<div/>",{class:"owl-video-wrapper",style:o})),this._core.settings.lazyLoad&&(a="data-src",l="owl-lazy"),r.length)return c(r.attr(a)),r.remove(),!1;"youtube"===i.type?(n="//img.youtube.com/vi/"+i.id+"/hqdefault.jpg",c(n)):"vimeo"===i.type?t.ajax({type:"GET",url:"//vimeo.com/api/v2/video/"+i.id+".json",jsonp:"callback",dataType:"jsonp",success:function(t){n=t[0].thumbnail_large,c(n)}}):"vzaar"===i.type&&t.ajax({type:"GET",url:"//vzaar.com/api/videos/"+i.id+".json",jsonp:"callback",dataType:"jsonp",success:function(t){n=t.framegrab_url,c(n)}})},n.prototype.stop=function(){this._core.trigger("stop",null,"video"),this._playing.find(".owl-video-frame").remove(),this._playing.removeClass("owl-video-playing"),this._playing=null,this._core.leave("playing"),this._core.trigger("stopped",null,"video")},n.prototype.play=function(e){var i,s=t(e.target).closest("."+this._core.settings.itemClass),n=this._videos[s.attr("data-video")],o=n.width||"100%",r=n.height||this._core.$stage.height();this._playing||(this._core.enter("playing"),this._core.trigger("play",null,"video"),s=this._core.items(this._core.relative(s.index())),this._core.reset(s.index()),(i=t('<iframe frameborder="0" allowfullscreen mozallowfullscreen webkitAllowFullScreen ></iframe>')).attr("height",r),i.attr("width",o),"youtube"===n.type?i.attr("src","//www.youtube.com/embed/"+n.id+"?autoplay=1&rel=0&v="+n.id):"vimeo"===n.type?i.attr("src","//player.vimeo.com/video/"+n.id+"?autoplay=1"):"vzaar"===n.type&&i.attr("src","//view.vzaar.com/"+n.id+"/player?autoplay=true"),t(i).wrap('<div class="owl-video-frame" />').insertAfter(s.find(".owl-video")),this._playing=s.addClass("owl-video-playing"))},n.prototype.isInFullScreen=function(){var e=i.fullscreenElement||i.mozFullScreenElement||i.webkitFullscreenElement;return e&&t(e).parent().hasClass("owl-video-frame")},n.prototype.destroy=function(){var t,e;for(t in this._core.$element.off("click.owl.video"),this._handlers)this._core.$element.off(t,this._handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},t.fn.owlCarousel.Constructor.Plugins.Video=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){var n=function(e){this.core=e,this.core.options=t.extend({},n.Defaults,this.core.options),this.swapping=!0,this.previous=s,this.next=s,this.handlers={"change.owl.carousel":t.proxy((function(t){t.namespace&&"position"==t.property.name&&(this.previous=this.core.current(),this.next=t.property.value)}),this),"drag.owl.carousel dragged.owl.carousel translated.owl.carousel":t.proxy((function(t){t.namespace&&(this.swapping="translated"==t.type)}),this),"translate.owl.carousel":t.proxy((function(t){t.namespace&&this.swapping&&(this.core.options.animateOut||this.core.options.animateIn)&&this.swap()}),this)},this.core.$element.on(this.handlers)};n.Defaults={animateOut:!1,animateIn:!1},n.prototype.swap=function(){if(1===this.core.settings.items&&t.support.animation&&t.support.transition){this.core.speed(0);var e,i=t.proxy(this.clear,this),s=this.core.$stage.children().eq(this.previous),n=this.core.$stage.children().eq(this.next),o=this.core.settings.animateIn,r=this.core.settings.animateOut;this.core.current()!==this.previous&&(r&&(e=this.core.coordinates(this.previous)-this.core.coordinates(this.next),s.one(t.support.animation.end,i).css({left:e+"px"}).addClass("animated owl-animated-out").addClass(r)),o&&n.one(t.support.animation.end,i).addClass("animated owl-animated-in").addClass(o))}},n.prototype.clear=function(e){t(e.target).css({left:""}).removeClass("animated owl-animated-out owl-animated-in").removeClass(this.core.settings.animateIn).removeClass(this.core.settings.animateOut),this.core.onTransitionEnd()},n.prototype.destroy=function(){var t,e;for(t in this.handlers)this.core.$element.off(t,this.handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},t.fn.owlCarousel.Constructor.Plugins.Animate=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){var n=function(e){this._core=e,this._call=null,this._time=0,this._timeout=0,this._paused=!0,this._handlers={"changed.owl.carousel":t.proxy((function(t){t.namespace&&"settings"===t.property.name?this._core.settings.autoplay?this.play():this.stop():t.namespace&&"position"===t.property.name&&this._paused&&(this._time=0)}),this),"initialized.owl.carousel":t.proxy((function(t){t.namespace&&this._core.settings.autoplay&&this.play()}),this),"play.owl.autoplay":t.proxy((function(t,e,i){t.namespace&&this.play(e,i)}),this),"stop.owl.autoplay":t.proxy((function(t){t.namespace&&this.stop()}),this),"mouseover.owl.autoplay":t.proxy((function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.pause()}),this),"mouseleave.owl.autoplay":t.proxy((function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.play()}),this),"touchstart.owl.core":t.proxy((function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.pause()}),this),"touchend.owl.core":t.proxy((function(){this._core.settings.autoplayHoverPause&&this.play()}),this)},this._core.$element.on(this._handlers),this._core.options=t.extend({},n.Defaults,this._core.options)};n.Defaults={autoplay:!1,autoplayTimeout:5e3,autoplayHoverPause:!1,autoplaySpeed:!1},n.prototype._next=function(s){this._call=e.setTimeout(t.proxy(this._next,this,s),this._timeout*(Math.round(this.read()/this._timeout)+1)-this.read()),this._core.is("interacting")||i.hidden||this._core.next(s||this._core.settings.autoplaySpeed)},n.prototype.read=function(){return(new Date).getTime()-this._time},n.prototype.play=function(i,s){var n;this._core.is("rotating")||this._core.enter("rotating"),i=i||this._core.settings.autoplayTimeout,n=Math.min(this._time%(this._timeout||i),i),this._paused?(this._time=this.read(),this._paused=!1):e.clearTimeout(this._call),this._time+=this.read()%i-n,this._timeout=i,this._call=e.setTimeout(t.proxy(this._next,this,s),i-n)},n.prototype.stop=function(){this._core.is("rotating")&&(this._time=0,this._paused=!0,e.clearTimeout(this._call),this._core.leave("rotating"))},n.prototype.pause=function(){this._core.is("rotating")&&!this._paused&&(this._time=this.read(),this._paused=!0,e.clearTimeout(this._call))},n.prototype.destroy=function(){var t,e;for(t in this.stop(),this._handlers)this._core.$element.off(t,this._handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},t.fn.owlCarousel.Constructor.Plugins.autoplay=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){"use strict";var n=function(e){this._core=e,this._initialized=!1,this._pages=[],this._controls={},this._templates=[],this.$element=this._core.$element,this._overrides={next:this._core.next,prev:this._core.prev,to:this._core.to},this._handlers={"prepared.owl.carousel":t.proxy((function(e){e.namespace&&this._core.settings.dotsData&&this._templates.push('<div class="'+this._core.settings.dotClass+'">'+t(e.content).find("[data-dot]").addBack("[data-dot]").attr("data-dot")+"</div>")}),this),"added.owl.carousel":t.proxy((function(t){t.namespace&&this._core.settings.dotsData&&this._templates.splice(t.position,0,this._templates.pop())}),this),"remove.owl.carousel":t.proxy((function(t){t.namespace&&this._core.settings.dotsData&&this._templates.splice(t.position,1)}),this),"changed.owl.carousel":t.proxy((function(t){t.namespace&&"position"==t.property.name&&this.draw()}),this),"initialized.owl.carousel":t.proxy((function(t){t.namespace&&!this._initialized&&(this._core.trigger("initialize",null,"navigation"),this.initialize(),this.update(),this.draw(),this._initialized=!0,this._core.trigger("initialized",null,"navigation"))}),this),"refreshed.owl.carousel":t.proxy((function(t){t.namespace&&this._initialized&&(this._core.trigger("refresh",null,"navigation"),this.update(),this.draw(),this._core.trigger("refreshed",null,"navigation"))}),this)},this._core.options=t.extend({},n.Defaults,this._core.options),this.$element.on(this._handlers)};n.Defaults={nav:!1,navText:['<span aria-label="Previous">‹</span>','<span aria-label="Next">›</span>'],navSpeed:!1,navElement:'button type="button" role="presentation"',navContainer:!1,navContainerClass:"owl-nav",navClass:["owl-prev","owl-next"],slideBy:1,dotClass:"owl-dot",dotsClass:"owl-dots",dots:!0,dotsEach:!1,dotsData:!1,dotsSpeed:!1,dotsContainer:!1},n.prototype.initialize=function(){var e,i=this._core.settings;for(e in this._controls.$relative=(i.navContainer?t(i.navContainer):t("<div>").addClass(i.navContainerClass).appendTo(this.$element)).addClass("disabled"),this._controls.$previous=t("<"+i.navElement+">").addClass(i.navClass[0]).html(i.navText[0]).prependTo(this._controls.$relative).on("click",t.proxy((function(t){this.prev(i.navSpeed)}),this)),this._controls.$next=t("<"+i.navElement+">").addClass(i.navClass[1]).html(i.navText[1]).appendTo(this._controls.$relative).on("click",t.proxy((function(t){this.next(i.navSpeed)}),this)),i.dotsData||(this._templates=[t('<button role="button">').addClass(i.dotClass).append(t("<span>")).prop("outerHTML")]),this._controls.$absolute=(i.dotsContainer?t(i.dotsContainer):t("<div>").addClass(i.dotsClass).appendTo(this.$element)).addClass("disabled"),this._controls.$absolute.on("click","button",t.proxy((function(e){var s=t(e.target).parent().is(this._controls.$absolute)?t(e.target).index():t(e.target).parent().index();e.preventDefault(),this.to(s,i.dotsSpeed)}),this)),this._overrides)this._core[e]=t.proxy(this[e],this)},n.prototype.destroy=function(){var t,e,i,s,n;for(t in n=this._core.settings,this._handlers)this.$element.off(t,this._handlers[t]);for(e in this._controls)"$relative"===e&&n.navContainer?this._controls[e].html(""):this._controls[e].remove();for(s in this.overides)this._core[s]=this._overrides[s];for(i in Object.getOwnPropertyNames(this))"function"!=typeof this[i]&&(this[i]=null)},n.prototype.update=function(){var t,e,i=this._core.clones().length/2,s=i+this._core.items().length,n=this._core.maximum(!0),o=this._core.settings,r=o.center||o.autoWidth||o.dotsData?1:o.dotsEach||o.items;if("page"!==o.slideBy&&(o.slideBy=Math.min(o.slideBy,o.items)),o.dots||"page"==o.slideBy)for(this._pages=[],t=i,e=0,0;t<s;t++){if(e>=r||0===e){if(this._pages.push({start:Math.min(n,t-i),end:t-i+r-1}),Math.min(n,t-i)===n)break;e=0}e+=this._core.mergers(this._core.relative(t))}},n.prototype.draw=function(){var e,i=this._core.settings,s=this._core.items().length<=i.items,n=this._core.relative(this._core.current()),o=i.loop||i.rewind;this._controls.$relative.toggleClass("disabled",!i.nav||s),i.nav&&(this._controls.$previous.toggleClass("disabled",!o&&n<=this._core.minimum(!0)),this._controls.$next.toggleClass("disabled",!o&&n>=this._core.maximum(!0))),this._controls.$absolute.toggleClass("disabled",!i.dots||s),i.dots&&(e=this._pages.length-this._controls.$absolute.children().length,i.dotsData&&0!==e?this._controls.$absolute.html(this._templates.join("")):e>0?this._controls.$absolute.append(new Array(e+1).join(this._templates[0])):e<0&&this._controls.$absolute.children().slice(e).remove(),this._controls.$absolute.find(".active").removeClass("active"),this._controls.$absolute.children().eq(t.inArray(this.current(),this._pages)).addClass("active"))},n.prototype.onTrigger=function(e){var i=this._core.settings;e.page={index:t.inArray(this.current(),this._pages),count:this._pages.length,size:i&&(i.center||i.autoWidth||i.dotsData?1:i.dotsEach||i.items)}},n.prototype.current=function(){var e=this._core.relative(this._core.current());return t.grep(this._pages,t.proxy((function(t,i){return t.start<=e&&t.end>=e}),this)).pop()},n.prototype.getPosition=function(e){var i,s,n=this._core.settings;return"page"==n.slideBy?(i=t.inArray(this.current(),this._pages),s=this._pages.length,e?++i:--i,i=this._pages[(i%s+s)%s].start):(i=this._core.relative(this._core.current()),s=this._core.items().length,e?i+=n.slideBy:i-=n.slideBy),i},n.prototype.next=function(e){t.proxy(this._overrides.to,this._core)(this.getPosition(!0),e)},n.prototype.prev=function(e){t.proxy(this._overrides.to,this._core)(this.getPosition(!1),e)},n.prototype.to=function(e,i,s){var n;!s&&this._pages.length?(n=this._pages.length,t.proxy(this._overrides.to,this._core)(this._pages[(e%n+n)%n].start,i)):t.proxy(this._overrides.to,this._core)(e,i)},t.fn.owlCarousel.Constructor.Plugins.Navigation=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){"use strict";var n=function(i){this._core=i,this._hashes={},this.$element=this._core.$element,this._handlers={"initialized.owl.carousel":t.proxy((function(i){i.namespace&&"URLHash"===this._core.settings.startPosition&&t(e).trigger("hashchange.owl.navigation")}),this),"prepared.owl.carousel":t.proxy((function(e){if(e.namespace){var i=t(e.content).find("[data-hash]").addBack("[data-hash]").attr("data-hash");if(!i)return;this._hashes[i]=e.content}}),this),"changed.owl.carousel":t.proxy((function(i){if(i.namespace&&"position"===i.property.name){var s=this._core.items(this._core.relative(this._core.current())),n=t.map(this._hashes,(function(t,e){return t===s?e:null})).join();if(!n||e.location.hash.slice(1)===n)return;e.location.hash=n}}),this)},this._core.options=t.extend({},n.Defaults,this._core.options),this.$element.on(this._handlers),t(e).on("hashchange.owl.navigation",t.proxy((function(t){var i=e.location.hash.substring(1),s=this._core.$stage.children(),n=this._hashes[i]&&s.index(this._hashes[i]);undefined!==n&&n!==this._core.current()&&this._core.to(this._core.relative(n),!1,!0)}),this))};n.Defaults={URLhashListener:!1},n.prototype.destroy=function(){var i,s;for(i in t(e).off("hashchange.owl.navigation"),this._handlers)this._core.$element.off(i,this._handlers[i]);for(s in Object.getOwnPropertyNames(this))"function"!=typeof this[s]&&(this[s]=null)},t.fn.owlCarousel.Constructor.Plugins.Hash=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){var n=t("<support>").get(0).style,o="Webkit Moz O ms".split(" "),r={transition:{end:{WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",transition:"transitionend"}},animation:{end:{WebkitAnimation:"webkitAnimationEnd",MozAnimation:"animationend",OAnimation:"oAnimationEnd",animation:"animationend"}}},a=function(){return!!c("transform")},l=function(){return!!c("perspective")},h=function(){return!!c("animation")};function c(e,i){var s=!1,r=e.charAt(0).toUpperCase()+e.slice(1);return t.each((e+" "+o.join(r+" ")+r).split(" "),(function(t,e){if(undefined!==n[e])return s=!i||e,!1})),s}function p(t){return c(t,!0)}(function(){return!!c("transition")})()&&(t.support.transition=new String(p("transition")),t.support.transition.end=r.transition.end[t.support.transition]),h()&&(t.support.animation=new String(p("animation")),t.support.animation.end=r.animation.end[t.support.animation]),a()&&(t.support.transform=new String(p("transform")),t.support.transform3d=l())}(window.Zepto||window.jQuery,window,document)},311:t=>{"use strict";t.exports=jQuery}},e={};function i(s){var n=e[s];if(void 0!==n)return n.exports;var o=e[s]={exports:{}};return t[s](o,o.exports,i),o.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var s in e)i.o(e,s)&&!i.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";i(213),i(112);var t=i(311),e=i.n(t);e()("body").find(".carousel-slider").each((function(){let t=e()(this),i=t.data("owl-settings");if("object"==typeof i&&Object.assign(i,{navText:['<svg class="carousel-slider-nav-icon" viewBox="0 0 20 20"><path d="M14 5l-5 5 5 5-1 2-7-7 7-7z"/></svg>','<svg class="carousel-slider-nav-icon" viewBox="0 0 20 20"><path d="M6 15l5-5-5-5 1-2 7 7-7 7z"/></svg>']}),t.owlCarousel(i),"hero-banner-slider"===t.data("slide-type")){let e=t.data("animation");e.length&&(t.on("change.owl.carousel",(function(){t.find(".carousel-slider-hero__cell__content").removeClass("animated "+e).hide()})),t.on("changed.owl.carousel",(function(i){setTimeout((function(){jQuery(i.target).find(".carousel-slider-hero__cell__content").eq(i.item.index).show().addClass("animated "+e)}),t.data("autoplay-speed"))})))}"product-carousel"===t.data("slide-type")?e()(this).find(".magnific-popup").magnificPopup({type:"ajax"}):"video-carousel"===t.data("slide-type")?e()(this).find(".magnific-popup").magnificPopup({type:"iframe"}):e()(this).find(".magnific-popup").magnificPopup({type:"image",gallery:{enabled:!0},zoom:{enabled:!0,duration:300,easing:"ease-in-out"}})}))})()})();
|
assets/js/frontend.js.LICENSE.txt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
/*! Magnific Popup - v1.1.0 - 2016-02-20
|
2 |
+
* http://dimsemenov.com/plugins/magnific-popup/
|
3 |
+
* Copyright (c) 2016 Dmitry Semenov; */
|
assets/js/gutenberg-block.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(()=>{var e,l,r,
|
1 |
+
(()=>{"use strict";var e={n:l=>{var r=l&&l.__esModule?()=>l.default:()=>l;return e.d(r,{a:r}),r},d:(l,r)=>{for(var t in r)e.o(r,t)&&!e.o(l,t)&&Object.defineProperty(l,t,{enumerable:!0,get:r[t]})},o:(e,l)=>Object.prototype.hasOwnProperty.call(e,l)};(()=>{const l=React;var r=e.n(l);const t=wp.blocks,s=wp.components,a=wp.blockEditor,o=window.i18nCarouselSliderBlock||{sliders:[],site_url:"",block_logo:"",block_title:"",select_slider:""};(0,t.registerBlockType)("carousel-slider/slider",{title:o.block_title,icon:"slides",category:"common",attributes:{sliderID:{type:"integer",default:0}},edit:e=>{let l=e.attributes.sliderID,t=[];l||(l="");let i=new URL(o.site_url);i.searchParams.append("carousel_slider_preview","1"),i.searchParams.append("carousel_slider_iframe","1"),i.searchParams.append("slider_id",l);let c=i.toString();const n=r().createElement(s.SelectControl,{label:o.select_slider,value:l,options:o.sliders,onChange:l=>{e.setAttributes({sliderID:parseInt(l)})}});let d=r().createElement("div",{className:"carousel-slider-iframe-container"},r().createElement("div",{className:"carousel-slider-iframe-overlay"}),r().createElement("iframe",{className:"carousel-slider-iframe",scrolling:"no",src:c,height:"0",width:"500"})),u=r().createElement("div",{className:"carousel-slider-editor-controls"},r().createElement("img",{className:"carousel-slider-editor-controls__logo",src:o.block_logo,alt:""}),r().createElement("div",{className:"carousel-slider-editor-controls__title"},o.block_title),r().createElement("div",{className:"carousel-slider-editor-controls__input"},n)),m=r().createElement(a.InspectorControls,null,r().createElement("div",{className:"carousel-slider-inspector-controls"},n));return""===l?t.push(u):t.push(d),t.push(m),[t]},save:e=>{let{attributes:l}=e;return l.sliderID?r().createElement("div",null,`[carousel_slide id='${l.sliderID}']`):""}})})()})();
|
assets/js/style-loader.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(()=>{if(window.carouselSliderCssUrl){if(!document.querySelector("#carousel-slider-frontend-css")){let e=document.createElement("link");e.id="carousel-slider-frontend-css",e.rel="stylesheet",e.media="all",e.href=window.carouselSliderCssUrl,document.head.append(e)}}})();
|
assets/lib/magnific-popup/jquery.magnific-popup.js
DELETED
@@ -1,1860 +0,0 @@
|
|
1 |
-
/*! Magnific Popup - v1.1.0 - 2016-02-20
|
2 |
-
* http://dimsemenov.com/plugins/magnific-popup/
|
3 |
-
* Copyright (c) 2016 Dmitry Semenov; */
|
4 |
-
;(function (factory) {
|
5 |
-
if (typeof define === 'function' && define.amd) {
|
6 |
-
// AMD. Register as an anonymous module.
|
7 |
-
define(['jquery'], factory);
|
8 |
-
} else if (typeof exports === 'object') {
|
9 |
-
// Node/CommonJS
|
10 |
-
factory(require('jquery'));
|
11 |
-
} else {
|
12 |
-
// Browser globals
|
13 |
-
factory(window.jQuery || window.Zepto);
|
14 |
-
}
|
15 |
-
}(function($) {
|
16 |
-
|
17 |
-
/*>>core*/
|
18 |
-
/**
|
19 |
-
*
|
20 |
-
* Magnific Popup Core JS file
|
21 |
-
*
|
22 |
-
*/
|
23 |
-
|
24 |
-
|
25 |
-
/**
|
26 |
-
* Private static constants
|
27 |
-
*/
|
28 |
-
var CLOSE_EVENT = 'Close',
|
29 |
-
BEFORE_CLOSE_EVENT = 'BeforeClose',
|
30 |
-
AFTER_CLOSE_EVENT = 'AfterClose',
|
31 |
-
BEFORE_APPEND_EVENT = 'BeforeAppend',
|
32 |
-
MARKUP_PARSE_EVENT = 'MarkupParse',
|
33 |
-
OPEN_EVENT = 'Open',
|
34 |
-
CHANGE_EVENT = 'Change',
|
35 |
-
NS = 'mfp',
|
36 |
-
EVENT_NS = '.' + NS,
|
37 |
-
READY_CLASS = 'mfp-ready',
|
38 |
-
REMOVING_CLASS = 'mfp-removing',
|
39 |
-
PREVENT_CLOSE_CLASS = 'mfp-prevent-close';
|
40 |
-
|
41 |
-
|
42 |
-
/**
|
43 |
-
* Private vars
|
44 |
-
*/
|
45 |
-
/*jshint -W079 */
|
46 |
-
var mfp, // As we have only one instance of MagnificPopup object, we define it locally to not to use 'this'
|
47 |
-
MagnificPopup = function(){},
|
48 |
-
_isJQ = !!(window.jQuery),
|
49 |
-
_prevStatus,
|
50 |
-
_window = $(window),
|
51 |
-
_document,
|
52 |
-
_prevContentType,
|
53 |
-
_wrapClasses,
|
54 |
-
_currPopupType;
|
55 |
-
|
56 |
-
|
57 |
-
/**
|
58 |
-
* Private functions
|
59 |
-
*/
|
60 |
-
var _mfpOn = function(name, f) {
|
61 |
-
mfp.ev.on(NS + name + EVENT_NS, f);
|
62 |
-
},
|
63 |
-
_getEl = function(className, appendTo, html, raw) {
|
64 |
-
var el = document.createElement('div');
|
65 |
-
el.className = 'mfp-'+className;
|
66 |
-
if(html) {
|
67 |
-
el.innerHTML = html;
|
68 |
-
}
|
69 |
-
if(!raw) {
|
70 |
-
el = $(el);
|
71 |
-
if(appendTo) {
|
72 |
-
el.appendTo(appendTo);
|
73 |
-
}
|
74 |
-
} else if(appendTo) {
|
75 |
-
appendTo.appendChild(el);
|
76 |
-
}
|
77 |
-
return el;
|
78 |
-
},
|
79 |
-
_mfpTrigger = function(e, data) {
|
80 |
-
mfp.ev.triggerHandler(NS + e, data);
|
81 |
-
|
82 |
-
if(mfp.st.callbacks) {
|
83 |
-
// converts "mfpEventName" to "eventName" callback and triggers it if it's present
|
84 |
-
e = e.charAt(0).toLowerCase() + e.slice(1);
|
85 |
-
if(mfp.st.callbacks[e]) {
|
86 |
-
mfp.st.callbacks[e].apply(mfp, $.isArray(data) ? data : [data]);
|
87 |
-
}
|
88 |
-
}
|
89 |
-
},
|
90 |
-
_getCloseBtn = function(type) {
|
91 |
-
if(type !== _currPopupType || !mfp.currTemplate.closeBtn) {
|
92 |
-
mfp.currTemplate.closeBtn = $( mfp.st.closeMarkup.replace('%title%', mfp.st.tClose ) );
|
93 |
-
_currPopupType = type;
|
94 |
-
}
|
95 |
-
return mfp.currTemplate.closeBtn;
|
96 |
-
},
|
97 |
-
// Initialize Magnific Popup only when called at least once
|
98 |
-
_checkInstance = function() {
|
99 |
-
if(!$.magnificPopup.instance) {
|
100 |
-
/*jshint -W020 */
|
101 |
-
mfp = new MagnificPopup();
|
102 |
-
mfp.init();
|
103 |
-
$.magnificPopup.instance = mfp;
|
104 |
-
}
|
105 |
-
},
|
106 |
-
// CSS transition detection, http://stackoverflow.com/questions/7264899/detect-css-transitions-using-javascript-and-without-modernizr
|
107 |
-
supportsTransitions = function() {
|
108 |
-
var s = document.createElement('p').style, // 's' for style. better to create an element if body yet to exist
|
109 |
-
v = ['ms','O','Moz','Webkit']; // 'v' for vendor
|
110 |
-
|
111 |
-
if( s['transition'] !== undefined ) {
|
112 |
-
return true;
|
113 |
-
}
|
114 |
-
|
115 |
-
while( v.length ) {
|
116 |
-
if( v.pop() + 'Transition' in s ) {
|
117 |
-
return true;
|
118 |
-
}
|
119 |
-
}
|
120 |
-
|
121 |
-
return false;
|
122 |
-
};
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
/**
|
127 |
-
* Public functions
|
128 |
-
*/
|
129 |
-
MagnificPopup.prototype = {
|
130 |
-
|
131 |
-
constructor: MagnificPopup,
|
132 |
-
|
133 |
-
/**
|
134 |
-
* Initializes Magnific Popup plugin.
|
135 |
-
* This function is triggered only once when $.fn.magnificPopup or $.magnificPopup is executed
|
136 |
-
*/
|
137 |
-
init: function() {
|
138 |
-
var appVersion = navigator.appVersion;
|
139 |
-
mfp.isLowIE = mfp.isIE8 = document.all && !document.addEventListener;
|
140 |
-
mfp.isAndroid = (/android/gi).test(appVersion);
|
141 |
-
mfp.isIOS = (/iphone|ipad|ipod/gi).test(appVersion);
|
142 |
-
mfp.supportsTransition = supportsTransitions();
|
143 |
-
|
144 |
-
// We disable fixed positioned lightbox on devices that don't handle it nicely.
|
145 |
-
// If you know a better way of detecting this - let me know.
|
146 |
-
mfp.probablyMobile = (mfp.isAndroid || mfp.isIOS || /(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent) );
|
147 |
-
_document = $(document);
|
148 |
-
|
149 |
-
mfp.popupsCache = {};
|
150 |
-
},
|
151 |
-
|
152 |
-
/**
|
153 |
-
* Opens popup
|
154 |
-
* @param data [description]
|
155 |
-
*/
|
156 |
-
open: function(data) {
|
157 |
-
|
158 |
-
var i;
|
159 |
-
|
160 |
-
if(data.isObj === false) {
|
161 |
-
// convert jQuery collection to array to avoid conflicts later
|
162 |
-
mfp.items = data.items.toArray();
|
163 |
-
|
164 |
-
mfp.index = 0;
|
165 |
-
var items = data.items,
|
166 |
-
item;
|
167 |
-
for(i = 0; i < items.length; i++) {
|
168 |
-
item = items[i];
|
169 |
-
if(item.parsed) {
|
170 |
-
item = item.el[0];
|
171 |
-
}
|
172 |
-
if(item === data.el[0]) {
|
173 |
-
mfp.index = i;
|
174 |
-
break;
|
175 |
-
}
|
176 |
-
}
|
177 |
-
} else {
|
178 |
-
mfp.items = $.isArray(data.items) ? data.items : [data.items];
|
179 |
-
mfp.index = data.index || 0;
|
180 |
-
}
|
181 |
-
|
182 |
-
// if popup is already opened - we just update the content
|
183 |
-
if(mfp.isOpen) {
|
184 |
-
mfp.updateItemHTML();
|
185 |
-
return;
|
186 |
-
}
|
187 |
-
|
188 |
-
mfp.types = [];
|
189 |
-
_wrapClasses = '';
|
190 |
-
if(data.mainEl && data.mainEl.length) {
|
191 |
-
mfp.ev = data.mainEl.eq(0);
|
192 |
-
} else {
|
193 |
-
mfp.ev = _document;
|
194 |
-
}
|
195 |
-
|
196 |
-
if(data.key) {
|
197 |
-
if(!mfp.popupsCache[data.key]) {
|
198 |
-
mfp.popupsCache[data.key] = {};
|
199 |
-
}
|
200 |
-
mfp.currTemplate = mfp.popupsCache[data.key];
|
201 |
-
} else {
|
202 |
-
mfp.currTemplate = {};
|
203 |
-
}
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
mfp.st = $.extend(true, {}, $.magnificPopup.defaults, data );
|
208 |
-
mfp.fixedContentPos = mfp.st.fixedContentPos === 'auto' ? !mfp.probablyMobile : mfp.st.fixedContentPos;
|
209 |
-
|
210 |
-
if(mfp.st.modal) {
|
211 |
-
mfp.st.closeOnContentClick = false;
|
212 |
-
mfp.st.closeOnBgClick = false;
|
213 |
-
mfp.st.showCloseBtn = false;
|
214 |
-
mfp.st.enableEscapeKey = false;
|
215 |
-
}
|
216 |
-
|
217 |
-
|
218 |
-
// Building markup
|
219 |
-
// main containers are created only once
|
220 |
-
if(!mfp.bgOverlay) {
|
221 |
-
|
222 |
-
// Dark overlay
|
223 |
-
mfp.bgOverlay = _getEl('bg').on('click'+EVENT_NS, function() {
|
224 |
-
mfp.close();
|
225 |
-
});
|
226 |
-
|
227 |
-
mfp.wrap = _getEl('wrap').attr('tabindex', -1).on('click'+EVENT_NS, function(e) {
|
228 |
-
if(mfp._checkIfClose(e.target)) {
|
229 |
-
mfp.close();
|
230 |
-
}
|
231 |
-
});
|
232 |
-
|
233 |
-
mfp.container = _getEl('container', mfp.wrap);
|
234 |
-
}
|
235 |
-
|
236 |
-
mfp.contentContainer = _getEl('content');
|
237 |
-
if(mfp.st.preloader) {
|
238 |
-
mfp.preloader = _getEl('preloader', mfp.container, mfp.st.tLoading);
|
239 |
-
}
|
240 |
-
|
241 |
-
|
242 |
-
// Initializing modules
|
243 |
-
var modules = $.magnificPopup.modules;
|
244 |
-
for(i = 0; i < modules.length; i++) {
|
245 |
-
var n = modules[i];
|
246 |
-
n = n.charAt(0).toUpperCase() + n.slice(1);
|
247 |
-
mfp['init'+n].call(mfp);
|
248 |
-
}
|
249 |
-
_mfpTrigger('BeforeOpen');
|
250 |
-
|
251 |
-
|
252 |
-
if(mfp.st.showCloseBtn) {
|
253 |
-
// Close button
|
254 |
-
if(!mfp.st.closeBtnInside) {
|
255 |
-
mfp.wrap.append( _getCloseBtn() );
|
256 |
-
} else {
|
257 |
-
_mfpOn(MARKUP_PARSE_EVENT, function(e, template, values, item) {
|
258 |
-
values.close_replaceWith = _getCloseBtn(item.type);
|
259 |
-
});
|
260 |
-
_wrapClasses += ' mfp-close-btn-in';
|
261 |
-
}
|
262 |
-
}
|
263 |
-
|
264 |
-
if(mfp.st.alignTop) {
|
265 |
-
_wrapClasses += ' mfp-align-top';
|
266 |
-
}
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
if(mfp.fixedContentPos) {
|
271 |
-
mfp.wrap.css({
|
272 |
-
overflow: mfp.st.overflowY,
|
273 |
-
overflowX: 'hidden',
|
274 |
-
overflowY: mfp.st.overflowY
|
275 |
-
});
|
276 |
-
} else {
|
277 |
-
mfp.wrap.css({
|
278 |
-
top: _window.scrollTop(),
|
279 |
-
position: 'absolute'
|
280 |
-
});
|
281 |
-
}
|
282 |
-
if( mfp.st.fixedBgPos === false || (mfp.st.fixedBgPos === 'auto' && !mfp.fixedContentPos) ) {
|
283 |
-
mfp.bgOverlay.css({
|
284 |
-
height: _document.height(),
|
285 |
-
position: 'absolute'
|
286 |
-
});
|
287 |
-
}
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
if(mfp.st.enableEscapeKey) {
|
292 |
-
// Close on ESC key
|
293 |
-
_document.on('keyup' + EVENT_NS, function(e) {
|
294 |
-
if(e.keyCode === 27) {
|
295 |
-
mfp.close();
|
296 |
-
}
|
297 |
-
});
|
298 |
-
}
|
299 |
-
|
300 |
-
_window.on('resize' + EVENT_NS, function() {
|
301 |
-
mfp.updateSize();
|
302 |
-
});
|
303 |
-
|
304 |
-
|
305 |
-
if(!mfp.st.closeOnContentClick) {
|
306 |
-
_wrapClasses += ' mfp-auto-cursor';
|
307 |
-
}
|
308 |
-
|
309 |
-
if(_wrapClasses)
|
310 |
-
mfp.wrap.addClass(_wrapClasses);
|
311 |
-
|
312 |
-
|
313 |
-
// this triggers recalculation of layout, so we get it once to not to trigger twice
|
314 |
-
var windowHeight = mfp.wH = _window.height();
|
315 |
-
|
316 |
-
|
317 |
-
var windowStyles = {};
|
318 |
-
|
319 |
-
if( mfp.fixedContentPos ) {
|
320 |
-
if(mfp._hasScrollBar(windowHeight)){
|
321 |
-
var s = mfp._getScrollbarSize();
|
322 |
-
if(s) {
|
323 |
-
windowStyles.marginRight = s;
|
324 |
-
}
|
325 |
-
}
|
326 |
-
}
|
327 |
-
|
328 |
-
if(mfp.fixedContentPos) {
|
329 |
-
if(!mfp.isIE7) {
|
330 |
-
windowStyles.overflow = 'hidden';
|
331 |
-
} else {
|
332 |
-
// ie7 double-scroll bug
|
333 |
-
$('body, html').css('overflow', 'hidden');
|
334 |
-
}
|
335 |
-
}
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
var classesToadd = mfp.st.mainClass;
|
340 |
-
if(mfp.isIE7) {
|
341 |
-
classesToadd += ' mfp-ie7';
|
342 |
-
}
|
343 |
-
if(classesToadd) {
|
344 |
-
mfp._addClassToMFP( classesToadd );
|
345 |
-
}
|
346 |
-
|
347 |
-
// add content
|
348 |
-
mfp.updateItemHTML();
|
349 |
-
|
350 |
-
_mfpTrigger('BuildControls');
|
351 |
-
|
352 |
-
// remove scrollbar, add margin e.t.c
|
353 |
-
$('html').css(windowStyles);
|
354 |
-
|
355 |
-
// add everything to DOM
|
356 |
-
mfp.bgOverlay.add(mfp.wrap).prependTo( mfp.st.prependTo || $(document.body) );
|
357 |
-
|
358 |
-
// Save last focused element
|
359 |
-
mfp._lastFocusedEl = document.activeElement;
|
360 |
-
|
361 |
-
// Wait for next cycle to allow CSS transition
|
362 |
-
setTimeout(function() {
|
363 |
-
|
364 |
-
if(mfp.content) {
|
365 |
-
mfp._addClassToMFP(READY_CLASS);
|
366 |
-
mfp._setFocus();
|
367 |
-
} else {
|
368 |
-
// if content is not defined (not loaded e.t.c) we add class only for BG
|
369 |
-
mfp.bgOverlay.addClass(READY_CLASS);
|
370 |
-
}
|
371 |
-
|
372 |
-
// Trap the focus in popup
|
373 |
-
_document.on('focusin' + EVENT_NS, mfp._onFocusIn);
|
374 |
-
|
375 |
-
}, 16);
|
376 |
-
|
377 |
-
mfp.isOpen = true;
|
378 |
-
mfp.updateSize(windowHeight);
|
379 |
-
_mfpTrigger(OPEN_EVENT);
|
380 |
-
|
381 |
-
return data;
|
382 |
-
},
|
383 |
-
|
384 |
-
/**
|
385 |
-
* Closes the popup
|
386 |
-
*/
|
387 |
-
close: function() {
|
388 |
-
if(!mfp.isOpen) return;
|
389 |
-
_mfpTrigger(BEFORE_CLOSE_EVENT);
|
390 |
-
|
391 |
-
mfp.isOpen = false;
|
392 |
-
// for CSS3 animation
|
393 |
-
if(mfp.st.removalDelay && !mfp.isLowIE && mfp.supportsTransition ) {
|
394 |
-
mfp._addClassToMFP(REMOVING_CLASS);
|
395 |
-
setTimeout(function() {
|
396 |
-
mfp._close();
|
397 |
-
}, mfp.st.removalDelay);
|
398 |
-
} else {
|
399 |
-
mfp._close();
|
400 |
-
}
|
401 |
-
},
|
402 |
-
|
403 |
-
/**
|
404 |
-
* Helper for close() function
|
405 |
-
*/
|
406 |
-
_close: function() {
|
407 |
-
_mfpTrigger(CLOSE_EVENT);
|
408 |
-
|
409 |
-
var classesToRemove = REMOVING_CLASS + ' ' + READY_CLASS + ' ';
|
410 |
-
|
411 |
-
mfp.bgOverlay.detach();
|
412 |
-
mfp.wrap.detach();
|
413 |
-
mfp.container.empty();
|
414 |
-
|
415 |
-
if(mfp.st.mainClass) {
|
416 |
-
classesToRemove += mfp.st.mainClass + ' ';
|
417 |
-
}
|
418 |
-
|
419 |
-
mfp._removeClassFromMFP(classesToRemove);
|
420 |
-
|
421 |
-
if(mfp.fixedContentPos) {
|
422 |
-
var windowStyles = {marginRight: ''};
|
423 |
-
if(mfp.isIE7) {
|
424 |
-
$('body, html').css('overflow', '');
|
425 |
-
} else {
|
426 |
-
windowStyles.overflow = '';
|
427 |
-
}
|
428 |
-
$('html').css(windowStyles);
|
429 |
-
}
|
430 |
-
|
431 |
-
_document.off('keyup' + EVENT_NS + ' focusin' + EVENT_NS);
|
432 |
-
mfp.ev.off(EVENT_NS);
|
433 |
-
|
434 |
-
// clean up DOM elements that aren't removed
|
435 |
-
mfp.wrap.attr('class', 'mfp-wrap').removeAttr('style');
|
436 |
-
mfp.bgOverlay.attr('class', 'mfp-bg');
|
437 |
-
mfp.container.attr('class', 'mfp-container');
|
438 |
-
|
439 |
-
// remove close button from target element
|
440 |
-
if(mfp.st.showCloseBtn &&
|
441 |
-
(!mfp.st.closeBtnInside || mfp.currTemplate[mfp.currItem.type] === true)) {
|
442 |
-
if(mfp.currTemplate.closeBtn)
|
443 |
-
mfp.currTemplate.closeBtn.detach();
|
444 |
-
}
|
445 |
-
|
446 |
-
|
447 |
-
if(mfp.st.autoFocusLast && mfp._lastFocusedEl) {
|
448 |
-
$(mfp._lastFocusedEl).focus(); // put tab focus back
|
449 |
-
}
|
450 |
-
mfp.currItem = null;
|
451 |
-
mfp.content = null;
|
452 |
-
mfp.currTemplate = null;
|
453 |
-
mfp.prevHeight = 0;
|
454 |
-
|
455 |
-
_mfpTrigger(AFTER_CLOSE_EVENT);
|
456 |
-
},
|
457 |
-
|
458 |
-
updateSize: function(winHeight) {
|
459 |
-
|
460 |
-
if(mfp.isIOS) {
|
461 |
-
// fixes iOS nav bars https://github.com/dimsemenov/Magnific-Popup/issues/2
|
462 |
-
var zoomLevel = document.documentElement.clientWidth / window.innerWidth;
|
463 |
-
var height = window.innerHeight * zoomLevel;
|
464 |
-
mfp.wrap.css('height', height);
|
465 |
-
mfp.wH = height;
|
466 |
-
} else {
|
467 |
-
mfp.wH = winHeight || _window.height();
|
468 |
-
}
|
469 |
-
// Fixes #84: popup incorrectly positioned with position:relative on body
|
470 |
-
if(!mfp.fixedContentPos) {
|
471 |
-
mfp.wrap.css('height', mfp.wH);
|
472 |
-
}
|
473 |
-
|
474 |
-
_mfpTrigger('Resize');
|
475 |
-
|
476 |
-
},
|
477 |
-
|
478 |
-
/**
|
479 |
-
* Set content of popup based on current index
|
480 |
-
*/
|
481 |
-
updateItemHTML: function() {
|
482 |
-
var item = mfp.items[mfp.index];
|
483 |
-
|
484 |
-
// Detach and perform modifications
|
485 |
-
mfp.contentContainer.detach();
|
486 |
-
|
487 |
-
if(mfp.content)
|
488 |
-
mfp.content.detach();
|
489 |
-
|
490 |
-
if(!item.parsed) {
|
491 |
-
item = mfp.parseEl( mfp.index );
|
492 |
-
}
|
493 |
-
|
494 |
-
var type = item.type;
|
495 |
-
|
496 |
-
_mfpTrigger('BeforeChange', [mfp.currItem ? mfp.currItem.type : '', type]);
|
497 |
-
// BeforeChange event works like so:
|
498 |
-
// _mfpOn('BeforeChange', function(e, prevType, newType) { });
|
499 |
-
|
500 |
-
mfp.currItem = item;
|
501 |
-
|
502 |
-
if(!mfp.currTemplate[type]) {
|
503 |
-
var markup = mfp.st[type] ? mfp.st[type].markup : false;
|
504 |
-
|
505 |
-
// allows to modify markup
|
506 |
-
_mfpTrigger('FirstMarkupParse', markup);
|
507 |
-
|
508 |
-
if(markup) {
|
509 |
-
mfp.currTemplate[type] = $(markup);
|
510 |
-
} else {
|
511 |
-
// if there is no markup found we just define that template is parsed
|
512 |
-
mfp.currTemplate[type] = true;
|
513 |
-
}
|
514 |
-
}
|
515 |
-
|
516 |
-
if(_prevContentType && _prevContentType !== item.type) {
|
517 |
-
mfp.container.removeClass('mfp-'+_prevContentType+'-holder');
|
518 |
-
}
|
519 |
-
|
520 |
-
var newContent = mfp['get' + type.charAt(0).toUpperCase() + type.slice(1)](item, mfp.currTemplate[type]);
|
521 |
-
mfp.appendContent(newContent, type);
|
522 |
-
|
523 |
-
item.preloaded = true;
|
524 |
-
|
525 |
-
_mfpTrigger(CHANGE_EVENT, item);
|
526 |
-
_prevContentType = item.type;
|
527 |
-
|
528 |
-
// Append container back after its content changed
|
529 |
-
mfp.container.prepend(mfp.contentContainer);
|
530 |
-
|
531 |
-
_mfpTrigger('AfterChange');
|
532 |
-
},
|
533 |
-
|
534 |
-
|
535 |
-
/**
|
536 |
-
* Set HTML content of popup
|
537 |
-
*/
|
538 |
-
appendContent: function(newContent, type) {
|
539 |
-
mfp.content = newContent;
|
540 |
-
|
541 |
-
if(newContent) {
|
542 |
-
if(mfp.st.showCloseBtn && mfp.st.closeBtnInside &&
|
543 |
-
mfp.currTemplate[type] === true) {
|
544 |
-
// if there is no markup, we just append close button element inside
|
545 |
-
if(!mfp.content.find('.mfp-close').length) {
|
546 |
-
mfp.content.append(_getCloseBtn());
|
547 |
-
}
|
548 |
-
} else {
|
549 |
-
mfp.content = newContent;
|
550 |
-
}
|
551 |
-
} else {
|
552 |
-
mfp.content = '';
|
553 |
-
}
|
554 |
-
|
555 |
-
_mfpTrigger(BEFORE_APPEND_EVENT);
|
556 |
-
mfp.container.addClass('mfp-'+type+'-holder');
|
557 |
-
|
558 |
-
mfp.contentContainer.append(mfp.content);
|
559 |
-
},
|
560 |
-
|
561 |
-
|
562 |
-
/**
|
563 |
-
* Creates Magnific Popup data object based on given data
|
564 |
-
* @param {int} index Index of item to parse
|
565 |
-
*/
|
566 |
-
parseEl: function(index) {
|
567 |
-
var item = mfp.items[index],
|
568 |
-
type;
|
569 |
-
|
570 |
-
if(item.tagName) {
|
571 |
-
item = { el: $(item) };
|
572 |
-
} else {
|
573 |
-
type = item.type;
|
574 |
-
item = { data: item, src: item.src };
|
575 |
-
}
|
576 |
-
|
577 |
-
if(item.el) {
|
578 |
-
var types = mfp.types;
|
579 |
-
|
580 |
-
// check for 'mfp-TYPE' class
|
581 |
-
for(var i = 0; i < types.length; i++) {
|
582 |
-
if( item.el.hasClass('mfp-'+types[i]) ) {
|
583 |
-
type = types[i];
|
584 |
-
break;
|
585 |
-
}
|
586 |
-
}
|
587 |
-
|
588 |
-
item.src = item.el.attr('data-mfp-src');
|
589 |
-
if(!item.src) {
|
590 |
-
item.src = item.el.attr('href');
|
591 |
-
}
|
592 |
-
}
|
593 |
-
|
594 |
-
item.type = type || mfp.st.type || 'inline';
|
595 |
-
item.index = index;
|
596 |
-
item.parsed = true;
|
597 |
-
mfp.items[index] = item;
|
598 |
-
_mfpTrigger('ElementParse', item);
|
599 |
-
|
600 |
-
return mfp.items[index];
|
601 |
-
},
|
602 |
-
|
603 |
-
|
604 |
-
/**
|
605 |
-
* Initializes single popup or a group of popups
|
606 |
-
*/
|
607 |
-
addGroup: function(el, options) {
|
608 |
-
var eHandler = function(e) {
|
609 |
-
e.mfpEl = this;
|
610 |
-
mfp._openClick(e, el, options);
|
611 |
-
};
|
612 |
-
|
613 |
-
if(!options) {
|
614 |
-
options = {};
|
615 |
-
}
|
616 |
-
|
617 |
-
var eName = 'click.magnificPopup';
|
618 |
-
options.mainEl = el;
|
619 |
-
|
620 |
-
if(options.items) {
|
621 |
-
options.isObj = true;
|
622 |
-
el.off(eName).on(eName, eHandler);
|
623 |
-
} else {
|
624 |
-
options.isObj = false;
|
625 |
-
if(options.delegate) {
|
626 |
-
el.off(eName).on(eName, options.delegate , eHandler);
|
627 |
-
} else {
|
628 |
-
options.items = el;
|
629 |
-
el.off(eName).on(eName, eHandler);
|
630 |
-
}
|
631 |
-
}
|
632 |
-
},
|
633 |
-
_openClick: function(e, el, options) {
|
634 |
-
var midClick = options.midClick !== undefined ? options.midClick : $.magnificPopup.defaults.midClick;
|
635 |
-
|
636 |
-
|
637 |
-
if(!midClick && ( e.which === 2 || e.ctrlKey || e.metaKey || e.altKey || e.shiftKey ) ) {
|
638 |
-
return;
|
639 |
-
}
|
640 |
-
|
641 |
-
var disableOn = options.disableOn !== undefined ? options.disableOn : $.magnificPopup.defaults.disableOn;
|
642 |
-
|
643 |
-
if(disableOn) {
|
644 |
-
if($.isFunction(disableOn)) {
|
645 |
-
if( !disableOn.call(mfp) ) {
|
646 |
-
return true;
|
647 |
-
}
|
648 |
-
} else { // else it's number
|
649 |
-
if( _window.width() < disableOn ) {
|
650 |
-
return true;
|
651 |
-
}
|
652 |
-
}
|
653 |
-
}
|
654 |
-
|
655 |
-
if(e.type) {
|
656 |
-
e.preventDefault();
|
657 |
-
|
658 |
-
// This will prevent popup from closing if element is inside and popup is already opened
|
659 |
-
if(mfp.isOpen) {
|
660 |
-
e.stopPropagation();
|
661 |
-
}
|
662 |
-
}
|
663 |
-
|
664 |
-
options.el = $(e.mfpEl);
|
665 |
-
if(options.delegate) {
|
666 |
-
options.items = el.find(options.delegate);
|
667 |
-
}
|
668 |
-
mfp.open(options);
|
669 |
-
},
|
670 |
-
|
671 |
-
|
672 |
-
/**
|
673 |
-
* Updates text on preloader
|
674 |
-
*/
|
675 |
-
updateStatus: function(status, text) {
|
676 |
-
|
677 |
-
if(mfp.preloader) {
|
678 |
-
if(_prevStatus !== status) {
|
679 |
-
mfp.container.removeClass('mfp-s-'+_prevStatus);
|
680 |
-
}
|
681 |
-
|
682 |
-
if(!text && status === 'loading') {
|
683 |
-
text = mfp.st.tLoading;
|
684 |
-
}
|
685 |
-
|
686 |
-
var data = {
|
687 |
-
status: status,
|
688 |
-
text: text
|
689 |
-
};
|
690 |
-
// allows to modify status
|
691 |
-
_mfpTrigger('UpdateStatus', data);
|
692 |
-
|
693 |
-
status = data.status;
|
694 |
-
text = data.text;
|
695 |
-
|
696 |
-
mfp.preloader.html(text);
|
697 |
-
|
698 |
-
mfp.preloader.find('a').on('click', function(e) {
|
699 |
-
e.stopImmediatePropagation();
|
700 |
-
});
|
701 |
-
|
702 |
-
mfp.container.addClass('mfp-s-'+status);
|
703 |
-
_prevStatus = status;
|
704 |
-
}
|
705 |
-
},
|
706 |
-
|
707 |
-
|
708 |
-
/*
|
709 |
-
"Private" helpers that aren't private at all
|
710 |
-
*/
|
711 |
-
// Check to close popup or not
|
712 |
-
// "target" is an element that was clicked
|
713 |
-
_checkIfClose: function(target) {
|
714 |
-
|
715 |
-
if($(target).hasClass(PREVENT_CLOSE_CLASS)) {
|
716 |
-
return;
|
717 |
-
}
|
718 |
-
|
719 |
-
var closeOnContent = mfp.st.closeOnContentClick;
|
720 |
-
var closeOnBg = mfp.st.closeOnBgClick;
|
721 |
-
|
722 |
-
if(closeOnContent && closeOnBg) {
|
723 |
-
return true;
|
724 |
-
} else {
|
725 |
-
|
726 |
-
// We close the popup if click is on close button or on preloader. Or if there is no content.
|
727 |
-
if(!mfp.content || $(target).hasClass('mfp-close') || (mfp.preloader && target === mfp.preloader[0]) ) {
|
728 |
-
return true;
|
729 |
-
}
|
730 |
-
|
731 |
-
// if click is outside the content
|
732 |
-
if( (target !== mfp.content[0] && !$.contains(mfp.content[0], target)) ) {
|
733 |
-
if(closeOnBg) {
|
734 |
-
// last check, if the clicked element is in DOM, (in case it's removed onclick)
|
735 |
-
if( $.contains(document, target) ) {
|
736 |
-
return true;
|
737 |
-
}
|
738 |
-
}
|
739 |
-
} else if(closeOnContent) {
|
740 |
-
return true;
|
741 |
-
}
|
742 |
-
|
743 |
-
}
|
744 |
-
return false;
|
745 |
-
},
|
746 |
-
_addClassToMFP: function(cName) {
|
747 |
-
mfp.bgOverlay.addClass(cName);
|
748 |
-
mfp.wrap.addClass(cName);
|
749 |
-
},
|
750 |
-
_removeClassFromMFP: function(cName) {
|
751 |
-
this.bgOverlay.removeClass(cName);
|
752 |
-
mfp.wrap.removeClass(cName);
|
753 |
-
},
|
754 |
-
_hasScrollBar: function(winHeight) {
|
755 |
-
return ( (mfp.isIE7 ? _document.height() : document.body.scrollHeight) > (winHeight || _window.height()) );
|
756 |
-
},
|
757 |
-
_setFocus: function() {
|
758 |
-
(mfp.st.focus ? mfp.content.find(mfp.st.focus).eq(0) : mfp.wrap).focus();
|
759 |
-
},
|
760 |
-
_onFocusIn: function(e) {
|
761 |
-
if( e.target !== mfp.wrap[0] && !$.contains(mfp.wrap[0], e.target) ) {
|
762 |
-
mfp._setFocus();
|
763 |
-
return false;
|
764 |
-
}
|
765 |
-
},
|
766 |
-
_parseMarkup: function(template, values, item) {
|
767 |
-
var arr;
|
768 |
-
if(item.data) {
|
769 |
-
values = $.extend(item.data, values);
|
770 |
-
}
|
771 |
-
_mfpTrigger(MARKUP_PARSE_EVENT, [template, values, item] );
|
772 |
-
|
773 |
-
$.each(values, function(key, value) {
|
774 |
-
if(value === undefined || value === false) {
|
775 |
-
return true;
|
776 |
-
}
|
777 |
-
arr = key.split('_');
|
778 |
-
if(arr.length > 1) {
|
779 |
-
var el = template.find(EVENT_NS + '-'+arr[0]);
|
780 |
-
|
781 |
-
if(el.length > 0) {
|
782 |
-
var attr = arr[1];
|
783 |
-
if(attr === 'replaceWith') {
|
784 |
-
if(el[0] !== value[0]) {
|
785 |
-
el.replaceWith(value);
|
786 |
-
}
|
787 |
-
} else if(attr === 'img') {
|
788 |
-
if(el.is('img')) {
|
789 |
-
el.attr('src', value);
|
790 |
-
} else {
|
791 |
-
el.replaceWith( $('<img>').attr('src', value).attr('class', el.attr('class')) );
|
792 |
-
}
|
793 |
-
} else {
|
794 |
-
el.attr(arr[1], value);
|
795 |
-
}
|
796 |
-
}
|
797 |
-
|
798 |
-
} else {
|
799 |
-
template.find(EVENT_NS + '-'+key).html(value);
|
800 |
-
}
|
801 |
-
});
|
802 |
-
},
|
803 |
-
|
804 |
-
_getScrollbarSize: function() {
|
805 |
-
// thx David
|
806 |
-
if(mfp.scrollbarSize === undefined) {
|
807 |
-
var scrollDiv = document.createElement("div");
|
808 |
-
scrollDiv.style.cssText = 'width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;';
|
809 |
-
document.body.appendChild(scrollDiv);
|
810 |
-
mfp.scrollbarSize = scrollDiv.offsetWidth - scrollDiv.clientWidth;
|
811 |
-
document.body.removeChild(scrollDiv);
|
812 |
-
}
|
813 |
-
return mfp.scrollbarSize;
|
814 |
-
}
|
815 |
-
|
816 |
-
}; /* MagnificPopup core prototype end */
|
817 |
-
|
818 |
-
|
819 |
-
|
820 |
-
|
821 |
-
/**
|
822 |
-
* Public static functions
|
823 |
-
*/
|
824 |
-
$.magnificPopup = {
|
825 |
-
instance: null,
|
826 |
-
proto: MagnificPopup.prototype,
|
827 |
-
modules: [],
|
828 |
-
|
829 |
-
open: function(options, index) {
|
830 |
-
_checkInstance();
|
831 |
-
|
832 |
-
if(!options) {
|
833 |
-
options = {};
|
834 |
-
} else {
|
835 |
-
options = $.extend(true, {}, options);
|
836 |
-
}
|
837 |
-
|
838 |
-
options.isObj = true;
|
839 |
-
options.index = index || 0;
|
840 |
-
return this.instance.open(options);
|
841 |
-
},
|
842 |
-
|
843 |
-
close: function() {
|
844 |
-
return $.magnificPopup.instance && $.magnificPopup.instance.close();
|
845 |
-
},
|
846 |
-
|
847 |
-
registerModule: function(name, module) {
|
848 |
-
if(module.options) {
|
849 |
-
$.magnificPopup.defaults[name] = module.options;
|
850 |
-
}
|
851 |
-
$.extend(this.proto, module.proto);
|
852 |
-
this.modules.push(name);
|
853 |
-
},
|
854 |
-
|
855 |
-
defaults: {
|
856 |
-
|
857 |
-
// Info about options is in docs:
|
858 |
-
// http://dimsemenov.com/plugins/magnific-popup/documentation.html#options
|
859 |
-
|
860 |
-
disableOn: 0,
|
861 |
-
|
862 |
-
key: null,
|
863 |
-
|
864 |
-
midClick: false,
|
865 |
-
|
866 |
-
mainClass: '',
|
867 |
-
|
868 |
-
preloader: true,
|
869 |
-
|
870 |
-
focus: '', // CSS selector of input to focus after popup is opened
|
871 |
-
|
872 |
-
closeOnContentClick: false,
|
873 |
-
|
874 |
-
closeOnBgClick: true,
|
875 |
-
|
876 |
-
closeBtnInside: true,
|
877 |
-
|
878 |
-
showCloseBtn: true,
|
879 |
-
|
880 |
-
enableEscapeKey: true,
|
881 |
-
|
882 |
-
modal: false,
|
883 |
-
|
884 |
-
alignTop: false,
|
885 |
-
|
886 |
-
removalDelay: 0,
|
887 |
-
|
888 |
-
prependTo: null,
|
889 |
-
|
890 |
-
fixedContentPos: 'auto',
|
891 |
-
|
892 |
-
fixedBgPos: 'auto',
|
893 |
-
|
894 |
-
overflowY: 'auto',
|
895 |
-
|
896 |
-
closeMarkup: '<button title="%title%" type="button" class="mfp-close">×</button>',
|
897 |
-
|
898 |
-
tClose: 'Close (Esc)',
|
899 |
-
|
900 |
-
tLoading: 'Loading...',
|
901 |
-
|
902 |
-
autoFocusLast: true
|
903 |
-
|
904 |
-
}
|
905 |
-
};
|
906 |
-
|
907 |
-
|
908 |
-
|
909 |
-
$.fn.magnificPopup = function(options) {
|
910 |
-
_checkInstance();
|
911 |
-
|
912 |
-
var jqEl = $(this);
|
913 |
-
|
914 |
-
// We call some API method of first param is a string
|
915 |
-
if (typeof options === "string" ) {
|
916 |
-
|
917 |
-
if(options === 'open') {
|
918 |
-
var items,
|
919 |
-
itemOpts = _isJQ ? jqEl.data('magnificPopup') : jqEl[0].magnificPopup,
|
920 |
-
index = parseInt(arguments[1], 10) || 0;
|
921 |
-
|
922 |
-
if(itemOpts.items) {
|
923 |
-
items = itemOpts.items[index];
|
924 |
-
} else {
|
925 |
-
items = jqEl;
|
926 |
-
if(itemOpts.delegate) {
|
927 |
-
items = items.find(itemOpts.delegate);
|
928 |
-
}
|
929 |
-
items = items.eq( index );
|
930 |
-
}
|
931 |
-
mfp._openClick({mfpEl:items}, jqEl, itemOpts);
|
932 |
-
} else {
|
933 |
-
if(mfp.isOpen)
|
934 |
-
mfp[options].apply(mfp, Array.prototype.slice.call(arguments, 1));
|
935 |
-
}
|
936 |
-
|
937 |
-
} else {
|
938 |
-
// clone options obj
|
939 |
-
options = $.extend(true, {}, options);
|
940 |
-
|
941 |
-
/*
|
942 |
-
* As Zepto doesn't support .data() method for objects
|
943 |
-
* and it works only in normal browsers
|
944 |
-
* we assign "options" object directly to the DOM element. FTW!
|
945 |
-
*/
|
946 |
-
if(_isJQ) {
|
947 |
-
jqEl.data('magnificPopup', options);
|
948 |
-
} else {
|
949 |
-
jqEl[0].magnificPopup = options;
|
950 |
-
}
|
951 |
-
|
952 |
-
mfp.addGroup(jqEl, options);
|
953 |
-
|
954 |
-
}
|
955 |
-
return jqEl;
|
956 |
-
};
|
957 |
-
|
958 |
-
/*>>core*/
|
959 |
-
|
960 |
-
/*>>inline*/
|
961 |
-
|
962 |
-
var INLINE_NS = 'inline',
|
963 |
-
_hiddenClass,
|
964 |
-
_inlinePlaceholder,
|
965 |
-
_lastInlineElement,
|
966 |
-
_putInlineElementsBack = function() {
|
967 |
-
if(_lastInlineElement) {
|
968 |
-
_inlinePlaceholder.after( _lastInlineElement.addClass(_hiddenClass) ).detach();
|
969 |
-
_lastInlineElement = null;
|
970 |
-
}
|
971 |
-
};
|
972 |
-
|
973 |
-
$.magnificPopup.registerModule(INLINE_NS, {
|
974 |
-
options: {
|
975 |
-
hiddenClass: 'hide', // will be appended with `mfp-` prefix
|
976 |
-
markup: '',
|
977 |
-
tNotFound: 'Content not found'
|
978 |
-
},
|
979 |
-
proto: {
|
980 |
-
|
981 |
-
initInline: function() {
|
982 |
-
mfp.types.push(INLINE_NS);
|
983 |
-
|
984 |
-
_mfpOn(CLOSE_EVENT+'.'+INLINE_NS, function() {
|
985 |
-
_putInlineElementsBack();
|
986 |
-
});
|
987 |
-
},
|
988 |
-
|
989 |
-
getInline: function(item, template) {
|
990 |
-
|
991 |
-
_putInlineElementsBack();
|
992 |
-
|
993 |
-
if(item.src) {
|
994 |
-
var inlineSt = mfp.st.inline,
|
995 |
-
el = $(item.src);
|
996 |
-
|
997 |
-
if(el.length) {
|
998 |
-
|
999 |
-
// If target element has parent - we replace it with placeholder and put it back after popup is closed
|
1000 |
-
var parent = el[0].parentNode;
|
1001 |
-
if(parent && parent.tagName) {
|
1002 |
-
if(!_inlinePlaceholder) {
|
1003 |
-
_hiddenClass = inlineSt.hiddenClass;
|
1004 |
-
_inlinePlaceholder = _getEl(_hiddenClass);
|
1005 |
-
_hiddenClass = 'mfp-'+_hiddenClass;
|
1006 |
-
}
|
1007 |
-
// replace target inline element with placeholder
|
1008 |
-
_lastInlineElement = el.after(_inlinePlaceholder).detach().removeClass(_hiddenClass);
|
1009 |
-
}
|
1010 |
-
|
1011 |
-
mfp.updateStatus('ready');
|
1012 |
-
} else {
|
1013 |
-
mfp.updateStatus('error', inlineSt.tNotFound);
|
1014 |
-
el = $('<div>');
|
1015 |
-
}
|
1016 |
-
|
1017 |
-
item.inlineElement = el;
|
1018 |
-
return el;
|
1019 |
-
}
|
1020 |
-
|
1021 |
-
mfp.updateStatus('ready');
|
1022 |
-
mfp._parseMarkup(template, {}, item);
|
1023 |
-
return template;
|
1024 |
-
}
|
1025 |
-
}
|
1026 |
-
});
|
1027 |
-
|
1028 |
-
/*>>inline*/
|
1029 |
-
|
1030 |
-
/*>>ajax*/
|
1031 |
-
var AJAX_NS = 'ajax',
|
1032 |
-
_ajaxCur,
|
1033 |
-
_removeAjaxCursor = function() {
|
1034 |
-
if(_ajaxCur) {
|
1035 |
-
$(document.body).removeClass(_ajaxCur);
|
1036 |
-
}
|
1037 |
-
},
|
1038 |
-
_destroyAjaxRequest = function() {
|
1039 |
-
_removeAjaxCursor();
|
1040 |
-
if(mfp.req) {
|
1041 |
-
mfp.req.abort();
|
1042 |
-
}
|
1043 |
-
};
|
1044 |
-
|
1045 |
-
$.magnificPopup.registerModule(AJAX_NS, {
|
1046 |
-
|
1047 |
-
options: {
|
1048 |
-
settings: null,
|
1049 |
-
cursor: 'mfp-ajax-cur',
|
1050 |
-
tError: '<a href="%url%">The content</a> could not be loaded.'
|
1051 |
-
},
|
1052 |
-
|
1053 |
-
proto: {
|
1054 |
-
initAjax: function() {
|
1055 |
-
mfp.types.push(AJAX_NS);
|
1056 |
-
_ajaxCur = mfp.st.ajax.cursor;
|
1057 |
-
|
1058 |
-
_mfpOn(CLOSE_EVENT+'.'+AJAX_NS, _destroyAjaxRequest);
|
1059 |
-
_mfpOn('BeforeChange.' + AJAX_NS, _destroyAjaxRequest);
|
1060 |
-
},
|
1061 |
-
getAjax: function(item) {
|
1062 |
-
|
1063 |
-
if(_ajaxCur) {
|
1064 |
-
$(document.body).addClass(_ajaxCur);
|
1065 |
-
}
|
1066 |
-
|
1067 |
-
mfp.updateStatus('loading');
|
1068 |
-
|
1069 |
-
var opts = $.extend({
|
1070 |
-
url: item.src,
|
1071 |
-
success: function(data, textStatus, jqXHR) {
|
1072 |
-
var temp = {
|
1073 |
-
data:data,
|
1074 |
-
xhr:jqXHR
|
1075 |
-
};
|
1076 |
-
|
1077 |
-
_mfpTrigger('ParseAjax', temp);
|
1078 |
-
|
1079 |
-
mfp.appendContent( $(temp.data), AJAX_NS );
|
1080 |
-
|
1081 |
-
item.finished = true;
|
1082 |
-
|
1083 |
-
_removeAjaxCursor();
|
1084 |
-
|
1085 |
-
mfp._setFocus();
|
1086 |
-
|
1087 |
-
setTimeout(function() {
|
1088 |
-
mfp.wrap.addClass(READY_CLASS);
|
1089 |
-
}, 16);
|
1090 |
-
|
1091 |
-
mfp.updateStatus('ready');
|
1092 |
-
|
1093 |
-
_mfpTrigger('AjaxContentAdded');
|
1094 |
-
},
|
1095 |
-
error: function() {
|
1096 |
-
_removeAjaxCursor();
|
1097 |
-
item.finished = item.loadError = true;
|
1098 |
-
mfp.updateStatus('error', mfp.st.ajax.tError.replace('%url%', item.src));
|
1099 |
-
}
|
1100 |
-
}, mfp.st.ajax.settings);
|
1101 |
-
|
1102 |
-
mfp.req = $.ajax(opts);
|
1103 |
-
|
1104 |
-
return '';
|
1105 |
-
}
|
1106 |
-
}
|
1107 |
-
});
|
1108 |
-
|
1109 |
-
/*>>ajax*/
|
1110 |
-
|
1111 |
-
/*>>image*/
|
1112 |
-
var _imgInterval,
|
1113 |
-
_getTitle = function(item) {
|
1114 |
-
if(item.data && item.data.title !== undefined)
|
1115 |
-
return item.data.title;
|
1116 |
-
|
1117 |
-
var src = mfp.st.image.titleSrc;
|
1118 |
-
|
1119 |
-
if(src) {
|
1120 |
-
if($.isFunction(src)) {
|
1121 |
-
return src.call(mfp, item);
|
1122 |
-
} else if(item.el) {
|
1123 |
-
return item.el.attr(src) || '';
|
1124 |
-
}
|
1125 |
-
}
|
1126 |
-
return '';
|
1127 |
-
};
|
1128 |
-
|
1129 |
-
$.magnificPopup.registerModule('image', {
|
1130 |
-
|
1131 |
-
options: {
|
1132 |
-
markup: '<div class="mfp-figure">'+
|
1133 |
-
'<div class="mfp-close"></div>'+
|
1134 |
-
'<figure>'+
|
1135 |
-
'<div class="mfp-img"></div>'+
|
1136 |
-
'<figcaption>'+
|
1137 |
-
'<div class="mfp-bottom-bar">'+
|
1138 |
-
'<div class="mfp-title"></div>'+
|
1139 |
-
'<div class="mfp-counter"></div>'+
|
1140 |
-
'</div>'+
|
1141 |
-
'</figcaption>'+
|
1142 |
-
'</figure>'+
|
1143 |
-
'</div>',
|
1144 |
-
cursor: 'mfp-zoom-out-cur',
|
1145 |
-
titleSrc: 'title',
|
1146 |
-
verticalFit: true,
|
1147 |
-
tError: '<a href="%url%">The image</a> could not be loaded.'
|
1148 |
-
},
|
1149 |
-
|
1150 |
-
proto: {
|
1151 |
-
initImage: function() {
|
1152 |
-
var imgSt = mfp.st.image,
|
1153 |
-
ns = '.image';
|
1154 |
-
|
1155 |
-
mfp.types.push('image');
|
1156 |
-
|
1157 |
-
_mfpOn(OPEN_EVENT+ns, function() {
|
1158 |
-
if(mfp.currItem.type === 'image' && imgSt.cursor) {
|
1159 |
-
$(document.body).addClass(imgSt.cursor);
|
1160 |
-
}
|
1161 |
-
});
|
1162 |
-
|
1163 |
-
_mfpOn(CLOSE_EVENT+ns, function() {
|
1164 |
-
if(imgSt.cursor) {
|
1165 |
-
$(document.body).removeClass(imgSt.cursor);
|
1166 |
-
}
|
1167 |
-
_window.off('resize' + EVENT_NS);
|
1168 |
-
});
|
1169 |
-
|
1170 |
-
_mfpOn('Resize'+ns, mfp.resizeImage);
|
1171 |
-
if(mfp.isLowIE) {
|
1172 |
-
_mfpOn('AfterChange', mfp.resizeImage);
|
1173 |
-
}
|
1174 |
-
},
|
1175 |
-
resizeImage: function() {
|
1176 |
-
var item = mfp.currItem;
|
1177 |
-
if(!item || !item.img) return;
|
1178 |
-
|
1179 |
-
if(mfp.st.image.verticalFit) {
|
1180 |
-
var decr = 0;
|
1181 |
-
// fix box-sizing in ie7/8
|
1182 |
-
if(mfp.isLowIE) {
|
1183 |
-
decr = parseInt(item.img.css('padding-top'), 10) + parseInt(item.img.css('padding-bottom'),10);
|
1184 |
-
}
|
1185 |
-
item.img.css('max-height', mfp.wH-decr);
|
1186 |
-
}
|
1187 |
-
},
|
1188 |
-
_onImageHasSize: function(item) {
|
1189 |
-
if(item.img) {
|
1190 |
-
|
1191 |
-
item.hasSize = true;
|
1192 |
-
|
1193 |
-
if(_imgInterval) {
|
1194 |
-
clearInterval(_imgInterval);
|
1195 |
-
}
|
1196 |
-
|
1197 |
-
item.isCheckingImgSize = false;
|
1198 |
-
|
1199 |
-
_mfpTrigger('ImageHasSize', item);
|
1200 |
-
|
1201 |
-
if(item.imgHidden) {
|
1202 |
-
if(mfp.content)
|
1203 |
-
mfp.content.removeClass('mfp-loading');
|
1204 |
-
|
1205 |
-
item.imgHidden = false;
|
1206 |
-
}
|
1207 |
-
|
1208 |
-
}
|
1209 |
-
},
|
1210 |
-
|
1211 |
-
/**
|
1212 |
-
* Function that loops until the image has size to display elements that rely on it asap
|
1213 |
-
*/
|
1214 |
-
findImageSize: function(item) {
|
1215 |
-
|
1216 |
-
var counter = 0,
|
1217 |
-
img = item.img[0],
|
1218 |
-
mfpSetInterval = function(delay) {
|
1219 |
-
|
1220 |
-
if(_imgInterval) {
|
1221 |
-
clearInterval(_imgInterval);
|
1222 |
-
}
|
1223 |
-
// decelerating interval that checks for size of an image
|
1224 |
-
_imgInterval = setInterval(function() {
|
1225 |
-
if(img.naturalWidth > 0) {
|
1226 |
-
mfp._onImageHasSize(item);
|
1227 |
-
return;
|
1228 |
-
}
|
1229 |
-
|
1230 |
-
if(counter > 200) {
|
1231 |
-
clearInterval(_imgInterval);
|
1232 |
-
}
|
1233 |
-
|
1234 |
-
counter++;
|
1235 |
-
if(counter === 3) {
|
1236 |
-
mfpSetInterval(10);
|
1237 |
-
} else if(counter === 40) {
|
1238 |
-
mfpSetInterval(50);
|
1239 |
-
} else if(counter === 100) {
|
1240 |
-
mfpSetInterval(500);
|
1241 |
-
}
|
1242 |
-
}, delay);
|
1243 |
-
};
|
1244 |
-
|
1245 |
-
mfpSetInterval(1);
|
1246 |
-
},
|
1247 |
-
|
1248 |
-
getImage: function(item, template) {
|
1249 |
-
|
1250 |
-
var guard = 0,
|
1251 |
-
|
1252 |
-
// image load complete handler
|
1253 |
-
onLoadComplete = function() {
|
1254 |
-
if(item) {
|
1255 |
-
if (item.img[0].complete) {
|
1256 |
-
item.img.off('.mfploader');
|
1257 |
-
|
1258 |
-
if(item === mfp.currItem){
|
1259 |
-
mfp._onImageHasSize(item);
|
1260 |
-
|
1261 |
-
mfp.updateStatus('ready');
|
1262 |
-
}
|
1263 |
-
|
1264 |
-
item.hasSize = true;
|
1265 |
-
item.loaded = true;
|
1266 |
-
|
1267 |
-
_mfpTrigger('ImageLoadComplete');
|
1268 |
-
|
1269 |
-
}
|
1270 |
-
else {
|
1271 |
-
// if image complete check fails 200 times (20 sec), we assume that there was an error.
|
1272 |
-
guard++;
|
1273 |
-
if(guard < 200) {
|
1274 |
-
setTimeout(onLoadComplete,100);
|
1275 |
-
} else {
|
1276 |
-
onLoadError();
|
1277 |
-
}
|
1278 |
-
}
|
1279 |
-
}
|
1280 |
-
},
|
1281 |
-
|
1282 |
-
// image error handler
|
1283 |
-
onLoadError = function() {
|
1284 |
-
if(item) {
|
1285 |
-
item.img.off('.mfploader');
|
1286 |
-
if(item === mfp.currItem){
|
1287 |
-
mfp._onImageHasSize(item);
|
1288 |
-
mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) );
|
1289 |
-
}
|
1290 |
-
|
1291 |
-
item.hasSize = true;
|
1292 |
-
item.loaded = true;
|
1293 |
-
item.loadError = true;
|
1294 |
-
}
|
1295 |
-
},
|
1296 |
-
imgSt = mfp.st.image;
|
1297 |
-
|
1298 |
-
|
1299 |
-
var el = template.find('.mfp-img');
|
1300 |
-
if(el.length) {
|
1301 |
-
var img = document.createElement('img');
|
1302 |
-
img.className = 'mfp-img';
|
1303 |
-
if(item.el && item.el.find('img').length) {
|
1304 |
-
img.alt = item.el.find('img').attr('alt');
|
1305 |
-
}
|
1306 |
-
item.img = $(img).on('load.mfploader', onLoadComplete).on('error.mfploader', onLoadError);
|
1307 |
-
img.src = item.src;
|
1308 |
-
|
1309 |
-
// without clone() "error" event is not firing when IMG is replaced by new IMG
|
1310 |
-
// TODO: find a way to avoid such cloning
|
1311 |
-
if(el.is('img')) {
|
1312 |
-
item.img = item.img.clone();
|
1313 |
-
}
|
1314 |
-
|
1315 |
-
img = item.img[0];
|
1316 |
-
if(img.naturalWidth > 0) {
|
1317 |
-
item.hasSize = true;
|
1318 |
-
} else if(!img.width) {
|
1319 |
-
item.hasSize = false;
|
1320 |
-
}
|
1321 |
-
}
|
1322 |
-
|
1323 |
-
mfp._parseMarkup(template, {
|
1324 |
-
title: _getTitle(item),
|
1325 |
-
img_replaceWith: item.img
|
1326 |
-
}, item);
|
1327 |
-
|
1328 |
-
mfp.resizeImage();
|
1329 |
-
|
1330 |
-
if(item.hasSize) {
|
1331 |
-
if(_imgInterval) clearInterval(_imgInterval);
|
1332 |
-
|
1333 |
-
if(item.loadError) {
|
1334 |
-
template.addClass('mfp-loading');
|
1335 |
-
mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) );
|
1336 |
-
} else {
|
1337 |
-
template.removeClass('mfp-loading');
|
1338 |
-
mfp.updateStatus('ready');
|
1339 |
-
}
|
1340 |
-
return template;
|
1341 |
-
}
|
1342 |
-
|
1343 |
-
mfp.updateStatus('loading');
|
1344 |
-
item.loading = true;
|
1345 |
-
|
1346 |
-
if(!item.hasSize) {
|
1347 |
-
item.imgHidden = true;
|
1348 |
-
template.addClass('mfp-loading');
|
1349 |
-
mfp.findImageSize(item);
|
1350 |
-
}
|
1351 |
-
|
1352 |
-
return template;
|
1353 |
-
}
|
1354 |
-
}
|
1355 |
-
});
|
1356 |
-
|
1357 |
-
/*>>image*/
|
1358 |
-
|
1359 |
-
/*>>zoom*/
|
1360 |
-
var hasMozTransform,
|
1361 |
-
getHasMozTransform = function() {
|
1362 |
-
if(hasMozTransform === undefined) {
|
1363 |
-
hasMozTransform = document.createElement('p').style.MozTransform !== undefined;
|
1364 |
-
}
|
1365 |
-
return hasMozTransform;
|
1366 |
-
};
|
1367 |
-
|
1368 |
-
$.magnificPopup.registerModule('zoom', {
|
1369 |
-
|
1370 |
-
options: {
|
1371 |
-
enabled: false,
|
1372 |
-
easing: 'ease-in-out',
|
1373 |
-
duration: 300,
|
1374 |
-
opener: function(element) {
|
1375 |
-
return element.is('img') ? element : element.find('img');
|
1376 |
-
}
|
1377 |
-
},
|
1378 |
-
|
1379 |
-
proto: {
|
1380 |
-
|
1381 |
-
initZoom: function() {
|
1382 |
-
var zoomSt = mfp.st.zoom,
|
1383 |
-
ns = '.zoom',
|
1384 |
-
image;
|
1385 |
-
|
1386 |
-
if(!zoomSt.enabled || !mfp.supportsTransition) {
|
1387 |
-
return;
|
1388 |
-
}
|
1389 |
-
|
1390 |
-
var duration = zoomSt.duration,
|
1391 |
-
getElToAnimate = function(image) {
|
1392 |
-
var newImg = image.clone().removeAttr('style').removeAttr('class').addClass('mfp-animated-image'),
|
1393 |
-
transition = 'all '+(zoomSt.duration/1000)+'s ' + zoomSt.easing,
|
1394 |
-
cssObj = {
|
1395 |
-
position: 'fixed',
|
1396 |
-
zIndex: 9999,
|
1397 |
-
left: 0,
|
1398 |
-
top: 0,
|
1399 |
-
'-webkit-backface-visibility': 'hidden'
|
1400 |
-
},
|
1401 |
-
t = 'transition';
|
1402 |
-
|
1403 |
-
cssObj['-webkit-'+t] = cssObj['-moz-'+t] = cssObj['-o-'+t] = cssObj[t] = transition;
|
1404 |
-
|
1405 |
-
newImg.css(cssObj);
|
1406 |
-
return newImg;
|
1407 |
-
},
|
1408 |
-
showMainContent = function() {
|
1409 |
-
mfp.content.css('visibility', 'visible');
|
1410 |
-
},
|
1411 |
-
openTimeout,
|
1412 |
-
animatedImg;
|
1413 |
-
|
1414 |
-
_mfpOn('BuildControls'+ns, function() {
|
1415 |
-
if(mfp._allowZoom()) {
|
1416 |
-
|
1417 |
-
clearTimeout(openTimeout);
|
1418 |
-
mfp.content.css('visibility', 'hidden');
|
1419 |
-
|
1420 |
-
// Basically, all code below does is clones existing image, puts in on top of the current one and animated it
|
1421 |
-
|
1422 |
-
image = mfp._getItemToZoom();
|
1423 |
-
|
1424 |
-
if(!image) {
|
1425 |
-
showMainContent();
|
1426 |
-
return;
|
1427 |
-
}
|
1428 |
-
|
1429 |
-
animatedImg = getElToAnimate(image);
|
1430 |
-
|
1431 |
-
animatedImg.css( mfp._getOffset() );
|
1432 |
-
|
1433 |
-
mfp.wrap.append(animatedImg);
|
1434 |
-
|
1435 |
-
openTimeout = setTimeout(function() {
|
1436 |
-
animatedImg.css( mfp._getOffset( true ) );
|
1437 |
-
openTimeout = setTimeout(function() {
|
1438 |
-
|
1439 |
-
showMainContent();
|
1440 |
-
|
1441 |
-
setTimeout(function() {
|
1442 |
-
animatedImg.remove();
|
1443 |
-
image = animatedImg = null;
|
1444 |
-
_mfpTrigger('ZoomAnimationEnded');
|
1445 |
-
}, 16); // avoid blink when switching images
|
1446 |
-
|
1447 |
-
}, duration); // this timeout equals animation duration
|
1448 |
-
|
1449 |
-
}, 16); // by adding this timeout we avoid short glitch at the beginning of animation
|
1450 |
-
|
1451 |
-
|
1452 |
-
// Lots of timeouts...
|
1453 |
-
}
|
1454 |
-
});
|
1455 |
-
_mfpOn(BEFORE_CLOSE_EVENT+ns, function() {
|
1456 |
-
if(mfp._allowZoom()) {
|
1457 |
-
|
1458 |
-
clearTimeout(openTimeout);
|
1459 |
-
|
1460 |
-
mfp.st.removalDelay = duration;
|
1461 |
-
|
1462 |
-
if(!image) {
|
1463 |
-
image = mfp._getItemToZoom();
|
1464 |
-
if(!image) {
|
1465 |
-
return;
|
1466 |
-
}
|
1467 |
-
animatedImg = getElToAnimate(image);
|
1468 |
-
}
|
1469 |
-
|
1470 |
-
animatedImg.css( mfp._getOffset(true) );
|
1471 |
-
mfp.wrap.append(animatedImg);
|
1472 |
-
mfp.content.css('visibility', 'hidden');
|
1473 |
-
|
1474 |
-
setTimeout(function() {
|
1475 |
-
animatedImg.css( mfp._getOffset() );
|
1476 |
-
}, 16);
|
1477 |
-
}
|
1478 |
-
|
1479 |
-
});
|
1480 |
-
|
1481 |
-
_mfpOn(CLOSE_EVENT+ns, function() {
|
1482 |
-
if(mfp._allowZoom()) {
|
1483 |
-
showMainContent();
|
1484 |
-
if(animatedImg) {
|
1485 |
-
animatedImg.remove();
|
1486 |
-
}
|
1487 |
-
image = null;
|
1488 |
-
}
|
1489 |
-
});
|
1490 |
-
},
|
1491 |
-
|
1492 |
-
_allowZoom: function() {
|
1493 |
-
return mfp.currItem.type === 'image';
|
1494 |
-
},
|
1495 |
-
|
1496 |
-
_getItemToZoom: function() {
|
1497 |
-
if(mfp.currItem.hasSize) {
|
1498 |
-
return mfp.currItem.img;
|
1499 |
-
} else {
|
1500 |
-
return false;
|
1501 |
-
}
|
1502 |
-
},
|
1503 |
-
|
1504 |
-
// Get element postion relative to viewport
|
1505 |
-
_getOffset: function(isLarge) {
|
1506 |
-
var el;
|
1507 |
-
if(isLarge) {
|
1508 |
-
el = mfp.currItem.img;
|
1509 |
-
} else {
|
1510 |
-
el = mfp.st.zoom.opener(mfp.currItem.el || mfp.currItem);
|
1511 |
-
}
|
1512 |
-
|
1513 |
-
var offset = el.offset();
|
1514 |
-
var paddingTop = parseInt(el.css('padding-top'),10);
|
1515 |
-
var paddingBottom = parseInt(el.css('padding-bottom'),10);
|
1516 |
-
offset.top -= ( $(window).scrollTop() - paddingTop );
|
1517 |
-
|
1518 |
-
|
1519 |
-
/*
|
1520 |
-
|
1521 |
-
Animating left + top + width/height looks glitchy in Firefox, but perfect in Chrome. And vice-versa.
|
1522 |
-
|
1523 |
-
*/
|
1524 |
-
var obj = {
|
1525 |
-
width: el.width(),
|
1526 |
-
// fix Zepto height+padding issue
|
1527 |
-
height: (_isJQ ? el.innerHeight() : el[0].offsetHeight) - paddingBottom - paddingTop
|
1528 |
-
};
|
1529 |
-
|
1530 |
-
// I hate to do this, but there is no another option
|
1531 |
-
if( getHasMozTransform() ) {
|
1532 |
-
obj['-moz-transform'] = obj['transform'] = 'translate(' + offset.left + 'px,' + offset.top + 'px)';
|
1533 |
-
} else {
|
1534 |
-
obj.left = offset.left;
|
1535 |
-
obj.top = offset.top;
|
1536 |
-
}
|
1537 |
-
return obj;
|
1538 |
-
}
|
1539 |
-
|
1540 |
-
}
|
1541 |
-
});
|
1542 |
-
|
1543 |
-
|
1544 |
-
|
1545 |
-
/*>>zoom*/
|
1546 |
-
|
1547 |
-
/*>>iframe*/
|
1548 |
-
|
1549 |
-
var IFRAME_NS = 'iframe',
|
1550 |
-
_emptyPage = '//about:blank',
|
1551 |
-
|
1552 |
-
_fixIframeBugs = function(isShowing) {
|
1553 |
-
if(mfp.currTemplate[IFRAME_NS]) {
|
1554 |
-
var el = mfp.currTemplate[IFRAME_NS].find('iframe');
|
1555 |
-
if(el.length) {
|
1556 |
-
// reset src after the popup is closed to avoid "video keeps playing after popup is closed" bug
|
1557 |
-
if(!isShowing) {
|
1558 |
-
el[0].src = _emptyPage;
|
1559 |
-
}
|
1560 |
-
|
1561 |
-
// IE8 black screen bug fix
|
1562 |
-
if(mfp.isIE8) {
|
1563 |
-
el.css('display', isShowing ? 'block' : 'none');
|
1564 |
-
}
|
1565 |
-
}
|
1566 |
-
}
|
1567 |
-
};
|
1568 |
-
|
1569 |
-
$.magnificPopup.registerModule(IFRAME_NS, {
|
1570 |
-
|
1571 |
-
options: {
|
1572 |
-
markup: '<div class="mfp-iframe-scaler">'+
|
1573 |
-
'<div class="mfp-close"></div>'+
|
1574 |
-
'<iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe>'+
|
1575 |
-
'</div>',
|
1576 |
-
|
1577 |
-
srcAction: 'iframe_src',
|
1578 |
-
|
1579 |
-
// we don't care and support only one default type of URL by default
|
1580 |
-
patterns: {
|
1581 |
-
youtube: {
|
1582 |
-
index: 'youtube.com',
|
1583 |
-
id: 'v=',
|
1584 |
-
src: '//www.youtube.com/embed/%id%?autoplay=1'
|
1585 |
-
},
|
1586 |
-
vimeo: {
|
1587 |
-
index: 'vimeo.com/',
|
1588 |
-
id: '/',
|
1589 |
-
src: '//player.vimeo.com/video/%id%?autoplay=1'
|
1590 |
-
},
|
1591 |
-
gmaps: {
|
1592 |
-
index: '//maps.google.',
|
1593 |
-
src: '%id%&output=embed'
|
1594 |
-
}
|
1595 |
-
}
|
1596 |
-
},
|
1597 |
-
|
1598 |
-
proto: {
|
1599 |
-
initIframe: function() {
|
1600 |
-
mfp.types.push(IFRAME_NS);
|
1601 |
-
|
1602 |
-
_mfpOn('BeforeChange', function(e, prevType, newType) {
|
1603 |
-
if(prevType !== newType) {
|
1604 |
-
if(prevType === IFRAME_NS) {
|
1605 |
-
_fixIframeBugs(); // iframe if removed
|
1606 |
-
} else if(newType === IFRAME_NS) {
|
1607 |
-
_fixIframeBugs(true); // iframe is showing
|
1608 |
-
}
|
1609 |
-
}// else {
|
1610 |
-
// iframe source is switched, don't do anything
|
1611 |
-
//}
|
1612 |
-
});
|
1613 |
-
|
1614 |
-
_mfpOn(CLOSE_EVENT + '.' + IFRAME_NS, function() {
|
1615 |
-
_fixIframeBugs();
|
1616 |
-
});
|
1617 |
-
},
|
1618 |
-
|
1619 |
-
getIframe: function(item, template) {
|
1620 |
-
var embedSrc = item.src;
|
1621 |
-
var iframeSt = mfp.st.iframe;
|
1622 |
-
|
1623 |
-
$.each(iframeSt.patterns, function() {
|
1624 |
-
if(embedSrc.indexOf( this.index ) > -1) {
|
1625 |
-
if(this.id) {
|
1626 |
-
if(typeof this.id === 'string') {
|
1627 |
-
embedSrc = embedSrc.substr(embedSrc.lastIndexOf(this.id)+this.id.length, embedSrc.length);
|
1628 |
-
} else {
|
1629 |
-
embedSrc = this.id.call( this, embedSrc );
|
1630 |
-
}
|
1631 |
-
}
|
1632 |
-
embedSrc = this.src.replace('%id%', embedSrc );
|
1633 |
-
return false; // break;
|
1634 |
-
}
|
1635 |
-
});
|
1636 |
-
|
1637 |
-
var dataObj = {};
|
1638 |
-
if(iframeSt.srcAction) {
|
1639 |
-
dataObj[iframeSt.srcAction] = embedSrc;
|
1640 |
-
}
|
1641 |
-
mfp._parseMarkup(template, dataObj, item);
|
1642 |
-
|
1643 |
-
mfp.updateStatus('ready');
|
1644 |
-
|
1645 |
-
return template;
|
1646 |
-
}
|
1647 |
-
}
|
1648 |
-
});
|
1649 |
-
|
1650 |
-
|
1651 |
-
|
1652 |
-
/*>>iframe*/
|
1653 |
-
|
1654 |
-
/*>>gallery*/
|
1655 |
-
/**
|
1656 |
-
* Get looped index depending on number of slides
|
1657 |
-
*/
|
1658 |
-
var _getLoopedId = function(index) {
|
1659 |
-
var numSlides = mfp.items.length;
|
1660 |
-
if(index > numSlides - 1) {
|
1661 |
-
return index - numSlides;
|
1662 |
-
} else if(index < 0) {
|
1663 |
-
return numSlides + index;
|
1664 |
-
}
|
1665 |
-
return index;
|
1666 |
-
},
|
1667 |
-
_replaceCurrTotal = function(text, curr, total) {
|
1668 |
-
return text.replace(/%curr%/gi, curr + 1).replace(/%total%/gi, total);
|
1669 |
-
};
|
1670 |
-
|
1671 |
-
$.magnificPopup.registerModule('gallery', {
|
1672 |
-
|
1673 |
-
options: {
|
1674 |
-
enabled: false,
|
1675 |
-
arrowMarkup: '<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',
|
1676 |
-
preload: [0,2],
|
1677 |
-
navigateByImgClick: true,
|
1678 |
-
arrows: true,
|
1679 |
-
|
1680 |
-
tPrev: 'Previous (Left arrow key)',
|
1681 |
-
tNext: 'Next (Right arrow key)',
|
1682 |
-
tCounter: '%curr% of %total%'
|
1683 |
-
},
|
1684 |
-
|
1685 |
-
proto: {
|
1686 |
-
initGallery: function() {
|
1687 |
-
|
1688 |
-
var gSt = mfp.st.gallery,
|
1689 |
-
ns = '.mfp-gallery';
|
1690 |
-
|
1691 |
-
mfp.direction = true; // true - next, false - prev
|
1692 |
-
|
1693 |
-
if(!gSt || !gSt.enabled ) return false;
|
1694 |
-
|
1695 |
-
_wrapClasses += ' mfp-gallery';
|
1696 |
-
|
1697 |
-
_mfpOn(OPEN_EVENT+ns, function() {
|
1698 |
-
|
1699 |
-
if(gSt.navigateByImgClick) {
|
1700 |
-
mfp.wrap.on('click'+ns, '.mfp-img', function() {
|
1701 |
-
if(mfp.items.length > 1) {
|
1702 |
-
mfp.next();
|
1703 |
-
return false;
|
1704 |
-
}
|
1705 |
-
});
|
1706 |
-
}
|
1707 |
-
|
1708 |
-
_document.on('keydown'+ns, function(e) {
|
1709 |
-
if (e.keyCode === 37) {
|
1710 |
-
mfp.prev();
|
1711 |
-
} else if (e.keyCode === 39) {
|
1712 |
-
mfp.next();
|
1713 |
-
}
|
1714 |
-
});
|
1715 |
-
});
|
1716 |
-
|
1717 |
-
_mfpOn('UpdateStatus'+ns, function(e, data) {
|
1718 |
-
if(data.text) {
|
1719 |
-
data.text = _replaceCurrTotal(data.text, mfp.currItem.index, mfp.items.length);
|
1720 |
-
}
|
1721 |
-
});
|
1722 |
-
|
1723 |
-
_mfpOn(MARKUP_PARSE_EVENT+ns, function(e, element, values, item) {
|
1724 |
-
var l = mfp.items.length;
|
1725 |
-
values.counter = l > 1 ? _replaceCurrTotal(gSt.tCounter, item.index, l) : '';
|
1726 |
-
});
|
1727 |
-
|
1728 |
-
_mfpOn('BuildControls' + ns, function() {
|
1729 |
-
if(mfp.items.length > 1 && gSt.arrows && !mfp.arrowLeft) {
|
1730 |
-
var markup = gSt.arrowMarkup,
|
1731 |
-
arrowLeft = mfp.arrowLeft = $( markup.replace(/%title%/gi, gSt.tPrev).replace(/%dir%/gi, 'left') ).addClass(PREVENT_CLOSE_CLASS),
|
1732 |
-
arrowRight = mfp.arrowRight = $( markup.replace(/%title%/gi, gSt.tNext).replace(/%dir%/gi, 'right') ).addClass(PREVENT_CLOSE_CLASS);
|
1733 |
-
|
1734 |
-
arrowLeft.click(function() {
|
1735 |
-
mfp.prev();
|
1736 |
-
});
|
1737 |
-
arrowRight.click(function() {
|
1738 |
-
mfp.next();
|
1739 |
-
});
|
1740 |
-
|
1741 |
-
mfp.container.append(arrowLeft.add(arrowRight));
|
1742 |
-
}
|
1743 |
-
});
|
1744 |
-
|
1745 |
-
_mfpOn(CHANGE_EVENT+ns, function() {
|
1746 |
-
if(mfp._preloadTimeout) clearTimeout(mfp._preloadTimeout);
|
1747 |
-
|
1748 |
-
mfp._preloadTimeout = setTimeout(function() {
|
1749 |
-
mfp.preloadNearbyImages();
|
1750 |
-
mfp._preloadTimeout = null;
|
1751 |
-
}, 16);
|
1752 |
-
});
|
1753 |
-
|
1754 |
-
|
1755 |
-
_mfpOn(CLOSE_EVENT+ns, function() {
|
1756 |
-
_document.off(ns);
|
1757 |
-
mfp.wrap.off('click'+ns);
|
1758 |
-
mfp.arrowRight = mfp.arrowLeft = null;
|
1759 |
-
});
|
1760 |
-
|
1761 |
-
},
|
1762 |
-
next: function() {
|
1763 |
-
mfp.direction = true;
|
1764 |
-
mfp.index = _getLoopedId(mfp.index + 1);
|
1765 |
-
mfp.updateItemHTML();
|
1766 |
-
},
|
1767 |
-
prev: function() {
|
1768 |
-
mfp.direction = false;
|
1769 |
-
mfp.index = _getLoopedId(mfp.index - 1);
|
1770 |
-
mfp.updateItemHTML();
|
1771 |
-
},
|
1772 |
-
goTo: function(newIndex) {
|
1773 |
-
mfp.direction = (newIndex >= mfp.index);
|
1774 |
-
mfp.index = newIndex;
|
1775 |
-
mfp.updateItemHTML();
|
1776 |
-
},
|
1777 |
-
preloadNearbyImages: function() {
|
1778 |
-
var p = mfp.st.gallery.preload,
|
1779 |
-
preloadBefore = Math.min(p[0], mfp.items.length),
|
1780 |
-
preloadAfter = Math.min(p[1], mfp.items.length),
|
1781 |
-
i;
|
1782 |
-
|
1783 |
-
for(i = 1; i <= (mfp.direction ? preloadAfter : preloadBefore); i++) {
|
1784 |
-
mfp._preloadItem(mfp.index+i);
|
1785 |
-
}
|
1786 |
-
for(i = 1; i <= (mfp.direction ? preloadBefore : preloadAfter); i++) {
|
1787 |
-
mfp._preloadItem(mfp.index-i);
|
1788 |
-
}
|
1789 |
-
},
|
1790 |
-
_preloadItem: function(index) {
|
1791 |
-
index = _getLoopedId(index);
|
1792 |
-
|
1793 |
-
if(mfp.items[index].preloaded) {
|
1794 |
-
return;
|
1795 |
-
}
|
1796 |
-
|
1797 |
-
var item = mfp.items[index];
|
1798 |
-
if(!item.parsed) {
|
1799 |
-
item = mfp.parseEl( index );
|
1800 |
-
}
|
1801 |
-
|
1802 |
-
_mfpTrigger('LazyLoad', item);
|
1803 |
-
|
1804 |
-
if(item.type === 'image') {
|
1805 |
-
item.img = $('<img class="mfp-img" />').on('load.mfploader', function() {
|
1806 |
-
item.hasSize = true;
|
1807 |
-
}).on('error.mfploader', function() {
|
1808 |
-
item.hasSize = true;
|
1809 |
-
item.loadError = true;
|
1810 |
-
_mfpTrigger('LazyLoadError', item);
|
1811 |
-
}).attr('src', item.src);
|
1812 |
-
}
|
1813 |
-
|
1814 |
-
|
1815 |
-
item.preloaded = true;
|
1816 |
-
}
|
1817 |
-
}
|
1818 |
-
});
|
1819 |
-
|
1820 |
-
/*>>gallery*/
|
1821 |
-
|
1822 |
-
/*>>retina*/
|
1823 |
-
|
1824 |
-
var RETINA_NS = 'retina';
|
1825 |
-
|
1826 |
-
$.magnificPopup.registerModule(RETINA_NS, {
|
1827 |
-
options: {
|
1828 |
-
replaceSrc: function(item) {
|
1829 |
-
return item.src.replace(/\.\w+$/, function(m) { return '@2x' + m; });
|
1830 |
-
},
|
1831 |
-
ratio: 1 // Function or number. Set to 1 to disable.
|
1832 |
-
},
|
1833 |
-
proto: {
|
1834 |
-
initRetina: function() {
|
1835 |
-
if(window.devicePixelRatio > 1) {
|
1836 |
-
|
1837 |
-
var st = mfp.st.retina,
|
1838 |
-
ratio = st.ratio;
|
1839 |
-
|
1840 |
-
ratio = !isNaN(ratio) ? ratio : ratio();
|
1841 |
-
|
1842 |
-
if(ratio > 1) {
|
1843 |
-
_mfpOn('ImageHasSize' + '.' + RETINA_NS, function(e, item) {
|
1844 |
-
item.img.css({
|
1845 |
-
'max-width': item.img[0].naturalWidth / ratio,
|
1846 |
-
'width': '100%'
|
1847 |
-
});
|
1848 |
-
});
|
1849 |
-
_mfpOn('ElementParse' + '.' + RETINA_NS, function(e, item) {
|
1850 |
-
item.src = st.replaceSrc(item, ratio);
|
1851 |
-
});
|
1852 |
-
}
|
1853 |
-
}
|
1854 |
-
|
1855 |
-
}
|
1856 |
-
}
|
1857 |
-
});
|
1858 |
-
|
1859 |
-
/*>>retina*/
|
1860 |
-
_checkInstance(); }));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/lib/magnific-popup/jquery.magnific-popup.min.js
DELETED
@@ -1,4 +0,0 @@
|
|
1 |
-
/*! Magnific Popup - v1.1.0 - 2016-02-20
|
2 |
-
* http://dimsemenov.com/plugins/magnific-popup/
|
3 |
-
* Copyright (c) 2016 Dmitry Semenov; */
|
4 |
-
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):window.jQuery||window.Zepto)}(function(a){var b,c,d,e,f,g,h="Close",i="BeforeClose",j="AfterClose",k="BeforeAppend",l="MarkupParse",m="Open",n="Change",o="mfp",p="."+o,q="mfp-ready",r="mfp-removing",s="mfp-prevent-close",t=function(){},u=!!window.jQuery,v=a(window),w=function(a,c){b.ev.on(o+a+p,c)},x=function(b,c,d,e){var f=document.createElement("div");return f.className="mfp-"+b,d&&(f.innerHTML=d),e?c&&c.appendChild(f):(f=a(f),c&&f.appendTo(c)),f},y=function(c,d){b.ev.triggerHandler(o+c,d),b.st.callbacks&&(c=c.charAt(0).toLowerCase()+c.slice(1),b.st.callbacks[c]&&b.st.callbacks[c].apply(b,a.isArray(d)?d:[d]))},z=function(c){return c===g&&b.currTemplate.closeBtn||(b.currTemplate.closeBtn=a(b.st.closeMarkup.replace("%title%",b.st.tClose)),g=c),b.currTemplate.closeBtn},A=function(){a.magnificPopup.instance||(b=new t,b.init(),a.magnificPopup.instance=b)},B=function(){var a=document.createElement("p").style,b=["ms","O","Moz","Webkit"];if(void 0!==a.transition)return!0;for(;b.length;)if(b.pop()+"Transition"in a)return!0;return!1};t.prototype={constructor:t,init:function(){var c=navigator.appVersion;b.isLowIE=b.isIE8=document.all&&!document.addEventListener,b.isAndroid=/android/gi.test(c),b.isIOS=/iphone|ipad|ipod/gi.test(c),b.supportsTransition=B(),b.probablyMobile=b.isAndroid||b.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),d=a(document),b.popupsCache={}},open:function(c){var e;if(c.isObj===!1){b.items=c.items.toArray(),b.index=0;var g,h=c.items;for(e=0;e<h.length;e++)if(g=h[e],g.parsed&&(g=g.el[0]),g===c.el[0]){b.index=e;break}}else b.items=a.isArray(c.items)?c.items:[c.items],b.index=c.index||0;if(b.isOpen)return void b.updateItemHTML();b.types=[],f="",c.mainEl&&c.mainEl.length?b.ev=c.mainEl.eq(0):b.ev=d,c.key?(b.popupsCache[c.key]||(b.popupsCache[c.key]={}),b.currTemplate=b.popupsCache[c.key]):b.currTemplate={},b.st=a.extend(!0,{},a.magnificPopup.defaults,c),b.fixedContentPos="auto"===b.st.fixedContentPos?!b.probablyMobile:b.st.fixedContentPos,b.st.modal&&(b.st.closeOnContentClick=!1,b.st.closeOnBgClick=!1,b.st.showCloseBtn=!1,b.st.enableEscapeKey=!1),b.bgOverlay||(b.bgOverlay=x("bg").on("click"+p,function(){b.close()}),b.wrap=x("wrap").attr("tabindex",-1).on("click"+p,function(a){b._checkIfClose(a.target)&&b.close()}),b.container=x("container",b.wrap)),b.contentContainer=x("content"),b.st.preloader&&(b.preloader=x("preloader",b.container,b.st.tLoading));var i=a.magnificPopup.modules;for(e=0;e<i.length;e++){var j=i[e];j=j.charAt(0).toUpperCase()+j.slice(1),b["init"+j].call(b)}y("BeforeOpen"),b.st.showCloseBtn&&(b.st.closeBtnInside?(w(l,function(a,b,c,d){c.close_replaceWith=z(d.type)}),f+=" mfp-close-btn-in"):b.wrap.append(z())),b.st.alignTop&&(f+=" mfp-align-top"),b.fixedContentPos?b.wrap.css({overflow:b.st.overflowY,overflowX:"hidden",overflowY:b.st.overflowY}):b.wrap.css({top:v.scrollTop(),position:"absolute"}),(b.st.fixedBgPos===!1||"auto"===b.st.fixedBgPos&&!b.fixedContentPos)&&b.bgOverlay.css({height:d.height(),position:"absolute"}),b.st.enableEscapeKey&&d.on("keyup"+p,function(a){27===a.keyCode&&b.close()}),v.on("resize"+p,function(){b.updateSize()}),b.st.closeOnContentClick||(f+=" mfp-auto-cursor"),f&&b.wrap.addClass(f);var k=b.wH=v.height(),n={};if(b.fixedContentPos&&b._hasScrollBar(k)){var o=b._getScrollbarSize();o&&(n.marginRight=o)}b.fixedContentPos&&(b.isIE7?a("body, html").css("overflow","hidden"):n.overflow="hidden");var r=b.st.mainClass;return b.isIE7&&(r+=" mfp-ie7"),r&&b._addClassToMFP(r),b.updateItemHTML(),y("BuildControls"),a("html").css(n),b.bgOverlay.add(b.wrap).prependTo(b.st.prependTo||a(document.body)),b._lastFocusedEl=document.activeElement,setTimeout(function(){b.content?(b._addClassToMFP(q),b._setFocus()):b.bgOverlay.addClass(q),d.on("focusin"+p,b._onFocusIn)},16),b.isOpen=!0,b.updateSize(k),y(m),c},close:function(){b.isOpen&&(y(i),b.isOpen=!1,b.st.removalDelay&&!b.isLowIE&&b.supportsTransition?(b._addClassToMFP(r),setTimeout(function(){b._close()},b.st.removalDelay)):b._close())},_close:function(){y(h);var c=r+" "+q+" ";if(b.bgOverlay.detach(),b.wrap.detach(),b.container.empty(),b.st.mainClass&&(c+=b.st.mainClass+" "),b._removeClassFromMFP(c),b.fixedContentPos){var e={marginRight:""};b.isIE7?a("body, html").css("overflow",""):e.overflow="",a("html").css(e)}d.off("keyup"+p+" focusin"+p),b.ev.off(p),b.wrap.attr("class","mfp-wrap").removeAttr("style"),b.bgOverlay.attr("class","mfp-bg"),b.container.attr("class","mfp-container"),!b.st.showCloseBtn||b.st.closeBtnInside&&b.currTemplate[b.currItem.type]!==!0||b.currTemplate.closeBtn&&b.currTemplate.closeBtn.detach(),b.st.autoFocusLast&&b._lastFocusedEl&&a(b._lastFocusedEl).focus(),b.currItem=null,b.content=null,b.currTemplate=null,b.prevHeight=0,y(j)},updateSize:function(a){if(b.isIOS){var c=document.documentElement.clientWidth/window.innerWidth,d=window.innerHeight*c;b.wrap.css("height",d),b.wH=d}else b.wH=a||v.height();b.fixedContentPos||b.wrap.css("height",b.wH),y("Resize")},updateItemHTML:function(){var c=b.items[b.index];b.contentContainer.detach(),b.content&&b.content.detach(),c.parsed||(c=b.parseEl(b.index));var d=c.type;if(y("BeforeChange",[b.currItem?b.currItem.type:"",d]),b.currItem=c,!b.currTemplate[d]){var f=b.st[d]?b.st[d].markup:!1;y("FirstMarkupParse",f),f?b.currTemplate[d]=a(f):b.currTemplate[d]=!0}e&&e!==c.type&&b.container.removeClass("mfp-"+e+"-holder");var g=b["get"+d.charAt(0).toUpperCase()+d.slice(1)](c,b.currTemplate[d]);b.appendContent(g,d),c.preloaded=!0,y(n,c),e=c.type,b.container.prepend(b.contentContainer),y("AfterChange")},appendContent:function(a,c){b.content=a,a?b.st.showCloseBtn&&b.st.closeBtnInside&&b.currTemplate[c]===!0?b.content.find(".mfp-close").length||b.content.append(z()):b.content=a:b.content="",y(k),b.container.addClass("mfp-"+c+"-holder"),b.contentContainer.append(b.content)},parseEl:function(c){var d,e=b.items[c];if(e.tagName?e={el:a(e)}:(d=e.type,e={data:e,src:e.src}),e.el){for(var f=b.types,g=0;g<f.length;g++)if(e.el.hasClass("mfp-"+f[g])){d=f[g];break}e.src=e.el.attr("data-mfp-src"),e.src||(e.src=e.el.attr("href"))}return e.type=d||b.st.type||"inline",e.index=c,e.parsed=!0,b.items[c]=e,y("ElementParse",e),b.items[c]},addGroup:function(a,c){var d=function(d){d.mfpEl=this,b._openClick(d,a,c)};c||(c={});var e="click.magnificPopup";c.mainEl=a,c.items?(c.isObj=!0,a.off(e).on(e,d)):(c.isObj=!1,c.delegate?a.off(e).on(e,c.delegate,d):(c.items=a,a.off(e).on(e,d)))},_openClick:function(c,d,e){var f=void 0!==e.midClick?e.midClick:a.magnificPopup.defaults.midClick;if(f||!(2===c.which||c.ctrlKey||c.metaKey||c.altKey||c.shiftKey)){var g=void 0!==e.disableOn?e.disableOn:a.magnificPopup.defaults.disableOn;if(g)if(a.isFunction(g)){if(!g.call(b))return!0}else if(v.width()<g)return!0;c.type&&(c.preventDefault(),b.isOpen&&c.stopPropagation()),e.el=a(c.mfpEl),e.delegate&&(e.items=d.find(e.delegate)),b.open(e)}},updateStatus:function(a,d){if(b.preloader){c!==a&&b.container.removeClass("mfp-s-"+c),d||"loading"!==a||(d=b.st.tLoading);var e={status:a,text:d};y("UpdateStatus",e),a=e.status,d=e.text,b.preloader.html(d),b.preloader.find("a").on("click",function(a){a.stopImmediatePropagation()}),b.container.addClass("mfp-s-"+a),c=a}},_checkIfClose:function(c){if(!a(c).hasClass(s)){var d=b.st.closeOnContentClick,e=b.st.closeOnBgClick;if(d&&e)return!0;if(!b.content||a(c).hasClass("mfp-close")||b.preloader&&c===b.preloader[0])return!0;if(c===b.content[0]||a.contains(b.content[0],c)){if(d)return!0}else if(e&&a.contains(document,c))return!0;return!1}},_addClassToMFP:function(a){b.bgOverlay.addClass(a),b.wrap.addClass(a)},_removeClassFromMFP:function(a){this.bgOverlay.removeClass(a),b.wrap.removeClass(a)},_hasScrollBar:function(a){return(b.isIE7?d.height():document.body.scrollHeight)>(a||v.height())},_setFocus:function(){(b.st.focus?b.content.find(b.st.focus).eq(0):b.wrap).focus()},_onFocusIn:function(c){return c.target===b.wrap[0]||a.contains(b.wrap[0],c.target)?void 0:(b._setFocus(),!1)},_parseMarkup:function(b,c,d){var e;d.data&&(c=a.extend(d.data,c)),y(l,[b,c,d]),a.each(c,function(c,d){if(void 0===d||d===!1)return!0;if(e=c.split("_"),e.length>1){var f=b.find(p+"-"+e[0]);if(f.length>0){var g=e[1];"replaceWith"===g?f[0]!==d[0]&&f.replaceWith(d):"img"===g?f.is("img")?f.attr("src",d):f.replaceWith(a("<img>").attr("src",d).attr("class",f.attr("class"))):f.attr(e[1],d)}}else b.find(p+"-"+c).html(d)})},_getScrollbarSize:function(){if(void 0===b.scrollbarSize){var a=document.createElement("div");a.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(a),b.scrollbarSize=a.offsetWidth-a.clientWidth,document.body.removeChild(a)}return b.scrollbarSize}},a.magnificPopup={instance:null,proto:t.prototype,modules:[],open:function(b,c){return A(),b=b?a.extend(!0,{},b):{},b.isObj=!0,b.index=c||0,this.instance.open(b)},close:function(){return a.magnificPopup.instance&&a.magnificPopup.instance.close()},registerModule:function(b,c){c.options&&(a.magnificPopup.defaults[b]=c.options),a.extend(this.proto,c.proto),this.modules.push(b)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'<button title="%title%" type="button" class="mfp-close">×</button>',tClose:"Close (Esc)",tLoading:"Loading...",autoFocusLast:!0}},a.fn.magnificPopup=function(c){A();var d=a(this);if("string"==typeof c)if("open"===c){var e,f=u?d.data("magnificPopup"):d[0].magnificPopup,g=parseInt(arguments[1],10)||0;f.items?e=f.items[g]:(e=d,f.delegate&&(e=e.find(f.delegate)),e=e.eq(g)),b._openClick({mfpEl:e},d,f)}else b.isOpen&&b[c].apply(b,Array.prototype.slice.call(arguments,1));else c=a.extend(!0,{},c),u?d.data("magnificPopup",c):d[0].magnificPopup=c,b.addGroup(d,c);return d};var C,D,E,F="inline",G=function(){E&&(D.after(E.addClass(C)).detach(),E=null)};a.magnificPopup.registerModule(F,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){b.types.push(F),w(h+"."+F,function(){G()})},getInline:function(c,d){if(G(),c.src){var e=b.st.inline,f=a(c.src);if(f.length){var g=f[0].parentNode;g&&g.tagName&&(D||(C=e.hiddenClass,D=x(C),C="mfp-"+C),E=f.after(D).detach().removeClass(C)),b.updateStatus("ready")}else b.updateStatus("error",e.tNotFound),f=a("<div>");return c.inlineElement=f,f}return b.updateStatus("ready"),b._parseMarkup(d,{},c),d}}});var H,I="ajax",J=function(){H&&a(document.body).removeClass(H)},K=function(){J(),b.req&&b.req.abort()};a.magnificPopup.registerModule(I,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'<a href="%url%">The content</a> could not be loaded.'},proto:{initAjax:function(){b.types.push(I),H=b.st.ajax.cursor,w(h+"."+I,K),w("BeforeChange."+I,K)},getAjax:function(c){H&&a(document.body).addClass(H),b.updateStatus("loading");var d=a.extend({url:c.src,success:function(d,e,f){var g={data:d,xhr:f};y("ParseAjax",g),b.appendContent(a(g.data),I),c.finished=!0,J(),b._setFocus(),setTimeout(function(){b.wrap.addClass(q)},16),b.updateStatus("ready"),y("AjaxContentAdded")},error:function(){J(),c.finished=c.loadError=!0,b.updateStatus("error",b.st.ajax.tError.replace("%url%",c.src))}},b.st.ajax.settings);return b.req=a.ajax(d),""}}});var L,M=function(c){if(c.data&&void 0!==c.data.title)return c.data.title;var d=b.st.image.titleSrc;if(d){if(a.isFunction(d))return d.call(b,c);if(c.el)return c.el.attr(d)||""}return""};a.magnificPopup.registerModule("image",{options:{markup:'<div class="mfp-figure"><div class="mfp-close"></div><figure><div class="mfp-img"></div><figcaption><div class="mfp-bottom-bar"><div class="mfp-title"></div><div class="mfp-counter"></div></div></figcaption></figure></div>',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'<a href="%url%">The image</a> could not be loaded.'},proto:{initImage:function(){var c=b.st.image,d=".image";b.types.push("image"),w(m+d,function(){"image"===b.currItem.type&&c.cursor&&a(document.body).addClass(c.cursor)}),w(h+d,function(){c.cursor&&a(document.body).removeClass(c.cursor),v.off("resize"+p)}),w("Resize"+d,b.resizeImage),b.isLowIE&&w("AfterChange",b.resizeImage)},resizeImage:function(){var a=b.currItem;if(a&&a.img&&b.st.image.verticalFit){var c=0;b.isLowIE&&(c=parseInt(a.img.css("padding-top"),10)+parseInt(a.img.css("padding-bottom"),10)),a.img.css("max-height",b.wH-c)}},_onImageHasSize:function(a){a.img&&(a.hasSize=!0,L&&clearInterval(L),a.isCheckingImgSize=!1,y("ImageHasSize",a),a.imgHidden&&(b.content&&b.content.removeClass("mfp-loading"),a.imgHidden=!1))},findImageSize:function(a){var c=0,d=a.img[0],e=function(f){L&&clearInterval(L),L=setInterval(function(){return d.naturalWidth>0?void b._onImageHasSize(a):(c>200&&clearInterval(L),c++,void(3===c?e(10):40===c?e(50):100===c&&e(500)))},f)};e(1)},getImage:function(c,d){var e=0,f=function(){c&&(c.img[0].complete?(c.img.off(".mfploader"),c===b.currItem&&(b._onImageHasSize(c),b.updateStatus("ready")),c.hasSize=!0,c.loaded=!0,y("ImageLoadComplete")):(e++,200>e?setTimeout(f,100):g()))},g=function(){c&&(c.img.off(".mfploader"),c===b.currItem&&(b._onImageHasSize(c),b.updateStatus("error",h.tError.replace("%url%",c.src))),c.hasSize=!0,c.loaded=!0,c.loadError=!0)},h=b.st.image,i=d.find(".mfp-img");if(i.length){var j=document.createElement("img");j.className="mfp-img",c.el&&c.el.find("img").length&&(j.alt=c.el.find("img").attr("alt")),c.img=a(j).on("load.mfploader",f).on("error.mfploader",g),j.src=c.src,i.is("img")&&(c.img=c.img.clone()),j=c.img[0],j.naturalWidth>0?c.hasSize=!0:j.width||(c.hasSize=!1)}return b._parseMarkup(d,{title:M(c),img_replaceWith:c.img},c),b.resizeImage(),c.hasSize?(L&&clearInterval(L),c.loadError?(d.addClass("mfp-loading"),b.updateStatus("error",h.tError.replace("%url%",c.src))):(d.removeClass("mfp-loading"),b.updateStatus("ready")),d):(b.updateStatus("loading"),c.loading=!0,c.hasSize||(c.imgHidden=!0,d.addClass("mfp-loading"),b.findImageSize(c)),d)}}});var N,O=function(){return void 0===N&&(N=void 0!==document.createElement("p").style.MozTransform),N};a.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(a){return a.is("img")?a:a.find("img")}},proto:{initZoom:function(){var a,c=b.st.zoom,d=".zoom";if(c.enabled&&b.supportsTransition){var e,f,g=c.duration,j=function(a){var b=a.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),d="all "+c.duration/1e3+"s "+c.easing,e={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},f="transition";return e["-webkit-"+f]=e["-moz-"+f]=e["-o-"+f]=e[f]=d,b.css(e),b},k=function(){b.content.css("visibility","visible")};w("BuildControls"+d,function(){if(b._allowZoom()){if(clearTimeout(e),b.content.css("visibility","hidden"),a=b._getItemToZoom(),!a)return void k();f=j(a),f.css(b._getOffset()),b.wrap.append(f),e=setTimeout(function(){f.css(b._getOffset(!0)),e=setTimeout(function(){k(),setTimeout(function(){f.remove(),a=f=null,y("ZoomAnimationEnded")},16)},g)},16)}}),w(i+d,function(){if(b._allowZoom()){if(clearTimeout(e),b.st.removalDelay=g,!a){if(a=b._getItemToZoom(),!a)return;f=j(a)}f.css(b._getOffset(!0)),b.wrap.append(f),b.content.css("visibility","hidden"),setTimeout(function(){f.css(b._getOffset())},16)}}),w(h+d,function(){b._allowZoom()&&(k(),f&&f.remove(),a=null)})}},_allowZoom:function(){return"image"===b.currItem.type},_getItemToZoom:function(){return b.currItem.hasSize?b.currItem.img:!1},_getOffset:function(c){var d;d=c?b.currItem.img:b.st.zoom.opener(b.currItem.el||b.currItem);var e=d.offset(),f=parseInt(d.css("padding-top"),10),g=parseInt(d.css("padding-bottom"),10);e.top-=a(window).scrollTop()-f;var h={width:d.width(),height:(u?d.innerHeight():d[0].offsetHeight)-g-f};return O()?h["-moz-transform"]=h.transform="translate("+e.left+"px,"+e.top+"px)":(h.left=e.left,h.top=e.top),h}}});var P="iframe",Q="//about:blank",R=function(a){if(b.currTemplate[P]){var c=b.currTemplate[P].find("iframe");c.length&&(a||(c[0].src=Q),b.isIE8&&c.css("display",a?"block":"none"))}};a.magnificPopup.registerModule(P,{options:{markup:'<div class="mfp-iframe-scaler"><div class="mfp-close"></div><iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe></div>',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){b.types.push(P),w("BeforeChange",function(a,b,c){b!==c&&(b===P?R():c===P&&R(!0))}),w(h+"."+P,function(){R()})},getIframe:function(c,d){var e=c.src,f=b.st.iframe;a.each(f.patterns,function(){return e.indexOf(this.index)>-1?(this.id&&(e="string"==typeof this.id?e.substr(e.lastIndexOf(this.id)+this.id.length,e.length):this.id.call(this,e)),e=this.src.replace("%id%",e),!1):void 0});var g={};return f.srcAction&&(g[f.srcAction]=e),b._parseMarkup(d,g,c),b.updateStatus("ready"),d}}});var S=function(a){var c=b.items.length;return a>c-1?a-c:0>a?c+a:a},T=function(a,b,c){return a.replace(/%curr%/gi,b+1).replace(/%total%/gi,c)};a.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var c=b.st.gallery,e=".mfp-gallery";return b.direction=!0,c&&c.enabled?(f+=" mfp-gallery",w(m+e,function(){c.navigateByImgClick&&b.wrap.on("click"+e,".mfp-img",function(){return b.items.length>1?(b.next(),!1):void 0}),d.on("keydown"+e,function(a){37===a.keyCode?b.prev():39===a.keyCode&&b.next()})}),w("UpdateStatus"+e,function(a,c){c.text&&(c.text=T(c.text,b.currItem.index,b.items.length))}),w(l+e,function(a,d,e,f){var g=b.items.length;e.counter=g>1?T(c.tCounter,f.index,g):""}),w("BuildControls"+e,function(){if(b.items.length>1&&c.arrows&&!b.arrowLeft){var d=c.arrowMarkup,e=b.arrowLeft=a(d.replace(/%title%/gi,c.tPrev).replace(/%dir%/gi,"left")).addClass(s),f=b.arrowRight=a(d.replace(/%title%/gi,c.tNext).replace(/%dir%/gi,"right")).addClass(s);e.click(function(){b.prev()}),f.click(function(){b.next()}),b.container.append(e.add(f))}}),w(n+e,function(){b._preloadTimeout&&clearTimeout(b._preloadTimeout),b._preloadTimeout=setTimeout(function(){b.preloadNearbyImages(),b._preloadTimeout=null},16)}),void w(h+e,function(){d.off(e),b.wrap.off("click"+e),b.arrowRight=b.arrowLeft=null})):!1},next:function(){b.direction=!0,b.index=S(b.index+1),b.updateItemHTML()},prev:function(){b.direction=!1,b.index=S(b.index-1),b.updateItemHTML()},goTo:function(a){b.direction=a>=b.index,b.index=a,b.updateItemHTML()},preloadNearbyImages:function(){var a,c=b.st.gallery.preload,d=Math.min(c[0],b.items.length),e=Math.min(c[1],b.items.length);for(a=1;a<=(b.direction?e:d);a++)b._preloadItem(b.index+a);for(a=1;a<=(b.direction?d:e);a++)b._preloadItem(b.index-a)},_preloadItem:function(c){if(c=S(c),!b.items[c].preloaded){var d=b.items[c];d.parsed||(d=b.parseEl(c)),y("LazyLoad",d),"image"===d.type&&(d.img=a('<img class="mfp-img" />').on("load.mfploader",function(){d.hasSize=!0}).on("error.mfploader",function(){d.hasSize=!0,d.loadError=!0,y("LazyLoadError",d)}).attr("src",d.src)),d.preloaded=!0}}}});var U="retina";a.magnificPopup.registerModule(U,{options:{replaceSrc:function(a){return a.src.replace(/\.\w+$/,function(a){return"@2x"+a})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var a=b.st.retina,c=a.ratio;c=isNaN(c)?c():c,c>1&&(w("ImageHasSize."+U,function(a,b){b.img.css({"max-width":b.img[0].naturalWidth/c,width:"100%"})}),w("ElementParse."+U,function(b,d){d.src=a.replaceSrc(d,c)}))}}}}),A()});
|
|
|
|
|
|
|
|
assets/lib/owl-carousel/owl.carousel.js
DELETED
@@ -1,3448 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* Owl Carousel v2.3.4
|
3 |
-
* Copyright 2013-2018 David Deutsch
|
4 |
-
* Licensed under: SEE LICENSE IN https://github.com/OwlCarousel2/OwlCarousel2/blob/master/LICENSE
|
5 |
-
*/
|
6 |
-
/**
|
7 |
-
* Owl carousel
|
8 |
-
* @version 2.3.4
|
9 |
-
* @author Bartosz Wojciechowski
|
10 |
-
* @author David Deutsch
|
11 |
-
* @license The MIT License (MIT)
|
12 |
-
* @todo Lazy Load Icon
|
13 |
-
* @todo prevent animationend bubling
|
14 |
-
* @todo itemsScaleUp
|
15 |
-
* @todo Test Zepto
|
16 |
-
* @todo stagePadding calculate wrong active classes
|
17 |
-
*/
|
18 |
-
;(function($, window, document, undefined) {
|
19 |
-
|
20 |
-
/**
|
21 |
-
* Creates a carousel.
|
22 |
-
* @class The Owl Carousel.
|
23 |
-
* @public
|
24 |
-
* @param {HTMLElement|jQuery} element - The element to create the carousel for.
|
25 |
-
* @param {Object} [options] - The options
|
26 |
-
*/
|
27 |
-
function Owl(element, options) {
|
28 |
-
|
29 |
-
/**
|
30 |
-
* Current settings for the carousel.
|
31 |
-
* @public
|
32 |
-
*/
|
33 |
-
this.settings = null;
|
34 |
-
|
35 |
-
/**
|
36 |
-
* Current options set by the caller including defaults.
|
37 |
-
* @public
|
38 |
-
*/
|
39 |
-
this.options = $.extend({}, Owl.Defaults, options);
|
40 |
-
|
41 |
-
/**
|
42 |
-
* Plugin element.
|
43 |
-
* @public
|
44 |
-
*/
|
45 |
-
this.$element = $(element);
|
46 |
-
|
47 |
-
/**
|
48 |
-
* Proxied event handlers.
|
49 |
-
* @protected
|
50 |
-
*/
|
51 |
-
this._handlers = {};
|
52 |
-
|
53 |
-
/**
|
54 |
-
* References to the running plugins of this carousel.
|
55 |
-
* @protected
|
56 |
-
*/
|
57 |
-
this._plugins = {};
|
58 |
-
|
59 |
-
/**
|
60 |
-
* Currently suppressed events to prevent them from being retriggered.
|
61 |
-
* @protected
|
62 |
-
*/
|
63 |
-
this._supress = {};
|
64 |
-
|
65 |
-
/**
|
66 |
-
* Absolute current position.
|
67 |
-
* @protected
|
68 |
-
*/
|
69 |
-
this._current = null;
|
70 |
-
|
71 |
-
/**
|
72 |
-
* Animation speed in milliseconds.
|
73 |
-
* @protected
|
74 |
-
*/
|
75 |
-
this._speed = null;
|
76 |
-
|
77 |
-
/**
|
78 |
-
* Coordinates of all items in pixel.
|
79 |
-
* @todo The name of this member is missleading.
|
80 |
-
* @protected
|
81 |
-
*/
|
82 |
-
this._coordinates = [];
|
83 |
-
|
84 |
-
/**
|
85 |
-
* Current breakpoint.
|
86 |
-
* @todo Real media queries would be nice.
|
87 |
-
* @protected
|
88 |
-
*/
|
89 |
-
this._breakpoint = null;
|
90 |
-
|
91 |
-
/**
|
92 |
-
* Current width of the plugin element.
|
93 |
-
*/
|
94 |
-
this._width = null;
|
95 |
-
|
96 |
-
/**
|
97 |
-
* All real items.
|
98 |
-
* @protected
|
99 |
-
*/
|
100 |
-
this._items = [];
|
101 |
-
|
102 |
-
/**
|
103 |
-
* All cloned items.
|
104 |
-
* @protected
|
105 |
-
*/
|
106 |
-
this._clones = [];
|
107 |
-
|
108 |
-
/**
|
109 |
-
* Merge values of all items.
|
110 |
-
* @todo Maybe this could be part of a plugin.
|
111 |
-
* @protected
|
112 |
-
*/
|
113 |
-
this._mergers = [];
|
114 |
-
|
115 |
-
/**
|
116 |
-
* Widths of all items.
|
117 |
-
*/
|
118 |
-
this._widths = [];
|
119 |
-
|
120 |
-
/**
|
121 |
-
* Invalidated parts within the update process.
|
122 |
-
* @protected
|
123 |
-
*/
|
124 |
-
this._invalidated = {};
|
125 |
-
|
126 |
-
/**
|
127 |
-
* Ordered list of workers for the update process.
|
128 |
-
* @protected
|
129 |
-
*/
|
130 |
-
this._pipe = [];
|
131 |
-
|
132 |
-
/**
|
133 |
-
* Current state information for the drag operation.
|
134 |
-
* @todo #261
|
135 |
-
* @protected
|
136 |
-
*/
|
137 |
-
this._drag = {
|
138 |
-
time: null,
|
139 |
-
target: null,
|
140 |
-
pointer: null,
|
141 |
-
stage: {
|
142 |
-
start: null,
|
143 |
-
current: null
|
144 |
-
},
|
145 |
-
direction: null
|
146 |
-
};
|
147 |
-
|
148 |
-
/**
|
149 |
-
* Current state information and their tags.
|
150 |
-
* @type {Object}
|
151 |
-
* @protected
|
152 |
-
*/
|
153 |
-
this._states = {
|
154 |
-
current: {},
|
155 |
-
tags: {
|
156 |
-
'initializing': [ 'busy' ],
|
157 |
-
'animating': [ 'busy' ],
|
158 |
-
'dragging': [ 'interacting' ]
|
159 |
-
}
|
160 |
-
};
|
161 |
-
|
162 |
-
$.each([ 'onResize', 'onThrottledResize' ], $.proxy(function(i, handler) {
|
163 |
-
this._handlers[handler] = $.proxy(this[handler], this);
|
164 |
-
}, this));
|
165 |
-
|
166 |
-
$.each(Owl.Plugins, $.proxy(function(key, plugin) {
|
167 |
-
this._plugins[key.charAt(0).toLowerCase() + key.slice(1)]
|
168 |
-
= new plugin(this);
|
169 |
-
}, this));
|
170 |
-
|
171 |
-
$.each(Owl.Workers, $.proxy(function(priority, worker) {
|
172 |
-
this._pipe.push({
|
173 |
-
'filter': worker.filter,
|
174 |
-
'run': $.proxy(worker.run, this)
|
175 |
-
});
|
176 |
-
}, this));
|
177 |
-
|
178 |
-
this.setup();
|
179 |
-
this.initialize();
|
180 |
-
}
|
181 |
-
|
182 |
-
/**
|
183 |
-
* Default options for the carousel.
|
184 |
-
* @public
|
185 |
-
*/
|
186 |
-
Owl.Defaults = {
|
187 |
-
items: 3,
|
188 |
-
loop: false,
|
189 |
-
center: false,
|
190 |
-
rewind: false,
|
191 |
-
checkVisibility: true,
|
192 |
-
|
193 |
-
mouseDrag: true,
|
194 |
-
touchDrag: true,
|
195 |
-
pullDrag: true,
|
196 |
-
freeDrag: false,
|
197 |
-
|
198 |
-
margin: 0,
|
199 |
-
stagePadding: 0,
|
200 |
-
|
201 |
-
merge: false,
|
202 |
-
mergeFit: true,
|
203 |
-
autoWidth: false,
|
204 |
-
|
205 |
-
startPosition: 0,
|
206 |
-
rtl: false,
|
207 |
-
|
208 |
-
smartSpeed: 250,
|
209 |
-
fluidSpeed: false,
|
210 |
-
dragEndSpeed: false,
|
211 |
-
|
212 |
-
responsive: {},
|
213 |
-
responsiveRefreshRate: 200,
|
214 |
-
responsiveBaseElement: window,
|
215 |
-
|
216 |
-
fallbackEasing: 'swing',
|
217 |
-
slideTransition: '',
|
218 |
-
|
219 |
-
info: false,
|
220 |
-
|
221 |
-
nestedItemSelector: false,
|
222 |
-
itemElement: 'div',
|
223 |
-
stageElement: 'div',
|
224 |
-
|
225 |
-
refreshClass: 'owl-refresh',
|
226 |
-
loadedClass: 'owl-loaded',
|
227 |
-
loadingClass: 'owl-loading',
|
228 |
-
rtlClass: 'owl-rtl',
|
229 |
-
responsiveClass: 'owl-responsive',
|
230 |
-
dragClass: 'owl-drag',
|
231 |
-
itemClass: 'owl-item',
|
232 |
-
stageClass: 'owl-stage',
|
233 |
-
stageOuterClass: 'owl-stage-outer',
|
234 |
-
grabClass: 'owl-grab'
|
235 |
-
};
|
236 |
-
|
237 |
-
/**
|
238 |
-
* Enumeration for width.
|
239 |
-
* @public
|
240 |
-
* @readonly
|
241 |
-
* @enum {String}
|
242 |
-
*/
|
243 |
-
Owl.Width = {
|
244 |
-
Default: 'default',
|
245 |
-
Inner: 'inner',
|
246 |
-
Outer: 'outer'
|
247 |
-
};
|
248 |
-
|
249 |
-
/**
|
250 |
-
* Enumeration for types.
|
251 |
-
* @public
|
252 |
-
* @readonly
|
253 |
-
* @enum {String}
|
254 |
-
*/
|
255 |
-
Owl.Type = {
|
256 |
-
Event: 'event',
|
257 |
-
State: 'state'
|
258 |
-
};
|
259 |
-
|
260 |
-
/**
|
261 |
-
* Contains all registered plugins.
|
262 |
-
* @public
|
263 |
-
*/
|
264 |
-
Owl.Plugins = {};
|
265 |
-
|
266 |
-
/**
|
267 |
-
* List of workers involved in the update process.
|
268 |
-
*/
|
269 |
-
Owl.Workers = [ {
|
270 |
-
filter: [ 'width', 'settings' ],
|
271 |
-
run: function() {
|
272 |
-
this._width = this.$element.width();
|
273 |
-
}
|
274 |
-
}, {
|
275 |
-
filter: [ 'width', 'items', 'settings' ],
|
276 |
-
run: function(cache) {
|
277 |
-
cache.current = this._items && this._items[this.relative(this._current)];
|
278 |
-
}
|
279 |
-
}, {
|
280 |
-
filter: [ 'items', 'settings' ],
|
281 |
-
run: function() {
|
282 |
-
this.$stage.children('.cloned').remove();
|
283 |
-
}
|
284 |
-
}, {
|
285 |
-
filter: [ 'width', 'items', 'settings' ],
|
286 |
-
run: function(cache) {
|
287 |
-
var margin = this.settings.margin || '',
|
288 |
-
grid = !this.settings.autoWidth,
|
289 |
-
rtl = this.settings.rtl,
|
290 |
-
css = {
|
291 |
-
'width': 'auto',
|
292 |
-
'margin-left': rtl ? margin : '',
|
293 |
-
'margin-right': rtl ? '' : margin
|
294 |
-
};
|
295 |
-
|
296 |
-
!grid && this.$stage.children().css(css);
|
297 |
-
|
298 |
-
cache.css = css;
|
299 |
-
}
|
300 |
-
}, {
|
301 |
-
filter: [ 'width', 'items', 'settings' ],
|
302 |
-
run: function(cache) {
|
303 |
-
var width = (this.width() / this.settings.items).toFixed(3) - this.settings.margin,
|
304 |
-
merge = null,
|
305 |
-
iterator = this._items.length,
|
306 |
-
grid = !this.settings.autoWidth,
|
307 |
-
widths = [];
|
308 |
-
|
309 |
-
cache.items = {
|
310 |
-
merge: false,
|
311 |
-
width: width
|
312 |
-
};
|
313 |
-
|
314 |
-
while (iterator--) {
|
315 |
-
merge = this._mergers[iterator];
|
316 |
-
merge = this.settings.mergeFit && Math.min(merge, this.settings.items) || merge;
|
317 |
-
|
318 |
-
cache.items.merge = merge > 1 || cache.items.merge;
|
319 |
-
|
320 |
-
widths[iterator] = !grid ? this._items[iterator].width() : width * merge;
|
321 |
-
}
|
322 |
-
|
323 |
-
this._widths = widths;
|
324 |
-
}
|
325 |
-
}, {
|
326 |
-
filter: [ 'items', 'settings' ],
|
327 |
-
run: function() {
|
328 |
-
var clones = [],
|
329 |
-
items = this._items,
|
330 |
-
settings = this.settings,
|
331 |
-
// TODO: Should be computed from number of min width items in stage
|
332 |
-
view = Math.max(settings.items * 2, 4),
|
333 |
-
size = Math.ceil(items.length / 2) * 2,
|
334 |
-
repeat = settings.loop && items.length ? settings.rewind ? view : Math.max(view, size) : 0,
|
335 |
-
append = '',
|
336 |
-
prepend = '';
|
337 |
-
|
338 |
-
repeat /= 2;
|
339 |
-
|
340 |
-
while (repeat > 0) {
|
341 |
-
// Switch to only using appended clones
|
342 |
-
clones.push(this.normalize(clones.length / 2, true));
|
343 |
-
append = append + items[clones[clones.length - 1]][0].outerHTML;
|
344 |
-
clones.push(this.normalize(items.length - 1 - (clones.length - 1) / 2, true));
|
345 |
-
prepend = items[clones[clones.length - 1]][0].outerHTML + prepend;
|
346 |
-
repeat -= 1;
|
347 |
-
}
|
348 |
-
|
349 |
-
this._clones = clones;
|
350 |
-
|
351 |
-
$(append).addClass('cloned').appendTo(this.$stage);
|
352 |
-
$(prepend).addClass('cloned').prependTo(this.$stage);
|
353 |
-
}
|
354 |
-
}, {
|
355 |
-
filter: [ 'width', 'items', 'settings' ],
|
356 |
-
run: function() {
|
357 |
-
var rtl = this.settings.rtl ? 1 : -1,
|
358 |
-
size = this._clones.length + this._items.length,
|
359 |
-
iterator = -1,
|
360 |
-
previous = 0,
|
361 |
-
current = 0,
|
362 |
-
coordinates = [];
|
363 |
-
|
364 |
-
while (++iterator < size) {
|
365 |
-
previous = coordinates[iterator - 1] || 0;
|
366 |
-
current = this._widths[this.relative(iterator)] + this.settings.margin;
|
367 |
-
coordinates.push(previous + current * rtl);
|
368 |
-
}
|
369 |
-
|
370 |
-
this._coordinates = coordinates;
|
371 |
-
}
|
372 |
-
}, {
|
373 |
-
filter: [ 'width', 'items', 'settings' ],
|
374 |
-
run: function() {
|
375 |
-
var padding = this.settings.stagePadding,
|
376 |
-
coordinates = this._coordinates,
|
377 |
-
css = {
|
378 |
-
'width': Math.ceil(Math.abs(coordinates[coordinates.length - 1])) + padding * 2,
|
379 |
-
'padding-left': padding || '',
|
380 |
-
'padding-right': padding || ''
|
381 |
-
};
|
382 |
-
|
383 |
-
this.$stage.css(css);
|
384 |
-
}
|
385 |
-
}, {
|
386 |
-
filter: [ 'width', 'items', 'settings' ],
|
387 |
-
run: function(cache) {
|
388 |
-
var iterator = this._coordinates.length,
|
389 |
-
grid = !this.settings.autoWidth,
|
390 |
-
items = this.$stage.children();
|
391 |
-
|
392 |
-
if (grid && cache.items.merge) {
|
393 |
-
while (iterator--) {
|
394 |
-
cache.css.width = this._widths[this.relative(iterator)];
|
395 |
-
items.eq(iterator).css(cache.css);
|
396 |
-
}
|
397 |
-
} else if (grid) {
|
398 |
-
cache.css.width = cache.items.width;
|
399 |
-
items.css(cache.css);
|
400 |
-
}
|
401 |
-
}
|
402 |
-
}, {
|
403 |
-
filter: [ 'items' ],
|
404 |
-
run: function() {
|
405 |
-
this._coordinates.length < 1 && this.$stage.removeAttr('style');
|
406 |
-
}
|
407 |
-
}, {
|
408 |
-
filter: [ 'width', 'items', 'settings' ],
|
409 |
-
run: function(cache) {
|
410 |
-
cache.current = cache.current ? this.$stage.children().index(cache.current) : 0;
|
411 |
-
cache.current = Math.max(this.minimum(), Math.min(this.maximum(), cache.current));
|
412 |
-
this.reset(cache.current);
|
413 |
-
}
|
414 |
-
}, {
|
415 |
-
filter: [ 'position' ],
|
416 |
-
run: function() {
|
417 |
-
this.animate(this.coordinates(this._current));
|
418 |
-
}
|
419 |
-
}, {
|
420 |
-
filter: [ 'width', 'position', 'items', 'settings' ],
|
421 |
-
run: function() {
|
422 |
-
var rtl = this.settings.rtl ? 1 : -1,
|
423 |
-
padding = this.settings.stagePadding * 2,
|
424 |
-
begin = this.coordinates(this.current()) + padding,
|
425 |
-
end = begin + this.width() * rtl,
|
426 |
-
inner, outer, matches = [], i, n;
|
427 |
-
|
428 |
-
for (i = 0, n = this._coordinates.length; i < n; i++) {
|
429 |
-
inner = this._coordinates[i - 1] || 0;
|
430 |
-
outer = Math.abs(this._coordinates[i]) + padding * rtl;
|
431 |
-
|
432 |
-
if ((this.op(inner, '<=', begin) && (this.op(inner, '>', end)))
|
433 |
-
|| (this.op(outer, '<', begin) && this.op(outer, '>', end))) {
|
434 |
-
matches.push(i);
|
435 |
-
}
|
436 |
-
}
|
437 |
-
|
438 |
-
this.$stage.children('.active').removeClass('active');
|
439 |
-
this.$stage.children(':eq(' + matches.join('), :eq(') + ')').addClass('active');
|
440 |
-
|
441 |
-
this.$stage.children('.center').removeClass('center');
|
442 |
-
if (this.settings.center) {
|
443 |
-
this.$stage.children().eq(this.current()).addClass('center');
|
444 |
-
}
|
445 |
-
}
|
446 |
-
} ];
|
447 |
-
|
448 |
-
/**
|
449 |
-
* Create the stage DOM element
|
450 |
-
*/
|
451 |
-
Owl.prototype.initializeStage = function() {
|
452 |
-
this.$stage = this.$element.find('.' + this.settings.stageClass);
|
453 |
-
|
454 |
-
// if the stage is already in the DOM, grab it and skip stage initialization
|
455 |
-
if (this.$stage.length) {
|
456 |
-
return;
|
457 |
-
}
|
458 |
-
|
459 |
-
this.$element.addClass(this.options.loadingClass);
|
460 |
-
|
461 |
-
// create stage
|
462 |
-
this.$stage = $('<' + this.settings.stageElement + '>', {
|
463 |
-
"class": this.settings.stageClass
|
464 |
-
}).wrap( $( '<div/>', {
|
465 |
-
"class": this.settings.stageOuterClass
|
466 |
-
}));
|
467 |
-
|
468 |
-
// append stage
|
469 |
-
this.$element.append(this.$stage.parent());
|
470 |
-
};
|
471 |
-
|
472 |
-
/**
|
473 |
-
* Create item DOM elements
|
474 |
-
*/
|
475 |
-
Owl.prototype.initializeItems = function() {
|
476 |
-
var $items = this.$element.find('.owl-item');
|
477 |
-
|
478 |
-
// if the items are already in the DOM, grab them and skip item initialization
|
479 |
-
if ($items.length) {
|
480 |
-
this._items = $items.get().map(function(item) {
|
481 |
-
return $(item);
|
482 |
-
});
|
483 |
-
|
484 |
-
this._mergers = this._items.map(function() {
|
485 |
-
return 1;
|
486 |
-
});
|
487 |
-
|
488 |
-
this.refresh();
|
489 |
-
|
490 |
-
return;
|
491 |
-
}
|
492 |
-
|
493 |
-
// append content
|
494 |
-
this.replace(this.$element.children().not(this.$stage.parent()));
|
495 |
-
|
496 |
-
// check visibility
|
497 |
-
if (this.isVisible()) {
|
498 |
-
// update view
|
499 |
-
this.refresh();
|
500 |
-
} else {
|
501 |
-
// invalidate width
|
502 |
-
this.invalidate('width');
|
503 |
-
}
|
504 |
-
|
505 |
-
this.$element
|
506 |
-
.removeClass(this.options.loadingClass)
|
507 |
-
.addClass(this.options.loadedClass);
|
508 |
-
};
|
509 |
-
|
510 |
-
/**
|
511 |
-
* Initializes the carousel.
|
512 |
-
* @protected
|
513 |
-
*/
|
514 |
-
Owl.prototype.initialize = function() {
|
515 |
-
this.enter('initializing');
|
516 |
-
this.trigger('initialize');
|
517 |
-
|
518 |
-
this.$element.toggleClass(this.settings.rtlClass, this.settings.rtl);
|
519 |
-
|
520 |
-
if (this.settings.autoWidth && !this.is('pre-loading')) {
|
521 |
-
var imgs, nestedSelector, width;
|
522 |
-
imgs = this.$element.find('img');
|
523 |
-
nestedSelector = this.settings.nestedItemSelector ? '.' + this.settings.nestedItemSelector : undefined;
|
524 |
-
width = this.$element.children(nestedSelector).width();
|
525 |
-
|
526 |
-
if (imgs.length && width <= 0) {
|
527 |
-
this.preloadAutoWidthImages(imgs);
|
528 |
-
}
|
529 |
-
}
|
530 |
-
|
531 |
-
this.initializeStage();
|
532 |
-
this.initializeItems();
|
533 |
-
|
534 |
-
// register event handlers
|
535 |
-
this.registerEventHandlers();
|
536 |
-
|
537 |
-
this.leave('initializing');
|
538 |
-
this.trigger('initialized');
|
539 |
-
};
|
540 |
-
|
541 |
-
/**
|
542 |
-
* @returns {Boolean} visibility of $element
|
543 |
-
* if you know the carousel will always be visible you can set `checkVisibility` to `false` to
|
544 |
-
* prevent the expensive browser layout forced reflow the $element.is(':visible') does
|
545 |
-
*/
|
546 |
-
Owl.prototype.isVisible = function() {
|
547 |
-
return this.settings.checkVisibility
|
548 |
-
? this.$element.is(':visible')
|
549 |
-
: true;
|
550 |
-
};
|
551 |
-
|
552 |
-
/**
|
553 |
-
* Setups the current settings.
|
554 |
-
* @todo Remove responsive classes. Why should adaptive designs be brought into IE8?
|
555 |
-
* @todo Support for media queries by using `matchMedia` would be nice.
|
556 |
-
* @public
|
557 |
-
*/
|
558 |
-
Owl.prototype.setup = function() {
|
559 |
-
var viewport = this.viewport(),
|
560 |
-
overwrites = this.options.responsive,
|
561 |
-
match = -1,
|
562 |
-
settings = null;
|
563 |
-
|
564 |
-
if (!overwrites) {
|
565 |
-
settings = $.extend({}, this.options);
|
566 |
-
} else {
|
567 |
-
$.each(overwrites, function(breakpoint) {
|
568 |
-
if (breakpoint <= viewport && breakpoint > match) {
|
569 |
-
match = Number(breakpoint);
|
570 |
-
}
|
571 |
-
});
|
572 |
-
|
573 |
-
settings = $.extend({}, this.options, overwrites[match]);
|
574 |
-
if (typeof settings.stagePadding === 'function') {
|
575 |
-
settings.stagePadding = settings.stagePadding();
|
576 |
-
}
|
577 |
-
delete settings.responsive;
|
578 |
-
|
579 |
-
// responsive class
|
580 |
-
if (settings.responsiveClass) {
|
581 |
-
this.$element.attr('class',
|
582 |
-
this.$element.attr('class').replace(new RegExp('(' + this.options.responsiveClass + '-)\\S+\\s', 'g'), '$1' + match)
|
583 |
-
);
|
584 |
-
}
|
585 |
-
}
|
586 |
-
|
587 |
-
this.trigger('change', { property: { name: 'settings', value: settings } });
|
588 |
-
this._breakpoint = match;
|
589 |
-
this.settings = settings;
|
590 |
-
this.invalidate('settings');
|
591 |
-
this.trigger('changed', { property: { name: 'settings', value: this.settings } });
|
592 |
-
};
|
593 |
-
|
594 |
-
/**
|
595 |
-
* Updates option logic if necessery.
|
596 |
-
* @protected
|
597 |
-
*/
|
598 |
-
Owl.prototype.optionsLogic = function() {
|
599 |
-
if (this.settings.autoWidth) {
|
600 |
-
this.settings.stagePadding = false;
|
601 |
-
this.settings.merge = false;
|
602 |
-
}
|
603 |
-
};
|
604 |
-
|
605 |
-
/**
|
606 |
-
* Prepares an item before add.
|
607 |
-
* @todo Rename event parameter `content` to `item`.
|
608 |
-
* @protected
|
609 |
-
* @returns {jQuery|HTMLElement} - The item container.
|
610 |
-
*/
|
611 |
-
Owl.prototype.prepare = function(item) {
|
612 |
-
var event = this.trigger('prepare', { content: item });
|
613 |
-
|
614 |
-
if (!event.data) {
|
615 |
-
event.data = $('<' + this.settings.itemElement + '/>')
|
616 |
-
.addClass(this.options.itemClass).append(item)
|
617 |
-
}
|
618 |
-
|
619 |
-
this.trigger('prepared', { content: event.data });
|
620 |
-
|
621 |
-
return event.data;
|
622 |
-
};
|
623 |
-
|
624 |
-
/**
|
625 |
-
* Updates the view.
|
626 |
-
* @public
|
627 |
-
*/
|
628 |
-
Owl.prototype.update = function() {
|
629 |
-
var i = 0,
|
630 |
-
n = this._pipe.length,
|
631 |
-
filter = $.proxy(function(p) { return this[p] }, this._invalidated),
|
632 |
-
cache = {};
|
633 |
-
|
634 |
-
while (i < n) {
|
635 |
-
if (this._invalidated.all || $.grep(this._pipe[i].filter, filter).length > 0) {
|
636 |
-
this._pipe[i].run(cache);
|
637 |
-
}
|
638 |
-
i++;
|
639 |
-
}
|
640 |
-
|
641 |
-
this._invalidated = {};
|
642 |
-
|
643 |
-
!this.is('valid') && this.enter('valid');
|
644 |
-
};
|
645 |
-
|
646 |
-
/**
|
647 |
-
* Gets the width of the view.
|
648 |
-
* @public
|
649 |
-
* @param {Owl.Width} [dimension=Owl.Width.Default] - The dimension to return.
|
650 |
-
* @returns {Number} - The width of the view in pixel.
|
651 |
-
*/
|
652 |
-
Owl.prototype.width = function(dimension) {
|
653 |
-
dimension = dimension || Owl.Width.Default;
|
654 |
-
switch (dimension) {
|
655 |
-
case Owl.Width.Inner:
|
656 |
-
case Owl.Width.Outer:
|
657 |
-
return this._width;
|
658 |
-
default:
|
659 |
-
return this._width - this.settings.stagePadding * 2 + this.settings.margin;
|
660 |
-
}
|
661 |
-
};
|
662 |
-
|
663 |
-
/**
|
664 |
-
* Refreshes the carousel primarily for adaptive purposes.
|
665 |
-
* @public
|
666 |
-
*/
|
667 |
-
Owl.prototype.refresh = function() {
|
668 |
-
this.enter('refreshing');
|
669 |
-
this.trigger('refresh');
|
670 |
-
|
671 |
-
this.setup();
|
672 |
-
|
673 |
-
this.optionsLogic();
|
674 |
-
|
675 |
-
this.$element.addClass(this.options.refreshClass);
|
676 |
-
|
677 |
-
this.update();
|
678 |
-
|
679 |
-
this.$element.removeClass(this.options.refreshClass);
|
680 |
-
|
681 |
-
this.leave('refreshing');
|
682 |
-
this.trigger('refreshed');
|
683 |
-
};
|
684 |
-
|
685 |
-
/**
|
686 |
-
* Checks window `resize` event.
|
687 |
-
* @protected
|
688 |
-
*/
|
689 |
-
Owl.prototype.onThrottledResize = function() {
|
690 |
-
window.clearTimeout(this.resizeTimer);
|
691 |
-
this.resizeTimer = window.setTimeout(this._handlers.onResize, this.settings.responsiveRefreshRate);
|
692 |
-
};
|
693 |
-
|
694 |
-
/**
|
695 |
-
* Checks window `resize` event.
|
696 |
-
* @protected
|
697 |
-
*/
|
698 |
-
Owl.prototype.onResize = function() {
|
699 |
-
if (!this._items.length) {
|
700 |
-
return false;
|
701 |
-
}
|
702 |
-
|
703 |
-
if (this._width === this.$element.width()) {
|
704 |
-
return false;
|
705 |
-
}
|
706 |
-
|
707 |
-
if (!this.isVisible()) {
|
708 |
-
return false;
|
709 |
-
}
|
710 |
-
|
711 |
-
this.enter('resizing');
|
712 |
-
|
713 |
-
if (this.trigger('resize').isDefaultPrevented()) {
|
714 |
-
this.leave('resizing');
|
715 |
-
return false;
|
716 |
-
}
|
717 |
-
|
718 |
-
this.invalidate('width');
|
719 |
-
|
720 |
-
this.refresh();
|
721 |
-
|
722 |
-
this.leave('resizing');
|
723 |
-
this.trigger('resized');
|
724 |
-
};
|
725 |
-
|
726 |
-
/**
|
727 |
-
* Registers event handlers.
|
728 |
-
* @todo Check `msPointerEnabled`
|
729 |
-
* @todo #261
|
730 |
-
* @protected
|
731 |
-
*/
|
732 |
-
Owl.prototype.registerEventHandlers = function() {
|
733 |
-
if ($.support.transition) {
|
734 |
-
this.$stage.on($.support.transition.end + '.owl.core', $.proxy(this.onTransitionEnd, this));
|
735 |
-
}
|
736 |
-
|
737 |
-
if (this.settings.responsive !== false) {
|
738 |
-
this.on(window, 'resize', this._handlers.onThrottledResize);
|
739 |
-
}
|
740 |
-
|
741 |
-
if (this.settings.mouseDrag) {
|
742 |
-
this.$element.addClass(this.options.dragClass);
|
743 |
-
this.$stage.on('mousedown.owl.core', $.proxy(this.onDragStart, this));
|
744 |
-
this.$stage.on('dragstart.owl.core selectstart.owl.core', function() { return false });
|
745 |
-
}
|
746 |
-
|
747 |
-
if (this.settings.touchDrag){
|
748 |
-
this.$stage.on('touchstart.owl.core', $.proxy(this.onDragStart, this));
|
749 |
-
this.$stage.on('touchcancel.owl.core', $.proxy(this.onDragEnd, this));
|
750 |
-
}
|
751 |
-
};
|
752 |
-
|
753 |
-
/**
|
754 |
-
* Handles `touchstart` and `mousedown` events.
|
755 |
-
* @todo Horizontal swipe threshold as option
|
756 |
-
* @todo #261
|
757 |
-
* @protected
|
758 |
-
* @param {Event} event - The event arguments.
|
759 |
-
*/
|
760 |
-
Owl.prototype.onDragStart = function(event) {
|
761 |
-
var stage = null;
|
762 |
-
|
763 |
-
if (event.which === 3) {
|
764 |
-
return;
|
765 |
-
}
|
766 |
-
|
767 |
-
if ($.support.transform) {
|
768 |
-
stage = this.$stage.css('transform').replace(/.*\(|\)| /g, '').split(',');
|
769 |
-
stage = {
|
770 |
-
x: stage[stage.length === 16 ? 12 : 4],
|
771 |
-
y: stage[stage.length === 16 ? 13 : 5]
|
772 |
-
};
|
773 |
-
} else {
|
774 |
-
stage = this.$stage.position();
|
775 |
-
stage = {
|
776 |
-
x: this.settings.rtl ?
|
777 |
-
stage.left + this.$stage.width() - this.width() + this.settings.margin :
|
778 |
-
stage.left,
|
779 |
-
y: stage.top
|
780 |
-
};
|
781 |
-
}
|
782 |
-
|
783 |
-
if (this.is('animating')) {
|
784 |
-
$.support.transform ? this.animate(stage.x) : this.$stage.stop()
|
785 |
-
this.invalidate('position');
|
786 |
-
}
|
787 |
-
|
788 |
-
this.$element.toggleClass(this.options.grabClass, event.type === 'mousedown');
|
789 |
-
|
790 |
-
this.speed(0);
|
791 |
-
|
792 |
-
this._drag.time = new Date().getTime();
|
793 |
-
this._drag.target = $(event.target);
|
794 |
-
this._drag.stage.start = stage;
|
795 |
-
this._drag.stage.current = stage;
|
796 |
-
this._drag.pointer = this.pointer(event);
|
797 |
-
|
798 |
-
$(document).on('mouseup.owl.core touchend.owl.core', $.proxy(this.onDragEnd, this));
|
799 |
-
|
800 |
-
$(document).one('mousemove.owl.core touchmove.owl.core', $.proxy(function(event) {
|
801 |
-
var delta = this.difference(this._drag.pointer, this.pointer(event));
|
802 |
-
|
803 |
-
$(document).on('mousemove.owl.core touchmove.owl.core', $.proxy(this.onDragMove, this));
|
804 |
-
|
805 |
-
if (Math.abs(delta.x) < Math.abs(delta.y) && this.is('valid')) {
|
806 |
-
return;
|
807 |
-
}
|
808 |
-
|
809 |
-
event.preventDefault();
|
810 |
-
|
811 |
-
this.enter('dragging');
|
812 |
-
this.trigger('drag');
|
813 |
-
}, this));
|
814 |
-
};
|
815 |
-
|
816 |
-
/**
|
817 |
-
* Handles the `touchmove` and `mousemove` events.
|
818 |
-
* @todo #261
|
819 |
-
* @protected
|
820 |
-
* @param {Event} event - The event arguments.
|
821 |
-
*/
|
822 |
-
Owl.prototype.onDragMove = function(event) {
|
823 |
-
var minimum = null,
|
824 |
-
maximum = null,
|
825 |
-
pull = null,
|
826 |
-
delta = this.difference(this._drag.pointer, this.pointer(event)),
|
827 |
-
stage = this.difference(this._drag.stage.start, delta);
|
828 |
-
|
829 |
-
if (!this.is('dragging')) {
|
830 |
-
return;
|
831 |
-
}
|
832 |
-
|
833 |
-
event.preventDefault();
|
834 |
-
|
835 |
-
if (this.settings.loop) {
|
836 |
-
minimum = this.coordinates(this.minimum());
|
837 |
-
maximum = this.coordinates(this.maximum() + 1) - minimum;
|
838 |
-
stage.x = (((stage.x - minimum) % maximum + maximum) % maximum) + minimum;
|
839 |
-
} else {
|
840 |
-
minimum = this.settings.rtl ? this.coordinates(this.maximum()) : this.coordinates(this.minimum());
|
841 |
-
maximum = this.settings.rtl ? this.coordinates(this.minimum()) : this.coordinates(this.maximum());
|
842 |
-
pull = this.settings.pullDrag ? -1 * delta.x / 5 : 0;
|
843 |
-
stage.x = Math.max(Math.min(stage.x, minimum + pull), maximum + pull);
|
844 |
-
}
|
845 |
-
|
846 |
-
this._drag.stage.current = stage;
|
847 |
-
|
848 |
-
this.animate(stage.x);
|
849 |
-
};
|
850 |
-
|
851 |
-
/**
|
852 |
-
* Handles the `touchend` and `mouseup` events.
|
853 |
-
* @todo #261
|
854 |
-
* @todo Threshold for click event
|
855 |
-
* @protected
|
856 |
-
* @param {Event} event - The event arguments.
|
857 |
-
*/
|
858 |
-
Owl.prototype.onDragEnd = function(event) {
|
859 |
-
var delta = this.difference(this._drag.pointer, this.pointer(event)),
|
860 |
-
stage = this._drag.stage.current,
|
861 |
-
direction = delta.x > 0 ^ this.settings.rtl ? 'left' : 'right';
|
862 |
-
|
863 |
-
$(document).off('.owl.core');
|
864 |
-
|
865 |
-
this.$element.removeClass(this.options.grabClass);
|
866 |
-
|
867 |
-
if (delta.x !== 0 && this.is('dragging') || !this.is('valid')) {
|
868 |
-
this.speed(this.settings.dragEndSpeed || this.settings.smartSpeed);
|
869 |
-
this.current(this.closest(stage.x, delta.x !== 0 ? direction : this._drag.direction));
|
870 |
-
this.invalidate('position');
|
871 |
-
this.update();
|
872 |
-
|
873 |
-
this._drag.direction = direction;
|
874 |
-
|
875 |
-
if (Math.abs(delta.x) > 3 || new Date().getTime() - this._drag.time > 300) {
|
876 |
-
this._drag.target.one('click.owl.core', function() { return false; });
|
877 |
-
}
|
878 |
-
}
|
879 |
-
|
880 |
-
if (!this.is('dragging')) {
|
881 |
-
return;
|
882 |
-
}
|
883 |
-
|
884 |
-
this.leave('dragging');
|
885 |
-
this.trigger('dragged');
|
886 |
-
};
|
887 |
-
|
888 |
-
/**
|
889 |
-
* Gets absolute position of the closest item for a coordinate.
|
890 |
-
* @todo Setting `freeDrag` makes `closest` not reusable. See #165.
|
891 |
-
* @protected
|
892 |
-
* @param {Number} coordinate - The coordinate in pixel.
|
893 |
-
* @param {String} direction - The direction to check for the closest item. Ether `left` or `right`.
|
894 |
-
* @return {Number} - The absolute position of the closest item.
|
895 |
-
*/
|
896 |
-
Owl.prototype.closest = function(coordinate, direction) {
|
897 |
-
var position = -1,
|
898 |
-
pull = 30,
|
899 |
-
width = this.width(),
|
900 |
-
coordinates = this.coordinates();
|
901 |
-
|
902 |
-
if (!this.settings.freeDrag) {
|
903 |
-
// check closest item
|
904 |
-
$.each(coordinates, $.proxy(function(index, value) {
|
905 |
-
// on a left pull, check on current index
|
906 |
-
if (direction === 'left' && coordinate > value - pull && coordinate < value + pull) {
|
907 |
-
position = index;
|
908 |
-
// on a right pull, check on previous index
|
909 |
-
// to do so, subtract width from value and set position = index + 1
|
910 |
-
} else if (direction === 'right' && coordinate > value - width - pull && coordinate < value - width + pull) {
|
911 |
-
position = index + 1;
|
912 |
-
} else if (this.op(coordinate, '<', value)
|
913 |
-
&& this.op(coordinate, '>', coordinates[index + 1] !== undefined ? coordinates[index + 1] : value - width)) {
|
914 |
-
position = direction === 'left' ? index + 1 : index;
|
915 |
-
}
|
916 |
-
return position === -1;
|
917 |
-
}, this));
|
918 |
-
}
|
919 |
-
|
920 |
-
if (!this.settings.loop) {
|
921 |
-
// non loop boundries
|
922 |
-
if (this.op(coordinate, '>', coordinates[this.minimum()])) {
|
923 |
-
position = coordinate = this.minimum();
|
924 |
-
} else if (this.op(coordinate, '<', coordinates[this.maximum()])) {
|
925 |
-
position = coordinate = this.maximum();
|
926 |
-
}
|
927 |
-
}
|
928 |
-
|
929 |
-
return position;
|
930 |
-
};
|
931 |
-
|
932 |
-
/**
|
933 |
-
* Animates the stage.
|
934 |
-
* @todo #270
|
935 |
-
* @public
|
936 |
-
* @param {Number} coordinate - The coordinate in pixels.
|
937 |
-
*/
|
938 |
-
Owl.prototype.animate = function(coordinate) {
|
939 |
-
var animate = this.speed() > 0;
|
940 |
-
|
941 |
-
this.is('animating') && this.onTransitionEnd();
|
942 |
-
|
943 |
-
if (animate) {
|
944 |
-
this.enter('animating');
|
945 |
-
this.trigger('translate');
|
946 |
-
}
|
947 |
-
|
948 |
-
if ($.support.transform3d && $.support.transition) {
|
949 |
-
this.$stage.css({
|
950 |
-
transform: 'translate3d(' + coordinate + 'px,0px,0px)',
|
951 |
-
transition: (this.speed() / 1000) + 's' + (
|
952 |
-
this.settings.slideTransition ? ' ' + this.settings.slideTransition : ''
|
953 |
-
)
|
954 |
-
});
|
955 |
-
} else if (animate) {
|
956 |
-
this.$stage.animate({
|
957 |
-
left: coordinate + 'px'
|
958 |
-
}, this.speed(), this.settings.fallbackEasing, $.proxy(this.onTransitionEnd, this));
|
959 |
-
} else {
|
960 |
-
this.$stage.css({
|
961 |
-
left: coordinate + 'px'
|
962 |
-
});
|
963 |
-
}
|
964 |
-
};
|
965 |
-
|
966 |
-
/**
|
967 |
-
* Checks whether the carousel is in a specific state or not.
|
968 |
-
* @param {String} state - The state to check.
|
969 |
-
* @returns {Boolean} - The flag which indicates if the carousel is busy.
|
970 |
-
*/
|
971 |
-
Owl.prototype.is = function(state) {
|
972 |
-
return this._states.current[state] && this._states.current[state] > 0;
|
973 |
-
};
|
974 |
-
|
975 |
-
/**
|
976 |
-
* Sets the absolute position of the current item.
|
977 |
-
* @public
|
978 |
-
* @param {Number} [position] - The new absolute position or nothing to leave it unchanged.
|
979 |
-
* @returns {Number} - The absolute position of the current item.
|
980 |
-
*/
|
981 |
-
Owl.prototype.current = function(position) {
|
982 |
-
if (position === undefined) {
|
983 |
-
return this._current;
|
984 |
-
}
|
985 |
-
|
986 |
-
if (this._items.length === 0) {
|
987 |
-
return undefined;
|
988 |
-
}
|
989 |
-
|
990 |
-
position = this.normalize(position);
|
991 |
-
|
992 |
-
if (this._current !== position) {
|
993 |
-
var event = this.trigger('change', { property: { name: 'position', value: position } });
|
994 |
-
|
995 |
-
if (event.data !== undefined) {
|
996 |
-
position = this.normalize(event.data);
|
997 |
-
}
|
998 |
-
|
999 |
-
this._current = position;
|
1000 |
-
|
1001 |
-
this.invalidate('position');
|
1002 |
-
|
1003 |
-
this.trigger('changed', { property: { name: 'position', value: this._current } });
|
1004 |
-
}
|
1005 |
-
|
1006 |
-
return this._current;
|
1007 |
-
};
|
1008 |
-
|
1009 |
-
/**
|
1010 |
-
* Invalidates the given part of the update routine.
|
1011 |
-
* @param {String} [part] - The part to invalidate.
|
1012 |
-
* @returns {Array.<String>} - The invalidated parts.
|
1013 |
-
*/
|
1014 |
-
Owl.prototype.invalidate = function(part) {
|
1015 |
-
if ($.type(part) === 'string') {
|
1016 |
-
this._invalidated[part] = true;
|
1017 |
-
this.is('valid') && this.leave('valid');
|
1018 |
-
}
|
1019 |
-
return $.map(this._invalidated, function(v, i) { return i });
|
1020 |
-
};
|
1021 |
-
|
1022 |
-
/**
|
1023 |
-
* Resets the absolute position of the current item.
|
1024 |
-
* @public
|
1025 |
-
* @param {Number} position - The absolute position of the new item.
|
1026 |
-
*/
|
1027 |
-
Owl.prototype.reset = function(position) {
|
1028 |
-
position = this.normalize(position);
|
1029 |
-
|
1030 |
-
if (position === undefined) {
|
1031 |
-
return;
|
1032 |
-
}
|
1033 |
-
|
1034 |
-
this._speed = 0;
|
1035 |
-
this._current = position;
|
1036 |
-
|
1037 |
-
this.suppress([ 'translate', 'translated' ]);
|
1038 |
-
|
1039 |
-
this.animate(this.coordinates(position));
|
1040 |
-
|
1041 |
-
this.release([ 'translate', 'translated' ]);
|
1042 |
-
};
|
1043 |
-
|
1044 |
-
/**
|
1045 |
-
* Normalizes an absolute or a relative position of an item.
|
1046 |
-
* @public
|
1047 |
-
* @param {Number} position - The absolute or relative position to normalize.
|
1048 |
-
* @param {Boolean} [relative=false] - Whether the given position is relative or not.
|
1049 |
-
* @returns {Number} - The normalized position.
|
1050 |
-
*/
|
1051 |
-
Owl.prototype.normalize = function(position, relative) {
|
1052 |
-
var n = this._items.length,
|
1053 |
-
m = relative ? 0 : this._clones.length;
|
1054 |
-
|
1055 |
-
if (!this.isNumeric(position) || n < 1) {
|
1056 |
-
position = undefined;
|
1057 |
-
} else if (position < 0 || position >= n + m) {
|
1058 |
-
position = ((position - m / 2) % n + n) % n + m / 2;
|
1059 |
-
}
|
1060 |
-
|
1061 |
-
return position;
|
1062 |
-
};
|
1063 |
-
|
1064 |
-
/**
|
1065 |
-
* Converts an absolute position of an item into a relative one.
|
1066 |
-
* @public
|
1067 |
-
* @param {Number} position - The absolute position to convert.
|
1068 |
-
* @returns {Number} - The converted position.
|
1069 |
-
*/
|
1070 |
-
Owl.prototype.relative = function(position) {
|
1071 |
-
position -= this._clones.length / 2;
|
1072 |
-
return this.normalize(position, true);
|
1073 |
-
};
|
1074 |
-
|
1075 |
-
/**
|
1076 |
-
* Gets the maximum position for the current item.
|
1077 |
-
* @public
|
1078 |
-
* @param {Boolean} [relative=false] - Whether to return an absolute position or a relative position.
|
1079 |
-
* @returns {Number}
|
1080 |
-
*/
|
1081 |
-
Owl.prototype.maximum = function(relative) {
|
1082 |
-
var settings = this.settings,
|
1083 |
-
maximum = this._coordinates.length,
|
1084 |
-
iterator,
|
1085 |
-
reciprocalItemsWidth,
|
1086 |
-
elementWidth;
|
1087 |
-
|
1088 |
-
if (settings.loop) {
|
1089 |
-
maximum = this._clones.length / 2 + this._items.length - 1;
|
1090 |
-
} else if (settings.autoWidth || settings.merge) {
|
1091 |
-
iterator = this._items.length;
|
1092 |
-
if (iterator) {
|
1093 |
-
reciprocalItemsWidth = this._items[--iterator].width();
|
1094 |
-
elementWidth = this.$element.width();
|
1095 |
-
while (iterator--) {
|
1096 |
-
reciprocalItemsWidth += this._items[iterator].width() + this.settings.margin;
|
1097 |
-
if (reciprocalItemsWidth > elementWidth) {
|
1098 |
-
break;
|
1099 |
-
}
|
1100 |
-
}
|
1101 |
-
}
|
1102 |
-
maximum = iterator + 1;
|
1103 |
-
} else if (settings.center) {
|
1104 |
-
maximum = this._items.length - 1;
|
1105 |
-
} else {
|
1106 |
-
maximum = this._items.length - settings.items;
|
1107 |
-
}
|
1108 |
-
|
1109 |
-
if (relative) {
|
1110 |
-
maximum -= this._clones.length / 2;
|
1111 |
-
}
|
1112 |
-
|
1113 |
-
return Math.max(maximum, 0);
|
1114 |
-
};
|
1115 |
-
|
1116 |
-
/**
|
1117 |
-
* Gets the minimum position for the current item.
|
1118 |
-
* @public
|
1119 |
-
* @param {Boolean} [relative=false] - Whether to return an absolute position or a relative position.
|
1120 |
-
* @returns {Number}
|
1121 |
-
*/
|
1122 |
-
Owl.prototype.minimum = function(relative) {
|
1123 |
-
return relative ? 0 : this._clones.length / 2;
|
1124 |
-
};
|
1125 |
-
|
1126 |
-
/**
|
1127 |
-
* Gets an item at the specified relative position.
|
1128 |
-
* @public
|
1129 |
-
* @param {Number} [position] - The relative position of the item.
|
1130 |
-
* @return {jQuery|Array.<jQuery>} - The item at the given position or all items if no position was given.
|
1131 |
-
*/
|
1132 |
-
Owl.prototype.items = function(position) {
|
1133 |
-
if (position === undefined) {
|
1134 |
-
return this._items.slice();
|
1135 |
-
}
|
1136 |
-
|
1137 |
-
position = this.normalize(position, true);
|
1138 |
-
return this._items[position];
|
1139 |
-
};
|
1140 |
-
|
1141 |
-
/**
|
1142 |
-
* Gets an item at the specified relative position.
|
1143 |
-
* @public
|
1144 |
-
* @param {Number} [position] - The relative position of the item.
|
1145 |
-
* @return {jQuery|Array.<jQuery>} - The item at the given position or all items if no position was given.
|
1146 |
-
*/
|
1147 |
-
Owl.prototype.mergers = function(position) {
|
1148 |
-
if (position === undefined) {
|
1149 |
-
return this._mergers.slice();
|
1150 |
-
}
|
1151 |
-
|
1152 |
-
position = this.normalize(position, true);
|
1153 |
-
return this._mergers[position];
|
1154 |
-
};
|
1155 |
-
|
1156 |
-
/**
|
1157 |
-
* Gets the absolute positions of clones for an item.
|
1158 |
-
* @public
|
1159 |
-
* @param {Number} [position] - The relative position of the item.
|
1160 |
-
* @returns {Array.<Number>} - The absolute positions of clones for the item or all if no position was given.
|
1161 |
-
*/
|
1162 |
-
Owl.prototype.clones = function(position) {
|
1163 |
-
var odd = this._clones.length / 2,
|
1164 |
-
even = odd + this._items.length,
|
1165 |
-
map = function(index) { return index % 2 === 0 ? even + index / 2 : odd - (index + 1) / 2 };
|
1166 |
-
|
1167 |
-
if (position === undefined) {
|
1168 |
-
return $.map(this._clones, function(v, i) { return map(i) });
|
1169 |
-
}
|
1170 |
-
|
1171 |
-
return $.map(this._clones, function(v, i) { return v === position ? map(i) : null });
|
1172 |
-
};
|
1173 |
-
|
1174 |
-
/**
|
1175 |
-
* Sets the current animation speed.
|
1176 |
-
* @public
|
1177 |
-
* @param {Number} [speed] - The animation speed in milliseconds or nothing to leave it unchanged.
|
1178 |
-
* @returns {Number} - The current animation speed in milliseconds.
|
1179 |
-
*/
|
1180 |
-
Owl.prototype.speed = function(speed) {
|
1181 |
-
if (speed !== undefined) {
|
1182 |
-
this._speed = speed;
|
1183 |
-
}
|
1184 |
-
|
1185 |
-
return this._speed;
|
1186 |
-
};
|
1187 |
-
|
1188 |
-
/**
|
1189 |
-
* Gets the coordinate of an item.
|
1190 |
-
* @todo The name of this method is missleanding.
|
1191 |
-
* @public
|
1192 |
-
* @param {Number} position - The absolute position of the item within `minimum()` and `maximum()`.
|
1193 |
-
* @returns {Number|Array.<Number>} - The coordinate of the item in pixel or all coordinates.
|
1194 |
-
*/
|
1195 |
-
Owl.prototype.coordinates = function(position) {
|
1196 |
-
var multiplier = 1,
|
1197 |
-
newPosition = position - 1,
|
1198 |
-
coordinate;
|
1199 |
-
|
1200 |
-
if (position === undefined) {
|
1201 |
-
return $.map(this._coordinates, $.proxy(function(coordinate, index) {
|
1202 |
-
return this.coordinates(index);
|
1203 |
-
}, this));
|
1204 |
-
}
|
1205 |
-
|
1206 |
-
if (this.settings.center) {
|
1207 |
-
if (this.settings.rtl) {
|
1208 |
-
multiplier = -1;
|
1209 |
-
newPosition = position + 1;
|
1210 |
-
}
|
1211 |
-
|
1212 |
-
coordinate = this._coordinates[position];
|
1213 |
-
coordinate += (this.width() - coordinate + (this._coordinates[newPosition] || 0)) / 2 * multiplier;
|
1214 |
-
} else {
|
1215 |
-
coordinate = this._coordinates[newPosition] || 0;
|
1216 |
-
}
|
1217 |
-
|
1218 |
-
coordinate = Math.ceil(coordinate);
|
1219 |
-
|
1220 |
-
return coordinate;
|
1221 |
-
};
|
1222 |
-
|
1223 |
-
/**
|
1224 |
-
* Calculates the speed for a translation.
|
1225 |
-
* @protected
|
1226 |
-
* @param {Number} from - The absolute position of the start item.
|
1227 |
-
* @param {Number} to - The absolute position of the target item.
|
1228 |
-
* @param {Number} [factor=undefined] - The time factor in milliseconds.
|
1229 |
-
* @returns {Number} - The time in milliseconds for the translation.
|
1230 |
-
*/
|
1231 |
-
Owl.prototype.duration = function(from, to, factor) {
|
1232 |
-
if (factor === 0) {
|
1233 |
-
return 0;
|
1234 |
-
}
|
1235 |
-
|
1236 |
-
return Math.min(Math.max(Math.abs(to - from), 1), 6) * Math.abs((factor || this.settings.smartSpeed));
|
1237 |
-
};
|
1238 |
-
|
1239 |
-
/**
|
1240 |
-
* Slides to the specified item.
|
1241 |
-
* @public
|
1242 |
-
* @param {Number} position - The position of the item.
|
1243 |
-
* @param {Number} [speed] - The time in milliseconds for the transition.
|
1244 |
-
*/
|
1245 |
-
Owl.prototype.to = function(position, speed) {
|
1246 |
-
var current = this.current(),
|
1247 |
-
revert = null,
|
1248 |
-
distance = position - this.relative(current),
|
1249 |
-
direction = (distance > 0) - (distance < 0),
|
1250 |
-
items = this._items.length,
|
1251 |
-
minimum = this.minimum(),
|
1252 |
-
maximum = this.maximum();
|
1253 |
-
|
1254 |
-
if (this.settings.loop) {
|
1255 |
-
if (!this.settings.rewind && Math.abs(distance) > items / 2) {
|
1256 |
-
distance += direction * -1 * items;
|
1257 |
-
}
|
1258 |
-
|
1259 |
-
position = current + distance;
|
1260 |
-
revert = ((position - minimum) % items + items) % items + minimum;
|
1261 |
-
|
1262 |
-
if (revert !== position && revert - distance <= maximum && revert - distance > 0) {
|
1263 |
-
current = revert - distance;
|
1264 |
-
position = revert;
|
1265 |
-
this.reset(current);
|
1266 |
-
}
|
1267 |
-
} else if (this.settings.rewind) {
|
1268 |
-
maximum += 1;
|
1269 |
-
position = (position % maximum + maximum) % maximum;
|
1270 |
-
} else {
|
1271 |
-
position = Math.max(minimum, Math.min(maximum, position));
|
1272 |
-
}
|
1273 |
-
|
1274 |
-
this.speed(this.duration(current, position, speed));
|
1275 |
-
this.current(position);
|
1276 |
-
|
1277 |
-
if (this.isVisible()) {
|
1278 |
-
this.update();
|
1279 |
-
}
|
1280 |
-
};
|
1281 |
-
|
1282 |
-
/**
|
1283 |
-
* Slides to the next item.
|
1284 |
-
* @public
|
1285 |
-
* @param {Number} [speed] - The time in milliseconds for the transition.
|
1286 |
-
*/
|
1287 |
-
Owl.prototype.next = function(speed) {
|
1288 |
-
speed = speed || false;
|
1289 |
-
this.to(this.relative(this.current()) + 1, speed);
|
1290 |
-
};
|
1291 |
-
|
1292 |
-
/**
|
1293 |
-
* Slides to the previous item.
|
1294 |
-
* @public
|
1295 |
-
* @param {Number} [speed] - The time in milliseconds for the transition.
|
1296 |
-
*/
|
1297 |
-
Owl.prototype.prev = function(speed) {
|
1298 |
-
speed = speed || false;
|
1299 |
-
this.to(this.relative(this.current()) - 1, speed);
|
1300 |
-
};
|
1301 |
-
|
1302 |
-
/**
|
1303 |
-
* Handles the end of an animation.
|
1304 |
-
* @protected
|
1305 |
-
* @param {Event} event - The event arguments.
|
1306 |
-
*/
|
1307 |
-
Owl.prototype.onTransitionEnd = function(event) {
|
1308 |
-
|
1309 |
-
// if css2 animation then event object is undefined
|
1310 |
-
if (event !== undefined) {
|
1311 |
-
event.stopPropagation();
|
1312 |
-
|
1313 |
-
// Catch only owl-stage transitionEnd event
|
1314 |
-
if ((event.target || event.srcElement || event.originalTarget) !== this.$stage.get(0)) {
|
1315 |
-
return false;
|
1316 |
-
}
|
1317 |
-
}
|
1318 |
-
|
1319 |
-
this.leave('animating');
|
1320 |
-
this.trigger('translated');
|
1321 |
-
};
|
1322 |
-
|
1323 |
-
/**
|
1324 |
-
* Gets viewport width.
|
1325 |
-
* @protected
|
1326 |
-
* @return {Number} - The width in pixel.
|
1327 |
-
*/
|
1328 |
-
Owl.prototype.viewport = function() {
|
1329 |
-
var width;
|
1330 |
-
if (this.options.responsiveBaseElement !== window) {
|
1331 |
-
width = $(this.options.responsiveBaseElement).width();
|
1332 |
-
} else if (window.innerWidth) {
|
1333 |
-
width = window.innerWidth;
|
1334 |
-
} else if (document.documentElement && document.documentElement.clientWidth) {
|
1335 |
-
width = document.documentElement.clientWidth;
|
1336 |
-
} else {
|
1337 |
-
console.warn('Can not detect viewport width.');
|
1338 |
-
}
|
1339 |
-
return width;
|
1340 |
-
};
|
1341 |
-
|
1342 |
-
/**
|
1343 |
-
* Replaces the current content.
|
1344 |
-
* @public
|
1345 |
-
* @param {HTMLElement|jQuery|String} content - The new content.
|
1346 |
-
*/
|
1347 |
-
Owl.prototype.replace = function(content) {
|
1348 |
-
this.$stage.empty();
|
1349 |
-
this._items = [];
|
1350 |
-
|
1351 |
-
if (content) {
|
1352 |
-
content = (content instanceof jQuery) ? content : $(content);
|
1353 |
-
}
|
1354 |
-
|
1355 |
-
if (this.settings.nestedItemSelector) {
|
1356 |
-
content = content.find('.' + this.settings.nestedItemSelector);
|
1357 |
-
}
|
1358 |
-
|
1359 |
-
content.filter(function() {
|
1360 |
-
return this.nodeType === 1;
|
1361 |
-
}).each($.proxy(function(index, item) {
|
1362 |
-
item = this.prepare(item);
|
1363 |
-
this.$stage.append(item);
|
1364 |
-
this._items.push(item);
|
1365 |
-
this._mergers.push(item.find('[data-merge]').addBack('[data-merge]').attr('data-merge') * 1 || 1);
|
1366 |
-
}, this));
|
1367 |
-
|
1368 |
-
this.reset(this.isNumeric(this.settings.startPosition) ? this.settings.startPosition : 0);
|
1369 |
-
|
1370 |
-
this.invalidate('items');
|
1371 |
-
};
|
1372 |
-
|
1373 |
-
/**
|
1374 |
-
* Adds an item.
|
1375 |
-
* @todo Use `item` instead of `content` for the event arguments.
|
1376 |
-
* @public
|
1377 |
-
* @param {HTMLElement|jQuery|String} content - The item content to add.
|
1378 |
-
* @param {Number} [position] - The relative position at which to insert the item otherwise the item will be added to the end.
|
1379 |
-
*/
|
1380 |
-
Owl.prototype.add = function(content, position) {
|
1381 |
-
var current = this.relative(this._current);
|
1382 |
-
|
1383 |
-
position = position === undefined ? this._items.length : this.normalize(position, true);
|
1384 |
-
content = content instanceof jQuery ? content : $(content);
|
1385 |
-
|
1386 |
-
this.trigger('add', { content: content, position: position });
|
1387 |
-
|
1388 |
-
content = this.prepare(content);
|
1389 |
-
|
1390 |
-
if (this._items.length === 0 || position === this._items.length) {
|
1391 |
-
this._items.length === 0 && this.$stage.append(content);
|
1392 |
-
this._items.length !== 0 && this._items[position - 1].after(content);
|
1393 |
-
this._items.push(content);
|
1394 |
-
this._mergers.push(content.find('[data-merge]').addBack('[data-merge]').attr('data-merge') * 1 || 1);
|
1395 |
-
} else {
|
1396 |
-
this._items[position].before(content);
|
1397 |
-
this._items.splice(position, 0, content);
|
1398 |
-
this._mergers.splice(position, 0, content.find('[data-merge]').addBack('[data-merge]').attr('data-merge') * 1 || 1);
|
1399 |
-
}
|
1400 |
-
|
1401 |
-
this._items[current] && this.reset(this._items[current].index());
|
1402 |
-
|
1403 |
-
this.invalidate('items');
|
1404 |
-
|
1405 |
-
this.trigger('added', { content: content, position: position });
|
1406 |
-
};
|
1407 |
-
|
1408 |
-
/**
|
1409 |
-
* Removes an item by its position.
|
1410 |
-
* @todo Use `item` instead of `content` for the event arguments.
|
1411 |
-
* @public
|
1412 |
-
* @param {Number} position - The relative position of the item to remove.
|
1413 |
-
*/
|
1414 |
-
Owl.prototype.remove = function(position) {
|
1415 |
-
position = this.normalize(position, true);
|
1416 |
-
|
1417 |
-
if (position === undefined) {
|
1418 |
-
return;
|
1419 |
-
}
|
1420 |
-
|
1421 |
-
this.trigger('remove', { content: this._items[position], position: position });
|
1422 |
-
|
1423 |
-
this._items[position].remove();
|
1424 |
-
this._items.splice(position, 1);
|
1425 |
-
this._mergers.splice(position, 1);
|
1426 |
-
|
1427 |
-
this.invalidate('items');
|
1428 |
-
|
1429 |
-
this.trigger('removed', { content: null, position: position });
|
1430 |
-
};
|
1431 |
-
|
1432 |
-
/**
|
1433 |
-
* Preloads images with auto width.
|
1434 |
-
* @todo Replace by a more generic approach
|
1435 |
-
* @protected
|
1436 |
-
*/
|
1437 |
-
Owl.prototype.preloadAutoWidthImages = function(images) {
|
1438 |
-
images.each($.proxy(function(i, element) {
|
1439 |
-
this.enter('pre-loading');
|
1440 |
-
element = $(element);
|
1441 |
-
$(new Image()).one('load', $.proxy(function(e) {
|
1442 |
-
element.attr('src', e.target.src);
|
1443 |
-
element.css('opacity', 1);
|
1444 |
-
this.leave('pre-loading');
|
1445 |
-
!this.is('pre-loading') && !this.is('initializing') && this.refresh();
|
1446 |
-
}, this)).attr('src', element.attr('src') || element.attr('data-src') || element.attr('data-src-retina'));
|
1447 |
-
}, this));
|
1448 |
-
};
|
1449 |
-
|
1450 |
-
/**
|
1451 |
-
* Destroys the carousel.
|
1452 |
-
* @public
|
1453 |
-
*/
|
1454 |
-
Owl.prototype.destroy = function() {
|
1455 |
-
|
1456 |
-
this.$element.off('.owl.core');
|
1457 |
-
this.$stage.off('.owl.core');
|
1458 |
-
$(document).off('.owl.core');
|
1459 |
-
|
1460 |
-
if (this.settings.responsive !== false) {
|
1461 |
-
window.clearTimeout(this.resizeTimer);
|
1462 |
-
this.off(window, 'resize', this._handlers.onThrottledResize);
|
1463 |
-
}
|
1464 |
-
|
1465 |
-
for (var i in this._plugins) {
|
1466 |
-
this._plugins[i].destroy();
|
1467 |
-
}
|
1468 |
-
|
1469 |
-
this.$stage.children('.cloned').remove();
|
1470 |
-
|
1471 |
-
this.$stage.unwrap();
|
1472 |
-
this.$stage.children().contents().unwrap();
|
1473 |
-
this.$stage.children().unwrap();
|
1474 |
-
this.$stage.remove();
|
1475 |
-
this.$element
|
1476 |
-
.removeClass(this.options.refreshClass)
|
1477 |
-
.removeClass(this.options.loadingClass)
|
1478 |
-
.removeClass(this.options.loadedClass)
|
1479 |
-
.removeClass(this.options.rtlClass)
|
1480 |
-
.removeClass(this.options.dragClass)
|
1481 |
-
.removeClass(this.options.grabClass)
|
1482 |
-
.attr('class', this.$element.attr('class').replace(new RegExp(this.options.responsiveClass + '-\\S+\\s', 'g'), ''))
|
1483 |
-
.removeData('owl.carousel');
|
1484 |
-
};
|
1485 |
-
|
1486 |
-
/**
|
1487 |
-
* Operators to calculate right-to-left and left-to-right.
|
1488 |
-
* @protected
|
1489 |
-
* @param {Number} [a] - The left side operand.
|
1490 |
-
* @param {String} [o] - The operator.
|
1491 |
-
* @param {Number} [b] - The right side operand.
|
1492 |
-
*/
|
1493 |
-
Owl.prototype.op = function(a, o, b) {
|
1494 |
-
var rtl = this.settings.rtl;
|
1495 |
-
switch (o) {
|
1496 |
-
case '<':
|
1497 |
-
return rtl ? a > b : a < b;
|
1498 |
-
case '>':
|
1499 |
-
return rtl ? a < b : a > b;
|
1500 |
-
case '>=':
|
1501 |
-
return rtl ? a <= b : a >= b;
|
1502 |
-
case '<=':
|
1503 |
-
return rtl ? a >= b : a <= b;
|
1504 |
-
default:
|
1505 |
-
break;
|
1506 |
-
}
|
1507 |
-
};
|
1508 |
-
|
1509 |
-
/**
|
1510 |
-
* Attaches to an internal event.
|
1511 |
-
* @protected
|
1512 |
-
* @param {HTMLElement} element - The event source.
|
1513 |
-
* @param {String} event - The event name.
|
1514 |
-
* @param {Function} listener - The event handler to attach.
|
1515 |
-
* @param {Boolean} capture - Wether the event should be handled at the capturing phase or not.
|
1516 |
-
*/
|
1517 |
-
Owl.prototype.on = function(element, event, listener, capture) {
|
1518 |
-
if (element.addEventListener) {
|
1519 |
-
element.addEventListener(event, listener, capture);
|
1520 |
-
} else if (element.attachEvent) {
|
1521 |
-
element.attachEvent('on' + event, listener);
|
1522 |
-
}
|
1523 |
-
};
|
1524 |
-
|
1525 |
-
/**
|
1526 |
-
* Detaches from an internal event.
|
1527 |
-
* @protected
|
1528 |
-
* @param {HTMLElement} element - The event source.
|
1529 |
-
* @param {String} event - The event name.
|
1530 |
-
* @param {Function} listener - The attached event handler to detach.
|
1531 |
-
* @param {Boolean} capture - Wether the attached event handler was registered as a capturing listener or not.
|
1532 |
-
*/
|
1533 |
-
Owl.prototype.off = function(element, event, listener, capture) {
|
1534 |
-
if (element.removeEventListener) {
|
1535 |
-
element.removeEventListener(event, listener, capture);
|
1536 |
-
} else if (element.detachEvent) {
|
1537 |
-
element.detachEvent('on' + event, listener);
|
1538 |
-
}
|
1539 |
-
};
|
1540 |
-
|
1541 |
-
/**
|
1542 |
-
* Triggers a public event.
|
1543 |
-
* @todo Remove `status`, `relatedTarget` should be used instead.
|
1544 |
-
* @protected
|
1545 |
-
* @param {String} name - The event name.
|
1546 |
-
* @param {*} [data=null] - The event data.
|
1547 |
-
* @param {String} [namespace=carousel] - The event namespace.
|
1548 |
-
* @param {String} [state] - The state which is associated with the event.
|
1549 |
-
* @param {Boolean} [enter=false] - Indicates if the call enters the specified state or not.
|
1550 |
-
* @returns {Event} - The event arguments.
|
1551 |
-
*/
|
1552 |
-
Owl.prototype.trigger = function(name, data, namespace, state, enter) {
|
1553 |
-
var status = {
|
1554 |
-
item: { count: this._items.length, index: this.current() }
|
1555 |
-
}, handler = $.camelCase(
|
1556 |
-
$.grep([ 'on', name, namespace ], function(v) { return v })
|
1557 |
-
.join('-').toLowerCase()
|
1558 |
-
), event = $.Event(
|
1559 |
-
[ name, 'owl', namespace || 'carousel' ].join('.').toLowerCase(),
|
1560 |
-
$.extend({ relatedTarget: this }, status, data)
|
1561 |
-
);
|
1562 |
-
|
1563 |
-
if (!this._supress[name]) {
|
1564 |
-
$.each(this._plugins, function(name, plugin) {
|
1565 |
-
if (plugin.onTrigger) {
|
1566 |
-
plugin.onTrigger(event);
|
1567 |
-
}
|
1568 |
-
});
|
1569 |
-
|
1570 |
-
this.register({ type: Owl.Type.Event, name: name });
|
1571 |
-
this.$element.trigger(event);
|
1572 |
-
|
1573 |
-
if (this.settings && typeof this.settings[handler] === 'function') {
|
1574 |
-
this.settings[handler].call(this, event);
|
1575 |
-
}
|
1576 |
-
}
|
1577 |
-
|
1578 |
-
return event;
|
1579 |
-
};
|
1580 |
-
|
1581 |
-
/**
|
1582 |
-
* Enters a state.
|
1583 |
-
* @param name - The state name.
|
1584 |
-
*/
|
1585 |
-
Owl.prototype.enter = function(name) {
|
1586 |
-
$.each([ name ].concat(this._states.tags[name] || []), $.proxy(function(i, name) {
|
1587 |
-
if (this._states.current[name] === undefined) {
|
1588 |
-
this._states.current[name] = 0;
|
1589 |
-
}
|
1590 |
-
|
1591 |
-
this._states.current[name]++;
|
1592 |
-
}, this));
|
1593 |
-
};
|
1594 |
-
|
1595 |
-
/**
|
1596 |
-
* Leaves a state.
|
1597 |
-
* @param name - The state name.
|
1598 |
-
*/
|
1599 |
-
Owl.prototype.leave = function(name) {
|
1600 |
-
$.each([ name ].concat(this._states.tags[name] || []), $.proxy(function(i, name) {
|
1601 |
-
this._states.current[name]--;
|
1602 |
-
}, this));
|
1603 |
-
};
|
1604 |
-
|
1605 |
-
/**
|
1606 |
-
* Registers an event or state.
|
1607 |
-
* @public
|
1608 |
-
* @param {Object} object - The event or state to register.
|
1609 |
-
*/
|
1610 |
-
Owl.prototype.register = function(object) {
|
1611 |
-
if (object.type === Owl.Type.Event) {
|
1612 |
-
if (!$.event.special[object.name]) {
|
1613 |
-
$.event.special[object.name] = {};
|
1614 |
-
}
|
1615 |
-
|
1616 |
-
if (!$.event.special[object.name].owl) {
|
1617 |
-
var _default = $.event.special[object.name]._default;
|
1618 |
-
$.event.special[object.name]._default = function(e) {
|
1619 |
-
if (_default && _default.apply && (!e.namespace || e.namespace.indexOf('owl') === -1)) {
|
1620 |
-
return _default.apply(this, arguments);
|
1621 |
-
}
|
1622 |
-
return e.namespace && e.namespace.indexOf('owl') > -1;
|
1623 |
-
};
|
1624 |
-
$.event.special[object.name].owl = true;
|
1625 |
-
}
|
1626 |
-
} else if (object.type === Owl.Type.State) {
|
1627 |
-
if (!this._states.tags[object.name]) {
|
1628 |
-
this._states.tags[object.name] = object.tags;
|
1629 |
-
} else {
|
1630 |
-
this._states.tags[object.name] = this._states.tags[object.name].concat(object.tags);
|
1631 |
-
}
|
1632 |
-
|
1633 |
-
this._states.tags[object.name] = $.grep(this._states.tags[object.name], $.proxy(function(tag, i) {
|
1634 |
-
return $.inArray(tag, this._states.tags[object.name]) === i;
|
1635 |
-
}, this));
|
1636 |
-
}
|
1637 |
-
};
|
1638 |
-
|
1639 |
-
/**
|
1640 |
-
* Suppresses events.
|
1641 |
-
* @protected
|
1642 |
-
* @param {Array.<String>} events - The events to suppress.
|
1643 |
-
*/
|
1644 |
-
Owl.prototype.suppress = function(events) {
|
1645 |
-
$.each(events, $.proxy(function(index, event) {
|
1646 |
-
this._supress[event] = true;
|
1647 |
-
}, this));
|
1648 |
-
};
|
1649 |
-
|
1650 |
-
/**
|
1651 |
-
* Releases suppressed events.
|
1652 |
-
* @protected
|
1653 |
-
* @param {Array.<String>} events - The events to release.
|
1654 |
-
*/
|
1655 |
-
Owl.prototype.release = function(events) {
|
1656 |
-
$.each(events, $.proxy(function(index, event) {
|
1657 |
-
delete this._supress[event];
|
1658 |
-
}, this));
|
1659 |
-
};
|
1660 |
-
|
1661 |
-
/**
|
1662 |
-
* Gets unified pointer coordinates from event.
|
1663 |
-
* @todo #261
|
1664 |
-
* @protected
|
1665 |
-
* @param {Event} - The `mousedown` or `touchstart` event.
|
1666 |
-
* @returns {Object} - Contains `x` and `y` coordinates of current pointer position.
|
1667 |
-
*/
|
1668 |
-
Owl.prototype.pointer = function(event) {
|
1669 |
-
var result = { x: null, y: null };
|
1670 |
-
|
1671 |
-
event = event.originalEvent || event || window.event;
|
1672 |
-
|
1673 |
-
event = event.touches && event.touches.length ?
|
1674 |
-
event.touches[0] : event.changedTouches && event.changedTouches.length ?
|
1675 |
-
event.changedTouches[0] : event;
|
1676 |
-
|
1677 |
-
if (event.pageX) {
|
1678 |
-
result.x = event.pageX;
|
1679 |
-
result.y = event.pageY;
|
1680 |
-
} else {
|
1681 |
-
result.x = event.clientX;
|
1682 |
-
result.y = event.clientY;
|
1683 |
-
}
|
1684 |
-
|
1685 |
-
return result;
|
1686 |
-
};
|
1687 |
-
|
1688 |
-
/**
|
1689 |
-
* Determines if the input is a Number or something that can be coerced to a Number
|
1690 |
-
* @protected
|
1691 |
-
* @param {Number|String|Object|Array|Boolean|RegExp|Function|Symbol} - The input to be tested
|
1692 |
-
* @returns {Boolean} - An indication if the input is a Number or can be coerced to a Number
|
1693 |
-
*/
|
1694 |
-
Owl.prototype.isNumeric = function(number) {
|
1695 |
-
return !isNaN(parseFloat(number));
|
1696 |
-
};
|
1697 |
-
|
1698 |
-
/**
|
1699 |
-
* Gets the difference of two vectors.
|
1700 |
-
* @todo #261
|
1701 |
-
* @protected
|
1702 |
-
* @param {Object} - The first vector.
|
1703 |
-
* @param {Object} - The second vector.
|
1704 |
-
* @returns {Object} - The difference.
|
1705 |
-
*/
|
1706 |
-
Owl.prototype.difference = function(first, second) {
|
1707 |
-
return {
|
1708 |
-
x: first.x - second.x,
|
1709 |
-
y: first.y - second.y
|
1710 |
-
};
|
1711 |
-
};
|
1712 |
-
|
1713 |
-
/**
|
1714 |
-
* The jQuery Plugin for the Owl Carousel
|
1715 |
-
* @todo Navigation plugin `next` and `prev`
|
1716 |
-
* @public
|
1717 |
-
*/
|
1718 |
-
$.fn.owlCarousel = function(option) {
|
1719 |
-
var args = Array.prototype.slice.call(arguments, 1);
|
1720 |
-
|
1721 |
-
return this.each(function() {
|
1722 |
-
var $this = $(this),
|
1723 |
-
data = $this.data('owl.carousel');
|
1724 |
-
|
1725 |
-
if (!data) {
|
1726 |
-
data = new Owl(this, typeof option == 'object' && option);
|
1727 |
-
$this.data('owl.carousel', data);
|
1728 |
-
|
1729 |
-
$.each([
|
1730 |
-
'next', 'prev', 'to', 'destroy', 'refresh', 'replace', 'add', 'remove'
|
1731 |
-
], function(i, event) {
|
1732 |
-
data.register({ type: Owl.Type.Event, name: event });
|
1733 |
-
data.$element.on(event + '.owl.carousel.core', $.proxy(function(e) {
|
1734 |
-
if (e.namespace && e.relatedTarget !== this) {
|
1735 |
-
this.suppress([ event ]);
|
1736 |
-
data[event].apply(this, [].slice.call(arguments, 1));
|
1737 |
-
this.release([ event ]);
|
1738 |
-
}
|
1739 |
-
}, data));
|
1740 |
-
});
|
1741 |
-
}
|
1742 |
-
|
1743 |
-
if (typeof option == 'string' && option.charAt(0) !== '_') {
|
1744 |
-
data[option].apply(data, args);
|
1745 |
-
}
|
1746 |
-
});
|
1747 |
-
};
|
1748 |
-
|
1749 |
-
/**
|
1750 |
-
* The constructor for the jQuery Plugin
|
1751 |
-
* @public
|
1752 |
-
*/
|
1753 |
-
$.fn.owlCarousel.Constructor = Owl;
|
1754 |
-
|
1755 |
-
})(window.Zepto || window.jQuery, window, document);
|
1756 |
-
|
1757 |
-
/**
|
1758 |
-
* AutoRefresh Plugin
|
1759 |
-
* @version 2.3.4
|
1760 |
-
* @author Artus Kolanowski
|
1761 |
-
* @author David Deutsch
|
1762 |
-
* @license The MIT License (MIT)
|
1763 |
-
*/
|
1764 |
-
;(function($, window, document, undefined) {
|
1765 |
-
|
1766 |
-
/**
|
1767 |
-
* Creates the auto refresh plugin.
|
1768 |
-
* @class The Auto Refresh Plugin
|
1769 |
-
* @param {Owl} carousel - The Owl Carousel
|
1770 |
-
*/
|
1771 |
-
var AutoRefresh = function(carousel) {
|
1772 |
-
/**
|
1773 |
-
* Reference to the core.
|
1774 |
-
* @protected
|
1775 |
-
* @type {Owl}
|
1776 |
-
*/
|
1777 |
-
this._core = carousel;
|
1778 |
-
|
1779 |
-
/**
|
1780 |
-
* Refresh interval.
|
1781 |
-
* @protected
|
1782 |
-
* @type {number}
|
1783 |
-
*/
|
1784 |
-
this._interval = null;
|
1785 |
-
|
1786 |
-
/**
|
1787 |
-
* Whether the element is currently visible or not.
|
1788 |
-
* @protected
|
1789 |
-
* @type {Boolean}
|
1790 |
-
*/
|
1791 |
-
this._visible = null;
|
1792 |
-
|
1793 |
-
/**
|
1794 |
-
* All event handlers.
|
1795 |
-
* @protected
|
1796 |
-
* @type {Object}
|
1797 |
-
*/
|
1798 |
-
this._handlers = {
|
1799 |
-
'initialized.owl.carousel': $.proxy(function(e) {
|
1800 |
-
if (e.namespace && this._core.settings.autoRefresh) {
|
1801 |
-
this.watch();
|
1802 |
-
}
|
1803 |
-
}, this)
|
1804 |
-
};
|
1805 |
-
|
1806 |
-
// set default options
|
1807 |
-
this._core.options = $.extend({}, AutoRefresh.Defaults, this._core.options);
|
1808 |
-
|
1809 |
-
// register event handlers
|
1810 |
-
this._core.$element.on(this._handlers);
|
1811 |
-
};
|
1812 |
-
|
1813 |
-
/**
|
1814 |
-
* Default options.
|
1815 |
-
* @public
|
1816 |
-
*/
|
1817 |
-
AutoRefresh.Defaults = {
|
1818 |
-
autoRefresh: true,
|
1819 |
-
autoRefreshInterval: 500
|
1820 |
-
};
|
1821 |
-
|
1822 |
-
/**
|
1823 |
-
* Watches the element.
|
1824 |
-
*/
|
1825 |
-
AutoRefresh.prototype.watch = function() {
|
1826 |
-
if (this._interval) {
|
1827 |
-
return;
|
1828 |
-
}
|
1829 |
-
|
1830 |
-
this._visible = this._core.isVisible();
|
1831 |
-
this._interval = window.setInterval($.proxy(this.refresh, this), this._core.settings.autoRefreshInterval);
|
1832 |
-
};
|
1833 |
-
|
1834 |
-
/**
|
1835 |
-
* Refreshes the element.
|
1836 |
-
*/
|
1837 |
-
AutoRefresh.prototype.refresh = function() {
|
1838 |
-
if (this._core.isVisible() === this._visible) {
|
1839 |
-
return;
|
1840 |
-
}
|
1841 |
-
|
1842 |
-
this._visible = !this._visible;
|
1843 |
-
|
1844 |
-
this._core.$element.toggleClass('owl-hidden', !this._visible);
|
1845 |
-
|
1846 |
-
this._visible && (this._core.invalidate('width') && this._core.refresh());
|
1847 |
-
};
|
1848 |
-
|
1849 |
-
/**
|
1850 |
-
* Destroys the plugin.
|
1851 |
-
*/
|
1852 |
-
AutoRefresh.prototype.destroy = function() {
|
1853 |
-
var handler, property;
|
1854 |
-
|
1855 |
-
window.clearInterval(this._interval);
|
1856 |
-
|
1857 |
-
for (handler in this._handlers) {
|
1858 |
-
this._core.$element.off(handler, this._handlers[handler]);
|
1859 |
-
}
|
1860 |
-
for (property in Object.getOwnPropertyNames(this)) {
|
1861 |
-
typeof this[property] != 'function' && (this[property] = null);
|
1862 |
-
}
|
1863 |
-
};
|
1864 |
-
|
1865 |
-
$.fn.owlCarousel.Constructor.Plugins.AutoRefresh = AutoRefresh;
|
1866 |
-
|
1867 |
-
})(window.Zepto || window.jQuery, window, document);
|
1868 |
-
|
1869 |
-
/**
|
1870 |
-
* Lazy Plugin
|
1871 |
-
* @version 2.3.4
|
1872 |
-
* @author Bartosz Wojciechowski
|
1873 |
-
* @author David Deutsch
|
1874 |
-
* @license The MIT License (MIT)
|
1875 |
-
*/
|
1876 |
-
;(function($, window, document, undefined) {
|
1877 |
-
|
1878 |
-
/**
|
1879 |
-
* Creates the lazy plugin.
|
1880 |
-
* @class The Lazy Plugin
|
1881 |
-
* @param {Owl} carousel - The Owl Carousel
|
1882 |
-
*/
|
1883 |
-
var Lazy = function(carousel) {
|
1884 |
-
|
1885 |
-
/**
|
1886 |
-
* Reference to the core.
|
1887 |
-
* @protected
|
1888 |
-
* @type {Owl}
|
1889 |
-
*/
|
1890 |
-
this._core = carousel;
|
1891 |
-
|
1892 |
-
/**
|
1893 |
-
* Already loaded items.
|
1894 |
-
* @protected
|
1895 |
-
* @type {Array.<jQuery>}
|
1896 |
-
*/
|
1897 |
-
this._loaded = [];
|
1898 |
-
|
1899 |
-
/**
|
1900 |
-
* Event handlers.
|
1901 |
-
* @protected
|
1902 |
-
* @type {Object}
|
1903 |
-
*/
|
1904 |
-
this._handlers = {
|
1905 |
-
'initialized.owl.carousel change.owl.carousel resized.owl.carousel': $.proxy(function(e) {
|
1906 |
-
if (!e.namespace) {
|
1907 |
-
return;
|
1908 |
-
}
|
1909 |
-
|
1910 |
-
if (!this._core.settings || !this._core.settings.lazyLoad) {
|
1911 |
-
return;
|
1912 |
-
}
|
1913 |
-
|
1914 |
-
if ((e.property && e.property.name == 'position') || e.type == 'initialized') {
|
1915 |
-
var settings = this._core.settings,
|
1916 |
-
n = (settings.center && Math.ceil(settings.items / 2) || settings.items),
|
1917 |
-
i = ((settings.center && n * -1) || 0),
|
1918 |
-
position = (e.property && e.property.value !== undefined ? e.property.value : this._core.current()) + i,
|
1919 |
-
clones = this._core.clones().length,
|
1920 |
-
load = $.proxy(function(i, v) { this.load(v) }, this);
|
1921 |
-
//TODO: Need documentation for this new option
|
1922 |
-
if (settings.lazyLoadEager > 0) {
|
1923 |
-
n += settings.lazyLoadEager;
|
1924 |
-
// If the carousel is looping also preload images that are to the "left"
|
1925 |
-
if (settings.loop) {
|
1926 |
-
position -= settings.lazyLoadEager;
|
1927 |
-
n++;
|
1928 |
-
}
|
1929 |
-
}
|
1930 |
-
|
1931 |
-
while (i++ < n) {
|
1932 |
-
this.load(clones / 2 + this._core.relative(position));
|
1933 |
-
clones && $.each(this._core.clones(this._core.relative(position)), load);
|
1934 |
-
position++;
|
1935 |
-
}
|
1936 |
-
}
|
1937 |
-
}, this)
|
1938 |
-
};
|
1939 |
-
|
1940 |
-
// set the default options
|
1941 |
-
this._core.options = $.extend({}, Lazy.Defaults, this._core.options);
|
1942 |
-
|
1943 |
-
// register event handler
|
1944 |
-
this._core.$element.on(this._handlers);
|
1945 |
-
};
|
1946 |
-
|
1947 |
-
/**
|
1948 |
-
* Default options.
|
1949 |
-
* @public
|
1950 |
-
*/
|
1951 |
-
Lazy.Defaults = {
|
1952 |
-
lazyLoad: false,
|
1953 |
-
lazyLoadEager: 0
|
1954 |
-
};
|
1955 |
-
|
1956 |
-
/**
|
1957 |
-
* Loads all resources of an item at the specified position.
|
1958 |
-
* @param {Number} position - The absolute position of the item.
|
1959 |
-
* @protected
|
1960 |
-
*/
|
1961 |
-
Lazy.prototype.load = function(position) {
|
1962 |
-
var $item = this._core.$stage.children().eq(position),
|
1963 |
-
$elements = $item && $item.find('.owl-lazy');
|
1964 |
-
|
1965 |
-
if (!$elements || $.inArray($item.get(0), this._loaded) > -1) {
|
1966 |
-
return;
|
1967 |
-
}
|
1968 |
-
|
1969 |
-
$elements.each($.proxy(function(index, element) {
|
1970 |
-
var $element = $(element), image,
|
1971 |
-
url = (window.devicePixelRatio > 1 && $element.attr('data-src-retina')) || $element.attr('data-src') || $element.attr('data-srcset');
|
1972 |
-
|
1973 |
-
this._core.trigger('load', { element: $element, url: url }, 'lazy');
|
1974 |
-
|
1975 |
-
if ($element.is('img')) {
|
1976 |
-
$element.one('load.owl.lazy', $.proxy(function() {
|
1977 |
-
$element.css('opacity', 1);
|
1978 |
-
this._core.trigger('loaded', { element: $element, url: url }, 'lazy');
|
1979 |
-
}, this)).attr('src', url);
|
1980 |
-
} else if ($element.is('source')) {
|
1981 |
-
$element.one('load.owl.lazy', $.proxy(function() {
|
1982 |
-
this._core.trigger('loaded', { element: $element, url: url }, 'lazy');
|
1983 |
-
}, this)).attr('srcset', url);
|
1984 |
-
} else {
|
1985 |
-
image = new Image();
|
1986 |
-
image.onload = $.proxy(function() {
|
1987 |
-
$element.css({
|
1988 |
-
'background-image': 'url("' + url + '")',
|
1989 |
-
'opacity': '1'
|
1990 |
-
});
|
1991 |
-
this._core.trigger('loaded', { element: $element, url: url }, 'lazy');
|
1992 |
-
}, this);
|
1993 |
-
image.src = url;
|
1994 |
-
}
|
1995 |
-
}, this));
|
1996 |
-
|
1997 |
-
this._loaded.push($item.get(0));
|
1998 |
-
};
|
1999 |
-
|
2000 |
-
/**
|
2001 |
-
* Destroys the plugin.
|
2002 |
-
* @public
|
2003 |
-
*/
|
2004 |
-
Lazy.prototype.destroy = function() {
|
2005 |
-
var handler, property;
|
2006 |
-
|
2007 |
-
for (handler in this.handlers) {
|
2008 |
-
this._core.$element.off(handler, this.handlers[handler]);
|
2009 |
-
}
|
2010 |
-
for (property in Object.getOwnPropertyNames(this)) {
|
2011 |
-
typeof this[property] != 'function' && (this[property] = null);
|
2012 |
-
}
|
2013 |
-
};
|
2014 |
-
|
2015 |
-
$.fn.owlCarousel.Constructor.Plugins.Lazy = Lazy;
|
2016 |
-
|
2017 |
-
})(window.Zepto || window.jQuery, window, document);
|
2018 |
-
|
2019 |
-
/**
|
2020 |
-
* AutoHeight Plugin
|
2021 |
-
* @version 2.3.4
|
2022 |
-
* @author Bartosz Wojciechowski
|
2023 |
-
* @author David Deutsch
|
2024 |
-
* @license The MIT License (MIT)
|
2025 |
-
*/
|
2026 |
-
;(function($, window, document, undefined) {
|
2027 |
-
|
2028 |
-
/**
|
2029 |
-
* Creates the auto height plugin.
|
2030 |
-
* @class The Auto Height Plugin
|
2031 |
-
* @param {Owl} carousel - The Owl Carousel
|
2032 |
-
*/
|
2033 |
-
var AutoHeight = function(carousel) {
|
2034 |
-
/**
|
2035 |
-
* Reference to the core.
|
2036 |
-
* @protected
|
2037 |
-
* @type {Owl}
|
2038 |
-
*/
|
2039 |
-
this._core = carousel;
|
2040 |
-
|
2041 |
-
this._previousHeight = null;
|
2042 |
-
|
2043 |
-
/**
|
2044 |
-
* All event handlers.
|
2045 |
-
* @protected
|
2046 |
-
* @type {Object}
|
2047 |
-
*/
|
2048 |
-
this._handlers = {
|
2049 |
-
'initialized.owl.carousel refreshed.owl.carousel': $.proxy(function(e) {
|
2050 |
-
if (e.namespace && this._core.settings.autoHeight) {
|
2051 |
-
this.update();
|
2052 |
-
}
|
2053 |
-
}, this),
|
2054 |
-
'changed.owl.carousel': $.proxy(function(e) {
|
2055 |
-
if (e.namespace && this._core.settings.autoHeight && e.property.name === 'position'){
|
2056 |
-
this.update();
|
2057 |
-
}
|
2058 |
-
}, this),
|
2059 |
-
'loaded.owl.lazy': $.proxy(function(e) {
|
2060 |
-
if (e.namespace && this._core.settings.autoHeight
|
2061 |
-
&& e.element.closest('.' + this._core.settings.itemClass).index() === this._core.current()) {
|
2062 |
-
this.update();
|
2063 |
-
}
|
2064 |
-
}, this)
|
2065 |
-
};
|
2066 |
-
|
2067 |
-
// set default options
|
2068 |
-
this._core.options = $.extend({}, AutoHeight.Defaults, this._core.options);
|
2069 |
-
|
2070 |
-
// register event handlers
|
2071 |
-
this._core.$element.on(this._handlers);
|
2072 |
-
this._intervalId = null;
|
2073 |
-
var refThis = this;
|
2074 |
-
|
2075 |
-
// These changes have been taken from a PR by gavrochelegnou proposed in #1575
|
2076 |
-
// and have been made compatible with the latest jQuery version
|
2077 |
-
$(window).on('load', function() {
|
2078 |
-
if (refThis._core.settings.autoHeight) {
|
2079 |
-
refThis.update();
|
2080 |
-
}
|
2081 |
-
});
|
2082 |
-
|
2083 |
-
// Autoresize the height of the carousel when window is resized
|
2084 |
-
// When carousel has images, the height is dependent on the width
|
2085 |
-
// and should also change on resize
|
2086 |
-
$(window).resize(function() {
|
2087 |
-
if (refThis._core.settings.autoHeight) {
|
2088 |
-
if (refThis._intervalId != null) {
|
2089 |
-
clearTimeout(refThis._intervalId);
|
2090 |
-
}
|
2091 |
-
|
2092 |
-
refThis._intervalId = setTimeout(function() {
|
2093 |
-
refThis.update();
|
2094 |
-
}, 250);
|
2095 |
-
}
|
2096 |
-
});
|
2097 |
-
|
2098 |
-
};
|
2099 |
-
|
2100 |
-
/**
|
2101 |
-
* Default options.
|
2102 |
-
* @public
|
2103 |
-
*/
|
2104 |
-
AutoHeight.Defaults = {
|
2105 |
-
autoHeight: false,
|
2106 |
-
autoHeightClass: 'owl-height'
|
2107 |
-
};
|
2108 |
-
|
2109 |
-
/**
|
2110 |
-
* Updates the view.
|
2111 |
-
*/
|
2112 |
-
AutoHeight.prototype.update = function() {
|
2113 |
-
var start = this._core._current,
|
2114 |
-
end = start + this._core.settings.items,
|
2115 |
-
lazyLoadEnabled = this._core.settings.lazyLoad,
|
2116 |
-
visible = this._core.$stage.children().toArray().slice(start, end),
|
2117 |
-
heights = [],
|
2118 |
-
maxheight = 0;
|
2119 |
-
|
2120 |
-
$.each(visible, function(index, item) {
|
2121 |
-
heights.push($(item).height());
|
2122 |
-
});
|
2123 |
-
|
2124 |
-
maxheight = Math.max.apply(null, heights);
|
2125 |
-
|
2126 |
-
if (maxheight <= 1 && lazyLoadEnabled && this._previousHeight) {
|
2127 |
-
maxheight = this._previousHeight;
|
2128 |
-
}
|
2129 |
-
|
2130 |
-
this._previousHeight = maxheight;
|
2131 |
-
|
2132 |
-
this._core.$stage.parent()
|
2133 |
-
.height(maxheight)
|
2134 |
-
.addClass(this._core.settings.autoHeightClass);
|
2135 |
-
};
|
2136 |
-
|
2137 |
-
AutoHeight.prototype.destroy = function() {
|
2138 |
-
var handler, property;
|
2139 |
-
|
2140 |
-
for (handler in this._handlers) {
|
2141 |
-
this._core.$element.off(handler, this._handlers[handler]);
|
2142 |
-
}
|
2143 |
-
for (property in Object.getOwnPropertyNames(this)) {
|
2144 |
-
typeof this[property] !== 'function' && (this[property] = null);
|
2145 |
-
}
|
2146 |
-
};
|
2147 |
-
|
2148 |
-
$.fn.owlCarousel.Constructor.Plugins.AutoHeight = AutoHeight;
|
2149 |
-
|
2150 |
-
})(window.Zepto || window.jQuery, window, document);
|
2151 |
-
|
2152 |
-
/**
|
2153 |
-
* Video Plugin
|
2154 |
-
* @version 2.3.4
|
2155 |
-
* @author Bartosz Wojciechowski
|
2156 |
-
* @author David Deutsch
|
2157 |
-
* @license The MIT License (MIT)
|
2158 |
-
*/
|
2159 |
-
;(function($, window, document, undefined) {
|
2160 |
-
|
2161 |
-
/**
|
2162 |
-
* Creates the video plugin.
|
2163 |
-
* @class The Video Plugin
|
2164 |
-
* @param {Owl} carousel - The Owl Carousel
|
2165 |
-
*/
|
2166 |
-
var Video = function(carousel) {
|
2167 |
-
/**
|
2168 |
-
* Reference to the core.
|
2169 |
-
* @protected
|
2170 |
-
* @type {Owl}
|
2171 |
-
*/
|
2172 |
-
this._core = carousel;
|
2173 |
-
|
2174 |
-
/**
|
2175 |
-
* Cache all video URLs.
|
2176 |
-
* @protected
|
2177 |
-
* @type {Object}
|
2178 |
-
*/
|
2179 |
-
this._videos = {};
|
2180 |
-
|
2181 |
-
/**
|
2182 |
-
* Current playing item.
|
2183 |
-
* @protected
|
2184 |
-
* @type {jQuery}
|
2185 |
-
*/
|
2186 |
-
this._playing = null;
|
2187 |
-
|
2188 |
-
/**
|
2189 |
-
* All event handlers.
|
2190 |
-
* @todo The cloned content removale is too late
|
2191 |
-
* @protected
|
2192 |
-
* @type {Object}
|
2193 |
-
*/
|
2194 |
-
this._handlers = {
|
2195 |
-
'initialized.owl.carousel': $.proxy(function(e) {
|
2196 |
-
if (e.namespace) {
|
2197 |
-
this._core.register({ type: 'state', name: 'playing', tags: [ 'interacting' ] });
|
2198 |
-
}
|
2199 |
-
}, this),
|
2200 |
-
'resize.owl.carousel': $.proxy(function(e) {
|
2201 |
-
if (e.namespace && this._core.settings.video && this.isInFullScreen()) {
|
2202 |
-
e.preventDefault();
|
2203 |
-
}
|
2204 |
-
}, this),
|
2205 |
-
'refreshed.owl.carousel': $.proxy(function(e) {
|
2206 |
-
if (e.namespace && this._core.is('resizing')) {
|
2207 |
-
this._core.$stage.find('.cloned .owl-video-frame').remove();
|
2208 |
-
}
|
2209 |
-
}, this),
|
2210 |
-
'changed.owl.carousel': $.proxy(function(e) {
|
2211 |
-
if (e.namespace && e.property.name === 'position' && this._playing) {
|
2212 |
-
this.stop();
|
2213 |
-
}
|
2214 |
-
}, this),
|
2215 |
-
'prepared.owl.carousel': $.proxy(function(e) {
|
2216 |
-
if (!e.namespace) {
|
2217 |
-
return;
|
2218 |
-
}
|
2219 |
-
|
2220 |
-
var $element = $(e.content).find('.owl-video');
|
2221 |
-
|
2222 |
-
if ($element.length) {
|
2223 |
-
$element.css('display', 'none');
|
2224 |
-
this.fetch($element, $(e.content));
|
2225 |
-
}
|
2226 |
-
}, this)
|
2227 |
-
};
|
2228 |
-
|
2229 |
-
// set default options
|
2230 |
-
this._core.options = $.extend({}, Video.Defaults, this._core.options);
|
2231 |
-
|
2232 |
-
// register event handlers
|
2233 |
-
this._core.$element.on(this._handlers);
|
2234 |
-
|
2235 |
-
this._core.$element.on('click.owl.video', '.owl-video-play-icon', $.proxy(function(e) {
|
2236 |
-
this.play(e);
|
2237 |
-
}, this));
|
2238 |
-
};
|
2239 |
-
|
2240 |
-
/**
|
2241 |
-
* Default options.
|
2242 |
-
* @public
|
2243 |
-
*/
|
2244 |
-
Video.Defaults = {
|
2245 |
-
video: false,
|
2246 |
-
videoHeight: false,
|
2247 |
-
videoWidth: false
|
2248 |
-
};
|
2249 |
-
|
2250 |
-
/**
|
2251 |
-
* Gets the video ID and the type (YouTube/Vimeo/vzaar only).
|
2252 |
-
* @protected
|
2253 |
-
* @param {jQuery} target - The target containing the video data.
|
2254 |
-
* @param {jQuery} item - The item containing the video.
|
2255 |
-
*/
|
2256 |
-
Video.prototype.fetch = function(target, item) {
|
2257 |
-
var type = (function() {
|
2258 |
-
if (target.attr('data-vimeo-id')) {
|
2259 |
-
return 'vimeo';
|
2260 |
-
} else if (target.attr('data-vzaar-id')) {
|
2261 |
-
return 'vzaar'
|
2262 |
-
} else {
|
2263 |
-
return 'youtube';
|
2264 |
-
}
|
2265 |
-
})(),
|
2266 |
-
id = target.attr('data-vimeo-id') || target.attr('data-youtube-id') || target.attr('data-vzaar-id'),
|
2267 |
-
width = target.attr('data-width') || this._core.settings.videoWidth,
|
2268 |
-
height = target.attr('data-height') || this._core.settings.videoHeight,
|
2269 |
-
url = target.attr('href');
|
2270 |
-
|
2271 |
-
if (url) {
|
2272 |
-
|
2273 |
-
/*
|
2274 |
-
Parses the id's out of the following urls (and probably more):
|
2275 |
-
https://www.youtube.com/watch?v=:id
|
2276 |
-
https://youtu.be/:id
|
2277 |
-
https://vimeo.com/:id
|
2278 |
-
https://vimeo.com/channels/:channel/:id
|
2279 |
-
https://vimeo.com/groups/:group/videos/:id
|
2280 |
-
https://app.vzaar.com/videos/:id
|
2281 |
-
|
2282 |
-
Visual example: https://regexper.com/#(http%3A%7Chttps%3A%7C)%5C%2F%5C%2F(player.%7Cwww.%7Capp.)%3F(vimeo%5C.com%7Cyoutu(be%5C.com%7C%5C.be%7Cbe%5C.googleapis%5C.com)%7Cvzaar%5C.com)%5C%2F(video%5C%2F%7Cvideos%5C%2F%7Cembed%5C%2F%7Cchannels%5C%2F.%2B%5C%2F%7Cgroups%5C%2F.%2B%5C%2F%7Cwatch%5C%3Fv%3D%7Cv%5C%2F)%3F(%5BA-Za-z0-9._%25-%5D*)(%5C%26%5CS%2B)%3F
|
2283 |
-
*/
|
2284 |
-
|
2285 |
-
id = url.match(/(http:|https:|)\/\/(player.|www.|app.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com|be\-nocookie\.com)|vzaar\.com)\/(video\/|videos\/|embed\/|channels\/.+\/|groups\/.+\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/);
|
2286 |
-
|
2287 |
-
if (id[3].indexOf('youtu') > -1) {
|
2288 |
-
type = 'youtube';
|
2289 |
-
} else if (id[3].indexOf('vimeo') > -1) {
|
2290 |
-
type = 'vimeo';
|
2291 |
-
} else if (id[3].indexOf('vzaar') > -1) {
|
2292 |
-
type = 'vzaar';
|
2293 |
-
} else {
|
2294 |
-
throw new Error('Video URL not supported.');
|
2295 |
-
}
|
2296 |
-
id = id[6];
|
2297 |
-
} else {
|
2298 |
-
throw new Error('Missing video URL.');
|
2299 |
-
}
|
2300 |
-
|
2301 |
-
this._videos[url] = {
|
2302 |
-
type: type,
|
2303 |
-
id: id,
|
2304 |
-
width: width,
|
2305 |
-
height: height
|
2306 |
-
};
|
2307 |
-
|
2308 |
-
item.attr('data-video', url);
|
2309 |
-
|
2310 |
-
this.thumbnail(target, this._videos[url]);
|
2311 |
-
};
|
2312 |
-
|
2313 |
-
/**
|
2314 |
-
* Creates video thumbnail.
|
2315 |
-
* @protected
|
2316 |
-
* @param {jQuery} target - The target containing the video data.
|
2317 |
-
* @param {Object} info - The video info object.
|
2318 |
-
* @see `fetch`
|
2319 |
-
*/
|
2320 |
-
Video.prototype.thumbnail = function(target, video) {
|
2321 |
-
var tnLink,
|
2322 |
-
icon,
|
2323 |
-
path,
|
2324 |
-
dimensions = video.width && video.height ? 'width:' + video.width + 'px;height:' + video.height + 'px;' : '',
|
2325 |
-
customTn = target.find('img'),
|
2326 |
-
srcType = 'src',
|
2327 |
-
lazyClass = '',
|
2328 |
-
settings = this._core.settings,
|
2329 |
-
create = function(path) {
|
2330 |
-
icon = '<div class="owl-video-play-icon"></div>';
|
2331 |
-
|
2332 |
-
if (settings.lazyLoad) {
|
2333 |
-
tnLink = $('<div/>',{
|
2334 |
-
"class": 'owl-video-tn ' + lazyClass,
|
2335 |
-
"srcType": path
|
2336 |
-
});
|
2337 |
-
} else {
|
2338 |
-
tnLink = $( '<div/>', {
|
2339 |
-
"class": "owl-video-tn",
|
2340 |
-
"style": 'opacity:1;background-image:url(' + path + ')'
|
2341 |
-
});
|
2342 |
-
}
|
2343 |
-
target.after(tnLink);
|
2344 |
-
target.after(icon);
|
2345 |
-
};
|
2346 |
-
|
2347 |
-
// wrap video content into owl-video-wrapper div
|
2348 |
-
target.wrap( $( '<div/>', {
|
2349 |
-
"class": "owl-video-wrapper",
|
2350 |
-
"style": dimensions
|
2351 |
-
}));
|
2352 |
-
|
2353 |
-
if (this._core.settings.lazyLoad) {
|
2354 |
-
srcType = 'data-src';
|
2355 |
-
lazyClass = 'owl-lazy';
|
2356 |
-
}
|
2357 |
-
|
2358 |
-
// custom thumbnail
|
2359 |
-
if (customTn.length) {
|
2360 |
-
create(customTn.attr(srcType));
|
2361 |
-
customTn.remove();
|
2362 |
-
return false;
|
2363 |
-
}
|
2364 |
-
|
2365 |
-
if (video.type === 'youtube') {
|
2366 |
-
path = "//img.youtube.com/vi/" + video.id + "/hqdefault.jpg";
|
2367 |
-
create(path);
|
2368 |
-
} else if (video.type === 'vimeo') {
|
2369 |
-
$.ajax({
|
2370 |
-
type: 'GET',
|
2371 |
-
url: '//vimeo.com/api/v2/video/' + video.id + '.json',
|
2372 |
-
jsonp: 'callback',
|
2373 |
-
dataType: 'jsonp',
|
2374 |
-
success: function(data) {
|
2375 |
-
path = data[0].thumbnail_large;
|
2376 |
-
create(path);
|
2377 |
-
}
|
2378 |
-
});
|
2379 |
-
} else if (video.type === 'vzaar') {
|
2380 |
-
$.ajax({
|
2381 |
-
type: 'GET',
|
2382 |
-
url: '//vzaar.com/api/videos/' + video.id + '.json',
|
2383 |
-
jsonp: 'callback',
|
2384 |
-
dataType: 'jsonp',
|
2385 |
-
success: function(data) {
|
2386 |
-
path = data.framegrab_url;
|
2387 |
-
create(path);
|
2388 |
-
}
|
2389 |
-
});
|
2390 |
-
}
|
2391 |
-
};
|
2392 |
-
|
2393 |
-
/**
|
2394 |
-
* Stops the current video.
|
2395 |
-
* @public
|
2396 |
-
*/
|
2397 |
-
Video.prototype.stop = function() {
|
2398 |
-
this._core.trigger('stop', null, 'video');
|
2399 |
-
this._playing.find('.owl-video-frame').remove();
|
2400 |
-
this._playing.removeClass('owl-video-playing');
|
2401 |
-
this._playing = null;
|
2402 |
-
this._core.leave('playing');
|
2403 |
-
this._core.trigger('stopped', null, 'video');
|
2404 |
-
};
|
2405 |
-
|
2406 |
-
/**
|
2407 |
-
* Starts the current video.
|
2408 |
-
* @public
|
2409 |
-
* @param {Event} event - The event arguments.
|
2410 |
-
*/
|
2411 |
-
Video.prototype.play = function(event) {
|
2412 |
-
var target = $(event.target),
|
2413 |
-
item = target.closest('.' + this._core.settings.itemClass),
|
2414 |
-
video = this._videos[item.attr('data-video')],
|
2415 |
-
width = video.width || '100%',
|
2416 |
-
height = video.height || this._core.$stage.height(),
|
2417 |
-
html,
|
2418 |
-
iframe;
|
2419 |
-
|
2420 |
-
if (this._playing) {
|
2421 |
-
return;
|
2422 |
-
}
|
2423 |
-
|
2424 |
-
this._core.enter('playing');
|
2425 |
-
this._core.trigger('play', null, 'video');
|
2426 |
-
|
2427 |
-
item = this._core.items(this._core.relative(item.index()));
|
2428 |
-
|
2429 |
-
this._core.reset(item.index());
|
2430 |
-
|
2431 |
-
html = $( '<iframe frameborder="0" allowfullscreen mozallowfullscreen webkitAllowFullScreen ></iframe>' );
|
2432 |
-
html.attr( 'height', height );
|
2433 |
-
html.attr( 'width', width );
|
2434 |
-
if (video.type === 'youtube') {
|
2435 |
-
html.attr( 'src', '//www.youtube.com/embed/' + video.id + '?autoplay=1&rel=0&v=' + video.id );
|
2436 |
-
} else if (video.type === 'vimeo') {
|
2437 |
-
html.attr( 'src', '//player.vimeo.com/video/' + video.id + '?autoplay=1' );
|
2438 |
-
} else if (video.type === 'vzaar') {
|
2439 |
-
html.attr( 'src', '//view.vzaar.com/' + video.id + '/player?autoplay=true' );
|
2440 |
-
}
|
2441 |
-
|
2442 |
-
iframe = $(html).wrap( '<div class="owl-video-frame" />' ).insertAfter(item.find('.owl-video'));
|
2443 |
-
|
2444 |
-
this._playing = item.addClass('owl-video-playing');
|
2445 |
-
};
|
2446 |
-
|
2447 |
-
/**
|
2448 |
-
* Checks whether an video is currently in full screen mode or not.
|
2449 |
-
* @todo Bad style because looks like a readonly method but changes members.
|
2450 |
-
* @protected
|
2451 |
-
* @returns {Boolean}
|
2452 |
-
*/
|
2453 |
-
Video.prototype.isInFullScreen = function() {
|
2454 |
-
var element = document.fullscreenElement || document.mozFullScreenElement ||
|
2455 |
-
document.webkitFullscreenElement;
|
2456 |
-
|
2457 |
-
return element && $(element).parent().hasClass('owl-video-frame');
|
2458 |
-
};
|
2459 |
-
|
2460 |
-
/**
|
2461 |
-
* Destroys the plugin.
|
2462 |
-
*/
|
2463 |
-
Video.prototype.destroy = function() {
|
2464 |
-
var handler, property;
|
2465 |
-
|
2466 |
-
this._core.$element.off('click.owl.video');
|
2467 |
-
|
2468 |
-
for (handler in this._handlers) {
|
2469 |
-
this._core.$element.off(handler, this._handlers[handler]);
|
2470 |
-
}
|
2471 |
-
for (property in Object.getOwnPropertyNames(this)) {
|
2472 |
-
typeof this[property] != 'function' && (this[property] = null);
|
2473 |
-
}
|
2474 |
-
};
|
2475 |
-
|
2476 |
-
$.fn.owlCarousel.Constructor.Plugins.Video = Video;
|
2477 |
-
|
2478 |
-
})(window.Zepto || window.jQuery, window, document);
|
2479 |
-
|
2480 |
-
/**
|
2481 |
-
* Animate Plugin
|
2482 |
-
* @version 2.3.4
|
2483 |
-
* @author Bartosz Wojciechowski
|
2484 |
-
* @author David Deutsch
|
2485 |
-
* @license The MIT License (MIT)
|
2486 |
-
*/
|
2487 |
-
;(function($, window, document, undefined) {
|
2488 |
-
|
2489 |
-
/**
|
2490 |
-
* Creates the animate plugin.
|
2491 |
-
* @class The Navigation Plugin
|
2492 |
-
* @param {Owl} scope - The Owl Carousel
|
2493 |
-
*/
|
2494 |
-
var Animate = function(scope) {
|
2495 |
-
this.core = scope;
|
2496 |
-
this.core.options = $.extend({}, Animate.Defaults, this.core.options);
|
2497 |
-
this.swapping = true;
|
2498 |
-
this.previous = undefined;
|
2499 |
-
this.next = undefined;
|
2500 |
-
|
2501 |
-
this.handlers = {
|
2502 |
-
'change.owl.carousel': $.proxy(function(e) {
|
2503 |
-
if (e.namespace && e.property.name == 'position') {
|
2504 |
-
this.previous = this.core.current();
|
2505 |
-
this.next = e.property.value;
|
2506 |
-
}
|
2507 |
-
}, this),
|
2508 |
-
'drag.owl.carousel dragged.owl.carousel translated.owl.carousel': $.proxy(function(e) {
|
2509 |
-
if (e.namespace) {
|
2510 |
-
this.swapping = e.type == 'translated';
|
2511 |
-
}
|
2512 |
-
}, this),
|
2513 |
-
'translate.owl.carousel': $.proxy(function(e) {
|
2514 |
-
if (e.namespace && this.swapping && (this.core.options.animateOut || this.core.options.animateIn)) {
|
2515 |
-
this.swap();
|
2516 |
-
}
|
2517 |
-
}, this)
|
2518 |
-
};
|
2519 |
-
|
2520 |
-
this.core.$element.on(this.handlers);
|
2521 |
-
};
|
2522 |
-
|
2523 |
-
/**
|
2524 |
-
* Default options.
|
2525 |
-
* @public
|
2526 |
-
*/
|
2527 |
-
Animate.Defaults = {
|
2528 |
-
animateOut: false,
|
2529 |
-
animateIn: false
|
2530 |
-
};
|
2531 |
-
|
2532 |
-
/**
|
2533 |
-
* Toggles the animation classes whenever an translations starts.
|
2534 |
-
* @protected
|
2535 |
-
* @returns {Boolean|undefined}
|
2536 |
-
*/
|
2537 |
-
Animate.prototype.swap = function() {
|
2538 |
-
|
2539 |
-
if (this.core.settings.items !== 1) {
|
2540 |
-
return;
|
2541 |
-
}
|
2542 |
-
|
2543 |
-
if (!$.support.animation || !$.support.transition) {
|
2544 |
-
return;
|
2545 |
-
}
|
2546 |
-
|
2547 |
-
this.core.speed(0);
|
2548 |
-
|
2549 |
-
var left,
|
2550 |
-
clear = $.proxy(this.clear, this),
|
2551 |
-
previous = this.core.$stage.children().eq(this.previous),
|
2552 |
-
next = this.core.$stage.children().eq(this.next),
|
2553 |
-
incoming = this.core.settings.animateIn,
|
2554 |
-
outgoing = this.core.settings.animateOut;
|
2555 |
-
|
2556 |
-
if (this.core.current() === this.previous) {
|
2557 |
-
return;
|
2558 |
-
}
|
2559 |
-
|
2560 |
-
if (outgoing) {
|
2561 |
-
left = this.core.coordinates(this.previous) - this.core.coordinates(this.next);
|
2562 |
-
previous.one($.support.animation.end, clear)
|
2563 |
-
.css( { 'left': left + 'px' } )
|
2564 |
-
.addClass('animated owl-animated-out')
|
2565 |
-
.addClass(outgoing);
|
2566 |
-
}
|
2567 |
-
|
2568 |
-
if (incoming) {
|
2569 |
-
next.one($.support.animation.end, clear)
|
2570 |
-
.addClass('animated owl-animated-in')
|
2571 |
-
.addClass(incoming);
|
2572 |
-
}
|
2573 |
-
};
|
2574 |
-
|
2575 |
-
Animate.prototype.clear = function(e) {
|
2576 |
-
$(e.target).css( { 'left': '' } )
|
2577 |
-
.removeClass('animated owl-animated-out owl-animated-in')
|
2578 |
-
.removeClass(this.core.settings.animateIn)
|
2579 |
-
.removeClass(this.core.settings.animateOut);
|
2580 |
-
this.core.onTransitionEnd();
|
2581 |
-
};
|
2582 |
-
|
2583 |
-
/**
|
2584 |
-
* Destroys the plugin.
|
2585 |
-
* @public
|
2586 |
-
*/
|
2587 |
-
Animate.prototype.destroy = function() {
|
2588 |
-
var handler, property;
|
2589 |
-
|
2590 |
-
for (handler in this.handlers) {
|
2591 |
-
this.core.$element.off(handler, this.handlers[handler]);
|
2592 |
-
}
|
2593 |
-
for (property in Object.getOwnPropertyNames(this)) {
|
2594 |
-
typeof this[property] != 'function' && (this[property] = null);
|
2595 |
-
}
|
2596 |
-
};
|
2597 |
-
|
2598 |
-
$.fn.owlCarousel.Constructor.Plugins.Animate = Animate;
|
2599 |
-
|
2600 |
-
})(window.Zepto || window.jQuery, window, document);
|
2601 |
-
|
2602 |
-
/**
|
2603 |
-
* Autoplay Plugin
|
2604 |
-
* @version 2.3.4
|
2605 |
-
* @author Bartosz Wojciechowski
|
2606 |
-
* @author Artus Kolanowski
|
2607 |
-
* @author David Deutsch
|
2608 |
-
* @author Tom De Caluwé
|
2609 |
-
* @license The MIT License (MIT)
|
2610 |
-
*/
|
2611 |
-
;(function($, window, document, undefined) {
|
2612 |
-
|
2613 |
-
/**
|
2614 |
-
* Creates the autoplay plugin.
|
2615 |
-
* @class The Autoplay Plugin
|
2616 |
-
* @param {Owl} scope - The Owl Carousel
|
2617 |
-
*/
|
2618 |
-
var Autoplay = function(carousel) {
|
2619 |
-
/**
|
2620 |
-
* Reference to the core.
|
2621 |
-
* @protected
|
2622 |
-
* @type {Owl}
|
2623 |
-
*/
|
2624 |
-
this._core = carousel;
|
2625 |
-
|
2626 |
-
/**
|
2627 |
-
* The autoplay timeout id.
|
2628 |
-
* @type {Number}
|
2629 |
-
*/
|
2630 |
-
this._call = null;
|
2631 |
-
|
2632 |
-
/**
|
2633 |
-
* Depending on the state of the plugin, this variable contains either
|
2634 |
-
* the start time of the timer or the current timer value if it's
|
2635 |
-
* paused. Since we start in a paused state we initialize the timer
|
2636 |
-
* value.
|
2637 |
-
* @type {Number}
|
2638 |
-
*/
|
2639 |
-
this._time = 0;
|
2640 |
-
|
2641 |
-
/**
|
2642 |
-
* Stores the timeout currently used.
|
2643 |
-
* @type {Number}
|
2644 |
-
*/
|
2645 |
-
this._timeout = 0;
|
2646 |
-
|
2647 |
-
/**
|
2648 |
-
* Indicates whenever the autoplay is paused.
|
2649 |
-
* @type {Boolean}
|
2650 |
-
*/
|
2651 |
-
this._paused = true;
|
2652 |
-
|
2653 |
-
/**
|
2654 |
-
* All event handlers.
|
2655 |
-
* @protected
|
2656 |
-
* @type {Object}
|
2657 |
-
*/
|
2658 |
-
this._handlers = {
|
2659 |
-
'changed.owl.carousel': $.proxy(function(e) {
|
2660 |
-
if (e.namespace && e.property.name === 'settings') {
|
2661 |
-
if (this._core.settings.autoplay) {
|
2662 |
-
this.play();
|
2663 |
-
} else {
|
2664 |
-
this.stop();
|
2665 |
-
}
|
2666 |
-
} else if (e.namespace && e.property.name === 'position' && this._paused) {
|
2667 |
-
// Reset the timer. This code is triggered when the position
|
2668 |
-
// of the carousel was changed through user interaction.
|
2669 |
-
this._time = 0;
|
2670 |
-
}
|
2671 |
-
}, this),
|
2672 |
-
'initialized.owl.carousel': $.proxy(function(e) {
|
2673 |
-
if (e.namespace && this._core.settings.autoplay) {
|
2674 |
-
this.play();
|
2675 |
-
}
|
2676 |
-
}, this),
|
2677 |
-
'play.owl.autoplay': $.proxy(function(e, t, s) {
|
2678 |
-
if (e.namespace) {
|
2679 |
-
this.play(t, s);
|
2680 |
-
}
|
2681 |
-
}, this),
|
2682 |
-
'stop.owl.autoplay': $.proxy(function(e) {
|
2683 |
-
if (e.namespace) {
|
2684 |
-
this.stop();
|
2685 |
-
}
|
2686 |
-
}, this),
|
2687 |
-
'mouseover.owl.autoplay': $.proxy(function() {
|
2688 |
-
if (this._core.settings.autoplayHoverPause && this._core.is('rotating')) {
|
2689 |
-
this.pause();
|
2690 |
-
}
|
2691 |
-
}, this),
|
2692 |
-
'mouseleave.owl.autoplay': $.proxy(function() {
|
2693 |
-
if (this._core.settings.autoplayHoverPause && this._core.is('rotating')) {
|
2694 |
-
this.play();
|
2695 |
-
}
|
2696 |
-
}, this),
|
2697 |
-
'touchstart.owl.core': $.proxy(function() {
|
2698 |
-
if (this._core.settings.autoplayHoverPause && this._core.is('rotating')) {
|
2699 |
-
this.pause();
|
2700 |
-
}
|
2701 |
-
}, this),
|
2702 |
-
'touchend.owl.core': $.proxy(function() {
|
2703 |
-
if (this._core.settings.autoplayHoverPause) {
|
2704 |
-
this.play();
|
2705 |
-
}
|
2706 |
-
}, this)
|
2707 |
-
};
|
2708 |
-
|
2709 |
-
// register event handlers
|
2710 |
-
this._core.$element.on(this._handlers);
|
2711 |
-
|
2712 |
-
// set default options
|
2713 |
-
this._core.options = $.extend({}, Autoplay.Defaults, this._core.options);
|
2714 |
-
};
|
2715 |
-
|
2716 |
-
/**
|
2717 |
-
* Default options.
|
2718 |
-
* @public
|
2719 |
-
*/
|
2720 |
-
Autoplay.Defaults = {
|
2721 |
-
autoplay: false,
|
2722 |
-
autoplayTimeout: 5000,
|
2723 |
-
autoplayHoverPause: false,
|
2724 |
-
autoplaySpeed: false
|
2725 |
-
};
|
2726 |
-
|
2727 |
-
/**
|
2728 |
-
* Transition to the next slide and set a timeout for the next transition.
|
2729 |
-
* @private
|
2730 |
-
* @param {Number} [speed] - The animation speed for the animations.
|
2731 |
-
*/
|
2732 |
-
Autoplay.prototype._next = function(speed) {
|
2733 |
-
this._call = window.setTimeout(
|
2734 |
-
$.proxy(this._next, this, speed),
|
2735 |
-
this._timeout * (Math.round(this.read() / this._timeout) + 1) - this.read()
|
2736 |
-
);
|
2737 |
-
|
2738 |
-
if (this._core.is('interacting') || document.hidden) {
|
2739 |
-
return;
|
2740 |
-
}
|
2741 |
-
this._core.next(speed || this._core.settings.autoplaySpeed);
|
2742 |
-
}
|
2743 |
-
|
2744 |
-
/**
|
2745 |
-
* Reads the current timer value when the timer is playing.
|
2746 |
-
* @public
|
2747 |
-
*/
|
2748 |
-
Autoplay.prototype.read = function() {
|
2749 |
-
return new Date().getTime() - this._time;
|
2750 |
-
};
|
2751 |
-
|
2752 |
-
/**
|
2753 |
-
* Starts the autoplay.
|
2754 |
-
* @public
|
2755 |
-
* @param {Number} [timeout] - The interval before the next animation starts.
|
2756 |
-
* @param {Number} [speed] - The animation speed for the animations.
|
2757 |
-
*/
|
2758 |
-
Autoplay.prototype.play = function(timeout, speed) {
|
2759 |
-
var elapsed;
|
2760 |
-
|
2761 |
-
if (!this._core.is('rotating')) {
|
2762 |
-
this._core.enter('rotating');
|
2763 |
-
}
|
2764 |
-
|
2765 |
-
timeout = timeout || this._core.settings.autoplayTimeout;
|
2766 |
-
|
2767 |
-
// Calculate the elapsed time since the last transition. If the carousel
|
2768 |
-
// wasn't playing this calculation will yield zero.
|
2769 |
-
elapsed = Math.min(this._time % (this._timeout || timeout), timeout);
|
2770 |
-
|
2771 |
-
if (this._paused) {
|
2772 |
-
// Start the clock.
|
2773 |
-
this._time = this.read();
|
2774 |
-
this._paused = false;
|
2775 |
-
} else {
|
2776 |
-
// Clear the active timeout to allow replacement.
|
2777 |
-
window.clearTimeout(this._call);
|
2778 |
-
}
|
2779 |
-
|
2780 |
-
// Adjust the origin of the timer to match the new timeout value.
|
2781 |
-
this._time += this.read() % timeout - elapsed;
|
2782 |
-
|
2783 |
-
this._timeout = timeout;
|
2784 |
-
this._call = window.setTimeout($.proxy(this._next, this, speed), timeout - elapsed);
|
2785 |
-
};
|
2786 |
-
|
2787 |
-
/**
|
2788 |
-
* Stops the autoplay.
|
2789 |
-
* @public
|
2790 |
-
*/
|
2791 |
-
Autoplay.prototype.stop = function() {
|
2792 |
-
if (this._core.is('rotating')) {
|
2793 |
-
// Reset the clock.
|
2794 |
-
this._time = 0;
|
2795 |
-
this._paused = true;
|
2796 |
-
|
2797 |
-
window.clearTimeout(this._call);
|
2798 |
-
this._core.leave('rotating');
|
2799 |
-
}
|
2800 |
-
};
|
2801 |
-
|
2802 |
-
/**
|
2803 |
-
* Pauses the autoplay.
|
2804 |
-
* @public
|
2805 |
-
*/
|
2806 |
-
Autoplay.prototype.pause = function() {
|
2807 |
-
if (this._core.is('rotating') && !this._paused) {
|
2808 |
-
// Pause the clock.
|
2809 |
-
this._time = this.read();
|
2810 |
-
this._paused = true;
|
2811 |
-
|
2812 |
-
window.clearTimeout(this._call);
|
2813 |
-
}
|
2814 |
-
};
|
2815 |
-
|
2816 |
-
/**
|
2817 |
-
* Destroys the plugin.
|
2818 |
-
*/
|
2819 |
-
Autoplay.prototype.destroy = function() {
|
2820 |
-
var handler, property;
|
2821 |
-
|
2822 |
-
this.stop();
|
2823 |
-
|
2824 |
-
for (handler in this._handlers) {
|
2825 |
-
this._core.$element.off(handler, this._handlers[handler]);
|
2826 |
-
}
|
2827 |
-
for (property in Object.getOwnPropertyNames(this)) {
|
2828 |
-
typeof this[property] != 'function' && (this[property] = null);
|
2829 |
-
}
|
2830 |
-
};
|
2831 |
-
|
2832 |
-
$.fn.owlCarousel.Constructor.Plugins.autoplay = Autoplay;
|
2833 |
-
|
2834 |
-
})(window.Zepto || window.jQuery, window, document);
|
2835 |
-
|
2836 |
-
/**
|
2837 |
-
* Navigation Plugin
|
2838 |
-
* @version 2.3.4
|
2839 |
-
* @author Artus Kolanowski
|
2840 |
-
* @author David Deutsch
|
2841 |
-
* @license The MIT License (MIT)
|
2842 |
-
*/
|
2843 |
-
;(function($, window, document, undefined) {
|
2844 |
-
'use strict';
|
2845 |
-
|
2846 |
-
/**
|
2847 |
-
* Creates the navigation plugin.
|
2848 |
-
* @class The Navigation Plugin
|
2849 |
-
* @param {Owl} carousel - The Owl Carousel.
|
2850 |
-
*/
|
2851 |
-
var Navigation = function(carousel) {
|
2852 |
-
/**
|
2853 |
-
* Reference to the core.
|
2854 |
-
* @protected
|
2855 |
-
* @type {Owl}
|
2856 |
-
*/
|
2857 |
-
this._core = carousel;
|
2858 |
-
|
2859 |
-
/**
|
2860 |
-
* Indicates whether the plugin is initialized or not.
|
2861 |
-
* @protected
|
2862 |
-
* @type {Boolean}
|
2863 |
-
*/
|
2864 |
-
this._initialized = false;
|
2865 |
-
|
2866 |
-
/**
|
2867 |
-
* The current paging indexes.
|
2868 |
-
* @protected
|
2869 |
-
* @type {Array}
|
2870 |
-
*/
|
2871 |
-
this._pages = [];
|
2872 |
-
|
2873 |
-
/**
|
2874 |
-
* All DOM elements of the user interface.
|
2875 |
-
* @protected
|
2876 |
-
* @type {Object}
|
2877 |
-
*/
|
2878 |
-
this._controls = {};
|
2879 |
-
|
2880 |
-
/**
|
2881 |
-
* Markup for an indicator.
|
2882 |
-
* @protected
|
2883 |
-
* @type {Array.<String>}
|
2884 |
-
*/
|
2885 |
-
this._templates = [];
|
2886 |
-
|
2887 |
-
/**
|
2888 |
-
* The carousel element.
|
2889 |
-
* @type {jQuery}
|
2890 |
-
*/
|
2891 |
-
this.$element = this._core.$element;
|
2892 |
-
|
2893 |
-
/**
|
2894 |
-
* Overridden methods of the carousel.
|
2895 |
-
* @protected
|
2896 |
-
* @type {Object}
|
2897 |
-
*/
|
2898 |
-
this._overrides = {
|
2899 |
-
next: this._core.next,
|
2900 |
-
prev: this._core.prev,
|
2901 |
-
to: this._core.to
|
2902 |
-
};
|
2903 |
-
|
2904 |
-
/**
|
2905 |
-
* All event handlers.
|
2906 |
-
* @protected
|
2907 |
-
* @type {Object}
|
2908 |
-
*/
|
2909 |
-
this._handlers = {
|
2910 |
-
'prepared.owl.carousel': $.proxy(function(e) {
|
2911 |
-
if (e.namespace && this._core.settings.dotsData) {
|
2912 |
-
this._templates.push('<div class="' + this._core.settings.dotClass + '">' +
|
2913 |
-
$(e.content).find('[data-dot]').addBack('[data-dot]').attr('data-dot') + '</div>');
|
2914 |
-
}
|
2915 |
-
}, this),
|
2916 |
-
'added.owl.carousel': $.proxy(function(e) {
|
2917 |
-
if (e.namespace && this._core.settings.dotsData) {
|
2918 |
-
this._templates.splice(e.position, 0, this._templates.pop());
|
2919 |
-
}
|
2920 |
-
}, this),
|
2921 |
-
'remove.owl.carousel': $.proxy(function(e) {
|
2922 |
-
if (e.namespace && this._core.settings.dotsData) {
|
2923 |
-
this._templates.splice(e.position, 1);
|
2924 |
-
}
|
2925 |
-
}, this),
|
2926 |
-
'changed.owl.carousel': $.proxy(function(e) {
|
2927 |
-
if (e.namespace && e.property.name == 'position') {
|
2928 |
-
this.draw();
|
2929 |
-
}
|
2930 |
-
}, this),
|
2931 |
-
'initialized.owl.carousel': $.proxy(function(e) {
|
2932 |
-
if (e.namespace && !this._initialized) {
|
2933 |
-
this._core.trigger('initialize', null, 'navigation');
|
2934 |
-
this.initialize();
|
2935 |
-
this.update();
|
2936 |
-
this.draw();
|
2937 |
-
this._initialized = true;
|
2938 |
-
this._core.trigger('initialized', null, 'navigation');
|
2939 |
-
}
|
2940 |
-
}, this),
|
2941 |
-
'refreshed.owl.carousel': $.proxy(function(e) {
|
2942 |
-
if (e.namespace && this._initialized) {
|
2943 |
-
this._core.trigger('refresh', null, 'navigation');
|
2944 |
-
this.update();
|
2945 |
-
this.draw();
|
2946 |
-
this._core.trigger('refreshed', null, 'navigation');
|
2947 |
-
}
|
2948 |
-
}, this)
|
2949 |
-
};
|
2950 |
-
|
2951 |
-
// set default options
|
2952 |
-
this._core.options = $.extend({}, Navigation.Defaults, this._core.options);
|
2953 |
-
|
2954 |
-
// register event handlers
|
2955 |
-
this.$element.on(this._handlers);
|
2956 |
-
};
|
2957 |
-
|
2958 |
-
/**
|
2959 |
-
* Default options.
|
2960 |
-
* @public
|
2961 |
-
* @todo Rename `slideBy` to `navBy`
|
2962 |
-
*/
|
2963 |
-
Navigation.Defaults = {
|
2964 |
-
nav: false,
|
2965 |
-
navText: [
|
2966 |
-
'<span aria-label="' + 'Previous' + '">‹</span>',
|
2967 |
-
'<span aria-label="' + 'Next' + '">›</span>'
|
2968 |
-
],
|
2969 |
-
navSpeed: false,
|
2970 |
-
navElement: 'button type="button" role="presentation"',
|
2971 |
-
navContainer: false,
|
2972 |
-
navContainerClass: 'owl-nav',
|
2973 |
-
navClass: [
|
2974 |
-
'owl-prev',
|
2975 |
-
'owl-next'
|
2976 |
-
],
|
2977 |
-
slideBy: 1,
|
2978 |
-
dotClass: 'owl-dot',
|
2979 |
-
dotsClass: 'owl-dots',
|
2980 |
-
dots: true,
|
2981 |
-
dotsEach: false,
|
2982 |
-
dotsData: false,
|
2983 |
-
dotsSpeed: false,
|
2984 |
-
dotsContainer: false
|
2985 |
-
};
|
2986 |
-
|
2987 |
-
/**
|
2988 |
-
* Initializes the layout of the plugin and extends the carousel.
|
2989 |
-
* @protected
|
2990 |
-
*/
|
2991 |
-
Navigation.prototype.initialize = function() {
|
2992 |
-
var override,
|
2993 |
-
settings = this._core.settings;
|
2994 |
-
|
2995 |
-
// create DOM structure for relative navigation
|
2996 |
-
this._controls.$relative = (settings.navContainer ? $(settings.navContainer)
|
2997 |
-
: $('<div>').addClass(settings.navContainerClass).appendTo(this.$element)).addClass('disabled');
|
2998 |
-
|
2999 |
-
this._controls.$previous = $('<' + settings.navElement + '>')
|
3000 |
-
.addClass(settings.navClass[0])
|
3001 |
-
.html(settings.navText[0])
|
3002 |
-
.prependTo(this._controls.$relative)
|
3003 |
-
.on('click', $.proxy(function(e) {
|
3004 |
-
this.prev(settings.navSpeed);
|
3005 |
-
}, this));
|
3006 |
-
this._controls.$next = $('<' + settings.navElement + '>')
|
3007 |
-
.addClass(settings.navClass[1])
|
3008 |
-
.html(settings.navText[1])
|
3009 |
-
.appendTo(this._controls.$relative)
|
3010 |
-
.on('click', $.proxy(function(e) {
|
3011 |
-
this.next(settings.navSpeed);
|
3012 |
-
}, this));
|
3013 |
-
|
3014 |
-
// create DOM structure for absolute navigation
|
3015 |
-
if (!settings.dotsData) {
|
3016 |
-
this._templates = [ $('<button role="button">')
|
3017 |
-
.addClass(settings.dotClass)
|
3018 |
-
.append($('<span>'))
|
3019 |
-
.prop('outerHTML') ];
|
3020 |
-
}
|
3021 |
-
|
3022 |
-
this._controls.$absolute = (settings.dotsContainer ? $(settings.dotsContainer)
|
3023 |
-
: $('<div>').addClass(settings.dotsClass).appendTo(this.$element)).addClass('disabled');
|
3024 |
-
|
3025 |
-
this._controls.$absolute.on('click', 'button', $.proxy(function(e) {
|
3026 |
-
var index = $(e.target).parent().is(this._controls.$absolute)
|
3027 |
-
? $(e.target).index() : $(e.target).parent().index();
|
3028 |
-
|
3029 |
-
e.preventDefault();
|
3030 |
-
|
3031 |
-
this.to(index, settings.dotsSpeed);
|
3032 |
-
}, this));
|
3033 |
-
|
3034 |
-
/*$el.on('focusin', function() {
|
3035 |
-
$(document).off(".carousel");
|
3036 |
-
|
3037 |
-
$(document).on('keydown.carousel', function(e) {
|
3038 |
-
if(e.keyCode == 37) {
|
3039 |
-
$el.trigger('prev.owl')
|
3040 |
-
}
|
3041 |
-
if(e.keyCode == 39) {
|
3042 |
-
$el.trigger('next.owl')
|
3043 |
-
}
|
3044 |
-
});
|
3045 |
-
});*/
|
3046 |
-
|
3047 |
-
// override public methods of the carousel
|
3048 |
-
for (override in this._overrides) {
|
3049 |
-
this._core[override] = $.proxy(this[override], this);
|
3050 |
-
}
|
3051 |
-
};
|
3052 |
-
|
3053 |
-
/**
|
3054 |
-
* Destroys the plugin.
|
3055 |
-
* @protected
|
3056 |
-
*/
|
3057 |
-
Navigation.prototype.destroy = function() {
|
3058 |
-
var handler, control, property, override, settings;
|
3059 |
-
settings = this._core.settings;
|
3060 |
-
|
3061 |
-
for (handler in this._handlers) {
|
3062 |
-
this.$element.off(handler, this._handlers[handler]);
|
3063 |
-
}
|
3064 |
-
for (control in this._controls) {
|
3065 |
-
if (control === '$relative' && settings.navContainer) {
|
3066 |
-
this._controls[control].html('');
|
3067 |
-
} else {
|
3068 |
-
this._controls[control].remove();
|
3069 |
-
}
|
3070 |
-
}
|
3071 |
-
for (override in this.overides) {
|
3072 |
-
this._core[override] = this._overrides[override];
|
3073 |
-
}
|
3074 |
-
for (property in Object.getOwnPropertyNames(this)) {
|
3075 |
-
typeof this[property] != 'function' && (this[property] = null);
|
3076 |
-
}
|
3077 |
-
};
|
3078 |
-
|
3079 |
-
/**
|
3080 |
-
* Updates the internal state.
|
3081 |
-
* @protected
|
3082 |
-
*/
|
3083 |
-
Navigation.prototype.update = function() {
|
3084 |
-
var i, j, k,
|
3085 |
-
lower = this._core.clones().length / 2,
|
3086 |
-
upper = lower + this._core.items().length,
|
3087 |
-
maximum = this._core.maximum(true),
|
3088 |
-
settings = this._core.settings,
|
3089 |
-
size = settings.center || settings.autoWidth || settings.dotsData
|
3090 |
-
? 1 : settings.dotsEach || settings.items;
|
3091 |
-
|
3092 |
-
if (settings.slideBy !== 'page') {
|
3093 |
-
settings.slideBy = Math.min(settings.slideBy, settings.items);
|
3094 |
-
}
|
3095 |
-
|
3096 |
-
if (settings.dots || settings.slideBy == 'page') {
|
3097 |
-
this._pages = [];
|
3098 |
-
|
3099 |
-
for (i = lower, j = 0, k = 0; i < upper; i++) {
|
3100 |
-
if (j >= size || j === 0) {
|
3101 |
-
this._pages.push({
|
3102 |
-
start: Math.min(maximum, i - lower),
|
3103 |
-
end: i - lower + size - 1
|
3104 |
-
});
|
3105 |
-
if (Math.min(maximum, i - lower) === maximum) {
|
3106 |
-
break;
|
3107 |
-
}
|
3108 |
-
j = 0, ++k;
|
3109 |
-
}
|
3110 |
-
j += this._core.mergers(this._core.relative(i));
|
3111 |
-
}
|
3112 |
-
}
|
3113 |
-
};
|
3114 |
-
|
3115 |
-
/**
|
3116 |
-
* Draws the user interface.
|
3117 |
-
* @todo The option `dotsData` wont work.
|
3118 |
-
* @protected
|
3119 |
-
*/
|
3120 |
-
Navigation.prototype.draw = function() {
|
3121 |
-
var difference,
|
3122 |
-
settings = this._core.settings,
|
3123 |
-
disabled = this._core.items().length <= settings.items,
|
3124 |
-
index = this._core.relative(this._core.current()),
|
3125 |
-
loop = settings.loop || settings.rewind;
|
3126 |
-
|
3127 |
-
this._controls.$relative.toggleClass('disabled', !settings.nav || disabled);
|
3128 |
-
|
3129 |
-
if (settings.nav) {
|
3130 |
-
this._controls.$previous.toggleClass('disabled', !loop && index <= this._core.minimum(true));
|
3131 |
-
this._controls.$next.toggleClass('disabled', !loop && index >= this._core.maximum(true));
|
3132 |
-
}
|
3133 |
-
|
3134 |
-
this._controls.$absolute.toggleClass('disabled', !settings.dots || disabled);
|
3135 |
-
|
3136 |
-
if (settings.dots) {
|
3137 |
-
difference = this._pages.length - this._controls.$absolute.children().length;
|
3138 |
-
|
3139 |
-
if (settings.dotsData && difference !== 0) {
|
3140 |
-
this._controls.$absolute.html(this._templates.join(''));
|
3141 |
-
} else if (difference > 0) {
|
3142 |
-
this._controls.$absolute.append(new Array(difference + 1).join(this._templates[0]));
|
3143 |
-
} else if (difference < 0) {
|
3144 |
-
this._controls.$absolute.children().slice(difference).remove();
|
3145 |
-
}
|
3146 |
-
|
3147 |
-
this._controls.$absolute.find('.active').removeClass('active');
|
3148 |
-
this._controls.$absolute.children().eq($.inArray(this.current(), this._pages)).addClass('active');
|
3149 |
-
}
|
3150 |
-
};
|
3151 |
-
|
3152 |
-
/**
|
3153 |
-
* Extends event data.
|
3154 |
-
* @protected
|
3155 |
-
* @param {Event} event - The event object which gets thrown.
|
3156 |
-
*/
|
3157 |
-
Navigation.prototype.onTrigger = function(event) {
|
3158 |
-
var settings = this._core.settings;
|
3159 |
-
|
3160 |
-
event.page = {
|
3161 |
-
index: $.inArray(this.current(), this._pages),
|
3162 |
-
count: this._pages.length,
|
3163 |
-
size: settings && (settings.center || settings.autoWidth || settings.dotsData
|
3164 |
-
? 1 : settings.dotsEach || settings.items)
|
3165 |
-
};
|
3166 |
-
};
|
3167 |
-
|
3168 |
-
/**
|
3169 |
-
* Gets the current page position of the carousel.
|
3170 |
-
* @protected
|
3171 |
-
* @returns {Number}
|
3172 |
-
*/
|
3173 |
-
Navigation.prototype.current = function() {
|
3174 |
-
var current = this._core.relative(this._core.current());
|
3175 |
-
return $.grep(this._pages, $.proxy(function(page, index) {
|
3176 |
-
return page.start <= current && page.end >= current;
|
3177 |
-
}, this)).pop();
|
3178 |
-
};
|
3179 |
-
|
3180 |
-
/**
|
3181 |
-
* Gets the current succesor/predecessor position.
|
3182 |
-
* @protected
|
3183 |
-
* @returns {Number}
|
3184 |
-
*/
|
3185 |
-
Navigation.prototype.getPosition = function(successor) {
|
3186 |
-
var position, length,
|
3187 |
-
settings = this._core.settings;
|
3188 |
-
|
3189 |
-
if (settings.slideBy == 'page') {
|
3190 |
-
position = $.inArray(this.current(), this._pages);
|
3191 |
-
length = this._pages.length;
|
3192 |
-
successor ? ++position : --position;
|
3193 |
-
position = this._pages[((position % length) + length) % length].start;
|
3194 |
-
} else {
|
3195 |
-
position = this._core.relative(this._core.current());
|
3196 |
-
length = this._core.items().length;
|
3197 |
-
successor ? position += settings.slideBy : position -= settings.slideBy;
|
3198 |
-
}
|
3199 |
-
|
3200 |
-
return position;
|
3201 |
-
};
|
3202 |
-
|
3203 |
-
/**
|
3204 |
-
* Slides to the next item or page.
|
3205 |
-
* @public
|
3206 |
-
* @param {Number} [speed=false] - The time in milliseconds for the transition.
|
3207 |
-
*/
|
3208 |
-
Navigation.prototype.next = function(speed) {
|
3209 |
-
$.proxy(this._overrides.to, this._core)(this.getPosition(true), speed);
|
3210 |
-
};
|
3211 |
-
|
3212 |
-
/**
|
3213 |
-
* Slides to the previous item or page.
|
3214 |
-
* @public
|
3215 |
-
* @param {Number} [speed=false] - The time in milliseconds for the transition.
|
3216 |
-
*/
|
3217 |
-
Navigation.prototype.prev = function(speed) {
|
3218 |
-
$.proxy(this._overrides.to, this._core)(this.getPosition(false), speed);
|
3219 |
-
};
|
3220 |
-
|
3221 |
-
/**
|
3222 |
-
* Slides to the specified item or page.
|
3223 |
-
* @public
|
3224 |
-
* @param {Number} position - The position of the item or page.
|
3225 |
-
* @param {Number} [speed] - The time in milliseconds for the transition.
|
3226 |
-
* @param {Boolean} [standard=false] - Whether to use the standard behaviour or not.
|
3227 |
-
*/
|
3228 |
-
Navigation.prototype.to = function(position, speed, standard) {
|
3229 |
-
var length;
|
3230 |
-
|
3231 |
-
if (!standard && this._pages.length) {
|
3232 |
-
length = this._pages.length;
|
3233 |
-
$.proxy(this._overrides.to, this._core)(this._pages[((position % length) + length) % length].start, speed);
|
3234 |
-
} else {
|
3235 |
-
$.proxy(this._overrides.to, this._core)(position, speed);
|
3236 |
-
}
|
3237 |
-
};
|
3238 |
-
|
3239 |
-
$.fn.owlCarousel.Constructor.Plugins.Navigation = Navigation;
|
3240 |
-
|
3241 |
-
})(window.Zepto || window.jQuery, window, document);
|
3242 |
-
|
3243 |
-
/**
|
3244 |
-
* Hash Plugin
|
3245 |
-
* @version 2.3.4
|
3246 |
-
* @author Artus Kolanowski
|
3247 |
-
* @author David Deutsch
|
3248 |
-
* @license The MIT License (MIT)
|
3249 |
-
*/
|
3250 |
-
;(function($, window, document, undefined) {
|
3251 |
-
'use strict';
|
3252 |
-
|
3253 |
-
/**
|
3254 |
-
* Creates the hash plugin.
|
3255 |
-
* @class The Hash Plugin
|
3256 |
-
* @param {Owl} carousel - The Owl Carousel
|
3257 |
-
*/
|
3258 |
-
var Hash = function(carousel) {
|
3259 |
-
/**
|
3260 |
-
* Reference to the core.
|
3261 |
-
* @protected
|
3262 |
-
* @type {Owl}
|
3263 |
-
*/
|
3264 |
-
this._core = carousel;
|
3265 |
-
|
3266 |
-
/**
|
3267 |
-
* Hash index for the items.
|
3268 |
-
* @protected
|
3269 |
-
* @type {Object}
|
3270 |
-
*/
|
3271 |
-
this._hashes = {};
|
3272 |
-
|
3273 |
-
/**
|
3274 |
-
* The carousel element.
|
3275 |
-
* @type {jQuery}
|
3276 |
-
*/
|
3277 |
-
this.$element = this._core.$element;
|
3278 |
-
|
3279 |
-
/**
|
3280 |
-
* All event handlers.
|
3281 |
-
* @protected
|
3282 |
-
* @type {Object}
|
3283 |
-
*/
|
3284 |
-
this._handlers = {
|
3285 |
-
'initialized.owl.carousel': $.proxy(function(e) {
|
3286 |
-
if (e.namespace && this._core.settings.startPosition === 'URLHash') {
|
3287 |
-
$(window).trigger('hashchange.owl.navigation');
|
3288 |
-
}
|
3289 |
-
}, this),
|
3290 |
-
'prepared.owl.carousel': $.proxy(function(e) {
|
3291 |
-
if (e.namespace) {
|
3292 |
-
var hash = $(e.content).find('[data-hash]').addBack('[data-hash]').attr('data-hash');
|
3293 |
-
|
3294 |
-
if (!hash) {
|
3295 |
-
return;
|
3296 |
-
}
|
3297 |
-
|
3298 |
-
this._hashes[hash] = e.content;
|
3299 |
-
}
|
3300 |
-
}, this),
|
3301 |
-
'changed.owl.carousel': $.proxy(function(e) {
|
3302 |
-
if (e.namespace && e.property.name === 'position') {
|
3303 |
-
var current = this._core.items(this._core.relative(this._core.current())),
|
3304 |
-
hash = $.map(this._hashes, function(item, hash) {
|
3305 |
-
return item === current ? hash : null;
|
3306 |
-
}).join();
|
3307 |
-
|
3308 |
-
if (!hash || window.location.hash.slice(1) === hash) {
|
3309 |
-
return;
|
3310 |
-
}
|
3311 |
-
|
3312 |
-
window.location.hash = hash;
|
3313 |
-
}
|
3314 |
-
}, this)
|
3315 |
-
};
|
3316 |
-
|
3317 |
-
// set default options
|
3318 |
-
this._core.options = $.extend({}, Hash.Defaults, this._core.options);
|
3319 |
-
|
3320 |
-
// register the event handlers
|
3321 |
-
this.$element.on(this._handlers);
|
3322 |
-
|
3323 |
-
// register event listener for hash navigation
|
3324 |
-
$(window).on('hashchange.owl.navigation', $.proxy(function(e) {
|
3325 |
-
var hash = window.location.hash.substring(1),
|
3326 |
-
items = this._core.$stage.children(),
|
3327 |
-
position = this._hashes[hash] && items.index(this._hashes[hash]);
|
3328 |
-
|
3329 |
-
if (position === undefined || position === this._core.current()) {
|
3330 |
-
return;
|
3331 |
-
}
|
3332 |
-
|
3333 |
-
this._core.to(this._core.relative(position), false, true);
|
3334 |
-
}, this));
|
3335 |
-
};
|
3336 |
-
|
3337 |
-
/**
|
3338 |
-
* Default options.
|
3339 |
-
* @public
|
3340 |
-
*/
|
3341 |
-
Hash.Defaults = {
|
3342 |
-
URLhashListener: false
|
3343 |
-
};
|
3344 |
-
|
3345 |
-
/**
|
3346 |
-
* Destroys the plugin.
|
3347 |
-
* @public
|
3348 |
-
*/
|
3349 |
-
Hash.prototype.destroy = function() {
|
3350 |
-
var handler, property;
|
3351 |
-
|
3352 |
-
$(window).off('hashchange.owl.navigation');
|
3353 |
-
|
3354 |
-
for (handler in this._handlers) {
|
3355 |
-
this._core.$element.off(handler, this._handlers[handler]);
|
3356 |
-
}
|
3357 |
-
for (property in Object.getOwnPropertyNames(this)) {
|
3358 |
-
typeof this[property] != 'function' && (this[property] = null);
|
3359 |
-
}
|
3360 |
-
};
|
3361 |
-
|
3362 |
-
$.fn.owlCarousel.Constructor.Plugins.Hash = Hash;
|
3363 |
-
|
3364 |
-
})(window.Zepto || window.jQuery, window, document);
|
3365 |
-
|
3366 |
-
/**
|
3367 |
-
* Support Plugin
|
3368 |
-
*
|
3369 |
-
* @version 2.3.4
|
3370 |
-
* @author Vivid Planet Software GmbH
|
3371 |
-
* @author Artus Kolanowski
|
3372 |
-
* @author David Deutsch
|
3373 |
-
* @license The MIT License (MIT)
|
3374 |
-
*/
|
3375 |
-
;(function($, window, document, undefined) {
|
3376 |
-
|
3377 |
-
var style = $('<support>').get(0).style,
|
3378 |
-
prefixes = 'Webkit Moz O ms'.split(' '),
|
3379 |
-
events = {
|
3380 |
-
transition: {
|
3381 |
-
end: {
|
3382 |
-
WebkitTransition: 'webkitTransitionEnd',
|
3383 |
-
MozTransition: 'transitionend',
|
3384 |
-
OTransition: 'oTransitionEnd',
|
3385 |
-
transition: 'transitionend'
|
3386 |
-
}
|
3387 |
-
},
|
3388 |
-
animation: {
|
3389 |
-
end: {
|
3390 |
-
WebkitAnimation: 'webkitAnimationEnd',
|
3391 |
-
MozAnimation: 'animationend',
|
3392 |
-
OAnimation: 'oAnimationEnd',
|
3393 |
-
animation: 'animationend'
|
3394 |
-
}
|
3395 |
-
}
|
3396 |
-
},
|
3397 |
-
tests = {
|
3398 |
-
csstransforms: function() {
|
3399 |
-
return !!test('transform');
|
3400 |
-
},
|
3401 |
-
csstransforms3d: function() {
|
3402 |
-
return !!test('perspective');
|
3403 |
-
},
|
3404 |
-
csstransitions: function() {
|
3405 |
-
return !!test('transition');
|
3406 |
-
},
|
3407 |
-
cssanimations: function() {
|
3408 |
-
return !!test('animation');
|
3409 |
-
}
|
3410 |
-
};
|
3411 |
-
|
3412 |
-
function test(property, prefixed) {
|
3413 |
-
var result = false,
|
3414 |
-
upper = property.charAt(0).toUpperCase() + property.slice(1);
|
3415 |
-
|
3416 |
-
$.each((property + ' ' + prefixes.join(upper + ' ') + upper).split(' '), function(i, property) {
|
3417 |
-
if (style[property] !== undefined) {
|
3418 |
-
result = prefixed ? property : true;
|
3419 |
-
return false;
|
3420 |
-
}
|
3421 |
-
});
|
3422 |
-
|
3423 |
-
return result;
|
3424 |
-
}
|
3425 |
-
|
3426 |
-
function prefixed(property) {
|
3427 |
-
return test(property, true);
|
3428 |
-
}
|
3429 |
-
|
3430 |
-
if (tests.csstransitions()) {
|
3431 |
-
/* jshint -W053 */
|
3432 |
-
$.support.transition = new String(prefixed('transition'))
|
3433 |
-
$.support.transition.end = events.transition.end[ $.support.transition ];
|
3434 |
-
}
|
3435 |
-
|
3436 |
-
if (tests.cssanimations()) {
|
3437 |
-
/* jshint -W053 */
|
3438 |
-
$.support.animation = new String(prefixed('animation'))
|
3439 |
-
$.support.animation.end = events.animation.end[ $.support.animation ];
|
3440 |
-
}
|
3441 |
-
|
3442 |
-
if (tests.csstransforms()) {
|
3443 |
-
/* jshint -W053 */
|
3444 |
-
$.support.transform = new String(prefixed('transform'));
|
3445 |
-
$.support.transform3d = tests.csstransforms3d();
|
3446 |
-
}
|
3447 |
-
|
3448 |
-
})(window.Zepto || window.jQuery, window, document);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/lib/owl-carousel/owl.carousel.min.js
DELETED
@@ -1,7 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* Owl Carousel v2.3.4
|
3 |
-
* Copyright 2013-2018 David Deutsch
|
4 |
-
* Licensed under: SEE LICENSE IN https://github.com/OwlCarousel2/OwlCarousel2/blob/master/LICENSE
|
5 |
-
*/
|
6 |
-
!function(a,b,c,d){function e(b,c){this.settings=null,this.options=a.extend({},e.Defaults,c),this.$element=a(b),this._handlers={},this._plugins={},this._supress={},this._current=null,this._speed=null,this._coordinates=[],this._breakpoint=null,this._width=null,this._items=[],this._clones=[],this._mergers=[],this._widths=[],this._invalidated={},this._pipe=[],this._drag={time:null,target:null,pointer:null,stage:{start:null,current:null},direction:null},this._states={current:{},tags:{initializing:["busy"],animating:["busy"],dragging:["interacting"]}},a.each(["onResize","onThrottledResize"],a.proxy(function(b,c){this._handlers[c]=a.proxy(this[c],this)},this)),a.each(e.Plugins,a.proxy(function(a,b){this._plugins[a.charAt(0).toLowerCase()+a.slice(1)]=new b(this)},this)),a.each(e.Workers,a.proxy(function(b,c){this._pipe.push({filter:c.filter,run:a.proxy(c.run,this)})},this)),this.setup(),this.initialize()}e.Defaults={items:3,loop:!1,center:!1,rewind:!1,checkVisibility:!0,mouseDrag:!0,touchDrag:!0,pullDrag:!0,freeDrag:!1,margin:0,stagePadding:0,merge:!1,mergeFit:!0,autoWidth:!1,startPosition:0,rtl:!1,smartSpeed:250,fluidSpeed:!1,dragEndSpeed:!1,responsive:{},responsiveRefreshRate:200,responsiveBaseElement:b,fallbackEasing:"swing",slideTransition:"",info:!1,nestedItemSelector:!1,itemElement:"div",stageElement:"div",refreshClass:"owl-refresh",loadedClass:"owl-loaded",loadingClass:"owl-loading",rtlClass:"owl-rtl",responsiveClass:"owl-responsive",dragClass:"owl-drag",itemClass:"owl-item",stageClass:"owl-stage",stageOuterClass:"owl-stage-outer",grabClass:"owl-grab"},e.Width={Default:"default",Inner:"inner",Outer:"outer"},e.Type={Event:"event",State:"state"},e.Plugins={},e.Workers=[{filter:["width","settings"],run:function(){this._width=this.$element.width()}},{filter:["width","items","settings"],run:function(a){a.current=this._items&&this._items[this.relative(this._current)]}},{filter:["items","settings"],run:function(){this.$stage.children(".cloned").remove()}},{filter:["width","items","settings"],run:function(a){var b=this.settings.margin||"",c=!this.settings.autoWidth,d=this.settings.rtl,e={width:"auto","margin-left":d?b:"","margin-right":d?"":b};!c&&this.$stage.children().css(e),a.css=e}},{filter:["width","items","settings"],run:function(a){var b=(this.width()/this.settings.items).toFixed(3)-this.settings.margin,c=null,d=this._items.length,e=!this.settings.autoWidth,f=[];for(a.items={merge:!1,width:b};d--;)c=this._mergers[d],c=this.settings.mergeFit&&Math.min(c,this.settings.items)||c,a.items.merge=c>1||a.items.merge,f[d]=e?b*c:this._items[d].width();this._widths=f}},{filter:["items","settings"],run:function(){var b=[],c=this._items,d=this.settings,e=Math.max(2*d.items,4),f=2*Math.ceil(c.length/2),g=d.loop&&c.length?d.rewind?e:Math.max(e,f):0,h="",i="";for(g/=2;g>0;)b.push(this.normalize(b.length/2,!0)),h+=c[b[b.length-1]][0].outerHTML,b.push(this.normalize(c.length-1-(b.length-1)/2,!0)),i=c[b[b.length-1]][0].outerHTML+i,g-=1;this._clones=b,a(h).addClass("cloned").appendTo(this.$stage),a(i).addClass("cloned").prependTo(this.$stage)}},{filter:["width","items","settings"],run:function(){for(var a=this.settings.rtl?1:-1,b=this._clones.length+this._items.length,c=-1,d=0,e=0,f=[];++c<b;)d=f[c-1]||0,e=this._widths[this.relative(c)]+this.settings.margin,f.push(d+e*a);this._coordinates=f}},{filter:["width","items","settings"],run:function(){var a=this.settings.stagePadding,b=this._coordinates,c={width:Math.ceil(Math.abs(b[b.length-1]))+2*a,"padding-left":a||"","padding-right":a||""};this.$stage.css(c)}},{filter:["width","items","settings"],run:function(a){var b=this._coordinates.length,c=!this.settings.autoWidth,d=this.$stage.children();if(c&&a.items.merge)for(;b--;)a.css.width=this._widths[this.relative(b)],d.eq(b).css(a.css);else c&&(a.css.width=a.items.width,d.css(a.css))}},{filter:["items"],run:function(){this._coordinates.length<1&&this.$stage.removeAttr("style")}},{filter:["width","items","settings"],run:function(a){a.current=a.current?this.$stage.children().index(a.current):0,a.current=Math.max(this.minimum(),Math.min(this.maximum(),a.current)),this.reset(a.current)}},{filter:["position"],run:function(){this.animate(this.coordinates(this._current))}},{filter:["width","position","items","settings"],run:function(){var a,b,c,d,e=this.settings.rtl?1:-1,f=2*this.settings.stagePadding,g=this.coordinates(this.current())+f,h=g+this.width()*e,i=[];for(c=0,d=this._coordinates.length;c<d;c++)a=this._coordinates[c-1]||0,b=Math.abs(this._coordinates[c])+f*e,(this.op(a,"<=",g)&&this.op(a,">",h)||this.op(b,"<",g)&&this.op(b,">",h))&&i.push(c);this.$stage.children(".active").removeClass("active"),this.$stage.children(":eq("+i.join("), :eq(")+")").addClass("active"),this.$stage.children(".center").removeClass("center"),this.settings.center&&this.$stage.children().eq(this.current()).addClass("center")}}],e.prototype.initializeStage=function(){this.$stage=this.$element.find("."+this.settings.stageClass),this.$stage.length||(this.$element.addClass(this.options.loadingClass),this.$stage=a("<"+this.settings.stageElement+">",{class:this.settings.stageClass}).wrap(a("<div/>",{class:this.settings.stageOuterClass})),this.$element.append(this.$stage.parent()))},e.prototype.initializeItems=function(){var b=this.$element.find(".owl-item");if(b.length)return this._items=b.get().map(function(b){return a(b)}),this._mergers=this._items.map(function(){return 1}),void this.refresh();this.replace(this.$element.children().not(this.$stage.parent())),this.isVisible()?this.refresh():this.invalidate("width"),this.$element.removeClass(this.options.loadingClass).addClass(this.options.loadedClass)},e.prototype.initialize=function(){if(this.enter("initializing"),this.trigger("initialize"),this.$element.toggleClass(this.settings.rtlClass,this.settings.rtl),this.settings.autoWidth&&!this.is("pre-loading")){var a,b,c;a=this.$element.find("img"),b=this.settings.nestedItemSelector?"."+this.settings.nestedItemSelector:d,c=this.$element.children(b).width(),a.length&&c<=0&&this.preloadAutoWidthImages(a)}this.initializeStage(),this.initializeItems(),this.registerEventHandlers(),this.leave("initializing"),this.trigger("initialized")},e.prototype.isVisible=function(){return!this.settings.checkVisibility||this.$element.is(":visible")},e.prototype.setup=function(){var b=this.viewport(),c=this.options.responsive,d=-1,e=null;c?(a.each(c,function(a){a<=b&&a>d&&(d=Number(a))}),e=a.extend({},this.options,c[d]),"function"==typeof e.stagePadding&&(e.stagePadding=e.stagePadding()),delete e.responsive,e.responsiveClass&&this.$element.attr("class",this.$element.attr("class").replace(new RegExp("("+this.options.responsiveClass+"-)\\S+\\s","g"),"$1"+d))):e=a.extend({},this.options),this.trigger("change",{property:{name:"settings",value:e}}),this._breakpoint=d,this.settings=e,this.invalidate("settings"),this.trigger("changed",{property:{name:"settings",value:this.settings}})},e.prototype.optionsLogic=function(){this.settings.autoWidth&&(this.settings.stagePadding=!1,this.settings.merge=!1)},e.prototype.prepare=function(b){var c=this.trigger("prepare",{content:b});return c.data||(c.data=a("<"+this.settings.itemElement+"/>").addClass(this.options.itemClass).append(b)),this.trigger("prepared",{content:c.data}),c.data},e.prototype.update=function(){for(var b=0,c=this._pipe.length,d=a.proxy(function(a){return this[a]},this._invalidated),e={};b<c;)(this._invalidated.all||a.grep(this._pipe[b].filter,d).length>0)&&this._pipe[b].run(e),b++;this._invalidated={},!this.is("valid")&&this.enter("valid")},e.prototype.width=function(a){switch(a=a||e.Width.Default){case e.Width.Inner:case e.Width.Outer:return this._width;default:return this._width-2*this.settings.stagePadding+this.settings.margin}},e.prototype.refresh=function(){this.enter("refreshing"),this.trigger("refresh"),this.setup(),this.optionsLogic(),this.$element.addClass(this.options.refreshClass),this.update(),this.$element.removeClass(this.options.refreshClass),this.leave("refreshing"),this.trigger("refreshed")},e.prototype.onThrottledResize=function(){b.clearTimeout(this.resizeTimer),this.resizeTimer=b.setTimeout(this._handlers.onResize,this.settings.responsiveRefreshRate)},e.prototype.onResize=function(){return!!this._items.length&&(this._width!==this.$element.width()&&(!!this.isVisible()&&(this.enter("resizing"),this.trigger("resize").isDefaultPrevented()?(this.leave("resizing"),!1):(this.invalidate("width"),this.refresh(),this.leave("resizing"),void this.trigger("resized")))))},e.prototype.registerEventHandlers=function(){a.support.transition&&this.$stage.on(a.support.transition.end+".owl.core",a.proxy(this.onTransitionEnd,this)),!1!==this.settings.responsive&&this.on(b,"resize",this._handlers.onThrottledResize),this.settings.mouseDrag&&(this.$element.addClass(this.options.dragClass),this.$stage.on("mousedown.owl.core",a.proxy(this.onDragStart,this)),this.$stage.on("dragstart.owl.core selectstart.owl.core",function(){return!1})),this.settings.touchDrag&&(this.$stage.on("touchstart.owl.core",a.proxy(this.onDragStart,this)),this.$stage.on("touchcancel.owl.core",a.proxy(this.onDragEnd,this)))},e.prototype.onDragStart=function(b){var d=null;3!==b.which&&(a.support.transform?(d=this.$stage.css("transform").replace(/.*\(|\)| /g,"").split(","),d={x:d[16===d.length?12:4],y:d[16===d.length?13:5]}):(d=this.$stage.position(),d={x:this.settings.rtl?d.left+this.$stage.width()-this.width()+this.settings.margin:d.left,y:d.top}),this.is("animating")&&(a.support.transform?this.animate(d.x):this.$stage.stop(),this.invalidate("position")),this.$element.toggleClass(this.options.grabClass,"mousedown"===b.type),this.speed(0),this._drag.time=(new Date).getTime(),this._drag.target=a(b.target),this._drag.stage.start=d,this._drag.stage.current=d,this._drag.pointer=this.pointer(b),a(c).on("mouseup.owl.core touchend.owl.core",a.proxy(this.onDragEnd,this)),a(c).one("mousemove.owl.core touchmove.owl.core",a.proxy(function(b){var d=this.difference(this._drag.pointer,this.pointer(b));a(c).on("mousemove.owl.core touchmove.owl.core",a.proxy(this.onDragMove,this)),Math.abs(d.x)<Math.abs(d.y)&&this.is("valid")||(b.preventDefault(),this.enter("dragging"),this.trigger("drag"))},this)))},e.prototype.onDragMove=function(a){var b=null,c=null,d=null,e=this.difference(this._drag.pointer,this.pointer(a)),f=this.difference(this._drag.stage.start,e);this.is("dragging")&&(a.preventDefault(),this.settings.loop?(b=this.coordinates(this.minimum()),c=this.coordinates(this.maximum()+1)-b,f.x=((f.x-b)%c+c)%c+b):(b=this.settings.rtl?this.coordinates(this.maximum()):this.coordinates(this.minimum()),c=this.settings.rtl?this.coordinates(this.minimum()):this.coordinates(this.maximum()),d=this.settings.pullDrag?-1*e.x/5:0,f.x=Math.max(Math.min(f.x,b+d),c+d)),this._drag.stage.current=f,this.animate(f.x))},e.prototype.onDragEnd=function(b){var d=this.difference(this._drag.pointer,this.pointer(b)),e=this._drag.stage.current,f=d.x>0^this.settings.rtl?"left":"right";a(c).off(".owl.core"),this.$element.removeClass(this.options.grabClass),(0!==d.x&&this.is("dragging")||!this.is("valid"))&&(this.speed(this.settings.dragEndSpeed||this.settings.smartSpeed),this.current(this.closest(e.x,0!==d.x?f:this._drag.direction)),this.invalidate("position"),this.update(),this._drag.direction=f,(Math.abs(d.x)>3||(new Date).getTime()-this._drag.time>300)&&this._drag.target.one("click.owl.core",function(){return!1})),this.is("dragging")&&(this.leave("dragging"),this.trigger("dragged"))},e.prototype.closest=function(b,c){var e=-1,f=30,g=this.width(),h=this.coordinates();return this.settings.freeDrag||a.each(h,a.proxy(function(a,i){return"left"===c&&b>i-f&&b<i+f?e=a:"right"===c&&b>i-g-f&&b<i-g+f?e=a+1:this.op(b,"<",i)&&this.op(b,">",h[a+1]!==d?h[a+1]:i-g)&&(e="left"===c?a+1:a),-1===e},this)),this.settings.loop||(this.op(b,">",h[this.minimum()])?e=b=this.minimum():this.op(b,"<",h[this.maximum()])&&(e=b=this.maximum())),e},e.prototype.animate=function(b){var c=this.speed()>0;this.is("animating")&&this.onTransitionEnd(),c&&(this.enter("animating"),this.trigger("translate")),a.support.transform3d&&a.support.transition?this.$stage.css({transform:"translate3d("+b+"px,0px,0px)",transition:this.speed()/1e3+"s"+(this.settings.slideTransition?" "+this.settings.slideTransition:"")}):c?this.$stage.animate({left:b+"px"},this.speed(),this.settings.fallbackEasing,a.proxy(this.onTransitionEnd,this)):this.$stage.css({left:b+"px"})},e.prototype.is=function(a){return this._states.current[a]&&this._states.current[a]>0},e.prototype.current=function(a){if(a===d)return this._current;if(0===this._items.length)return d;if(a=this.normalize(a),this._current!==a){var b=this.trigger("change",{property:{name:"position",value:a}});b.data!==d&&(a=this.normalize(b.data)),this._current=a,this.invalidate("position"),this.trigger("changed",{property:{name:"position",value:this._current}})}return this._current},e.prototype.invalidate=function(b){return"string"===a.type(b)&&(this._invalidated[b]=!0,this.is("valid")&&this.leave("valid")),a.map(this._invalidated,function(a,b){return b})},e.prototype.reset=function(a){(a=this.normalize(a))!==d&&(this._speed=0,this._current=a,this.suppress(["translate","translated"]),this.animate(this.coordinates(a)),this.release(["translate","translated"]))},e.prototype.normalize=function(a,b){var c=this._items.length,e=b?0:this._clones.length;return!this.isNumeric(a)||c<1?a=d:(a<0||a>=c+e)&&(a=((a-e/2)%c+c)%c+e/2),a},e.prototype.relative=function(a){return a-=this._clones.length/2,this.normalize(a,!0)},e.prototype.maximum=function(a){var b,c,d,e=this.settings,f=this._coordinates.length;if(e.loop)f=this._clones.length/2+this._items.length-1;else if(e.autoWidth||e.merge){if(b=this._items.length)for(c=this._items[--b].width(),d=this.$element.width();b--&&!((c+=this._items[b].width()+this.settings.margin)>d););f=b+1}else f=e.center?this._items.length-1:this._items.length-e.items;return a&&(f-=this._clones.length/2),Math.max(f,0)},e.prototype.minimum=function(a){return a?0:this._clones.length/2},e.prototype.items=function(a){return a===d?this._items.slice():(a=this.normalize(a,!0),this._items[a])},e.prototype.mergers=function(a){return a===d?this._mergers.slice():(a=this.normalize(a,!0),this._mergers[a])},e.prototype.clones=function(b){var c=this._clones.length/2,e=c+this._items.length,f=function(a){return a%2==0?e+a/2:c-(a+1)/2};return b===d?a.map(this._clones,function(a,b){return f(b)}):a.map(this._clones,function(a,c){return a===b?f(c):null})},e.prototype.speed=function(a){return a!==d&&(this._speed=a),this._speed},e.prototype.coordinates=function(b){var c,e=1,f=b-1;return b===d?a.map(this._coordinates,a.proxy(function(a,b){return this.coordinates(b)},this)):(this.settings.center?(this.settings.rtl&&(e=-1,f=b+1),c=this._coordinates[b],c+=(this.width()-c+(this._coordinates[f]||0))/2*e):c=this._coordinates[f]||0,c=Math.ceil(c))},e.prototype.duration=function(a,b,c){return 0===c?0:Math.min(Math.max(Math.abs(b-a),1),6)*Math.abs(c||this.settings.smartSpeed)},e.prototype.to=function(a,b){var c=this.current(),d=null,e=a-this.relative(c),f=(e>0)-(e<0),g=this._items.length,h=this.minimum(),i=this.maximum();this.settings.loop?(!this.settings.rewind&&Math.abs(e)>g/2&&(e+=-1*f*g),a=c+e,(d=((a-h)%g+g)%g+h)!==a&&d-e<=i&&d-e>0&&(c=d-e,a=d,this.reset(c))):this.settings.rewind?(i+=1,a=(a%i+i)%i):a=Math.max(h,Math.min(i,a)),this.speed(this.duration(c,a,b)),this.current(a),this.isVisible()&&this.update()},e.prototype.next=function(a){a=a||!1,this.to(this.relative(this.current())+1,a)},e.prototype.prev=function(a){a=a||!1,this.to(this.relative(this.current())-1,a)},e.prototype.onTransitionEnd=function(a){if(a!==d&&(a.stopPropagation(),(a.target||a.srcElement||a.originalTarget)!==this.$stage.get(0)))return!1;this.leave("animating"),this.trigger("translated")},e.prototype.viewport=function(){var d;return this.options.responsiveBaseElement!==b?d=a(this.options.responsiveBaseElement).width():b.innerWidth?d=b.innerWidth:c.documentElement&&c.documentElement.clientWidth?d=c.documentElement.clientWidth:console.warn("Can not detect viewport width."),d},e.prototype.replace=function(b){this.$stage.empty(),this._items=[],b&&(b=b instanceof jQuery?b:a(b)),this.settings.nestedItemSelector&&(b=b.find("."+this.settings.nestedItemSelector)),b.filter(function(){return 1===this.nodeType}).each(a.proxy(function(a,b){b=this.prepare(b),this.$stage.append(b),this._items.push(b),this._mergers.push(1*b.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)},this)),this.reset(this.isNumeric(this.settings.startPosition)?this.settings.startPosition:0),this.invalidate("items")},e.prototype.add=function(b,c){var e=this.relative(this._current);c=c===d?this._items.length:this.normalize(c,!0),b=b instanceof jQuery?b:a(b),this.trigger("add",{content:b,position:c}),b=this.prepare(b),0===this._items.length||c===this._items.length?(0===this._items.length&&this.$stage.append(b),0!==this._items.length&&this._items[c-1].after(b),this._items.push(b),this._mergers.push(1*b.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)):(this._items[c].before(b),this._items.splice(c,0,b),this._mergers.splice(c,0,1*b.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)),this._items[e]&&this.reset(this._items[e].index()),this.invalidate("items"),this.trigger("added",{content:b,position:c})},e.prototype.remove=function(a){(a=this.normalize(a,!0))!==d&&(this.trigger("remove",{content:this._items[a],position:a}),this._items[a].remove(),this._items.splice(a,1),this._mergers.splice(a,1),this.invalidate("items"),this.trigger("removed",{content:null,position:a}))},e.prototype.preloadAutoWidthImages=function(b){b.each(a.proxy(function(b,c){this.enter("pre-loading"),c=a(c),a(new Image).one("load",a.proxy(function(a){c.attr("src",a.target.src),c.css("opacity",1),this.leave("pre-loading"),!this.is("pre-loading")&&!this.is("initializing")&&this.refresh()},this)).attr("src",c.attr("src")||c.attr("data-src")||c.attr("data-src-retina"))},this))},e.prototype.destroy=function(){this.$element.off(".owl.core"),this.$stage.off(".owl.core"),a(c).off(".owl.core"),!1!==this.settings.responsive&&(b.clearTimeout(this.resizeTimer),this.off(b,"resize",this._handlers.onThrottledResize));for(var d in this._plugins)this._plugins[d].destroy();this.$stage.children(".cloned").remove(),this.$stage.unwrap(),this.$stage.children().contents().unwrap(),this.$stage.children().unwrap(),this.$stage.remove(),this.$element.removeClass(this.options.refreshClass).removeClass(this.options.loadingClass).removeClass(this.options.loadedClass).removeClass(this.options.rtlClass).removeClass(this.options.dragClass).removeClass(this.options.grabClass).attr("class",this.$element.attr("class").replace(new RegExp(this.options.responsiveClass+"-\\S+\\s","g"),"")).removeData("owl.carousel")},e.prototype.op=function(a,b,c){var d=this.settings.rtl;switch(b){case"<":return d?a>c:a<c;case">":return d?a<c:a>c;case">=":return d?a<=c:a>=c;case"<=":return d?a>=c:a<=c}},e.prototype.on=function(a,b,c,d){a.addEventListener?a.addEventListener(b,c,d):a.attachEvent&&a.attachEvent("on"+b,c)},e.prototype.off=function(a,b,c,d){a.removeEventListener?a.removeEventListener(b,c,d):a.detachEvent&&a.detachEvent("on"+b,c)},e.prototype.trigger=function(b,c,d,f,g){var h={item:{count:this._items.length,index:this.current()}},i=a.camelCase(a.grep(["on",b,d],function(a){return a}).join("-").toLowerCase()),j=a.Event([b,"owl",d||"carousel"].join(".").toLowerCase(),a.extend({relatedTarget:this},h,c));return this._supress[b]||(a.each(this._plugins,function(a,b){b.onTrigger&&b.onTrigger(j)}),this.register({type:e.Type.Event,name:b}),this.$element.trigger(j),this.settings&&"function"==typeof this.settings[i]&&this.settings[i].call(this,j)),j},e.prototype.enter=function(b){a.each([b].concat(this._states.tags[b]||[]),a.proxy(function(a,b){this._states.current[b]===d&&(this._states.current[b]=0),this._states.current[b]++},this))},e.prototype.leave=function(b){a.each([b].concat(this._states.tags[b]||[]),a.proxy(function(a,b){this._states.current[b]--},this))},e.prototype.register=function(b){if(b.type===e.Type.Event){if(a.event.special[b.name]||(a.event.special[b.name]={}),!a.event.special[b.name].owl){var c=a.event.special[b.name]._default;a.event.special[b.name]._default=function(a){return!c||!c.apply||a.namespace&&-1!==a.namespace.indexOf("owl")?a.namespace&&a.namespace.indexOf("owl")>-1:c.apply(this,arguments)},a.event.special[b.name].owl=!0}}else b.type===e.Type.State&&(this._states.tags[b.name]?this._states.tags[b.name]=this._states.tags[b.name].concat(b.tags):this._states.tags[b.name]=b.tags,this._states.tags[b.name]=a.grep(this._states.tags[b.name],a.proxy(function(c,d){return a.inArray(c,this._states.tags[b.name])===d},this)))},e.prototype.suppress=function(b){a.each(b,a.proxy(function(a,b){this._supress[b]=!0},this))},e.prototype.release=function(b){a.each(b,a.proxy(function(a,b){delete this._supress[b]},this))},e.prototype.pointer=function(a){var c={x:null,y:null};return a=a.originalEvent||a||b.event,a=a.touches&&a.touches.length?a.touches[0]:a.changedTouches&&a.changedTouches.length?a.changedTouches[0]:a,a.pageX?(c.x=a.pageX,c.y=a.pageY):(c.x=a.clientX,c.y=a.clientY),c},e.prototype.isNumeric=function(a){return!isNaN(parseFloat(a))},e.prototype.difference=function(a,b){return{x:a.x-b.x,y:a.y-b.y}},a.fn.owlCarousel=function(b){var c=Array.prototype.slice.call(arguments,1);return this.each(function(){var d=a(this),f=d.data("owl.carousel");f||(f=new e(this,"object"==typeof b&&b),d.data("owl.carousel",f),a.each(["next","prev","to","destroy","refresh","replace","add","remove"],function(b,c){f.register({type:e.Type.Event,name:c}),f.$element.on(c+".owl.carousel.core",a.proxy(function(a){a.namespace&&a.relatedTarget!==this&&(this.suppress([c]),f[c].apply(this,[].slice.call(arguments,1)),this.release([c]))},f))})),"string"==typeof b&&"_"!==b.charAt(0)&&f[b].apply(f,c)})},a.fn.owlCarousel.Constructor=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._interval=null,this._visible=null,this._handlers={"initialized.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoRefresh&&this.watch()},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers)};e.Defaults={autoRefresh:!0,autoRefreshInterval:500},e.prototype.watch=function(){this._interval||(this._visible=this._core.isVisible(),this._interval=b.setInterval(a.proxy(this.refresh,this),this._core.settings.autoRefreshInterval))},e.prototype.refresh=function(){this._core.isVisible()!==this._visible&&(this._visible=!this._visible,this._core.$element.toggleClass("owl-hidden",!this._visible),this._visible&&this._core.invalidate("width")&&this._core.refresh())},e.prototype.destroy=function(){var a,c;b.clearInterval(this._interval);for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(c in Object.getOwnPropertyNames(this))"function"!=typeof this[c]&&(this[c]=null)},a.fn.owlCarousel.Constructor.Plugins.AutoRefresh=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._loaded=[],this._handlers={"initialized.owl.carousel change.owl.carousel resized.owl.carousel":a.proxy(function(b){if(b.namespace&&this._core.settings&&this._core.settings.lazyLoad&&(b.property&&"position"==b.property.name||"initialized"==b.type)){var c=this._core.settings,e=c.center&&Math.ceil(c.items/2)||c.items,f=c.center&&-1*e||0,g=(b.property&&b.property.value!==d?b.property.value:this._core.current())+f,h=this._core.clones().length,i=a.proxy(function(a,b){this.load(b)},this);for(c.lazyLoadEager>0&&(e+=c.lazyLoadEager,c.loop&&(g-=c.lazyLoadEager,e++));f++<e;)this.load(h/2+this._core.relative(g)),h&&a.each(this._core.clones(this._core.relative(g)),i),g++}},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers)};e.Defaults={lazyLoad:!1,lazyLoadEager:0},e.prototype.load=function(c){var d=this._core.$stage.children().eq(c),e=d&&d.find(".owl-lazy");!e||a.inArray(d.get(0),this._loaded)>-1||(e.each(a.proxy(function(c,d){var e,f=a(d),g=b.devicePixelRatio>1&&f.attr("data-src-retina")||f.attr("data-src")||f.attr("data-srcset");this._core.trigger("load",{element:f,url:g},"lazy"),f.is("img")?f.one("load.owl.lazy",a.proxy(function(){f.css("opacity",1),this._core.trigger("loaded",{element:f,url:g},"lazy")},this)).attr("src",g):f.is("source")?f.one("load.owl.lazy",a.proxy(function(){this._core.trigger("loaded",{element:f,url:g},"lazy")},this)).attr("srcset",g):(e=new Image,e.onload=a.proxy(function(){f.css({"background-image":'url("'+g+'")',opacity:"1"}),this._core.trigger("loaded",{element:f,url:g},"lazy")},this),e.src=g)},this)),this._loaded.push(d.get(0)))},e.prototype.destroy=function(){var a,b;for(a in this.handlers)this._core.$element.off(a,this.handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Lazy=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(c){this._core=c,this._previousHeight=null,this._handlers={"initialized.owl.carousel refreshed.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoHeight&&this.update()},this),"changed.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoHeight&&"position"===a.property.name&&this.update()},this),"loaded.owl.lazy":a.proxy(function(a){a.namespace&&this._core.settings.autoHeight&&a.element.closest("."+this._core.settings.itemClass).index()===this._core.current()&&this.update()},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers),this._intervalId=null;var d=this;a(b).on("load",function(){d._core.settings.autoHeight&&d.update()}),a(b).resize(function(){d._core.settings.autoHeight&&(null!=d._intervalId&&clearTimeout(d._intervalId),d._intervalId=setTimeout(function(){d.update()},250))})};e.Defaults={autoHeight:!1,autoHeightClass:"owl-height"},e.prototype.update=function(){var b=this._core._current,c=b+this._core.settings.items,d=this._core.settings.lazyLoad,e=this._core.$stage.children().toArray().slice(b,c),f=[],g=0;a.each(e,function(b,c){f.push(a(c).height())}),g=Math.max.apply(null,f),g<=1&&d&&this._previousHeight&&(g=this._previousHeight),this._previousHeight=g,this._core.$stage.parent().height(g).addClass(this._core.settings.autoHeightClass)},e.prototype.destroy=function(){var a,b;for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.AutoHeight=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._videos={},this._playing=null,this._handlers={"initialized.owl.carousel":a.proxy(function(a){a.namespace&&this._core.register({type:"state",name:"playing",tags:["interacting"]})},this),"resize.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.video&&this.isInFullScreen()&&a.preventDefault()},this),"refreshed.owl.carousel":a.proxy(function(a){a.namespace&&this._core.is("resizing")&&this._core.$stage.find(".cloned .owl-video-frame").remove()},this),"changed.owl.carousel":a.proxy(function(a){a.namespace&&"position"===a.property.name&&this._playing&&this.stop()},this),"prepared.owl.carousel":a.proxy(function(b){if(b.namespace){var c=a(b.content).find(".owl-video");c.length&&(c.css("display","none"),this.fetch(c,a(b.content)))}},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers),this._core.$element.on("click.owl.video",".owl-video-play-icon",a.proxy(function(a){this.play(a)},this))};e.Defaults={video:!1,videoHeight:!1,videoWidth:!1},e.prototype.fetch=function(a,b){var c=function(){return a.attr("data-vimeo-id")?"vimeo":a.attr("data-vzaar-id")?"vzaar":"youtube"}(),d=a.attr("data-vimeo-id")||a.attr("data-youtube-id")||a.attr("data-vzaar-id"),e=a.attr("data-width")||this._core.settings.videoWidth,f=a.attr("data-height")||this._core.settings.videoHeight,g=a.attr("href");if(!g)throw new Error("Missing video URL.");if(d=g.match(/(http:|https:|)\/\/(player.|www.|app.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com|be\-nocookie\.com)|vzaar\.com)\/(video\/|videos\/|embed\/|channels\/.+\/|groups\/.+\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/),d[3].indexOf("youtu")>-1)c="youtube";else if(d[3].indexOf("vimeo")>-1)c="vimeo";else{if(!(d[3].indexOf("vzaar")>-1))throw new Error("Video URL not supported.");c="vzaar"}d=d[6],this._videos[g]={type:c,id:d,width:e,height:f},b.attr("data-video",g),this.thumbnail(a,this._videos[g])},e.prototype.thumbnail=function(b,c){var d,e,f,g=c.width&&c.height?"width:"+c.width+"px;height:"+c.height+"px;":"",h=b.find("img"),i="src",j="",k=this._core.settings,l=function(c){e='<div class="owl-video-play-icon"></div>',d=k.lazyLoad?a("<div/>",{class:"owl-video-tn "+j,srcType:c}):a("<div/>",{class:"owl-video-tn",style:"opacity:1;background-image:url("+c+")"}),b.after(d),b.after(e)};if(b.wrap(a("<div/>",{class:"owl-video-wrapper",style:g})),this._core.settings.lazyLoad&&(i="data-src",j="owl-lazy"),h.length)return l(h.attr(i)),h.remove(),!1;"youtube"===c.type?(f="//img.youtube.com/vi/"+c.id+"/hqdefault.jpg",l(f)):"vimeo"===c.type?a.ajax({type:"GET",url:"//vimeo.com/api/v2/video/"+c.id+".json",jsonp:"callback",dataType:"jsonp",success:function(a){f=a[0].thumbnail_large,l(f)}}):"vzaar"===c.type&&a.ajax({type:"GET",url:"//vzaar.com/api/videos/"+c.id+".json",jsonp:"callback",dataType:"jsonp",success:function(a){f=a.framegrab_url,l(f)}})},e.prototype.stop=function(){this._core.trigger("stop",null,"video"),this._playing.find(".owl-video-frame").remove(),this._playing.removeClass("owl-video-playing"),this._playing=null,this._core.leave("playing"),this._core.trigger("stopped",null,"video")},e.prototype.play=function(b){var c,d=a(b.target),e=d.closest("."+this._core.settings.itemClass),f=this._videos[e.attr("data-video")],g=f.width||"100%",h=f.height||this._core.$stage.height();this._playing||(this._core.enter("playing"),this._core.trigger("play",null,"video"),e=this._core.items(this._core.relative(e.index())),this._core.reset(e.index()),c=a('<iframe frameborder="0" allowfullscreen mozallowfullscreen webkitAllowFullScreen ></iframe>'),c.attr("height",h),c.attr("width",g),"youtube"===f.type?c.attr("src","//www.youtube.com/embed/"+f.id+"?autoplay=1&rel=0&v="+f.id):"vimeo"===f.type?c.attr("src","//player.vimeo.com/video/"+f.id+"?autoplay=1"):"vzaar"===f.type&&c.attr("src","//view.vzaar.com/"+f.id+"/player?autoplay=true"),a(c).wrap('<div class="owl-video-frame" />').insertAfter(e.find(".owl-video")),this._playing=e.addClass("owl-video-playing"))},e.prototype.isInFullScreen=function(){var b=c.fullscreenElement||c.mozFullScreenElement||c.webkitFullscreenElement;return b&&a(b).parent().hasClass("owl-video-frame")},e.prototype.destroy=function(){var a,b;this._core.$element.off("click.owl.video");for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Video=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this.core=b,this.core.options=a.extend({},e.Defaults,this.core.options),this.swapping=!0,this.previous=d,this.next=d,this.handlers={"change.owl.carousel":a.proxy(function(a){a.namespace&&"position"==a.property.name&&(this.previous=this.core.current(),this.next=a.property.value)},this),"drag.owl.carousel dragged.owl.carousel translated.owl.carousel":a.proxy(function(a){a.namespace&&(this.swapping="translated"==a.type)},this),"translate.owl.carousel":a.proxy(function(a){a.namespace&&this.swapping&&(this.core.options.animateOut||this.core.options.animateIn)&&this.swap()},this)},this.core.$element.on(this.handlers)};e.Defaults={animateOut:!1,
|
7 |
-
animateIn:!1},e.prototype.swap=function(){if(1===this.core.settings.items&&a.support.animation&&a.support.transition){this.core.speed(0);var b,c=a.proxy(this.clear,this),d=this.core.$stage.children().eq(this.previous),e=this.core.$stage.children().eq(this.next),f=this.core.settings.animateIn,g=this.core.settings.animateOut;this.core.current()!==this.previous&&(g&&(b=this.core.coordinates(this.previous)-this.core.coordinates(this.next),d.one(a.support.animation.end,c).css({left:b+"px"}).addClass("animated owl-animated-out").addClass(g)),f&&e.one(a.support.animation.end,c).addClass("animated owl-animated-in").addClass(f))}},e.prototype.clear=function(b){a(b.target).css({left:""}).removeClass("animated owl-animated-out owl-animated-in").removeClass(this.core.settings.animateIn).removeClass(this.core.settings.animateOut),this.core.onTransitionEnd()},e.prototype.destroy=function(){var a,b;for(a in this.handlers)this.core.$element.off(a,this.handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Animate=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._call=null,this._time=0,this._timeout=0,this._paused=!0,this._handlers={"changed.owl.carousel":a.proxy(function(a){a.namespace&&"settings"===a.property.name?this._core.settings.autoplay?this.play():this.stop():a.namespace&&"position"===a.property.name&&this._paused&&(this._time=0)},this),"initialized.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoplay&&this.play()},this),"play.owl.autoplay":a.proxy(function(a,b,c){a.namespace&&this.play(b,c)},this),"stop.owl.autoplay":a.proxy(function(a){a.namespace&&this.stop()},this),"mouseover.owl.autoplay":a.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.pause()},this),"mouseleave.owl.autoplay":a.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.play()},this),"touchstart.owl.core":a.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.pause()},this),"touchend.owl.core":a.proxy(function(){this._core.settings.autoplayHoverPause&&this.play()},this)},this._core.$element.on(this._handlers),this._core.options=a.extend({},e.Defaults,this._core.options)};e.Defaults={autoplay:!1,autoplayTimeout:5e3,autoplayHoverPause:!1,autoplaySpeed:!1},e.prototype._next=function(d){this._call=b.setTimeout(a.proxy(this._next,this,d),this._timeout*(Math.round(this.read()/this._timeout)+1)-this.read()),this._core.is("interacting")||c.hidden||this._core.next(d||this._core.settings.autoplaySpeed)},e.prototype.read=function(){return(new Date).getTime()-this._time},e.prototype.play=function(c,d){var e;this._core.is("rotating")||this._core.enter("rotating"),c=c||this._core.settings.autoplayTimeout,e=Math.min(this._time%(this._timeout||c),c),this._paused?(this._time=this.read(),this._paused=!1):b.clearTimeout(this._call),this._time+=this.read()%c-e,this._timeout=c,this._call=b.setTimeout(a.proxy(this._next,this,d),c-e)},e.prototype.stop=function(){this._core.is("rotating")&&(this._time=0,this._paused=!0,b.clearTimeout(this._call),this._core.leave("rotating"))},e.prototype.pause=function(){this._core.is("rotating")&&!this._paused&&(this._time=this.read(),this._paused=!0,b.clearTimeout(this._call))},e.prototype.destroy=function(){var a,b;this.stop();for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.autoplay=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){"use strict";var e=function(b){this._core=b,this._initialized=!1,this._pages=[],this._controls={},this._templates=[],this.$element=this._core.$element,this._overrides={next:this._core.next,prev:this._core.prev,to:this._core.to},this._handlers={"prepared.owl.carousel":a.proxy(function(b){b.namespace&&this._core.settings.dotsData&&this._templates.push('<div class="'+this._core.settings.dotClass+'">'+a(b.content).find("[data-dot]").addBack("[data-dot]").attr("data-dot")+"</div>")},this),"added.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.dotsData&&this._templates.splice(a.position,0,this._templates.pop())},this),"remove.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.dotsData&&this._templates.splice(a.position,1)},this),"changed.owl.carousel":a.proxy(function(a){a.namespace&&"position"==a.property.name&&this.draw()},this),"initialized.owl.carousel":a.proxy(function(a){a.namespace&&!this._initialized&&(this._core.trigger("initialize",null,"navigation"),this.initialize(),this.update(),this.draw(),this._initialized=!0,this._core.trigger("initialized",null,"navigation"))},this),"refreshed.owl.carousel":a.proxy(function(a){a.namespace&&this._initialized&&(this._core.trigger("refresh",null,"navigation"),this.update(),this.draw(),this._core.trigger("refreshed",null,"navigation"))},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this.$element.on(this._handlers)};e.Defaults={nav:!1,navText:['<span aria-label="Previous">‹</span>','<span aria-label="Next">›</span>'],navSpeed:!1,navElement:'button type="button" role="presentation"',navContainer:!1,navContainerClass:"owl-nav",navClass:["owl-prev","owl-next"],slideBy:1,dotClass:"owl-dot",dotsClass:"owl-dots",dots:!0,dotsEach:!1,dotsData:!1,dotsSpeed:!1,dotsContainer:!1},e.prototype.initialize=function(){var b,c=this._core.settings;this._controls.$relative=(c.navContainer?a(c.navContainer):a("<div>").addClass(c.navContainerClass).appendTo(this.$element)).addClass("disabled"),this._controls.$previous=a("<"+c.navElement+">").addClass(c.navClass[0]).html(c.navText[0]).prependTo(this._controls.$relative).on("click",a.proxy(function(a){this.prev(c.navSpeed)},this)),this._controls.$next=a("<"+c.navElement+">").addClass(c.navClass[1]).html(c.navText[1]).appendTo(this._controls.$relative).on("click",a.proxy(function(a){this.next(c.navSpeed)},this)),c.dotsData||(this._templates=[a('<button role="button">').addClass(c.dotClass).append(a("<span>")).prop("outerHTML")]),this._controls.$absolute=(c.dotsContainer?a(c.dotsContainer):a("<div>").addClass(c.dotsClass).appendTo(this.$element)).addClass("disabled"),this._controls.$absolute.on("click","button",a.proxy(function(b){var d=a(b.target).parent().is(this._controls.$absolute)?a(b.target).index():a(b.target).parent().index();b.preventDefault(),this.to(d,c.dotsSpeed)},this));for(b in this._overrides)this._core[b]=a.proxy(this[b],this)},e.prototype.destroy=function(){var a,b,c,d,e;e=this._core.settings;for(a in this._handlers)this.$element.off(a,this._handlers[a]);for(b in this._controls)"$relative"===b&&e.navContainer?this._controls[b].html(""):this._controls[b].remove();for(d in this.overides)this._core[d]=this._overrides[d];for(c in Object.getOwnPropertyNames(this))"function"!=typeof this[c]&&(this[c]=null)},e.prototype.update=function(){var a,b,c,d=this._core.clones().length/2,e=d+this._core.items().length,f=this._core.maximum(!0),g=this._core.settings,h=g.center||g.autoWidth||g.dotsData?1:g.dotsEach||g.items;if("page"!==g.slideBy&&(g.slideBy=Math.min(g.slideBy,g.items)),g.dots||"page"==g.slideBy)for(this._pages=[],a=d,b=0,c=0;a<e;a++){if(b>=h||0===b){if(this._pages.push({start:Math.min(f,a-d),end:a-d+h-1}),Math.min(f,a-d)===f)break;b=0,++c}b+=this._core.mergers(this._core.relative(a))}},e.prototype.draw=function(){var b,c=this._core.settings,d=this._core.items().length<=c.items,e=this._core.relative(this._core.current()),f=c.loop||c.rewind;this._controls.$relative.toggleClass("disabled",!c.nav||d),c.nav&&(this._controls.$previous.toggleClass("disabled",!f&&e<=this._core.minimum(!0)),this._controls.$next.toggleClass("disabled",!f&&e>=this._core.maximum(!0))),this._controls.$absolute.toggleClass("disabled",!c.dots||d),c.dots&&(b=this._pages.length-this._controls.$absolute.children().length,c.dotsData&&0!==b?this._controls.$absolute.html(this._templates.join("")):b>0?this._controls.$absolute.append(new Array(b+1).join(this._templates[0])):b<0&&this._controls.$absolute.children().slice(b).remove(),this._controls.$absolute.find(".active").removeClass("active"),this._controls.$absolute.children().eq(a.inArray(this.current(),this._pages)).addClass("active"))},e.prototype.onTrigger=function(b){var c=this._core.settings;b.page={index:a.inArray(this.current(),this._pages),count:this._pages.length,size:c&&(c.center||c.autoWidth||c.dotsData?1:c.dotsEach||c.items)}},e.prototype.current=function(){var b=this._core.relative(this._core.current());return a.grep(this._pages,a.proxy(function(a,c){return a.start<=b&&a.end>=b},this)).pop()},e.prototype.getPosition=function(b){var c,d,e=this._core.settings;return"page"==e.slideBy?(c=a.inArray(this.current(),this._pages),d=this._pages.length,b?++c:--c,c=this._pages[(c%d+d)%d].start):(c=this._core.relative(this._core.current()),d=this._core.items().length,b?c+=e.slideBy:c-=e.slideBy),c},e.prototype.next=function(b){a.proxy(this._overrides.to,this._core)(this.getPosition(!0),b)},e.prototype.prev=function(b){a.proxy(this._overrides.to,this._core)(this.getPosition(!1),b)},e.prototype.to=function(b,c,d){var e;!d&&this._pages.length?(e=this._pages.length,a.proxy(this._overrides.to,this._core)(this._pages[(b%e+e)%e].start,c)):a.proxy(this._overrides.to,this._core)(b,c)},a.fn.owlCarousel.Constructor.Plugins.Navigation=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){"use strict";var e=function(c){this._core=c,this._hashes={},this.$element=this._core.$element,this._handlers={"initialized.owl.carousel":a.proxy(function(c){c.namespace&&"URLHash"===this._core.settings.startPosition&&a(b).trigger("hashchange.owl.navigation")},this),"prepared.owl.carousel":a.proxy(function(b){if(b.namespace){var c=a(b.content).find("[data-hash]").addBack("[data-hash]").attr("data-hash");if(!c)return;this._hashes[c]=b.content}},this),"changed.owl.carousel":a.proxy(function(c){if(c.namespace&&"position"===c.property.name){var d=this._core.items(this._core.relative(this._core.current())),e=a.map(this._hashes,function(a,b){return a===d?b:null}).join();if(!e||b.location.hash.slice(1)===e)return;b.location.hash=e}},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this.$element.on(this._handlers),a(b).on("hashchange.owl.navigation",a.proxy(function(a){var c=b.location.hash.substring(1),e=this._core.$stage.children(),f=this._hashes[c]&&e.index(this._hashes[c]);f!==d&&f!==this._core.current()&&this._core.to(this._core.relative(f),!1,!0)},this))};e.Defaults={URLhashListener:!1},e.prototype.destroy=function(){var c,d;a(b).off("hashchange.owl.navigation");for(c in this._handlers)this._core.$element.off(c,this._handlers[c]);for(d in Object.getOwnPropertyNames(this))"function"!=typeof this[d]&&(this[d]=null)},a.fn.owlCarousel.Constructor.Plugins.Hash=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){function e(b,c){var e=!1,f=b.charAt(0).toUpperCase()+b.slice(1);return a.each((b+" "+h.join(f+" ")+f).split(" "),function(a,b){if(g[b]!==d)return e=!c||b,!1}),e}function f(a){return e(a,!0)}var g=a("<support>").get(0).style,h="Webkit Moz O ms".split(" "),i={transition:{end:{WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",transition:"transitionend"}},animation:{end:{WebkitAnimation:"webkitAnimationEnd",MozAnimation:"animationend",OAnimation:"oAnimationEnd",animation:"animationend"}}},j={csstransforms:function(){return!!e("transform")},csstransforms3d:function(){return!!e("perspective")},csstransitions:function(){return!!e("transition")},cssanimations:function(){return!!e("animation")}};j.csstransitions()&&(a.support.transition=new String(f("transition")),a.support.transition.end=i.transition.end[a.support.transition]),j.cssanimations()&&(a.support.animation=new String(f("animation")),a.support.animation.end=i.animation.end[a.support.animation]),j.csstransforms()&&(a.support.transform=new String(f("transform")),a.support.transform3d=j.csstransforms3d())}(window.Zepto||window.jQuery,window,document);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/lib/select2/select2.js
DELETED
@@ -1,5746 +0,0 @@
|
|
1 |
-
/*!
|
2 |
-
* Select2 4.0.5
|
3 |
-
* https://select2.github.io
|
4 |
-
*
|
5 |
-
* Released under the MIT license
|
6 |
-
* https://github.com/select2/select2/blob/master/LICENSE.md
|
7 |
-
*/
|
8 |
-
(function (factory) {
|
9 |
-
if (typeof define === 'function' && define.amd) {
|
10 |
-
// AMD. Register as an anonymous module.
|
11 |
-
define(['jquery'], factory);
|
12 |
-
} else if (typeof module === 'object' && module.exports) {
|
13 |
-
// Node/CommonJS
|
14 |
-
module.exports = function (root, jQuery) {
|
15 |
-
if (jQuery === undefined) {
|
16 |
-
// require('jQuery') returns a factory that requires window to
|
17 |
-
// build a jQuery instance, we normalize how we use modules
|
18 |
-
// that require this pattern but the window provided is a noop
|
19 |
-
// if it's defined (how jquery works)
|
20 |
-
if (typeof window !== 'undefined') {
|
21 |
-
jQuery = require('jquery');
|
22 |
-
}
|
23 |
-
else {
|
24 |
-
jQuery = require('jquery')(root);
|
25 |
-
}
|
26 |
-
}
|
27 |
-
factory(jQuery);
|
28 |
-
return jQuery;
|
29 |
-
};
|
30 |
-
} else {
|
31 |
-
// Browser globals
|
32 |
-
factory(jQuery);
|
33 |
-
}
|
34 |
-
} (function (jQuery) {
|
35 |
-
// This is needed so we can catch the AMD loader configuration and use it
|
36 |
-
// The inner file should be wrapped (by `banner.start.js`) in a function that
|
37 |
-
// returns the AMD loader references.
|
38 |
-
var S2 =(function () {
|
39 |
-
// Restore the Select2 AMD loader so it can be used
|
40 |
-
// Needed mostly in the language files, where the loader is not inserted
|
41 |
-
if (jQuery && jQuery.fn && jQuery.fn.select2 && jQuery.fn.select2.amd) {
|
42 |
-
var S2 = jQuery.fn.select2.amd;
|
43 |
-
}
|
44 |
-
var S2;(function () { if (!S2 || !S2.requirejs) {
|
45 |
-
if (!S2) { S2 = {}; } else { require = S2; }
|
46 |
-
/**
|
47 |
-
* @license almond 0.3.3 Copyright jQuery Foundation and other contributors.
|
48 |
-
* Released under MIT license, http://github.com/requirejs/almond/LICENSE
|
49 |
-
*/
|
50 |
-
//Going sloppy to avoid 'use strict' string cost, but strict practices should
|
51 |
-
//be followed.
|
52 |
-
/*global setTimeout: false */
|
53 |
-
|
54 |
-
var requirejs, require, define;
|
55 |
-
(function (undef) {
|
56 |
-
var main, req, makeMap, handlers,
|
57 |
-
defined = {},
|
58 |
-
waiting = {},
|
59 |
-
config = {},
|
60 |
-
defining = {},
|
61 |
-
hasOwn = Object.prototype.hasOwnProperty,
|
62 |
-
aps = [].slice,
|
63 |
-
jsSuffixRegExp = /\.js$/;
|
64 |
-
|
65 |
-
function hasProp(obj, prop) {
|
66 |
-
return hasOwn.call(obj, prop);
|
67 |
-
}
|
68 |
-
|
69 |
-
/**
|
70 |
-
* Given a relative module name, like ./something, normalize it to
|
71 |
-
* a real name that can be mapped to a path.
|
72 |
-
* @param {String} name the relative name
|
73 |
-
* @param {String} baseName a real name that the name arg is relative
|
74 |
-
* to.
|
75 |
-
* @returns {String} normalized name
|
76 |
-
*/
|
77 |
-
function normalize(name, baseName) {
|
78 |
-
var nameParts, nameSegment, mapValue, foundMap, lastIndex,
|
79 |
-
foundI, foundStarMap, starI, i, j, part, normalizedBaseParts,
|
80 |
-
baseParts = baseName && baseName.split("/"),
|
81 |
-
map = config.map,
|
82 |
-
starMap = (map && map['*']) || {};
|
83 |
-
|
84 |
-
//Adjust any relative paths.
|
85 |
-
if (name) {
|
86 |
-
name = name.split('/');
|
87 |
-
lastIndex = name.length - 1;
|
88 |
-
|
89 |
-
// If wanting node ID compatibility, strip .js from end
|
90 |
-
// of IDs. Have to do this here, and not in nameToUrl
|
91 |
-
// because node allows either .js or non .js to map
|
92 |
-
// to same file.
|
93 |
-
if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) {
|
94 |
-
name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, '');
|
95 |
-
}
|
96 |
-
|
97 |
-
// Starts with a '.' so need the baseName
|
98 |
-
if (name[0].charAt(0) === '.' && baseParts) {
|
99 |
-
//Convert baseName to array, and lop off the last part,
|
100 |
-
//so that . matches that 'directory' and not name of the baseName's
|
101 |
-
//module. For instance, baseName of 'one/two/three', maps to
|
102 |
-
//'one/two/three.js', but we want the directory, 'one/two' for
|
103 |
-
//this normalization.
|
104 |
-
normalizedBaseParts = baseParts.slice(0, baseParts.length - 1);
|
105 |
-
name = normalizedBaseParts.concat(name);
|
106 |
-
}
|
107 |
-
|
108 |
-
//start trimDots
|
109 |
-
for (i = 0; i < name.length; i++) {
|
110 |
-
part = name[i];
|
111 |
-
if (part === '.') {
|
112 |
-
name.splice(i, 1);
|
113 |
-
i -= 1;
|
114 |
-
} else if (part === '..') {
|
115 |
-
// If at the start, or previous value is still ..,
|
116 |
-
// keep them so that when converted to a path it may
|
117 |
-
// still work when converted to a path, even though
|
118 |
-
// as an ID it is less than ideal. In larger point
|
119 |
-
// releases, may be better to just kick out an error.
|
120 |
-
if (i === 0 || (i === 1 && name[2] === '..') || name[i - 1] === '..') {
|
121 |
-
continue;
|
122 |
-
} else if (i > 0) {
|
123 |
-
name.splice(i - 1, 2);
|
124 |
-
i -= 2;
|
125 |
-
}
|
126 |
-
}
|
127 |
-
}
|
128 |
-
//end trimDots
|
129 |
-
|
130 |
-
name = name.join('/');
|
131 |
-
}
|
132 |
-
|
133 |
-
//Apply map config if available.
|
134 |
-
if ((baseParts || starMap) && map) {
|
135 |
-
nameParts = name.split('/');
|
136 |
-
|
137 |
-
for (i = nameParts.length; i > 0; i -= 1) {
|
138 |
-
nameSegment = nameParts.slice(0, i).join("/");
|
139 |
-
|
140 |
-
if (baseParts) {
|
141 |
-
//Find the longest baseName segment match in the config.
|
142 |
-
//So, do joins on the biggest to smallest lengths of baseParts.
|
143 |
-
for (j = baseParts.length; j > 0; j -= 1) {
|
144 |
-
mapValue = map[baseParts.slice(0, j).join('/')];
|
145 |
-
|
146 |
-
//baseName segment has config, find if it has one for
|
147 |
-
//this name.
|
148 |
-
if (mapValue) {
|
149 |
-
mapValue = mapValue[nameSegment];
|
150 |
-
if (mapValue) {
|
151 |
-
//Match, update name to the new value.
|
152 |
-
foundMap = mapValue;
|
153 |
-
foundI = i;
|
154 |
-
break;
|
155 |
-
}
|
156 |
-
}
|
157 |
-
}
|
158 |
-
}
|
159 |
-
|
160 |
-
if (foundMap) {
|
161 |
-
break;
|
162 |
-
}
|
163 |
-
|
164 |
-
//Check for a star map match, but just hold on to it,
|
165 |
-
//if there is a shorter segment match later in a matching
|
166 |
-
//config, then favor over this star map.
|
167 |
-
if (!foundStarMap && starMap && starMap[nameSegment]) {
|
168 |
-
foundStarMap = starMap[nameSegment];
|
169 |
-
starI = i;
|
170 |
-
}
|
171 |
-
}
|
172 |
-
|
173 |
-
if (!foundMap && foundStarMap) {
|
174 |
-
foundMap = foundStarMap;
|
175 |
-
foundI = starI;
|
176 |
-
}
|
177 |
-
|
178 |
-
if (foundMap) {
|
179 |
-
nameParts.splice(0, foundI, foundMap);
|
180 |
-
name = nameParts.join('/');
|
181 |
-
}
|
182 |
-
}
|
183 |
-
|
184 |
-
return name;
|
185 |
-
}
|
186 |
-
|
187 |
-
function makeRequire(relName, forceSync) {
|
188 |
-
return function () {
|
189 |
-
//A version of a require function that passes a moduleName
|
190 |
-
//value for items that may need to
|
191 |
-
//look up paths relative to the moduleName
|
192 |
-
var args = aps.call(arguments, 0);
|
193 |
-
|
194 |
-
//If first arg is not require('string'), and there is only
|
195 |
-
//one arg, it is the array form without a callback. Insert
|
196 |
-
//a null so that the following concat is correct.
|
197 |
-
if (typeof args[0] !== 'string' && args.length === 1) {
|
198 |
-
args.push(null);
|
199 |
-
}
|
200 |
-
return req.apply(undef, args.concat([relName, forceSync]));
|
201 |
-
};
|
202 |
-
}
|
203 |
-
|
204 |
-
function makeNormalize(relName) {
|
205 |
-
return function (name) {
|
206 |
-
return normalize(name, relName);
|
207 |
-
};
|
208 |
-
}
|
209 |
-
|
210 |
-
function makeLoad(depName) {
|
211 |
-
return function (value) {
|
212 |
-
defined[depName] = value;
|
213 |
-
};
|
214 |
-
}
|
215 |
-
|
216 |
-
function callDep(name) {
|
217 |
-
if (hasProp(waiting, name)) {
|
218 |
-
var args = waiting[name];
|
219 |
-
delete waiting[name];
|
220 |
-
defining[name] = true;
|
221 |
-
main.apply(undef, args);
|
222 |
-
}
|
223 |
-
|
224 |
-
if (!hasProp(defined, name) && !hasProp(defining, name)) {
|
225 |
-
throw new Error('No ' + name);
|
226 |
-
}
|
227 |
-
return defined[name];
|
228 |
-
}
|
229 |
-
|
230 |
-
//Turns a plugin!resource to [plugin, resource]
|
231 |
-
//with the plugin being undefined if the name
|
232 |
-
//did not have a plugin prefix.
|
233 |
-
function splitPrefix(name) {
|
234 |
-
var prefix,
|
235 |
-
index = name ? name.indexOf('!') : -1;
|
236 |
-
if (index > -1) {
|
237 |
-
prefix = name.substring(0, index);
|
238 |
-
name = name.substring(index + 1, name.length);
|
239 |
-
}
|
240 |
-
return [prefix, name];
|
241 |
-
}
|
242 |
-
|
243 |
-
//Creates a parts array for a relName where first part is plugin ID,
|
244 |
-
//second part is resource ID. Assumes relName has already been normalized.
|
245 |
-
function makeRelParts(relName) {
|
246 |
-
return relName ? splitPrefix(relName) : [];
|
247 |
-
}
|
248 |
-
|
249 |
-
/**
|
250 |
-
* Makes a name map, normalizing the name, and using a plugin
|
251 |
-
* for normalization if necessary. Grabs a ref to plugin
|
252 |
-
* too, as an optimization.
|
253 |
-
*/
|
254 |
-
makeMap = function (name, relParts) {
|
255 |
-
var plugin,
|
256 |
-
parts = splitPrefix(name),
|
257 |
-
prefix = parts[0],
|
258 |
-
relResourceName = relParts[1];
|
259 |
-
|
260 |
-
name = parts[1];
|
261 |
-
|
262 |
-
if (prefix) {
|
263 |
-
prefix = normalize(prefix, relResourceName);
|
264 |
-
plugin = callDep(prefix);
|
265 |
-
}
|
266 |
-
|
267 |
-
//Normalize according
|
268 |
-
if (prefix) {
|
269 |
-
if (plugin && plugin.normalize) {
|
270 |
-
name = plugin.normalize(name, makeNormalize(relResourceName));
|
271 |
-
} else {
|
272 |
-
name = normalize(name, relResourceName);
|
273 |
-
}
|
274 |
-
} else {
|
275 |
-
name = normalize(name, relResourceName);
|
276 |
-
parts = splitPrefix(name);
|
277 |
-
prefix = parts[0];
|
278 |
-
name = parts[1];
|
279 |
-
if (prefix) {
|
280 |
-
plugin = callDep(prefix);
|
281 |
-
}
|
282 |
-
}
|
283 |
-
|
284 |
-
//Using ridiculous property names for space reasons
|
285 |
-
return {
|
286 |
-
f: prefix ? prefix + '!' + name : name, //fullName
|
287 |
-
n: name,
|
288 |
-
pr: prefix,
|
289 |
-
p: plugin
|
290 |
-
};
|
291 |
-
};
|
292 |
-
|
293 |
-
function makeConfig(name) {
|
294 |
-
return function () {
|
295 |
-
return (config && config.config && config.config[name]) || {};
|
296 |
-
};
|
297 |
-
}
|
298 |
-
|
299 |
-
handlers = {
|
300 |
-
require: function (name) {
|
301 |
-
return makeRequire(name);
|
302 |
-
},
|
303 |
-
exports: function (name) {
|
304 |
-
var e = defined[name];
|
305 |
-
if (typeof e !== 'undefined') {
|
306 |
-
return e;
|
307 |
-
} else {
|
308 |
-
return (defined[name] = {});
|
309 |
-
}
|
310 |
-
},
|
311 |
-
module: function (name) {
|
312 |
-
return {
|
313 |
-
id: name,
|
314 |
-
uri: '',
|
315 |
-
exports: defined[name],
|
316 |
-
config: makeConfig(name)
|
317 |
-
};
|
318 |
-
}
|
319 |
-
};
|
320 |
-
|
321 |
-
main = function (name, deps, callback, relName) {
|
322 |
-
var cjsModule, depName, ret, map, i, relParts,
|
323 |
-
args = [],
|
324 |
-
callbackType = typeof callback,
|
325 |
-
usingExports;
|
326 |
-
|
327 |
-
//Use name if no relName
|
328 |
-
relName = relName || name;
|
329 |
-
relParts = makeRelParts(relName);
|
330 |
-
|
331 |
-
//Call the callback to define the module, if necessary.
|
332 |
-
if (callbackType === 'undefined' || callbackType === 'function') {
|
333 |
-
//Pull out the defined dependencies and pass the ordered
|
334 |
-
//values to the callback.
|
335 |
-
//Default to [require, exports, module] if no deps
|
336 |
-
deps = !deps.length && callback.length ? ['require', 'exports', 'module'] : deps;
|
337 |
-
for (i = 0; i < deps.length; i += 1) {
|
338 |
-
map = makeMap(deps[i], relParts);
|
339 |
-
depName = map.f;
|
340 |
-
|
341 |
-
//Fast path CommonJS standard dependencies.
|
342 |
-
if (depName === "require") {
|
343 |
-
args[i] = handlers.require(name);
|
344 |
-
} else if (depName === "exports") {
|
345 |
-
//CommonJS module spec 1.1
|
346 |
-
args[i] = handlers.exports(name);
|
347 |
-
usingExports = true;
|
348 |
-
} else if (depName === "module") {
|
349 |
-
//CommonJS module spec 1.1
|
350 |
-
cjsModule = args[i] = handlers.module(name);
|
351 |
-
} else if (hasProp(defined, depName) ||
|
352 |
-
hasProp(waiting, depName) ||
|
353 |
-
hasProp(defining, depName)) {
|
354 |
-
args[i] = callDep(depName);
|
355 |
-
} else if (map.p) {
|
356 |
-
map.p.load(map.n, makeRequire(relName, true), makeLoad(depName), {});
|
357 |
-
args[i] = defined[depName];
|
358 |
-
} else {
|
359 |
-
throw new Error(name + ' missing ' + depName);
|
360 |
-
}
|
361 |
-
}
|
362 |
-
|
363 |
-
ret = callback ? callback.apply(defined[name], args) : undefined;
|
364 |
-
|
365 |
-
if (name) {
|
366 |
-
//If setting exports via "module" is in play,
|
367 |
-
//favor that over return value and exports. After that,
|
368 |
-
//favor a non-undefined return value over exports use.
|
369 |
-
if (cjsModule && cjsModule.exports !== undef &&
|
370 |
-
cjsModule.exports !== defined[name]) {
|
371 |
-
defined[name] = cjsModule.exports;
|
372 |
-
} else if (ret !== undef || !usingExports) {
|
373 |
-
//Use the return value from the function.
|
374 |
-
defined[name] = ret;
|
375 |
-
}
|
376 |
-
}
|
377 |
-
} else if (name) {
|
378 |
-
//May just be an object definition for the module. Only
|
379 |
-
//worry about defining if have a module name.
|
380 |
-
defined[name] = callback;
|
381 |
-
}
|
382 |
-
};
|
383 |
-
|
384 |
-
requirejs = require = req = function (deps, callback, relName, forceSync, alt) {
|
385 |
-
if (typeof deps === "string") {
|
386 |
-
if (handlers[deps]) {
|
387 |
-
//callback in this case is really relName
|
388 |
-
return handlers[deps](callback);
|
389 |
-
}
|
390 |
-
//Just return the module wanted. In this scenario, the
|
391 |
-
//deps arg is the module name, and second arg (if passed)
|
392 |
-
//is just the relName.
|
393 |
-
//Normalize module name, if it contains . or ..
|
394 |
-
return callDep(makeMap(deps, makeRelParts(callback)).f);
|
395 |
-
} else if (!deps.splice) {
|
396 |
-
//deps is a config object, not an array.
|
397 |
-
config = deps;
|
398 |
-
if (config.deps) {
|
399 |
-
req(config.deps, config.callback);
|
400 |
-
}
|
401 |
-
if (!callback) {
|
402 |
-
return;
|
403 |
-
}
|
404 |
-
|
405 |
-
if (callback.splice) {
|
406 |
-
//callback is an array, which means it is a dependency list.
|
407 |
-
//Adjust args if there are dependencies
|
408 |
-
deps = callback;
|
409 |
-
callback = relName;
|
410 |
-
relName = null;
|
411 |
-
} else {
|
412 |
-
deps = undef;
|
413 |
-
}
|
414 |
-
}
|
415 |
-
|
416 |
-
//Support require(['a'])
|
417 |
-
callback = callback || function () {};
|
418 |
-
|
419 |
-
//If relName is a function, it is an errback handler,
|
420 |
-
//so remove it.
|
421 |
-
if (typeof relName === 'function') {
|
422 |
-
relName = forceSync;
|
423 |
-
forceSync = alt;
|
424 |
-
}
|
425 |
-
|
426 |
-
//Simulate async callback;
|
427 |
-
if (forceSync) {
|
428 |
-
main(undef, deps, callback, relName);
|
429 |
-
} else {
|
430 |
-
//Using a non-zero value because of concern for what old browsers
|
431 |
-
//do, and latest browsers "upgrade" to 4 if lower value is used:
|
432 |
-
//http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#dom-windowtimers-settimeout:
|
433 |
-
//If want a value immediately, use require('id') instead -- something
|
434 |
-
//that works in almond on the global level, but not guaranteed and
|
435 |
-
//unlikely to work in other AMD implementations.
|
436 |
-
setTimeout(function () {
|
437 |
-
main(undef, deps, callback, relName);
|
438 |
-
}, 4);
|
439 |
-
}
|
440 |
-
|
441 |
-
return req;
|
442 |
-
};
|
443 |
-
|
444 |
-
/**
|
445 |
-
* Just drops the config on the floor, but returns req in case
|
446 |
-
* the config return value is used.
|
447 |
-
*/
|
448 |
-
req.config = function (cfg) {
|
449 |
-
return req(cfg);
|
450 |
-
};
|
451 |
-
|
452 |
-
/**
|
453 |
-
* Expose module registry for debugging and tooling
|
454 |
-
*/
|
455 |
-
requirejs._defined = defined;
|
456 |
-
|
457 |
-
define = function (name, deps, callback) {
|
458 |
-
if (typeof name !== 'string') {
|
459 |
-
throw new Error('See almond README: incorrect module build, no module name');
|
460 |
-
}
|
461 |
-
|
462 |
-
//This module may not have dependencies
|
463 |
-
if (!deps.splice) {
|
464 |
-
//deps is not an array, so probably means
|
465 |
-
//an object literal or factory function for
|
466 |
-
//the value. Adjust args.
|
467 |
-
callback = deps;
|
468 |
-
deps = [];
|
469 |
-
}
|
470 |
-
|
471 |
-
if (!hasProp(defined, name) && !hasProp(waiting, name)) {
|
472 |
-
waiting[name] = [name, deps, callback];
|
473 |
-
}
|
474 |
-
};
|
475 |
-
|
476 |
-
define.amd = {
|
477 |
-
jQuery: true
|
478 |
-
};
|
479 |
-
}());
|
480 |
-
|
481 |
-
S2.requirejs = requirejs;S2.require = require;S2.define = define;
|
482 |
-
}
|
483 |
-
}());
|
484 |
-
S2.define("almond", function(){});
|
485 |
-
|
486 |
-
/* global jQuery:false, $:false */
|
487 |
-
S2.define('jquery',[],function () {
|
488 |
-
var _$ = jQuery || $;
|
489 |
-
|
490 |
-
if (_$ == null && console && console.error) {
|
491 |
-
console.error(
|
492 |
-
'Select2: An instance of jQuery or a jQuery-compatible library was not ' +
|
493 |
-
'found. Make sure that you are including jQuery before Select2 on your ' +
|
494 |
-
'web page.'
|
495 |
-
);
|
496 |
-
}
|
497 |
-
|
498 |
-
return _$;
|
499 |
-
});
|
500 |
-
|
501 |
-
S2.define('select2/utils',[
|
502 |
-
'jquery'
|
503 |
-
], function ($) {
|
504 |
-
var Utils = {};
|
505 |
-
|
506 |
-
Utils.Extend = function (ChildClass, SuperClass) {
|
507 |
-
var __hasProp = {}.hasOwnProperty;
|
508 |
-
|
509 |
-
function BaseConstructor () {
|
510 |
-
this.constructor = ChildClass;
|
511 |
-
}
|
512 |
-
|
513 |
-
for (var key in SuperClass) {
|
514 |
-
if (__hasProp.call(SuperClass, key)) {
|
515 |
-
ChildClass[key] = SuperClass[key];
|
516 |
-
}
|
517 |
-
}
|
518 |
-
|
519 |
-
BaseConstructor.prototype = SuperClass.prototype;
|
520 |
-
ChildClass.prototype = new BaseConstructor();
|
521 |
-
ChildClass.__super__ = SuperClass.prototype;
|
522 |
-
|
523 |
-
return ChildClass;
|
524 |
-
};
|
525 |
-
|
526 |
-
function getMethods (theClass) {
|
527 |
-
var proto = theClass.prototype;
|
528 |
-
|
529 |
-
var methods = [];
|
530 |
-
|
531 |
-
for (var methodName in proto) {
|
532 |
-
var m = proto[methodName];
|
533 |
-
|
534 |
-
if (typeof m !== 'function') {
|
535 |
-
continue;
|
536 |
-
}
|
537 |
-
|
538 |
-
if (methodName === 'constructor') {
|
539 |
-
continue;
|
540 |
-
}
|
541 |
-
|
542 |
-
methods.push(methodName);
|
543 |
-
}
|
544 |
-
|
545 |
-
return methods;
|
546 |
-
}
|
547 |
-
|
548 |
-
Utils.Decorate = function (SuperClass, DecoratorClass) {
|
549 |
-
var decoratedMethods = getMethods(DecoratorClass);
|
550 |
-
var superMethods = getMethods(SuperClass);
|
551 |
-
|
552 |
-
function DecoratedClass () {
|
553 |
-
var unshift = Array.prototype.unshift;
|
554 |
-
|
555 |
-
var argCount = DecoratorClass.prototype.constructor.length;
|
556 |
-
|
557 |
-
var calledConstructor = SuperClass.prototype.constructor;
|
558 |
-
|
559 |
-
if (argCount > 0) {
|
560 |
-
unshift.call(arguments, SuperClass.prototype.constructor);
|
561 |
-
|
562 |
-
calledConstructor = DecoratorClass.prototype.constructor;
|
563 |
-
}
|
564 |
-
|
565 |
-
calledConstructor.apply(this, arguments);
|
566 |
-
}
|
567 |
-
|
568 |
-
DecoratorClass.displayName = SuperClass.displayName;
|
569 |
-
|
570 |
-
function ctr () {
|
571 |
-
this.constructor = DecoratedClass;
|
572 |
-
}
|
573 |
-
|
574 |
-
DecoratedClass.prototype = new ctr();
|
575 |
-
|
576 |
-
for (var m = 0; m < superMethods.length; m++) {
|
577 |
-
var superMethod = superMethods[m];
|
578 |
-
|
579 |
-
DecoratedClass.prototype[superMethod] =
|
580 |
-
SuperClass.prototype[superMethod];
|
581 |
-
}
|
582 |
-
|
583 |
-
var calledMethod = function (methodName) {
|
584 |
-
// Stub out the original method if it's not decorating an actual method
|
585 |
-
var originalMethod = function () {};
|
586 |
-
|
587 |
-
if (methodName in DecoratedClass.prototype) {
|
588 |
-
originalMethod = DecoratedClass.prototype[methodName];
|
589 |
-
}
|
590 |
-
|
591 |
-
var decoratedMethod = DecoratorClass.prototype[methodName];
|
592 |
-
|
593 |
-
return function () {
|
594 |
-
var unshift = Array.prototype.unshift;
|
595 |
-
|
596 |
-
unshift.call(arguments, originalMethod);
|
597 |
-
|
598 |
-
return decoratedMethod.apply(this, arguments);
|
599 |
-
};
|
600 |
-
};
|
601 |
-
|
602 |
-
for (var d = 0; d < decoratedMethods.length; d++) {
|
603 |
-
var decoratedMethod = decoratedMethods[d];
|
604 |
-
|
605 |
-
DecoratedClass.prototype[decoratedMethod] = calledMethod(decoratedMethod);
|
606 |
-
}
|
607 |
-
|
608 |
-
return DecoratedClass;
|
609 |
-
};
|
610 |
-
|
611 |
-
var Observable = function () {
|
612 |
-
this.listeners = {};
|
613 |
-
};
|
614 |
-
|
615 |
-
Observable.prototype.on = function (event, callback) {
|
616 |
-
this.listeners = this.listeners || {};
|
617 |
-
|
618 |
-
if (event in this.listeners) {
|
619 |
-
this.listeners[event].push(callback);
|
620 |
-
} else {
|
621 |
-
this.listeners[event] = [callback];
|
622 |
-
}
|
623 |
-
};
|
624 |
-
|
625 |
-
Observable.prototype.trigger = function (event) {
|
626 |
-
var slice = Array.prototype.slice;
|
627 |
-
var params = slice.call(arguments, 1);
|
628 |
-
|
629 |
-
this.listeners = this.listeners || {};
|
630 |
-
|
631 |
-
// Params should always come in as an array
|
632 |
-
if (params == null) {
|
633 |
-
params = [];
|
634 |
-
}
|
635 |
-
|
636 |
-
// If there are no arguments to the event, use a temporary object
|
637 |
-
if (params.length === 0) {
|
638 |
-
params.push({});
|
639 |
-
}
|
640 |
-
|
641 |
-
// Set the `_type` of the first object to the event
|
642 |
-
params[0]._type = event;
|
643 |
-
|
644 |
-
if (event in this.listeners) {
|
645 |
-
this.invoke(this.listeners[event], slice.call(arguments, 1));
|
646 |
-
}
|
647 |
-
|
648 |
-
if ('*' in this.listeners) {
|
649 |
-
this.invoke(this.listeners['*'], arguments);
|
650 |
-
}
|
651 |
-
};
|
652 |
-
|
653 |
-
Observable.prototype.invoke = function (listeners, params) {
|
654 |
-
for (var i = 0, len = listeners.length; i < len; i++) {
|
655 |
-
listeners[i].apply(this, params);
|
656 |
-
}
|
657 |
-
};
|
658 |
-
|
659 |
-
Utils.Observable = Observable;
|
660 |
-
|
661 |
-
Utils.generateChars = function (length) {
|
662 |
-
var chars = '';
|
663 |
-
|
664 |
-
for (var i = 0; i < length; i++) {
|
665 |
-
var randomChar = Math.floor(Math.random() * 36);
|
666 |
-
chars += randomChar.toString(36);
|
667 |
-
}
|
668 |
-
|
669 |
-
return chars;
|
670 |
-
};
|
671 |
-
|
672 |
-
Utils.bind = function (func, context) {
|
673 |
-
return function () {
|
674 |
-
func.apply(context, arguments);
|
675 |
-
};
|
676 |
-
};
|
677 |
-
|
678 |
-
Utils._convertData = function (data) {
|
679 |
-
for (var originalKey in data) {
|
680 |
-
var keys = originalKey.split('-');
|
681 |
-
|
682 |
-
var dataLevel = data;
|
683 |
-
|
684 |
-
if (keys.length === 1) {
|
685 |
-
continue;
|
686 |
-
}
|
687 |
-
|
688 |
-
for (var k = 0; k < keys.length; k++) {
|
689 |
-
var key = keys[k];
|
690 |
-
|
691 |
-
// Lowercase the first letter
|
692 |
-
// By default, dash-separated becomes camelCase
|
693 |
-
key = key.substring(0, 1).toLowerCase() + key.substring(1);
|
694 |
-
|
695 |
-
if (!(key in dataLevel)) {
|
696 |
-
dataLevel[key] = {};
|
697 |
-
}
|
698 |
-
|
699 |
-
if (k == keys.length - 1) {
|
700 |
-
dataLevel[key] = data[originalKey];
|
701 |
-
}
|
702 |
-
|
703 |
-
dataLevel = dataLevel[key];
|
704 |
-
}
|
705 |
-
|
706 |
-
delete data[originalKey];
|
707 |
-
}
|
708 |
-
|
709 |
-
return data;
|
710 |
-
};
|
711 |
-
|
712 |
-
Utils.hasScroll = function (index, el) {
|
713 |
-
// Adapted from the function created by @ShadowScripter
|
714 |
-
// and adapted by @BillBarry on the Stack Exchange Code Review website.
|
715 |
-
// The original code can be found at
|
716 |
-
// http://codereview.stackexchange.com/q/13338
|
717 |
-
// and was designed to be used with the Sizzle selector engine.
|
718 |
-
|
719 |
-
var $el = $(el);
|
720 |
-
var overflowX = el.style.overflowX;
|
721 |
-
var overflowY = el.style.overflowY;
|
722 |
-
|
723 |
-
//Check both x and y declarations
|
724 |
-
if (overflowX === overflowY &&
|
725 |
-
(overflowY === 'hidden' || overflowY === 'visible')) {
|
726 |
-
return false;
|
727 |
-
}
|
728 |
-
|
729 |
-
if (overflowX === 'scroll' || overflowY === 'scroll') {
|
730 |
-
return true;
|
731 |
-
}
|
732 |
-
|
733 |
-
return ($el.innerHeight() < el.scrollHeight ||
|
734 |
-
$el.innerWidth() < el.scrollWidth);
|
735 |
-
};
|
736 |
-
|
737 |
-
Utils.escapeMarkup = function (markup) {
|
738 |
-
var replaceMap = {
|
739 |
-
'\\': '\',
|
740 |
-
'&': '&',
|
741 |
-
'<': '<',
|
742 |
-
'>': '>',
|
743 |
-
'"': '"',
|
744 |
-
'\'': ''',
|
745 |
-
'/': '/'
|
746 |
-
};
|
747 |
-
|
748 |
-
// Do not try to escape the markup if it's not a string
|
749 |
-
if (typeof markup !== 'string') {
|
750 |
-
return markup;
|
751 |
-
}
|
752 |
-
|
753 |
-
return String(markup).replace(/[&<>"'\/\\]/g, function (match) {
|
754 |
-
return replaceMap[match];
|
755 |
-
});
|
756 |
-
};
|
757 |
-
|
758 |
-
// Append an array of jQuery nodes to a given element.
|
759 |
-
Utils.appendMany = function ($element, $nodes) {
|
760 |
-
// jQuery 1.7.x does not support $.fn.append() with an array
|
761 |
-
// Fall back to a jQuery object collection using $.fn.add()
|
762 |
-
if ($.fn.jquery.substr(0, 3) === '1.7') {
|
763 |
-
var $jqNodes = $();
|
764 |
-
|
765 |
-
$.map($nodes, function (node) {
|
766 |
-
$jqNodes = $jqNodes.add(node);
|
767 |
-
});
|
768 |
-
|
769 |
-
$nodes = $jqNodes;
|
770 |
-
}
|
771 |
-
|
772 |
-
$element.append($nodes);
|
773 |
-
};
|
774 |
-
|
775 |
-
return Utils;
|
776 |
-
});
|
777 |
-
|
778 |
-
S2.define('select2/results',[
|
779 |
-
'jquery',
|
780 |
-
'./utils'
|
781 |
-
], function ($, Utils) {
|
782 |
-
function Results ($element, options, dataAdapter) {
|
783 |
-
this.$element = $element;
|
784 |
-
this.data = dataAdapter;
|
785 |
-
this.options = options;
|
786 |
-
|
787 |
-
Results.__super__.constructor.call(this);
|
788 |
-
}
|
789 |
-
|
790 |
-
Utils.Extend(Results, Utils.Observable);
|
791 |
-
|
792 |
-
Results.prototype.render = function () {
|
793 |
-
var $results = $(
|
794 |
-
'<ul class="select2-results__options" role="tree"></ul>'
|
795 |
-
);
|
796 |
-
|
797 |
-
if (this.options.get('multiple')) {
|
798 |
-
$results.attr('aria-multiselectable', 'true');
|
799 |
-
}
|
800 |
-
|
801 |
-
this.$results = $results;
|
802 |
-
|
803 |
-
return $results;
|
804 |
-
};
|
805 |
-
|
806 |
-
Results.prototype.clear = function () {
|
807 |
-
this.$results.empty();
|
808 |
-
};
|
809 |
-
|
810 |
-
Results.prototype.displayMessage = function (params) {
|
811 |
-
var escapeMarkup = this.options.get('escapeMarkup');
|
812 |
-
|
813 |
-
this.clear();
|
814 |
-
this.hideLoading();
|
815 |
-
|
816 |
-
var $message = $(
|
817 |
-
'<li role="treeitem" aria-live="assertive"' +
|
818 |
-
' class="select2-results__option"></li>'
|
819 |
-
);
|
820 |
-
|
821 |
-
var message = this.options.get('translations').get(params.message);
|
822 |
-
|
823 |
-
$message.append(
|
824 |
-
escapeMarkup(
|
825 |
-
message(params.args)
|
826 |
-
)
|
827 |
-
);
|
828 |
-
|
829 |
-
$message[0].className += ' select2-results__message';
|
830 |
-
|
831 |
-
this.$results.append($message);
|
832 |
-
};
|
833 |
-
|
834 |
-
Results.prototype.hideMessages = function () {
|
835 |
-
this.$results.find('.select2-results__message').remove();
|
836 |
-
};
|
837 |
-
|
838 |
-
Results.prototype.append = function (data) {
|
839 |
-
this.hideLoading();
|
840 |
-
|
841 |
-
var $options = [];
|
842 |
-
|
843 |
-
if (data.results == null || data.results.length === 0) {
|
844 |
-
if (this.$results.children().length === 0) {
|
845 |
-
this.trigger('results:message', {
|
846 |
-
message: 'noResults'
|
847 |
-
});
|
848 |
-
}
|
849 |
-
|
850 |
-
return;
|
851 |
-
}
|
852 |
-
|
853 |
-
data.results = this.sort(data.results);
|
854 |
-
|
855 |
-
for (var d = 0; d < data.results.length; d++) {
|
856 |
-
var item = data.results[d];
|
857 |
-
|
858 |
-
var $option = this.option(item);
|
859 |
-
|
860 |
-
$options.push($option);
|
861 |
-
}
|
862 |
-
|
863 |
-
this.$results.append($options);
|
864 |
-
};
|
865 |
-
|
866 |
-
Results.prototype.position = function ($results, $dropdown) {
|
867 |
-
var $resultsContainer = $dropdown.find('.select2-results');
|
868 |
-
$resultsContainer.append($results);
|
869 |
-
};
|
870 |
-
|
871 |
-
Results.prototype.sort = function (data) {
|
872 |
-
var sorter = this.options.get('sorter');
|
873 |
-
|
874 |
-
return sorter(data);
|
875 |
-
};
|
876 |
-
|
877 |
-
Results.prototype.highlightFirstItem = function () {
|
878 |
-
var $options = this.$results
|
879 |
-
.find('.select2-results__option[aria-selected]');
|
880 |
-
|
881 |
-
var $selected = $options.filter('[aria-selected=true]');
|
882 |
-
|
883 |
-
// Check if there are any selected options
|
884 |
-
if ($selected.length > 0) {
|
885 |
-
// If there are selected options, highlight the first
|
886 |
-
$selected.first().trigger('mouseenter');
|
887 |
-
} else {
|
888 |
-
// If there are no selected options, highlight the first option
|
889 |
-
// in the dropdown
|
890 |
-
$options.first().trigger('mouseenter');
|
891 |
-
}
|
892 |
-
|
893 |
-
this.ensureHighlightVisible();
|
894 |
-
};
|
895 |
-
|
896 |
-
Results.prototype.setClasses = function () {
|
897 |
-
var self = this;
|
898 |
-
|
899 |
-
this.data.current(function (selected) {
|
900 |
-
var selectedIds = $.map(selected, function (s) {
|
901 |
-
return s.id.toString();
|
902 |
-
});
|
903 |
-
|
904 |
-
var $options = self.$results
|
905 |
-
.find('.select2-results__option[aria-selected]');
|
906 |
-
|
907 |
-
$options.each(function () {
|
908 |
-
var $option = $(this);
|
909 |
-
|
910 |
-
var item = $.data(this, 'data');
|
911 |
-
|
912 |
-
// id needs to be converted to a string when comparing
|
913 |
-
var id = '' + item.id;
|
914 |
-
|
915 |
-
if ((item.element != null && item.element.selected) ||
|
916 |
-
(item.element == null && $.inArray(id, selectedIds) > -1)) {
|
917 |
-
$option.attr('aria-selected', 'true');
|
918 |
-
} else {
|
919 |
-
$option.attr('aria-selected', 'false');
|
920 |
-
}
|
921 |
-
});
|
922 |
-
|
923 |
-
});
|
924 |
-
};
|
925 |
-
|
926 |
-
Results.prototype.showLoading = function (params) {
|
927 |
-
this.hideLoading();
|
928 |
-
|
929 |
-
var loadingMore = this.options.get('translations').get('searching');
|
930 |
-
|
931 |
-
var loading = {
|
932 |
-
disabled: true,
|
933 |
-
loading: true,
|
934 |
-
text: loadingMore(params)
|
935 |
-
};
|
936 |
-
var $loading = this.option(loading);
|
937 |
-
$loading.className += ' loading-results';
|
938 |
-
|
939 |
-
this.$results.prepend($loading);
|
940 |
-
};
|
941 |
-
|
942 |
-
Results.prototype.hideLoading = function () {
|
943 |
-
this.$results.find('.loading-results').remove();
|
944 |
-
};
|
945 |
-
|
946 |
-
Results.prototype.option = function (data) {
|
947 |
-
var option = document.createElement('li');
|
948 |
-
option.className = 'select2-results__option';
|
949 |
-
|
950 |
-
var attrs = {
|
951 |
-
'role': 'treeitem',
|
952 |
-
'aria-selected': 'false'
|
953 |
-
};
|
954 |
-
|
955 |
-
if (data.disabled) {
|
956 |
-
delete attrs['aria-selected'];
|
957 |
-
attrs['aria-disabled'] = 'true';
|
958 |
-
}
|
959 |
-
|
960 |
-
if (data.id == null) {
|
961 |
-
delete attrs['aria-selected'];
|
962 |
-
}
|
963 |
-
|
964 |
-
if (data._resultId != null) {
|
965 |
-
option.id = data._resultId;
|
966 |
-
}
|
967 |
-
|
968 |
-
if (data.title) {
|
969 |
-
option.title = data.title;
|
970 |
-
}
|
971 |
-
|
972 |
-
if (data.children) {
|
973 |
-
attrs.role = 'group';
|
974 |
-
attrs['aria-label'] = data.text;
|
975 |
-
delete attrs['aria-selected'];
|
976 |
-
}
|
977 |
-
|
978 |
-
for (var attr in attrs) {
|
979 |
-
var val = attrs[attr];
|
980 |
-
|
981 |
-
option.setAttribute(attr, val);
|
982 |
-
}
|
983 |
-
|
984 |
-
if (data.children) {
|
985 |
-
var $option = $(option);
|
986 |
-
|
987 |
-
var label = document.createElement('strong');
|
988 |
-
label.className = 'select2-results__group';
|
989 |
-
|
990 |
-
var $label = $(label);
|
991 |
-
this.template(data, label);
|
992 |
-
|
993 |
-
var $children = [];
|
994 |
-
|
995 |
-
for (var c = 0; c < data.children.length; c++) {
|
996 |
-
var child = data.children[c];
|
997 |
-
|
998 |
-
var $child = this.option(child);
|
999 |
-
|
1000 |
-
$children.push($child);
|
1001 |
-
}
|
1002 |
-
|
1003 |
-
var $childrenContainer = $('<ul></ul>', {
|
1004 |
-
'class': 'select2-results__options select2-results__options--nested'
|
1005 |
-
});
|
1006 |
-
|
1007 |
-
$childrenContainer.append($children);
|
1008 |
-
|
1009 |
-
$option.append(label);
|
1010 |
-
$option.append($childrenContainer);
|
1011 |
-
} else {
|
1012 |
-
this.template(data, option);
|
1013 |
-
}
|
1014 |
-
|
1015 |
-
$.data(option, 'data', data);
|
1016 |
-
|
1017 |
-
return option;
|
1018 |
-
};
|
1019 |
-
|
1020 |
-
Results.prototype.bind = function (container, $container) {
|
1021 |
-
var self = this;
|
1022 |
-
|
1023 |
-
var id = container.id + '-results';
|
1024 |
-
|
1025 |
-
this.$results.attr('id', id);
|
1026 |
-
|
1027 |
-
container.on('results:all', function (params) {
|
1028 |
-
self.clear();
|
1029 |
-
self.append(params.data);
|
1030 |
-
|
1031 |
-
if (container.isOpen()) {
|
1032 |
-
self.setClasses();
|
1033 |
-
self.highlightFirstItem();
|
1034 |
-
}
|
1035 |
-
});
|
1036 |
-
|
1037 |
-
container.on('results:append', function (params) {
|
1038 |
-
self.append(params.data);
|
1039 |
-
|
1040 |
-
if (container.isOpen()) {
|
1041 |
-
self.setClasses();
|
1042 |
-
}
|
1043 |
-
});
|
1044 |
-
|
1045 |
-
container.on('query', function (params) {
|
1046 |
-
self.hideMessages();
|
1047 |
-
self.showLoading(params);
|
1048 |
-
});
|
1049 |
-
|
1050 |
-
container.on('select', function () {
|
1051 |
-
if (!container.isOpen()) {
|
1052 |
-
return;
|
1053 |
-
}
|
1054 |
-
|
1055 |
-
self.setClasses();
|
1056 |
-
self.highlightFirstItem();
|
1057 |
-
});
|
1058 |
-
|
1059 |
-
container.on('unselect', function () {
|
1060 |
-
if (!container.isOpen()) {
|
1061 |
-
return;
|
1062 |
-
}
|
1063 |
-
|
1064 |
-
self.setClasses();
|
1065 |
-
self.highlightFirstItem();
|
1066 |
-
});
|
1067 |
-
|
1068 |
-
container.on('open', function () {
|
1069 |
-
// When the dropdown is open, aria-expended="true"
|
1070 |
-
self.$results.attr('aria-expanded', 'true');
|
1071 |
-
self.$results.attr('aria-hidden', 'false');
|
1072 |
-
|
1073 |
-
self.setClasses();
|
1074 |
-
self.ensureHighlightVisible();
|
1075 |
-
});
|
1076 |
-
|
1077 |
-
container.on('close', function () {
|
1078 |
-
// When the dropdown is closed, aria-expended="false"
|
1079 |
-
self.$results.attr('aria-expanded', 'false');
|
1080 |
-
self.$results.attr('aria-hidden', 'true');
|
1081 |
-
self.$results.removeAttr('aria-activedescendant');
|
1082 |
-
});
|
1083 |
-
|
1084 |
-
container.on('results:toggle', function () {
|
1085 |
-
var $highlighted = self.getHighlightedResults();
|
1086 |
-
|
1087 |
-
if ($highlighted.length === 0) {
|
1088 |
-
return;
|
1089 |
-
}
|
1090 |
-
|
1091 |
-
$highlighted.trigger('mouseup');
|
1092 |
-
});
|
1093 |
-
|
1094 |
-
container.on('results:select', function () {
|
1095 |
-
var $highlighted = self.getHighlightedResults();
|
1096 |
-
|
1097 |
-
if ($highlighted.length === 0) {
|
1098 |
-
return;
|
1099 |
-
}
|
1100 |
-
|
1101 |
-
var data = $highlighted.data('data');
|
1102 |
-
|
1103 |
-
if ($highlighted.attr('aria-selected') == 'true') {
|
1104 |
-
self.trigger('close', {});
|
1105 |
-
} else {
|
1106 |
-
self.trigger('select', {
|
1107 |
-
data: data
|
1108 |
-
});
|
1109 |
-
}
|
1110 |
-
});
|
1111 |
-
|
1112 |
-
container.on('results:previous', function () {
|
1113 |
-
var $highlighted = self.getHighlightedResults();
|
1114 |
-
|
1115 |
-
var $options = self.$results.find('[aria-selected]');
|
1116 |
-
|
1117 |
-
var currentIndex = $options.index($highlighted);
|
1118 |
-
|
1119 |
-
// If we are already at te top, don't move further
|
1120 |
-
if (currentIndex === 0) {
|
1121 |
-
return;
|
1122 |
-
}
|
1123 |
-
|
1124 |
-
var nextIndex = currentIndex - 1;
|
1125 |
-
|
1126 |
-
// If none are highlighted, highlight the first
|
1127 |
-
if ($highlighted.length === 0) {
|
1128 |
-
nextIndex = 0;
|
1129 |
-
}
|
1130 |
-
|
1131 |
-
var $next = $options.eq(nextIndex);
|
1132 |
-
|
1133 |
-
$next.trigger('mouseenter');
|
1134 |
-
|
1135 |
-
var currentOffset = self.$results.offset().top;
|
1136 |
-
var nextTop = $next.offset().top;
|
1137 |
-
var nextOffset = self.$results.scrollTop() + (nextTop - currentOffset);
|
1138 |
-
|
1139 |
-
if (nextIndex === 0) {
|
1140 |
-
self.$results.scrollTop(0);
|
1141 |
-
} else if (nextTop - currentOffset < 0) {
|
1142 |
-
self.$results.scrollTop(nextOffset);
|
1143 |
-
}
|
1144 |
-
});
|
1145 |
-
|
1146 |
-
container.on('results:next', function () {
|
1147 |
-
var $highlighted = self.getHighlightedResults();
|
1148 |
-
|
1149 |
-
var $options = self.$results.find('[aria-selected]');
|
1150 |
-
|
1151 |
-
var currentIndex = $options.index($highlighted);
|
1152 |
-
|
1153 |
-
var nextIndex = currentIndex + 1;
|
1154 |
-
|
1155 |
-
// If we are at the last option, stay there
|
1156 |
-
if (nextIndex >= $options.length) {
|
1157 |
-
return;
|
1158 |
-
}
|
1159 |
-
|
1160 |
-
var $next = $options.eq(nextIndex);
|
1161 |
-
|
1162 |
-
$next.trigger('mouseenter');
|
1163 |
-
|
1164 |
-
var currentOffset = self.$results.offset().top +
|
1165 |
-
self.$results.outerHeight(false);
|
1166 |
-
var nextBottom = $next.offset().top + $next.outerHeight(false);
|
1167 |
-
var nextOffset = self.$results.scrollTop() + nextBottom - currentOffset;
|
1168 |
-
|
1169 |
-
if (nextIndex === 0) {
|
1170 |
-
self.$results.scrollTop(0);
|
1171 |
-
} else if (nextBottom > currentOffset) {
|
1172 |
-
self.$results.scrollTop(nextOffset);
|
1173 |
-
}
|
1174 |
-
});
|
1175 |
-
|
1176 |
-
container.on('results:focus', function (params) {
|
1177 |
-
params.element.addClass('select2-results__option--highlighted');
|
1178 |
-
});
|
1179 |
-
|
1180 |
-
container.on('results:message', function (params) {
|
1181 |
-
self.displayMessage(params);
|
1182 |
-
});
|
1183 |
-
|
1184 |
-
if ($.fn.mousewheel) {
|
1185 |
-
this.$results.on('mousewheel', function (e) {
|
1186 |
-
var top = self.$results.scrollTop();
|
1187 |
-
|
1188 |
-
var bottom = self.$results.get(0).scrollHeight - top + e.deltaY;
|
1189 |
-
|
1190 |
-
var isAtTop = e.deltaY > 0 && top - e.deltaY <= 0;
|
1191 |
-
var isAtBottom = e.deltaY < 0 && bottom <= self.$results.height();
|
1192 |
-
|
1193 |
-
if (isAtTop) {
|
1194 |
-
self.$results.scrollTop(0);
|
1195 |
-
|
1196 |
-
e.preventDefault();
|
1197 |
-
e.stopPropagation();
|
1198 |
-
} else if (isAtBottom) {
|
1199 |
-
self.$results.scrollTop(
|
1200 |
-
self.$results.get(0).scrollHeight - self.$results.height()
|
1201 |
-
);
|
1202 |
-
|
1203 |
-
e.preventDefault();
|
1204 |
-
e.stopPropagation();
|
1205 |
-
}
|
1206 |
-
});
|
1207 |
-
}
|
1208 |
-
|
1209 |
-
this.$results.on('mouseup', '.select2-results__option[aria-selected]',
|
1210 |
-
function (evt) {
|
1211 |
-
var $this = $(this);
|
1212 |
-
|
1213 |
-
var data = $this.data('data');
|
1214 |
-
|
1215 |
-
if ($this.attr('aria-selected') === 'true') {
|
1216 |
-
if (self.options.get('multiple')) {
|
1217 |
-
self.trigger('unselect', {
|
1218 |
-
originalEvent: evt,
|
1219 |
-
data: data
|
1220 |
-
});
|
1221 |
-
} else {
|
1222 |
-
self.trigger('close', {});
|
1223 |
-
}
|
1224 |
-
|
1225 |
-
return;
|
1226 |
-
}
|
1227 |
-
|
1228 |
-
self.trigger('select', {
|
1229 |
-
originalEvent: evt,
|
1230 |
-
data: data
|
1231 |
-
});
|
1232 |
-
});
|
1233 |
-
|
1234 |
-
this.$results.on('mouseenter', '.select2-results__option[aria-selected]',
|
1235 |
-
function (evt) {
|
1236 |
-
var data = $(this).data('data');
|
1237 |
-
|
1238 |
-
self.getHighlightedResults()
|
1239 |
-
.removeClass('select2-results__option--highlighted');
|
1240 |
-
|
1241 |
-
self.trigger('results:focus', {
|
1242 |
-
data: data,
|
1243 |
-
element: $(this)
|
1244 |
-
});
|
1245 |
-
});
|
1246 |
-
};
|
1247 |
-
|
1248 |
-
Results.prototype.getHighlightedResults = function () {
|
1249 |
-
var $highlighted = this.$results
|
1250 |
-
.find('.select2-results__option--highlighted');
|
1251 |
-
|
1252 |
-
return $highlighted;
|
1253 |
-
};
|
1254 |
-
|
1255 |
-
Results.prototype.destroy = function () {
|
1256 |
-
this.$results.remove();
|
1257 |
-
};
|
1258 |
-
|
1259 |
-
Results.prototype.ensureHighlightVisible = function () {
|
1260 |
-
var $highlighted = this.getHighlightedResults();
|
1261 |
-
|
1262 |
-
if ($highlighted.length === 0) {
|
1263 |
-
return;
|
1264 |
-
}
|
1265 |
-
|
1266 |
-
var $options = this.$results.find('[aria-selected]');
|
1267 |
-
|
1268 |
-
var currentIndex = $options.index($highlighted);
|
1269 |
-
|
1270 |
-
var currentOffset = this.$results.offset().top;
|
1271 |
-
var nextTop = $highlighted.offset().top;
|
1272 |
-
var nextOffset = this.$results.scrollTop() + (nextTop - currentOffset);
|
1273 |
-
|
1274 |
-
var offsetDelta = nextTop - currentOffset;
|
1275 |
-
nextOffset -= $highlighted.outerHeight(false) * 2;
|
1276 |
-
|
1277 |
-
if (currentIndex <= 2) {
|
1278 |
-
this.$results.scrollTop(0);
|
1279 |
-
} else if (offsetDelta > this.$results.outerHeight() || offsetDelta < 0) {
|
1280 |
-
this.$results.scrollTop(nextOffset);
|
1281 |
-
}
|
1282 |
-
};
|
1283 |
-
|
1284 |
-
Results.prototype.template = function (result, container) {
|
1285 |
-
var template = this.options.get('templateResult');
|
1286 |
-
var escapeMarkup = this.options.get('escapeMarkup');
|
1287 |
-
|
1288 |
-
var content = template(result, container);
|
1289 |
-
|
1290 |
-
if (content == null) {
|
1291 |
-
container.style.display = 'none';
|
1292 |
-
} else if (typeof content === 'string') {
|
1293 |
-
container.innerHTML = escapeMarkup(content);
|
1294 |
-
} else {
|
1295 |
-
$(container).append(content);
|
1296 |
-
}
|
1297 |
-
};
|
1298 |
-
|
1299 |
-
return Results;
|
1300 |
-
});
|
1301 |
-
|
1302 |
-
S2.define('select2/keys',[
|
1303 |
-
|
1304 |
-
], function () {
|
1305 |
-
var KEYS = {
|
1306 |
-
BACKSPACE: 8,
|
1307 |
-
TAB: 9,
|
1308 |
-
ENTER: 13,
|
1309 |
-
SHIFT: 16,
|
1310 |
-
CTRL: 17,
|
1311 |
-
ALT: 18,
|
1312 |
-
ESC: 27,
|
1313 |
-
SPACE: 32,
|
1314 |
-
PAGE_UP: 33,
|
1315 |
-
PAGE_DOWN: 34,
|
1316 |
-
END: 35,
|
1317 |
-
HOME: 36,
|
1318 |
-
LEFT: 37,
|
1319 |
-
UP: 38,
|
1320 |
-
RIGHT: 39,
|
1321 |
-
DOWN: 40,
|
1322 |
-
DELETE: 46
|
1323 |
-
};
|
1324 |
-
|
1325 |
-
return KEYS;
|
1326 |
-
});
|
1327 |
-
|
1328 |
-
S2.define('select2/selection/base',[
|
1329 |
-
'jquery',
|
1330 |
-
'../utils',
|
1331 |
-
'../keys'
|
1332 |
-
], function ($, Utils, KEYS) {
|
1333 |
-
function BaseSelection ($element, options) {
|
1334 |
-
this.$element = $element;
|
1335 |
-
this.options = options;
|
1336 |
-
|
1337 |
-
BaseSelection.__super__.constructor.call(this);
|
1338 |
-
}
|
1339 |
-
|
1340 |
-
Utils.Extend(BaseSelection, Utils.Observable);
|
1341 |
-
|
1342 |
-
BaseSelection.prototype.render = function () {
|
1343 |
-
var $selection = $(
|
1344 |
-
'<span class="select2-selection" role="combobox" ' +
|
1345 |
-
' aria-haspopup="true" aria-expanded="false">' +
|
1346 |
-
'</span>'
|
1347 |
-
);
|
1348 |
-
|
1349 |
-
this._tabindex = 0;
|
1350 |
-
|
1351 |
-
if (this.$element.data('old-tabindex') != null) {
|
1352 |
-
this._tabindex = this.$element.data('old-tabindex');
|
1353 |
-
} else if (this.$element.attr('tabindex') != null) {
|
1354 |
-
this._tabindex = this.$element.attr('tabindex');
|
1355 |
-
}
|
1356 |
-
|
1357 |
-
$selection.attr('title', this.$element.attr('title'));
|
1358 |
-
$selection.attr('tabindex', this._tabindex);
|
1359 |
-
|
1360 |
-
this.$selection = $selection;
|
1361 |
-
|
1362 |
-
return $selection;
|
1363 |
-
};
|
1364 |
-
|
1365 |
-
BaseSelection.prototype.bind = function (container, $container) {
|
1366 |
-
var self = this;
|
1367 |
-
|
1368 |
-
var id = container.id + '-container';
|
1369 |
-
var resultsId = container.id + '-results';
|
1370 |
-
|
1371 |
-
this.container = container;
|
1372 |
-
|
1373 |
-
this.$selection.on('focus', function (evt) {
|
1374 |
-
self.trigger('focus', evt);
|
1375 |
-
});
|
1376 |
-
|
1377 |
-
this.$selection.on('blur', function (evt) {
|
1378 |
-
self._handleBlur(evt);
|
1379 |
-
});
|
1380 |
-
|
1381 |
-
this.$selection.on('keydown', function (evt) {
|
1382 |
-
self.trigger('keypress', evt);
|
1383 |
-
|
1384 |
-
if (evt.which === KEYS.SPACE) {
|
1385 |
-
evt.preventDefault();
|
1386 |
-
}
|
1387 |
-
});
|
1388 |
-
|
1389 |
-
container.on('results:focus', function (params) {
|
1390 |
-
self.$selection.attr('aria-activedescendant', params.data._resultId);
|
1391 |
-
});
|
1392 |
-
|
1393 |
-
container.on('selection:update', function (params) {
|
1394 |
-
self.update(params.data);
|
1395 |
-
});
|
1396 |
-
|
1397 |
-
container.on('open', function () {
|
1398 |
-
// When the dropdown is open, aria-expanded="true"
|
1399 |
-
self.$selection.attr('aria-expanded', 'true');
|
1400 |
-
self.$selection.attr('aria-owns', resultsId);
|
1401 |
-
|
1402 |
-
self._attachCloseHandler(container);
|
1403 |
-
});
|
1404 |
-
|
1405 |
-
container.on('close', function () {
|
1406 |
-
// When the dropdown is closed, aria-expanded="false"
|
1407 |
-
self.$selection.attr('aria-expanded', 'false');
|
1408 |
-
self.$selection.removeAttr('aria-activedescendant');
|
1409 |
-
self.$selection.removeAttr('aria-owns');
|
1410 |
-
|
1411 |
-
self.$selection.focus();
|
1412 |
-
|
1413 |
-
self._detachCloseHandler(container);
|
1414 |
-
});
|
1415 |
-
|
1416 |
-
container.on('enable', function () {
|
1417 |
-
self.$selection.attr('tabindex', self._tabindex);
|
1418 |
-
});
|
1419 |
-
|
1420 |
-
container.on('disable', function () {
|
1421 |
-
self.$selection.attr('tabindex', '-1');
|
1422 |
-
});
|
1423 |
-
};
|
1424 |
-
|
1425 |
-
BaseSelection.prototype._handleBlur = function (evt) {
|
1426 |
-
var self = this;
|
1427 |
-
|
1428 |
-
// This needs to be delayed as the active element is the body when the tab
|
1429 |
-
// key is pressed, possibly along with others.
|
1430 |
-
window.setTimeout(function () {
|
1431 |
-
// Don't trigger `blur` if the focus is still in the selection
|
1432 |
-
if (
|
1433 |
-
(document.activeElement == self.$selection[0]) ||
|
1434 |
-
($.contains(self.$selection[0], document.activeElement))
|
1435 |
-
) {
|
1436 |
-
return;
|
1437 |
-
}
|
1438 |
-
|
1439 |
-
self.trigger('blur', evt);
|
1440 |
-
}, 1);
|
1441 |
-
};
|
1442 |
-
|
1443 |
-
BaseSelection.prototype._attachCloseHandler = function (container) {
|
1444 |
-
var self = this;
|
1445 |
-
|
1446 |
-
$(document.body).on('mousedown.select2.' + container.id, function (e) {
|
1447 |
-
var $target = $(e.target);
|
1448 |
-
|
1449 |
-
var $select = $target.closest('.select2');
|
1450 |
-
|
1451 |
-
var $all = $('.select2.select2-container--open');
|
1452 |
-
|
1453 |
-
$all.each(function () {
|
1454 |
-
var $this = $(this);
|
1455 |
-
|
1456 |
-
if (this == $select[0]) {
|
1457 |
-
return;
|
1458 |
-
}
|
1459 |
-
|
1460 |
-
var $element = $this.data('element');
|
1461 |
-
|
1462 |
-
$element.select2('close');
|
1463 |
-
});
|
1464 |
-
});
|
1465 |
-
};
|
1466 |
-
|
1467 |
-
BaseSelection.prototype._detachCloseHandler = function (container) {
|
1468 |
-
$(document.body).off('mousedown.select2.' + container.id);
|
1469 |
-
};
|
1470 |
-
|
1471 |
-
BaseSelection.prototype.position = function ($selection, $container) {
|
1472 |
-
var $selectionContainer = $container.find('.selection');
|
1473 |
-
$selectionContainer.append($selection);
|
1474 |
-
};
|
1475 |
-
|
1476 |
-
BaseSelection.prototype.destroy = function () {
|
1477 |
-
this._detachCloseHandler(this.container);
|
1478 |
-
};
|
1479 |
-
|
1480 |
-
BaseSelection.prototype.update = function (data) {
|
1481 |
-
throw new Error('The `update` method must be defined in child classes.');
|
1482 |
-
};
|
1483 |
-
|
1484 |
-
return BaseSelection;
|
1485 |
-
});
|
1486 |
-
|
1487 |
-
S2.define('select2/selection/single',[
|
1488 |
-
'jquery',
|
1489 |
-
'./base',
|
1490 |
-
'../utils',
|
1491 |
-
'../keys'
|
1492 |
-
], function ($, BaseSelection, Utils, KEYS) {
|
1493 |
-
function SingleSelection () {
|
1494 |
-
SingleSelection.__super__.constructor.apply(this, arguments);
|
1495 |
-
}
|
1496 |
-
|
1497 |
-
Utils.Extend(SingleSelection, BaseSelection);
|
1498 |
-
|
1499 |
-
SingleSelection.prototype.render = function () {
|
1500 |
-
var $selection = SingleSelection.__super__.render.call(this);
|
1501 |
-
|
1502 |
-
$selection.addClass('select2-selection--single');
|
1503 |
-
|
1504 |
-
$selection.html(
|
1505 |
-
'<span class="select2-selection__rendered"></span>' +
|
1506 |
-
'<span class="select2-selection__arrow" role="presentation">' +
|
1507 |
-
'<b role="presentation"></b>' +
|
1508 |
-
'</span>'
|
1509 |
-
);
|
1510 |
-
|
1511 |
-
return $selection;
|
1512 |
-
};
|
1513 |
-
|
1514 |
-
SingleSelection.prototype.bind = function (container, $container) {
|
1515 |
-
var self = this;
|
1516 |
-
|
1517 |
-
SingleSelection.__super__.bind.apply(this, arguments);
|
1518 |
-
|
1519 |
-
var id = container.id + '-container';
|
1520 |
-
|
1521 |
-
this.$selection.find('.select2-selection__rendered').attr('id', id);
|
1522 |
-
this.$selection.attr('aria-labelledby', id);
|
1523 |
-
|
1524 |
-
this.$selection.on('mousedown', function (evt) {
|
1525 |
-
// Only respond to left clicks
|
1526 |
-
if (evt.which !== 1) {
|
1527 |
-
return;
|
1528 |
-
}
|
1529 |
-
|
1530 |
-
self.trigger('toggle', {
|
1531 |
-
originalEvent: evt
|
1532 |
-
});
|
1533 |
-
});
|
1534 |
-
|
1535 |
-
this.$selection.on('focus', function (evt) {
|
1536 |
-
// User focuses on the container
|
1537 |
-
});
|
1538 |
-
|
1539 |
-
this.$selection.on('blur', function (evt) {
|
1540 |
-
// User exits the container
|
1541 |
-
});
|
1542 |
-
|
1543 |
-
container.on('focus', function (evt) {
|
1544 |
-
if (!container.isOpen()) {
|
1545 |
-
self.$selection.focus();
|
1546 |
-
}
|
1547 |
-
});
|
1548 |
-
|
1549 |
-
container.on('selection:update', function (params) {
|
1550 |
-
self.update(params.data);
|
1551 |
-
});
|
1552 |
-
};
|
1553 |
-
|
1554 |
-
SingleSelection.prototype.clear = function () {
|
1555 |
-
this.$selection.find('.select2-selection__rendered').empty();
|
1556 |
-
};
|
1557 |
-
|
1558 |
-
SingleSelection.prototype.display = function (data, container) {
|
1559 |
-
var template = this.options.get('templateSelection');
|
1560 |
-
var escapeMarkup = this.options.get('escapeMarkup');
|
1561 |
-
|
1562 |
-
return escapeMarkup(template(data, container));
|
1563 |
-
};
|
1564 |
-
|
1565 |
-
SingleSelection.prototype.selectionContainer = function () {
|
1566 |
-
return $('<span></span>');
|
1567 |
-
};
|
1568 |
-
|
1569 |
-
SingleSelection.prototype.update = function (data) {
|
1570 |
-
if (data.length === 0) {
|
1571 |
-
this.clear();
|
1572 |
-
return;
|
1573 |
-
}
|
1574 |
-
|
1575 |
-
var selection = data[0];
|
1576 |
-
|
1577 |
-
var $rendered = this.$selection.find('.select2-selection__rendered');
|
1578 |
-
var formatted = this.display(selection, $rendered);
|
1579 |
-
|
1580 |
-
$rendered.empty().append(formatted);
|
1581 |
-
$rendered.prop('title', selection.title || selection.text);
|
1582 |
-
};
|
1583 |
-
|
1584 |
-
return SingleSelection;
|
1585 |
-
});
|
1586 |
-
|
1587 |
-
S2.define('select2/selection/multiple',[
|
1588 |
-
'jquery',
|
1589 |
-
'./base',
|
1590 |
-
'../utils'
|
1591 |
-
], function ($, BaseSelection, Utils) {
|
1592 |
-
function MultipleSelection ($element, options) {
|
1593 |
-
MultipleSelection.__super__.constructor.apply(this, arguments);
|
1594 |
-
}
|
1595 |
-
|
1596 |
-
Utils.Extend(MultipleSelection, BaseSelection);
|
1597 |
-
|
1598 |
-
MultipleSelection.prototype.render = function () {
|
1599 |
-
var $selection = MultipleSelection.__super__.render.call(this);
|
1600 |
-
|
1601 |
-
$selection.addClass('select2-selection--multiple');
|
1602 |
-
|
1603 |
-
$selection.html(
|
1604 |
-
'<ul class="select2-selection__rendered"></ul>'
|
1605 |
-
);
|
1606 |
-
|
1607 |
-
return $selection;
|
1608 |
-
};
|
1609 |
-
|
1610 |
-
MultipleSelection.prototype.bind = function (container, $container) {
|
1611 |
-
var self = this;
|
1612 |
-
|
1613 |
-
MultipleSelection.__super__.bind.apply(this, arguments);
|
1614 |
-
|
1615 |
-
this.$selection.on('click', function (evt) {
|
1616 |
-
self.trigger('toggle', {
|
1617 |
-
originalEvent: evt
|
1618 |
-
});
|
1619 |
-
});
|
1620 |
-
|
1621 |
-
this.$selection.on(
|
1622 |
-
'click',
|
1623 |
-
'.select2-selection__choice__remove',
|
1624 |
-
function (evt) {
|
1625 |
-
// Ignore the event if it is disabled
|
1626 |
-
if (self.options.get('disabled')) {
|
1627 |
-
return;
|
1628 |
-
}
|
1629 |
-
|
1630 |
-
var $remove = $(this);
|
1631 |
-
var $selection = $remove.parent();
|
1632 |
-
|
1633 |
-
var data = $selection.data('data');
|
1634 |
-
|
1635 |
-
self.trigger('unselect', {
|
1636 |
-
originalEvent: evt,
|
1637 |
-
data: data
|
1638 |
-
});
|
1639 |
-
}
|
1640 |
-
);
|
1641 |
-
};
|
1642 |
-
|
1643 |
-
MultipleSelection.prototype.clear = function () {
|
1644 |
-
this.$selection.find('.select2-selection__rendered').empty();
|
1645 |
-
};
|
1646 |
-
|
1647 |
-
MultipleSelection.prototype.display = function (data, container) {
|
1648 |
-
var template = this.options.get('templateSelection');
|
1649 |
-
var escapeMarkup = this.options.get('escapeMarkup');
|
1650 |
-
|
1651 |
-
return escapeMarkup(template(data, container));
|
1652 |
-
};
|
1653 |
-
|
1654 |
-
MultipleSelection.prototype.selectionContainer = function () {
|
1655 |
-
var $container = $(
|
1656 |
-
'<li class="select2-selection__choice">' +
|
1657 |
-
'<span class="select2-selection__choice__remove" role="presentation">' +
|
1658 |
-
'×' +
|
1659 |
-
'</span>' +
|
1660 |
-
'</li>'
|
1661 |
-
);
|
1662 |
-
|
1663 |
-
return $container;
|
1664 |
-
};
|
1665 |
-
|
1666 |
-
MultipleSelection.prototype.update = function (data) {
|
1667 |
-
this.clear();
|
1668 |
-
|
1669 |
-
if (data.length === 0) {
|
1670 |
-
return;
|
1671 |
-
}
|
1672 |
-
|
1673 |
-
var $selections = [];
|
1674 |
-
|
1675 |
-
for (var d = 0; d < data.length; d++) {
|
1676 |
-
var selection = data[d];
|
1677 |
-
|
1678 |
-
var $selection = this.selectionContainer();
|
1679 |
-
var formatted = this.display(selection, $selection);
|
1680 |
-
|
1681 |
-
$selection.append(formatted);
|
1682 |
-
$selection.prop('title', selection.title || selection.text);
|
1683 |
-
|
1684 |
-
$selection.data('data', selection);
|
1685 |
-
|
1686 |
-
$selections.push($selection);
|
1687 |
-
}
|
1688 |
-
|
1689 |
-
var $rendered = this.$selection.find('.select2-selection__rendered');
|
1690 |
-
|
1691 |
-
Utils.appendMany($rendered, $selections);
|
1692 |
-
};
|
1693 |
-
|
1694 |
-
return MultipleSelection;
|
1695 |
-
});
|
1696 |
-
|
1697 |
-
S2.define('select2/selection/placeholder',[
|
1698 |
-
'../utils'
|
1699 |
-
], function (Utils) {
|
1700 |
-
function Placeholder (decorated, $element, options) {
|
1701 |
-
this.placeholder = this.normalizePlaceholder(options.get('placeholder'));
|
1702 |
-
|
1703 |
-
decorated.call(this, $element, options);
|
1704 |
-
}
|
1705 |
-
|
1706 |
-
Placeholder.prototype.normalizePlaceholder = function (_, placeholder) {
|
1707 |
-
if (typeof placeholder === 'string') {
|
1708 |
-
placeholder = {
|
1709 |
-
id: '',
|
1710 |
-
text: placeholder
|
1711 |
-
};
|
1712 |
-
}
|
1713 |
-
|
1714 |
-
return placeholder;
|
1715 |
-
};
|
1716 |
-
|
1717 |
-
Placeholder.prototype.createPlaceholder = function (decorated, placeholder) {
|
1718 |
-
var $placeholder = this.selectionContainer();
|
1719 |
-
|
1720 |
-
$placeholder.html(this.display(placeholder));
|
1721 |
-
$placeholder.addClass('select2-selection__placeholder')
|
1722 |
-
.removeClass('select2-selection__choice');
|
1723 |
-
|
1724 |
-
return $placeholder;
|
1725 |
-
};
|
1726 |
-
|
1727 |
-
Placeholder.prototype.update = function (decorated, data) {
|
1728 |
-
var singlePlaceholder = (
|
1729 |
-
data.length == 1 && data[0].id != this.placeholder.id
|
1730 |
-
);
|
1731 |
-
var multipleSelections = data.length > 1;
|
1732 |
-
|
1733 |
-
if (multipleSelections || singlePlaceholder) {
|
1734 |
-
return decorated.call(this, data);
|
1735 |
-
}
|
1736 |
-
|
1737 |
-
this.clear();
|
1738 |
-
|
1739 |
-
var $placeholder = this.createPlaceholder(this.placeholder);
|
1740 |
-
|
1741 |
-
this.$selection.find('.select2-selection__rendered').append($placeholder);
|
1742 |
-
};
|
1743 |
-
|
1744 |
-
return Placeholder;
|
1745 |
-
});
|
1746 |
-
|
1747 |
-
S2.define('select2/selection/allowClear',[
|
1748 |
-
'jquery',
|
1749 |
-
'../keys'
|
1750 |
-
], function ($, KEYS) {
|
1751 |
-
function AllowClear () { }
|
1752 |
-
|
1753 |
-
AllowClear.prototype.bind = function (decorated, container, $container) {
|
1754 |
-
var self = this;
|
1755 |
-
|
1756 |
-
decorated.call(this, container, $container);
|
1757 |
-
|
1758 |
-
if (this.placeholder == null) {
|
1759 |
-
if (this.options.get('debug') && window.console && console.error) {
|
1760 |
-
console.error(
|
1761 |
-
'Select2: The `allowClear` option should be used in combination ' +
|
1762 |
-
'with the `placeholder` option.'
|
1763 |
-
);
|
1764 |
-
}
|
1765 |
-
}
|
1766 |
-
|
1767 |
-
this.$selection.on('mousedown', '.select2-selection__clear',
|
1768 |
-
function (evt) {
|
1769 |
-
self._handleClear(evt);
|
1770 |
-
});
|
1771 |
-
|
1772 |
-
container.on('keypress', function (evt) {
|
1773 |
-
self._handleKeyboardClear(evt, container);
|
1774 |
-
});
|
1775 |
-
};
|
1776 |
-
|
1777 |
-
AllowClear.prototype._handleClear = function (_, evt) {
|
1778 |
-
// Ignore the event if it is disabled
|
1779 |
-
if (this.options.get('disabled')) {
|
1780 |
-
return;
|
1781 |
-
}
|
1782 |
-
|
1783 |
-
var $clear = this.$selection.find('.select2-selection__clear');
|
1784 |
-
|
1785 |
-
// Ignore the event if nothing has been selected
|
1786 |
-
if ($clear.length === 0) {
|
1787 |
-
return;
|
1788 |
-
}
|
1789 |
-
|
1790 |
-
evt.stopPropagation();
|
1791 |
-
|
1792 |
-
var data = $clear.data('data');
|
1793 |
-
|
1794 |
-
for (var d = 0; d < data.length; d++) {
|
1795 |
-
var unselectData = {
|
1796 |
-
data: data[d]
|
1797 |
-
};
|
1798 |
-
|
1799 |
-
// Trigger the `unselect` event, so people can prevent it from being
|
1800 |
-
// cleared.
|
1801 |
-
this.trigger('unselect', unselectData);
|
1802 |
-
|
1803 |
-
// If the event was prevented, don't clear it out.
|
1804 |
-
if (unselectData.prevented) {
|
1805 |
-
return;
|
1806 |
-
}
|
1807 |
-
}
|
1808 |
-
|
1809 |
-
this.$element.val(this.placeholder.id).trigger('change');
|
1810 |
-
|
1811 |
-
this.trigger('toggle', {});
|
1812 |
-
};
|
1813 |
-
|
1814 |
-
AllowClear.prototype._handleKeyboardClear = function (_, evt, container) {
|
1815 |
-
if (container.isOpen()) {
|
1816 |
-
return;
|
1817 |
-
}
|
1818 |
-
|
1819 |
-
if (evt.which == KEYS.DELETE || evt.which == KEYS.BACKSPACE) {
|
1820 |
-
this._handleClear(evt);
|
1821 |
-
}
|
1822 |
-
};
|
1823 |
-
|
1824 |
-
AllowClear.prototype.update = function (decorated, data) {
|
1825 |
-
decorated.call(this, data);
|
1826 |
-
|
1827 |
-
if (this.$selection.find('.select2-selection__placeholder').length > 0 ||
|
1828 |
-
data.length === 0) {
|
1829 |
-
return;
|
1830 |
-
}
|
1831 |
-
|
1832 |
-
var $remove = $(
|
1833 |
-
'<span class="select2-selection__clear">' +
|
1834 |
-
'×' +
|
1835 |
-
'</span>'
|
1836 |
-
);
|
1837 |
-
$remove.data('data', data);
|
1838 |
-
|
1839 |
-
this.$selection.find('.select2-selection__rendered').prepend($remove);
|
1840 |
-
};
|
1841 |
-
|
1842 |
-
return AllowClear;
|
1843 |
-
});
|
1844 |
-
|
1845 |
-
S2.define('select2/selection/search',[
|
1846 |
-
'jquery',
|
1847 |
-
'../utils',
|
1848 |
-
'../keys'
|
1849 |
-
], function ($, Utils, KEYS) {
|
1850 |
-
function Search (decorated, $element, options) {
|
1851 |
-
decorated.call(this, $element, options);
|
1852 |
-
}
|
1853 |
-
|
1854 |
-
Search.prototype.render = function (decorated) {
|
1855 |
-
var $search = $(
|
1856 |
-
'<li class="select2-search select2-search--inline">' +
|
1857 |
-
'<input class="select2-search__field" type="search" tabindex="-1"' +
|
1858 |
-
' autocomplete="off" autocorrect="off" autocapitalize="none"' +
|
1859 |
-
' spellcheck="false" role="textbox" aria-autocomplete="list" />' +
|
1860 |
-
'</li>'
|
1861 |
-
);
|
1862 |
-
|
1863 |
-
this.$searchContainer = $search;
|
1864 |
-
this.$search = $search.find('input');
|
1865 |
-
|
1866 |
-
var $rendered = decorated.call(this);
|
1867 |
-
|
1868 |
-
this._transferTabIndex();
|
1869 |
-
|
1870 |
-
return $rendered;
|
1871 |
-
};
|
1872 |
-
|
1873 |
-
Search.prototype.bind = function (decorated, container, $container) {
|
1874 |
-
var self = this;
|
1875 |
-
|
1876 |
-
decorated.call(this, container, $container);
|
1877 |
-
|
1878 |
-
container.on('open', function () {
|
1879 |
-
self.$search.trigger('focus');
|
1880 |
-
});
|
1881 |
-
|
1882 |
-
container.on('close', function () {
|
1883 |
-
self.$search.val('');
|
1884 |
-
self.$search.removeAttr('aria-activedescendant');
|
1885 |
-
self.$search.trigger('focus');
|
1886 |
-
});
|
1887 |
-
|
1888 |
-
container.on('enable', function () {
|
1889 |
-
self.$search.prop('disabled', false);
|
1890 |
-
|
1891 |
-
self._transferTabIndex();
|
1892 |
-
});
|
1893 |
-
|
1894 |
-
container.on('disable', function () {
|
1895 |
-
self.$search.prop('disabled', true);
|
1896 |
-
});
|
1897 |
-
|
1898 |
-
container.on('focus', function (evt) {
|
1899 |
-
self.$search.trigger('focus');
|
1900 |
-
});
|
1901 |
-
|
1902 |
-
container.on('results:focus', function (params) {
|
1903 |
-
self.$search.attr('aria-activedescendant', params.id);
|
1904 |
-
});
|
1905 |
-
|
1906 |
-
this.$selection.on('focusin', '.select2-search--inline', function (evt) {
|
1907 |
-
self.trigger('focus', evt);
|
1908 |
-
});
|
1909 |
-
|
1910 |
-
this.$selection.on('focusout', '.select2-search--inline', function (evt) {
|
1911 |
-
self._handleBlur(evt);
|
1912 |
-
});
|
1913 |
-
|
1914 |
-
this.$selection.on('keydown', '.select2-search--inline', function (evt) {
|
1915 |
-
evt.stopPropagation();
|
1916 |
-
|
1917 |
-
self.trigger('keypress', evt);
|
1918 |
-
|
1919 |
-
self._keyUpPrevented = evt.isDefaultPrevented();
|
1920 |
-
|
1921 |
-
var key = evt.which;
|
1922 |
-
|
1923 |
-
if (key === KEYS.BACKSPACE && self.$search.val() === '') {
|
1924 |
-
var $previousChoice = self.$searchContainer
|
1925 |
-
.prev('.select2-selection__choice');
|
1926 |
-
|
1927 |
-
if ($previousChoice.length > 0) {
|
1928 |
-
var item = $previousChoice.data('data');
|
1929 |
-
|
1930 |
-
self.searchRemoveChoice(item);
|
1931 |
-
|
1932 |
-
evt.preventDefault();
|
1933 |
-
}
|
1934 |
-
}
|
1935 |
-
});
|
1936 |
-
|
1937 |
-
// Try to detect the IE version should the `documentMode` property that
|
1938 |
-
// is stored on the document. This is only implemented in IE and is
|
1939 |
-
// slightly cleaner than doing a user agent check.
|
1940 |
-
// This property is not available in Edge, but Edge also doesn't have
|
1941 |
-
// this bug.
|
1942 |
-
var msie = document.documentMode;
|
1943 |
-
var disableInputEvents = msie && msie <= 11;
|
1944 |
-
|
1945 |
-
// Workaround for browsers which do not support the `input` event
|
1946 |
-
// This will prevent double-triggering of events for browsers which support
|
1947 |
-
// both the `keyup` and `input` events.
|
1948 |
-
this.$selection.on(
|
1949 |
-
'input.searchcheck',
|
1950 |
-
'.select2-search--inline',
|
1951 |
-
function (evt) {
|
1952 |
-
// IE will trigger the `input` event when a placeholder is used on a
|
1953 |
-
// search box. To get around this issue, we are forced to ignore all
|
1954 |
-
// `input` events in IE and keep using `keyup`.
|
1955 |
-
if (disableInputEvents) {
|
1956 |
-
self.$selection.off('input.search input.searchcheck');
|
1957 |
-
return;
|
1958 |
-
}
|
1959 |
-
|
1960 |
-
// Unbind the duplicated `keyup` event
|
1961 |
-
self.$selection.off('keyup.search');
|
1962 |
-
}
|
1963 |
-
);
|
1964 |
-
|
1965 |
-
this.$selection.on(
|
1966 |
-
'keyup.search input.search',
|
1967 |
-
'.select2-search--inline',
|
1968 |
-
function (evt) {
|
1969 |
-
// IE will trigger the `input` event when a placeholder is used on a
|
1970 |
-
// search box. To get around this issue, we are forced to ignore all
|
1971 |
-
// `input` events in IE and keep using `keyup`.
|
1972 |
-
if (disableInputEvents && evt.type === 'input') {
|
1973 |
-
self.$selection.off('input.search input.searchcheck');
|
1974 |
-
return;
|
1975 |
-
}
|
1976 |
-
|
1977 |
-
var key = evt.which;
|
1978 |
-
|
1979 |
-
// We can freely ignore events from modifier keys
|
1980 |
-
if (key == KEYS.SHIFT || key == KEYS.CTRL || key == KEYS.ALT) {
|
1981 |
-
return;
|
1982 |
-
}
|
1983 |
-
|
1984 |
-
// Tabbing will be handled during the `keydown` phase
|
1985 |
-
if (key == KEYS.TAB) {
|
1986 |
-
return;
|
1987 |
-
}
|
1988 |
-
|
1989 |
-
self.handleSearch(evt);
|
1990 |
-
}
|
1991 |
-
);
|
1992 |
-
};
|
1993 |
-
|
1994 |
-
/**
|
1995 |
-
* This method will transfer the tabindex attribute from the rendered
|
1996 |
-
* selection to the search box. This allows for the search box to be used as
|
1997 |
-
* the primary focus instead of the selection container.
|
1998 |
-
*
|
1999 |
-
* @private
|
2000 |
-
*/
|
2001 |
-
Search.prototype._transferTabIndex = function (decorated) {
|
2002 |
-
this.$search.attr('tabindex', this.$selection.attr('tabindex'));
|
2003 |
-
this.$selection.attr('tabindex', '-1');
|
2004 |
-
};
|
2005 |
-
|
2006 |
-
Search.prototype.createPlaceholder = function (decorated, placeholder) {
|
2007 |
-
this.$search.attr('placeholder', placeholder.text);
|
2008 |
-
};
|
2009 |
-
|
2010 |
-
Search.prototype.update = function (decorated, data) {
|
2011 |
-
var searchHadFocus = this.$search[0] == document.activeElement;
|
2012 |
-
|
2013 |
-
this.$search.attr('placeholder', '');
|
2014 |
-
|
2015 |
-
decorated.call(this, data);
|
2016 |
-
|
2017 |
-
this.$selection.find('.select2-selection__rendered')
|
2018 |
-
.append(this.$searchContainer);
|
2019 |
-
|
2020 |
-
this.resizeSearch();
|
2021 |
-
if (searchHadFocus) {
|
2022 |
-
this.$search.focus();
|
2023 |
-
}
|
2024 |
-
};
|
2025 |
-
|
2026 |
-
Search.prototype.handleSearch = function () {
|
2027 |
-
this.resizeSearch();
|
2028 |
-
|
2029 |
-
if (!this._keyUpPrevented) {
|
2030 |
-
var input = this.$search.val();
|
2031 |
-
|
2032 |
-
this.trigger('query', {
|
2033 |
-
term: input
|
2034 |
-
});
|
2035 |
-
}
|
2036 |
-
|
2037 |
-
this._keyUpPrevented = false;
|
2038 |
-
};
|
2039 |
-
|
2040 |
-
Search.prototype.searchRemoveChoice = function (decorated, item) {
|
2041 |
-
this.trigger('unselect', {
|
2042 |
-
data: item
|
2043 |
-
});
|
2044 |
-
|
2045 |
-
this.$search.val(item.text);
|
2046 |
-
this.handleSearch();
|
2047 |
-
};
|
2048 |
-
|
2049 |
-
Search.prototype.resizeSearch = function () {
|
2050 |
-
this.$search.css('width', '25px');
|
2051 |
-
|
2052 |
-
var width = '';
|
2053 |
-
|
2054 |
-
if (this.$search.attr('placeholder') !== '') {
|
2055 |
-
width = this.$selection.find('.select2-selection__rendered').innerWidth();
|
2056 |
-
} else {
|
2057 |
-
var minimumWidth = this.$search.val().length + 1;
|
2058 |
-
|
2059 |
-
width = (minimumWidth * 0.75) + 'em';
|
2060 |
-
}
|
2061 |
-
|
2062 |
-
this.$search.css('width', width);
|
2063 |
-
};
|
2064 |
-
|
2065 |
-
return Search;
|
2066 |
-
});
|
2067 |
-
|
2068 |
-
S2.define('select2/selection/eventRelay',[
|
2069 |
-
'jquery'
|
2070 |
-
], function ($) {
|
2071 |
-
function EventRelay () { }
|
2072 |
-
|
2073 |
-
EventRelay.prototype.bind = function (decorated, container, $container) {
|
2074 |
-
var self = this;
|
2075 |
-
var relayEvents = [
|
2076 |
-
'open', 'opening',
|
2077 |
-
'close', 'closing',
|
2078 |
-
'select', 'selecting',
|
2079 |
-
'unselect', 'unselecting'
|
2080 |
-
];
|
2081 |
-
|
2082 |
-
var preventableEvents = ['opening', 'closing', 'selecting', 'unselecting'];
|
2083 |
-
|
2084 |
-
decorated.call(this, container, $container);
|
2085 |
-
|
2086 |
-
container.on('*', function (name, params) {
|
2087 |
-
// Ignore events that should not be relayed
|
2088 |
-
if ($.inArray(name, relayEvents) === -1) {
|
2089 |
-
return;
|
2090 |
-
}
|
2091 |
-
|
2092 |
-
// The parameters should always be an object
|
2093 |
-
params = params || {};
|
2094 |
-
|
2095 |
-
// Generate the jQuery event for the Select2 event
|
2096 |
-
var evt = $.Event('select2:' + name, {
|
2097 |
-
params: params
|
2098 |
-
});
|
2099 |
-
|
2100 |
-
self.$element.trigger(evt);
|
2101 |
-
|
2102 |
-
// Only handle preventable events if it was one
|
2103 |
-
if ($.inArray(name, preventableEvents) === -1) {
|
2104 |
-
return;
|
2105 |
-
}
|
2106 |
-
|
2107 |
-
params.prevented = evt.isDefaultPrevented();
|
2108 |
-
});
|
2109 |
-
};
|
2110 |
-
|
2111 |
-
return EventRelay;
|
2112 |
-
});
|
2113 |
-
|
2114 |
-
S2.define('select2/translation',[
|
2115 |
-
'jquery',
|
2116 |
-
'require'
|
2117 |
-
], function ($, require) {
|
2118 |
-
function Translation (dict) {
|
2119 |
-
this.dict = dict || {};
|
2120 |
-
}
|
2121 |
-
|
2122 |
-
Translation.prototype.all = function () {
|
2123 |
-
return this.dict;
|
2124 |
-
};
|
2125 |
-
|
2126 |
-
Translation.prototype.get = function (key) {
|
2127 |
-
return this.dict[key];
|
2128 |
-
};
|
2129 |
-
|
2130 |
-
Translation.prototype.extend = function (translation) {
|
2131 |
-
this.dict = $.extend({}, translation.all(), this.dict);
|
2132 |
-
};
|
2133 |
-
|
2134 |
-
// Static functions
|
2135 |
-
|
2136 |
-
Translation._cache = {};
|
2137 |
-
|
2138 |
-
Translation.loadPath = function (path) {
|
2139 |
-
if (!(path in Translation._cache)) {
|
2140 |
-
var translations = require(path);
|
2141 |
-
|
2142 |
-
Translation._cache[path] = translations;
|
2143 |
-
}
|
2144 |
-
|
2145 |
-
return new Translation(Translation._cache[path]);
|
2146 |
-
};
|
2147 |
-
|
2148 |
-
return Translation;
|
2149 |
-
});
|
2150 |
-
|
2151 |
-
S2.define('select2/diacritics',[
|
2152 |
-
|
2153 |
-
], function () {
|
2154 |
-
var diacritics = {
|
2155 |
-
'\u24B6': 'A',
|
2156 |
-
'\uFF21': 'A',
|
2157 |
-
'\u00C0': 'A',
|
2158 |
-
'\u00C1': 'A',
|
2159 |
-
'\u00C2': 'A',
|
2160 |
-
'\u1EA6': 'A',
|
2161 |
-
'\u1EA4': 'A',
|
2162 |
-
'\u1EAA': 'A',
|
2163 |
-
'\u1EA8': 'A',
|
2164 |
-
'\u00C3': 'A',
|
2165 |
-
'\u0100': 'A',
|
2166 |
-
'\u0102': 'A',
|
2167 |
-
'\u1EB0': 'A',
|
2168 |
-
'\u1EAE': 'A',
|
2169 |
-
'\u1EB4': 'A',
|
2170 |
-
'\u1EB2': 'A',
|
2171 |
-
'\u0226': 'A',
|
2172 |
-
'\u01E0': 'A',
|
2173 |
-
'\u00C4': 'A',
|
2174 |
-
'\u01DE': 'A',
|
2175 |
-
'\u1EA2': 'A',
|
2176 |
-
'\u00C5': 'A',
|
2177 |
-
'\u01FA': 'A',
|
2178 |
-
'\u01CD': 'A',
|
2179 |
-
'\u0200': 'A',
|
2180 |
-
'\u0202': 'A',
|
2181 |
-
'\u1EA0': 'A',
|
2182 |
-
'\u1EAC': 'A',
|
2183 |
-
'\u1EB6': 'A',
|
2184 |
-
'\u1E00': 'A',
|
2185 |
-
'\u0104': 'A',
|
2186 |
-
'\u023A': 'A',
|
2187 |
-
'\u2C6F': 'A',
|
2188 |
-
'\uA732': 'AA',
|
2189 |
-
'\u00C6': 'AE',
|
2190 |
-
'\u01FC': 'AE',
|
2191 |
-
'\u01E2': 'AE',
|
2192 |
-
'\uA734': 'AO',
|
2193 |
-
'\uA736': 'AU',
|
2194 |
-
'\uA738': 'AV',
|
2195 |
-
'\uA73A': 'AV',
|
2196 |
-
'\uA73C': 'AY',
|
2197 |
-
'\u24B7': 'B',
|
2198 |
-
'\uFF22': 'B',
|
2199 |
-
'\u1E02': 'B',
|
2200 |
-
'\u1E04': 'B',
|
2201 |
-
'\u1E06': 'B',
|
2202 |
-
'\u0243': 'B',
|
2203 |
-
'\u0182': 'B',
|
2204 |
-
'\u0181': 'B',
|
2205 |
-
'\u24B8': 'C',
|
2206 |
-
'\uFF23': 'C',
|
2207 |
-
'\u0106': 'C',
|
2208 |
-
'\u0108': 'C',
|
2209 |
-
'\u010A': 'C',
|
2210 |
-
'\u010C': 'C',
|
2211 |
-
'\u00C7': 'C',
|
2212 |
-
'\u1E08': 'C',
|
2213 |
-
'\u0187': 'C',
|
2214 |
-
'\u023B': 'C',
|
2215 |
-
'\uA73E': 'C',
|
2216 |
-
'\u24B9': 'D',
|
2217 |
-
'\uFF24': 'D',
|
2218 |
-
'\u1E0A': 'D',
|
2219 |
-
'\u010E': 'D',
|
2220 |
-
'\u1E0C': 'D',
|
2221 |
-
'\u1E10': 'D',
|
2222 |
-
'\u1E12': 'D',
|
2223 |
-
'\u1E0E': 'D',
|
2224 |
-
'\u0110': 'D',
|
2225 |
-
'\u018B': 'D',
|
2226 |
-
'\u018A': 'D',
|
2227 |
-
'\u0189': 'D',
|
2228 |
-
'\uA779': 'D',
|
2229 |
-
'\u01F1': 'DZ',
|
2230 |
-
'\u01C4': 'DZ',
|
2231 |
-
'\u01F2': 'Dz',
|
2232 |
-
'\u01C5': 'Dz',
|
2233 |
-
'\u24BA': 'E',
|
2234 |
-
'\uFF25': 'E',
|
2235 |
-
'\u00C8': 'E',
|
2236 |
-
'\u00C9': 'E',
|
2237 |
-
'\u00CA': 'E',
|
2238 |
-
'\u1EC0': 'E',
|
2239 |
-
'\u1EBE': 'E',
|
2240 |
-
'\u1EC4': 'E',
|
2241 |
-
'\u1EC2': 'E',
|
2242 |
-
'\u1EBC': 'E',
|
2243 |
-
'\u0112': 'E',
|
2244 |
-
'\u1E14': 'E',
|
2245 |
-
'\u1E16': 'E',
|
2246 |
-
'\u0114': 'E',
|
2247 |
-
'\u0116': 'E',
|
2248 |
-
'\u00CB': 'E',
|
2249 |
-
'\u1EBA': 'E',
|
2250 |
-
'\u011A': 'E',
|
2251 |
-
'\u0204': 'E',
|
2252 |
-
'\u0206': 'E',
|
2253 |
-
'\u1EB8': 'E',
|
2254 |
-
'\u1EC6': 'E',
|
2255 |
-
'\u0228': 'E',
|
2256 |
-
'\u1E1C': 'E',
|
2257 |
-
'\u0118': 'E',
|
2258 |
-
'\u1E18': 'E',
|
2259 |
-
'\u1E1A': 'E',
|
2260 |
-
'\u0190': 'E',
|
2261 |
-
'\u018E': 'E',
|
2262 |
-
'\u24BB': 'F',
|
2263 |
-
'\uFF26': 'F',
|
2264 |
-
'\u1E1E': 'F',
|
2265 |
-
'\u0191': 'F',
|
2266 |
-
'\uA77B': 'F',
|
2267 |
-
'\u24BC': 'G',
|
2268 |
-
'\uFF27': 'G',
|
2269 |
-
'\u01F4': 'G',
|
2270 |
-
'\u011C': 'G',
|
2271 |
-
'\u1E20': 'G',
|
2272 |
-
'\u011E': 'G',
|
2273 |
-
'\u0120': 'G',
|
2274 |
-
'\u01E6': 'G',
|
2275 |
-
'\u0122': 'G',
|
2276 |
-
'\u01E4': 'G',
|
2277 |
-
'\u0193': 'G',
|
2278 |
-
'\uA7A0': 'G',
|
2279 |
-
'\uA77D': 'G',
|
2280 |
-
'\uA77E': 'G',
|
2281 |
-
'\u24BD': 'H',
|
2282 |
-
'\uFF28': 'H',
|
2283 |
-
'\u0124': 'H',
|
2284 |
-
'\u1E22': 'H',
|
2285 |
-
'\u1E26': 'H',
|
2286 |
-
'\u021E': 'H',
|
2287 |
-
'\u1E24': 'H',
|
2288 |
-
'\u1E28': 'H',
|
2289 |
-
'\u1E2A': 'H',
|
2290 |
-
'\u0126': 'H',
|
2291 |
-
'\u2C67': 'H',
|
2292 |
-
'\u2C75': 'H',
|
2293 |
-
'\uA78D': 'H',
|
2294 |
-
'\u24BE': 'I',
|
2295 |
-
'\uFF29': 'I',
|
2296 |
-
'\u00CC': 'I',
|
2297 |
-
'\u00CD': 'I',
|
2298 |
-
'\u00CE': 'I',
|
2299 |
-
'\u0128': 'I',
|
2300 |
-
'\u012A': 'I',
|
2301 |
-
'\u012C': 'I',
|
2302 |
-
'\u0130': 'I',
|
2303 |
-
'\u00CF': 'I',
|
2304 |
-
'\u1E2E': 'I',
|
2305 |
-
'\u1EC8': 'I',
|
2306 |
-
'\u01CF': 'I',
|
2307 |
-
'\u0208': 'I',
|
2308 |
-
'\u020A': 'I',
|
2309 |
-
'\u1ECA': 'I',
|
2310 |
-
'\u012E': 'I',
|
2311 |
-
'\u1E2C': 'I',
|
2312 |
-
'\u0197': 'I',
|
2313 |
-
'\u24BF': 'J',
|
2314 |
-
'\uFF2A': 'J',
|
2315 |
-
'\u0134': 'J',
|
2316 |
-
'\u0248': 'J',
|
2317 |
-
'\u24C0': 'K',
|
2318 |
-
'\uFF2B': 'K',
|
2319 |
-
'\u1E30': 'K',
|
2320 |
-
'\u01E8': 'K',
|
2321 |
-
'\u1E32': 'K',
|
2322 |
-
'\u0136': 'K',
|
2323 |
-
'\u1E34': 'K',
|
2324 |
-
'\u0198': 'K',
|
2325 |
-
'\u2C69': 'K',
|
2326 |
-
'\uA740': 'K',
|
2327 |
-
'\uA742': 'K',
|
2328 |
-
'\uA744': 'K',
|
2329 |
-
'\uA7A2': 'K',
|
2330 |
-
'\u24C1': 'L',
|
2331 |
-
'\uFF2C': 'L',
|
2332 |
-
'\u013F': 'L',
|
2333 |
-
'\u0139': 'L',
|
2334 |
-
'\u013D': 'L',
|
2335 |
-
'\u1E36': 'L',
|
2336 |
-
'\u1E38': 'L',
|
2337 |
-
'\u013B': 'L',
|
2338 |
-
'\u1E3C': 'L',
|
2339 |
-
'\u1E3A': 'L',
|
2340 |
-
'\u0141': 'L',
|
2341 |
-
'\u023D': 'L',
|
2342 |
-
'\u2C62': 'L',
|
2343 |
-
'\u2C60': 'L',
|
2344 |
-
'\uA748': 'L',
|
2345 |
-
'\uA746': 'L',
|
2346 |
-
'\uA780': 'L',
|
2347 |
-
'\u01C7': 'LJ',
|
2348 |
-
'\u01C8': 'Lj',
|
2349 |
-
'\u24C2': 'M',
|
2350 |
-
'\uFF2D': 'M',
|
2351 |
-
'\u1E3E': 'M',
|
2352 |
-
'\u1E40': 'M',
|
2353 |
-
'\u1E42': 'M',
|
2354 |
-
'\u2C6E': 'M',
|
2355 |
-
'\u019C': 'M',
|
2356 |
-
'\u24C3': 'N',
|
2357 |
-
'\uFF2E': 'N',
|
2358 |
-
'\u01F8': 'N',
|
2359 |
-
'\u0143': 'N',
|
2360 |
-
'\u00D1': 'N',
|
2361 |
-
'\u1E44': 'N',
|
2362 |
-
'\u0147': 'N',
|
2363 |
-
'\u1E46': 'N',
|
2364 |
-
'\u0145': 'N',
|
2365 |
-
'\u1E4A': 'N',
|
2366 |
-
'\u1E48': 'N',
|
2367 |
-
'\u0220': 'N',
|
2368 |
-
'\u019D': 'N',
|
2369 |
-
'\uA790': 'N',
|
2370 |
-
'\uA7A4': 'N',
|
2371 |
-
'\u01CA': 'NJ',
|
2372 |
-
'\u01CB': 'Nj',
|
2373 |
-
'\u24C4': 'O',
|
2374 |
-
'\uFF2F': 'O',
|
2375 |
-
'\u00D2': 'O',
|
2376 |
-
'\u00D3': 'O',
|
2377 |
-
'\u00D4': 'O',
|
2378 |
-
'\u1ED2': 'O',
|
2379 |
-
'\u1ED0': 'O',
|
2380 |
-
'\u1ED6': 'O',
|
2381 |
-
'\u1ED4': 'O',
|
2382 |
-
'\u00D5': 'O',
|
2383 |
-
'\u1E4C': 'O',
|
2384 |
-
'\u022C': 'O',
|
2385 |
-
'\u1E4E': 'O',
|
2386 |
-
'\u014C': 'O',
|
2387 |
-
'\u1E50': 'O',
|
2388 |
-
'\u1E52': 'O',
|
2389 |
-
'\u014E': 'O',
|
2390 |
-
'\u022E': 'O',
|
2391 |
-
'\u0230': 'O',
|
2392 |
-
'\u00D6': 'O',
|
2393 |
-
'\u022A': 'O',
|
2394 |
-
'\u1ECE': 'O',
|
2395 |
-
'\u0150': 'O',
|
2396 |
-
'\u01D1': 'O',
|
2397 |
-
'\u020C': 'O',
|
2398 |
-
'\u020E': 'O',
|
2399 |
-
'\u01A0': 'O',
|
2400 |
-
'\u1EDC': 'O',
|
2401 |
-
'\u1EDA': 'O',
|
2402 |
-
'\u1EE0': 'O',
|
2403 |
-
'\u1EDE': 'O',
|
2404 |
-
'\u1EE2': 'O',
|
2405 |
-
'\u1ECC': 'O',
|
2406 |
-
'\u1ED8': 'O',
|
2407 |
-
'\u01EA': 'O',
|
2408 |
-
'\u01EC': 'O',
|
2409 |
-
'\u00D8': 'O',
|
2410 |
-
'\u01FE': 'O',
|
2411 |
-
'\u0186': 'O',
|
2412 |
-
'\u019F': 'O',
|
2413 |
-
'\uA74A': 'O',
|
2414 |
-
'\uA74C': 'O',
|
2415 |
-
'\u01A2': 'OI',
|
2416 |
-
'\uA74E': 'OO',
|
2417 |
-
'\u0222': 'OU',
|
2418 |
-
'\u24C5': 'P',
|
2419 |
-
'\uFF30': 'P',
|
2420 |
-
'\u1E54': 'P',
|
2421 |
-
'\u1E56': 'P',
|
2422 |
-
'\u01A4': 'P',
|
2423 |
-
'\u2C63': 'P',
|
2424 |
-
'\uA750': 'P',
|
2425 |
-
'\uA752': 'P',
|
2426 |
-
'\uA754': 'P',
|
2427 |
-
'\u24C6': 'Q',
|
2428 |
-
'\uFF31': 'Q',
|
2429 |
-
'\uA756': 'Q',
|
2430 |
-
'\uA758': 'Q',
|
2431 |
-
'\u024A': 'Q',
|
2432 |
-
'\u24C7': 'R',
|
2433 |
-
'\uFF32': 'R',
|
2434 |
-
'\u0154': 'R',
|
2435 |
-
'\u1E58': 'R',
|
2436 |
-
'\u0158': 'R',
|
2437 |
-
'\u0210': 'R',
|
2438 |
-
'\u0212': 'R',
|
2439 |
-
'\u1E5A': 'R',
|
2440 |
-
'\u1E5C': 'R',
|
2441 |
-
'\u0156': 'R',
|
2442 |
-
'\u1E5E': 'R',
|
2443 |
-
'\u024C': 'R',
|
2444 |
-
'\u2C64': 'R',
|
2445 |
-
'\uA75A': 'R',
|
2446 |
-
'\uA7A6': 'R',
|
2447 |
-
'\uA782': 'R',
|
2448 |
-
'\u24C8': 'S',
|
2449 |
-
'\uFF33': 'S',
|
2450 |
-
'\u1E9E': 'S',
|
2451 |
-
'\u015A': 'S',
|
2452 |
-
'\u1E64': 'S',
|
2453 |
-
'\u015C': 'S',
|
2454 |
-
'\u1E60': 'S',
|
2455 |
-
'\u0160': 'S',
|
2456 |
-
'\u1E66': 'S',
|
2457 |
-
'\u1E62': 'S',
|
2458 |
-
'\u1E68': 'S',
|
2459 |
-
'\u0218': 'S',
|
2460 |
-
'\u015E': 'S',
|
2461 |
-
'\u2C7E': 'S',
|
2462 |
-
'\uA7A8': 'S',
|
2463 |
-
'\uA784': 'S',
|
2464 |
-
'\u24C9': 'T',
|
2465 |
-
'\uFF34': 'T',
|
2466 |
-
'\u1E6A': 'T',
|
2467 |
-
'\u0164': 'T',
|
2468 |
-
'\u1E6C': 'T',
|
2469 |
-
'\u021A': 'T',
|
2470 |
-
'\u0162': 'T',
|
2471 |
-
'\u1E70': 'T',
|
2472 |
-
'\u1E6E': 'T',
|
2473 |
-
'\u0166': 'T',
|
2474 |
-
'\u01AC': 'T',
|
2475 |
-
'\u01AE': 'T',
|
2476 |
-
'\u023E': 'T',
|
2477 |
-
'\uA786': 'T',
|
2478 |
-
'\uA728': 'TZ',
|
2479 |
-
'\u24CA': 'U',
|
2480 |
-
'\uFF35': 'U',
|
2481 |
-
'\u00D9': 'U',
|
2482 |
-
'\u00DA': 'U',
|
2483 |
-
'\u00DB': 'U',
|
2484 |
-
'\u0168': 'U',
|
2485 |
-
'\u1E78': 'U',
|
2486 |
-
'\u016A': 'U',
|
2487 |
-
'\u1E7A': 'U',
|
2488 |
-
'\u016C': 'U',
|
2489 |
-
'\u00DC': 'U',
|
2490 |
-
'\u01DB': 'U',
|
2491 |
-
'\u01D7': 'U',
|
2492 |
-
'\u01D5': 'U',
|
2493 |
-
'\u01D9': 'U',
|
2494 |
-
'\u1EE6': 'U',
|
2495 |
-
'\u016E': 'U',
|
2496 |
-
'\u0170': 'U',
|
2497 |
-
'\u01D3': 'U',
|
2498 |
-
'\u0214': 'U',
|
2499 |
-
'\u0216': 'U',
|
2500 |
-
'\u01AF': 'U',
|
2501 |
-
'\u1EEA': 'U',
|
2502 |
-
'\u1EE8': 'U',
|
2503 |
-
'\u1EEE': 'U',
|
2504 |
-
'\u1EEC': 'U',
|
2505 |
-
'\u1EF0': 'U',
|
2506 |
-
'\u1EE4': 'U',
|
2507 |
-
'\u1E72': 'U',
|
2508 |
-
'\u0172': 'U',
|
2509 |
-
'\u1E76': 'U',
|
2510 |
-
'\u1E74': 'U',
|
2511 |
-
'\u0244': 'U',
|
2512 |
-
'\u24CB': 'V',
|
2513 |
-
'\uFF36': 'V',
|
2514 |
-
'\u1E7C': 'V',
|
2515 |
-
'\u1E7E': 'V',
|
2516 |
-
'\u01B2': 'V',
|
2517 |
-
'\uA75E': 'V',
|
2518 |
-
'\u0245': 'V',
|
2519 |
-
'\uA760': 'VY',
|
2520 |
-
'\u24CC': 'W',
|
2521 |
-
'\uFF37': 'W',
|
2522 |
-
'\u1E80': 'W',
|
2523 |
-
'\u1E82': 'W',
|
2524 |
-
'\u0174': 'W',
|
2525 |
-
'\u1E86': 'W',
|
2526 |
-
'\u1E84': 'W',
|
2527 |
-
'\u1E88': 'W',
|
2528 |
-
'\u2C72': 'W',
|
2529 |
-
'\u24CD': 'X',
|
2530 |
-
'\uFF38': 'X',
|
2531 |
-
'\u1E8A': 'X',
|
2532 |
-
'\u1E8C': 'X',
|
2533 |
-
'\u24CE': 'Y',
|
2534 |
-
'\uFF39': 'Y',
|
2535 |
-
'\u1EF2': 'Y',
|
2536 |
-
'\u00DD': 'Y',
|
2537 |
-
'\u0176': 'Y',
|
2538 |
-
'\u1EF8': 'Y',
|
2539 |
-
'\u0232': 'Y',
|
2540 |
-
'\u1E8E': 'Y',
|
2541 |
-
'\u0178': 'Y',
|
2542 |
-
'\u1EF6': 'Y',
|
2543 |
-
'\u1EF4': 'Y',
|
2544 |
-
'\u01B3': 'Y',
|
2545 |
-
'\u024E': 'Y',
|
2546 |
-
'\u1EFE': 'Y',
|
2547 |
-
'\u24CF': 'Z',
|
2548 |
-
'\uFF3A': 'Z',
|
2549 |
-
'\u0179': 'Z',
|
2550 |
-
'\u1E90': 'Z',
|
2551 |
-
'\u017B': 'Z',
|
2552 |
-
'\u017D': 'Z',
|
2553 |
-
'\u1E92': 'Z',
|
2554 |
-
'\u1E94': 'Z',
|
2555 |
-
'\u01B5': 'Z',
|
2556 |
-
'\u0224': 'Z',
|
2557 |
-
'\u2C7F': 'Z',
|
2558 |
-
'\u2C6B': 'Z',
|
2559 |
-
'\uA762': 'Z',
|
2560 |
-
'\u24D0': 'a',
|
2561 |
-
'\uFF41': 'a',
|
2562 |
-
'\u1E9A': 'a',
|
2563 |
-
'\u00E0': 'a',
|
2564 |
-
'\u00E1': 'a',
|
2565 |
-
'\u00E2': 'a',
|
2566 |
-
'\u1EA7': 'a',
|
2567 |
-
'\u1EA5': 'a',
|
2568 |
-
'\u1EAB': 'a',
|
2569 |
-
'\u1EA9': 'a',
|
2570 |
-
'\u00E3': 'a',
|
2571 |
-
'\u0101': 'a',
|
2572 |
-
'\u0103': 'a',
|
2573 |
-
'\u1EB1': 'a',
|
2574 |
-
'\u1EAF': 'a',
|
2575 |
-
'\u1EB5': 'a',
|
2576 |
-
'\u1EB3': 'a',
|
2577 |
-
'\u0227': 'a',
|
2578 |
-
'\u01E1': 'a',
|
2579 |
-
'\u00E4': 'a',
|
2580 |
-
'\u01DF': 'a',
|
2581 |
-
'\u1EA3': 'a',
|
2582 |
-
'\u00E5': 'a',
|
2583 |
-
'\u01FB': 'a',
|
2584 |
-
'\u01CE': 'a',
|
2585 |
-
'\u0201': 'a',
|
2586 |
-
'\u0203': 'a',
|
2587 |
-
'\u1EA1': 'a',
|
2588 |
-
'\u1EAD': 'a',
|
2589 |
-
'\u1EB7': 'a',
|
2590 |
-
'\u1E01': 'a',
|
2591 |
-
'\u0105': 'a',
|
2592 |
-
'\u2C65': 'a',
|
2593 |
-
'\u0250': 'a',
|
2594 |
-
'\uA733': 'aa',
|
2595 |
-
'\u00E6': 'ae',
|
2596 |
-
'\u01FD': 'ae',
|
2597 |
-
'\u01E3': 'ae',
|
2598 |
-
'\uA735': 'ao',
|
2599 |
-
'\uA737': 'au',
|
2600 |
-
'\uA739': 'av',
|
2601 |
-
'\uA73B': 'av',
|
2602 |
-
'\uA73D': 'ay',
|
2603 |
-
'\u24D1': 'b',
|
2604 |
-
'\uFF42': 'b',
|
2605 |
-
'\u1E03': 'b',
|
2606 |
-
'\u1E05': 'b',
|
2607 |
-
'\u1E07': 'b',
|
2608 |
-
'\u0180': 'b',
|
2609 |
-
'\u0183': 'b',
|
2610 |
-
'\u0253': 'b',
|
2611 |
-
'\u24D2': 'c',
|
2612 |
-
'\uFF43': 'c',
|
2613 |
-
'\u0107': 'c',
|
2614 |
-
'\u0109': 'c',
|
2615 |
-
'\u010B': 'c',
|
2616 |
-
'\u010D': 'c',
|
2617 |
-
'\u00E7': 'c',
|
2618 |
-
'\u1E09': 'c',
|
2619 |
-
'\u0188': 'c',
|
2620 |
-
'\u023C': 'c',
|
2621 |
-
'\uA73F': 'c',
|
2622 |
-
'\u2184': 'c',
|
2623 |
-
'\u24D3': 'd',
|
2624 |
-
'\uFF44': 'd',
|
2625 |
-
'\u1E0B': 'd',
|
2626 |
-
'\u010F': 'd',
|
2627 |
-
'\u1E0D': 'd',
|
2628 |
-
'\u1E11': 'd',
|
2629 |
-
'\u1E13': 'd',
|
2630 |
-
'\u1E0F': 'd',
|
2631 |
-
'\u0111': 'd',
|
2632 |
-
'\u018C': 'd',
|
2633 |
-
'\u0256': 'd',
|
2634 |
-
'\u0257': 'd',
|
2635 |
-
'\uA77A': 'd',
|
2636 |
-
'\u01F3': 'dz',
|
2637 |
-
'\u01C6': 'dz',
|
2638 |
-
'\u24D4': 'e',
|
2639 |
-
'\uFF45': 'e',
|
2640 |
-
'\u00E8': 'e',
|
2641 |
-
'\u00E9': 'e',
|
2642 |
-
'\u00EA': 'e',
|
2643 |
-
'\u1EC1': 'e',
|
2644 |
-
'\u1EBF': 'e',
|
2645 |
-
'\u1EC5': 'e',
|
2646 |
-
'\u1EC3': 'e',
|
2647 |
-
'\u1EBD': 'e',
|
2648 |
-
'\u0113': 'e',
|
2649 |
-
'\u1E15': 'e',
|
2650 |
-
'\u1E17': 'e',
|
2651 |
-
'\u0115': 'e',
|
2652 |
-
'\u0117': 'e',
|
2653 |
-
'\u00EB': 'e',
|
2654 |
-
'\u1EBB': 'e',
|
2655 |
-
'\u011B': 'e',
|
2656 |
-
'\u0205': 'e',
|
2657 |
-
'\u0207': 'e',
|
2658 |
-
'\u1EB9': 'e',
|
2659 |
-
'\u1EC7': 'e',
|
2660 |
-
'\u0229': 'e',
|
2661 |
-
'\u1E1D': 'e',
|
2662 |
-
'\u0119': 'e',
|
2663 |
-
'\u1E19': 'e',
|
2664 |
-
'\u1E1B': 'e',
|
2665 |
-
'\u0247': 'e',
|
2666 |
-
'\u025B': 'e',
|
2667 |
-
'\u01DD': 'e',
|
2668 |
-
'\u24D5': 'f',
|
2669 |
-
'\uFF46': 'f',
|
2670 |
-
'\u1E1F': 'f',
|
2671 |
-
'\u0192': 'f',
|
2672 |
-
'\uA77C': 'f',
|
2673 |
-
'\u24D6': 'g',
|
2674 |
-
'\uFF47': 'g',
|
2675 |
-
'\u01F5': 'g',
|
2676 |
-
'\u011D': 'g',
|
2677 |
-
'\u1E21': 'g',
|
2678 |
-
'\u011F': 'g',
|
2679 |
-
'\u0121': 'g',
|
2680 |
-
'\u01E7': 'g',
|
2681 |
-
'\u0123': 'g',
|
2682 |
-
'\u01E5': 'g',
|
2683 |
-
'\u0260': 'g',
|
2684 |
-
'\uA7A1': 'g',
|
2685 |
-
'\u1D79': 'g',
|
2686 |
-
'\uA77F': 'g',
|
2687 |
-
'\u24D7': 'h',
|
2688 |
-
'\uFF48': 'h',
|
2689 |
-
'\u0125': 'h',
|
2690 |
-
'\u1E23': 'h',
|
2691 |
-
'\u1E27': 'h',
|
2692 |
-
'\u021F': 'h',
|
2693 |
-
'\u1E25': 'h',
|
2694 |
-
'\u1E29': 'h',
|
2695 |
-
'\u1E2B': 'h',
|
2696 |
-
'\u1E96': 'h',
|
2697 |
-
'\u0127': 'h',
|
2698 |
-
'\u2C68': 'h',
|
2699 |
-
'\u2C76': 'h',
|
2700 |
-
'\u0265': 'h',
|
2701 |
-
'\u0195': 'hv',
|
2702 |
-
'\u24D8': 'i',
|
2703 |
-
'\uFF49': 'i',
|
2704 |
-
'\u00EC': 'i',
|
2705 |
-
'\u00ED': 'i',
|
2706 |
-
'\u00EE': 'i',
|
2707 |
-
'\u0129': 'i',
|
2708 |
-
'\u012B': 'i',
|
2709 |
-
'\u012D': 'i',
|
2710 |
-
'\u00EF': 'i',
|
2711 |
-
'\u1E2F': 'i',
|
2712 |
-
'\u1EC9': 'i',
|
2713 |
-
'\u01D0': 'i',
|
2714 |
-
'\u0209': 'i',
|
2715 |
-
'\u020B': 'i',
|
2716 |
-
'\u1ECB': 'i',
|
2717 |
-
'\u012F': 'i',
|
2718 |
-
'\u1E2D': 'i',
|
2719 |
-
'\u0268': 'i',
|
2720 |
-
'\u0131': 'i',
|
2721 |
-
'\u24D9': 'j',
|
2722 |
-
'\uFF4A': 'j',
|
2723 |
-
'\u0135': 'j',
|
2724 |
-
'\u01F0': 'j',
|
2725 |
-
'\u0249': 'j',
|
2726 |
-
'\u24DA': 'k',
|
2727 |
-
'\uFF4B': 'k',
|
2728 |
-
'\u1E31': 'k',
|
2729 |
-
'\u01E9': 'k',
|
2730 |
-
'\u1E33': 'k',
|
2731 |
-
'\u0137': 'k',
|
2732 |
-
'\u1E35': 'k',
|
2733 |
-
'\u0199': 'k',
|
2734 |
-
'\u2C6A': 'k',
|
2735 |
-
'\uA741': 'k',
|
2736 |
-
'\uA743': 'k',
|
2737 |
-
'\uA745': 'k',
|
2738 |
-
'\uA7A3': 'k',
|
2739 |
-
'\u24DB': 'l',
|
2740 |
-
'\uFF4C': 'l',
|
2741 |
-
'\u0140': 'l',
|
2742 |
-
'\u013A': 'l',
|
2743 |
-
'\u013E': 'l',
|
2744 |
-
'\u1E37': 'l',
|
2745 |
-
'\u1E39': 'l',
|
2746 |
-
'\u013C': 'l',
|
2747 |
-
'\u1E3D': 'l',
|
2748 |
-
'\u1E3B': 'l',
|
2749 |
-
'\u017F': 'l',
|
2750 |
-
'\u0142': 'l',
|
2751 |
-
'\u019A': 'l',
|
2752 |
-
'\u026B': 'l',
|
2753 |
-
'\u2C61': 'l',
|
2754 |
-
'\uA749': 'l',
|
2755 |
-
'\uA781': 'l',
|
2756 |
-
'\uA747': 'l',
|
2757 |
-
'\u01C9': 'lj',
|
2758 |
-
'\u24DC': 'm',
|
2759 |
-
'\uFF4D': 'm',
|
2760 |
-
'\u1E3F': 'm',
|
2761 |
-
'\u1E41': 'm',
|
2762 |
-
'\u1E43': 'm',
|
2763 |
-
'\u0271': 'm',
|
2764 |
-
'\u026F': 'm',
|
2765 |
-
'\u24DD': 'n',
|
2766 |
-
'\uFF4E': 'n',
|
2767 |
-
'\u01F9': 'n',
|
2768 |
-
'\u0144': 'n',
|
2769 |
-
'\u00F1': 'n',
|
2770 |
-
'\u1E45': 'n',
|
2771 |
-
'\u0148': 'n',
|
2772 |
-
'\u1E47': 'n',
|
2773 |
-
'\u0146': 'n',
|
2774 |
-
'\u1E4B': 'n',
|
2775 |
-
'\u1E49': 'n',
|
2776 |
-
'\u019E': 'n',
|
2777 |
-
'\u0272': 'n',
|
2778 |
-
'\u0149': 'n',
|
2779 |
-
'\uA791': 'n',
|
2780 |
-
'\uA7A5': 'n',
|
2781 |
-
'\u01CC': 'nj',
|
2782 |
-
'\u24DE': 'o',
|
2783 |
-
'\uFF4F': 'o',
|
2784 |
-
'\u00F2': 'o',
|
2785 |
-
'\u00F3': 'o',
|
2786 |
-
'\u00F4': 'o',
|
2787 |
-
'\u1ED3': 'o',
|
2788 |
-
'\u1ED1': 'o',
|
2789 |
-
'\u1ED7': 'o',
|
2790 |
-
'\u1ED5': 'o',
|
2791 |
-
'\u00F5': 'o',
|
2792 |
-
'\u1E4D': 'o',
|
2793 |
-
'\u022D': 'o',
|
2794 |
-
'\u1E4F': 'o',
|
2795 |
-
'\u014D': 'o',
|
2796 |
-
'\u1E51': 'o',
|
2797 |
-
'\u1E53': 'o',
|
2798 |
-
'\u014F': 'o',
|
2799 |
-
'\u022F': 'o',
|
2800 |
-
'\u0231': 'o',
|
2801 |
-
'\u00F6': 'o',
|
2802 |
-
'\u022B': 'o',
|
2803 |
-
'\u1ECF': 'o',
|
2804 |
-
'\u0151': 'o',
|
2805 |
-
'\u01D2': 'o',
|
2806 |
-
'\u020D': 'o',
|
2807 |
-
'\u020F': 'o',
|
2808 |
-
'\u01A1': 'o',
|
2809 |
-
'\u1EDD': 'o',
|
2810 |
-
'\u1EDB': 'o',
|
2811 |
-
'\u1EE1': 'o',
|
2812 |
-
'\u1EDF': 'o',
|
2813 |
-
'\u1EE3': 'o',
|
2814 |
-
'\u1ECD': 'o',
|
2815 |
-
'\u1ED9': 'o',
|
2816 |
-
'\u01EB': 'o',
|
2817 |
-
'\u01ED': 'o',
|
2818 |
-
'\u00F8': 'o',
|
2819 |
-
'\u01FF': 'o',
|
2820 |
-
'\u0254': 'o',
|
2821 |
-
'\uA74B': 'o',
|
2822 |
-
'\uA74D': 'o',
|
2823 |
-
'\u0275': 'o',
|
2824 |
-
'\u01A3': 'oi',
|
2825 |
-
'\u0223': 'ou',
|
2826 |
-
'\uA74F': 'oo',
|
2827 |
-
'\u24DF': 'p',
|
2828 |
-
'\uFF50': 'p',
|
2829 |
-
'\u1E55': 'p',
|
2830 |
-
'\u1E57': 'p',
|
2831 |
-
'\u01A5': 'p',
|
2832 |
-
'\u1D7D': 'p',
|
2833 |
-
'\uA751': 'p',
|
2834 |
-
'\uA753': 'p',
|
2835 |
-
'\uA755': 'p',
|
2836 |
-
'\u24E0': 'q',
|
2837 |
-
'\uFF51': 'q',
|
2838 |
-
'\u024B': 'q',
|
2839 |
-
'\uA757': 'q',
|
2840 |
-
'\uA759': 'q',
|
2841 |
-
'\u24E1': 'r',
|
2842 |
-
'\uFF52': 'r',
|
2843 |
-
'\u0155': 'r',
|
2844 |
-
'\u1E59': 'r',
|
2845 |
-
'\u0159': 'r',
|
2846 |
-
'\u0211': 'r',
|
2847 |
-
'\u0213': 'r',
|
2848 |
-
'\u1E5B': 'r',
|
2849 |
-
'\u1E5D': 'r',
|
2850 |
-
'\u0157': 'r',
|
2851 |
-
'\u1E5F': 'r',
|
2852 |
-
'\u024D': 'r',
|
2853 |
-
'\u027D': 'r',
|
2854 |
-
'\uA75B': 'r',
|
2855 |
-
'\uA7A7': 'r',
|
2856 |
-
'\uA783': 'r',
|
2857 |
-
'\u24E2': 's',
|
2858 |
-
'\uFF53': 's',
|
2859 |
-
'\u00DF': 's',
|
2860 |
-
'\u015B': 's',
|
2861 |
-
'\u1E65': 's',
|
2862 |
-
'\u015D': 's',
|
2863 |
-
'\u1E61': 's',
|
2864 |
-
'\u0161': 's',
|
2865 |
-
'\u1E67': 's',
|
2866 |
-
'\u1E63': 's',
|
2867 |
-
'\u1E69': 's',
|
2868 |
-
'\u0219': 's',
|
2869 |
-
'\u015F': 's',
|
2870 |
-
'\u023F': 's',
|
2871 |
-
'\uA7A9': 's',
|
2872 |
-
'\uA785': 's',
|
2873 |
-
'\u1E9B': 's',
|
2874 |
-
'\u24E3': 't',
|
2875 |
-
'\uFF54': 't',
|
2876 |
-
'\u1E6B': 't',
|
2877 |
-
'\u1E97': 't',
|
2878 |
-
'\u0165': 't',
|
2879 |
-
'\u1E6D': 't',
|
2880 |
-
'\u021B': 't',
|
2881 |
-
'\u0163': 't',
|
2882 |
-
'\u1E71': 't',
|
2883 |
-
'\u1E6F': 't',
|
2884 |
-
'\u0167': 't',
|
2885 |
-
'\u01AD': 't',
|
2886 |
-
'\u0288': 't',
|
2887 |
-
'\u2C66': 't',
|
2888 |
-
'\uA787': 't',
|
2889 |
-
'\uA729': 'tz',
|
2890 |
-
'\u24E4': 'u',
|
2891 |
-
'\uFF55': 'u',
|
2892 |
-
'\u00F9': 'u',
|
2893 |
-
'\u00FA': 'u',
|
2894 |
-
'\u00FB': 'u',
|
2895 |
-
'\u0169': 'u',
|
2896 |
-
'\u1E79': 'u',
|
2897 |
-
'\u016B': 'u',
|
2898 |
-
'\u1E7B': 'u',
|
2899 |
-
'\u016D': 'u',
|
2900 |
-
'\u00FC': 'u',
|
2901 |
-
'\u01DC': 'u',
|
2902 |
-
'\u01D8': 'u',
|
2903 |
-
'\u01D6': 'u',
|
2904 |
-
'\u01DA': 'u',
|
2905 |
-
'\u1EE7': 'u',
|
2906 |
-
'\u016F': 'u',
|
2907 |
-
'\u0171': 'u',
|
2908 |
-
'\u01D4': 'u',
|
2909 |
-
'\u0215': 'u',
|
2910 |
-
'\u0217': 'u',
|
2911 |
-
'\u01B0': 'u',
|
2912 |
-
'\u1EEB': 'u',
|
2913 |
-
'\u1EE9': 'u',
|
2914 |
-
'\u1EEF': 'u',
|
2915 |
-
'\u1EED': 'u',
|
2916 |
-
'\u1EF1': 'u',
|
2917 |
-
'\u1EE5': 'u',
|
2918 |
-
'\u1E73': 'u',
|
2919 |
-
'\u0173': 'u',
|
2920 |
-
'\u1E77': 'u',
|
2921 |
-
'\u1E75': 'u',
|
2922 |
-
'\u0289': 'u',
|
2923 |
-
'\u24E5': 'v',
|
2924 |
-
'\uFF56': 'v',
|
2925 |
-
'\u1E7D': 'v',
|
2926 |
-
'\u1E7F': 'v',
|
2927 |
-
'\u028B': 'v',
|
2928 |
-
'\uA75F': 'v',
|
2929 |
-
'\u028C': 'v',
|
2930 |
-
'\uA761': 'vy',
|
2931 |
-
'\u24E6': 'w',
|
2932 |
-
'\uFF57': 'w',
|
2933 |
-
'\u1E81': 'w',
|
2934 |
-
'\u1E83': 'w',
|
2935 |
-
'\u0175': 'w',
|
2936 |
-
'\u1E87': 'w',
|
2937 |
-
'\u1E85': 'w',
|
2938 |
-
'\u1E98': 'w',
|
2939 |
-
'\u1E89': 'w',
|
2940 |
-
'\u2C73': 'w',
|
2941 |
-
'\u24E7': 'x',
|
2942 |
-
'\uFF58': 'x',
|
2943 |
-
'\u1E8B': 'x',
|
2944 |
-
'\u1E8D': 'x',
|
2945 |
-
'\u24E8': 'y',
|
2946 |
-
'\uFF59': 'y',
|
2947 |
-
'\u1EF3': 'y',
|
2948 |
-
'\u00FD': 'y',
|
2949 |
-
'\u0177': 'y',
|
2950 |
-
'\u1EF9': 'y',
|
2951 |
-
'\u0233': 'y',
|
2952 |
-
'\u1E8F': 'y',
|
2953 |
-
'\u00FF': 'y',
|
2954 |
-
'\u1EF7': 'y',
|
2955 |
-
'\u1E99': 'y',
|
2956 |
-
'\u1EF5': 'y',
|
2957 |
-
'\u01B4': 'y',
|
2958 |
-
'\u024F': 'y',
|
2959 |
-
'\u1EFF': 'y',
|
2960 |
-
'\u24E9': 'z',
|
2961 |
-
'\uFF5A': 'z',
|
2962 |
-
'\u017A': 'z',
|
2963 |
-
'\u1E91': 'z',
|
2964 |
-
'\u017C': 'z',
|
2965 |
-
'\u017E': 'z',
|
2966 |
-
'\u1E93': 'z',
|
2967 |
-
'\u1E95': 'z',
|
2968 |
-
'\u01B6': 'z',
|
2969 |
-
'\u0225': 'z',
|
2970 |
-
'\u0240': 'z',
|
2971 |
-
'\u2C6C': 'z',
|
2972 |
-
'\uA763': 'z',
|
2973 |
-
'\u0386': '\u0391',
|
2974 |
-
'\u0388': '\u0395',
|
2975 |
-
'\u0389': '\u0397',
|
2976 |
-
'\u038A': '\u0399',
|
2977 |
-
'\u03AA': '\u0399',
|
2978 |
-
'\u038C': '\u039F',
|
2979 |
-
'\u038E': '\u03A5',
|
2980 |
-
'\u03AB': '\u03A5',
|
2981 |
-
'\u038F': '\u03A9',
|
2982 |
-
'\u03AC': '\u03B1',
|
2983 |
-
'\u03AD': '\u03B5',
|
2984 |
-
'\u03AE': '\u03B7',
|
2985 |
-
'\u03AF': '\u03B9',
|
2986 |
-
'\u03CA': '\u03B9',
|
2987 |
-
'\u0390': '\u03B9',
|
2988 |
-
'\u03CC': '\u03BF',
|
2989 |
-
'\u03CD': '\u03C5',
|
2990 |
-
'\u03CB': '\u03C5',
|
2991 |
-
'\u03B0': '\u03C5',
|
2992 |
-
'\u03C9': '\u03C9',
|
2993 |
-
'\u03C2': '\u03C3'
|
2994 |
-
};
|
2995 |
-
|
2996 |
-
return diacritics;
|
2997 |
-
});
|
2998 |
-
|
2999 |
-
S2.define('select2/data/base',[
|
3000 |
-
'../utils'
|
3001 |
-
], function (Utils) {
|
3002 |
-
function BaseAdapter ($element, options) {
|
3003 |
-
BaseAdapter.__super__.constructor.call(this);
|
3004 |
-
}
|
3005 |
-
|
3006 |
-
Utils.Extend(BaseAdapter, Utils.Observable);
|
3007 |
-
|
3008 |
-
BaseAdapter.prototype.current = function (callback) {
|
3009 |
-
throw new Error('The `current` method must be defined in child classes.');
|
3010 |
-
};
|
3011 |
-
|
3012 |
-
BaseAdapter.prototype.query = function (params, callback) {
|
3013 |
-
throw new Error('The `query` method must be defined in child classes.');
|
3014 |
-
};
|
3015 |
-
|
3016 |
-
BaseAdapter.prototype.bind = function (container, $container) {
|
3017 |
-
// Can be implemented in subclasses
|
3018 |
-
};
|
3019 |
-
|
3020 |
-
BaseAdapter.prototype.destroy = function () {
|
3021 |
-
// Can be implemented in subclasses
|
3022 |
-
};
|
3023 |
-
|
3024 |
-
BaseAdapter.prototype.generateResultId = function (container, data) {
|
3025 |
-
var id = container.id + '-result-';
|
3026 |
-
|
3027 |
-
id += Utils.generateChars(4);
|
3028 |
-
|
3029 |
-
if (data.id != null) {
|
3030 |
-
id += '-' + data.id.toString();
|
3031 |
-
} else {
|
3032 |
-
id += '-' + Utils.generateChars(4);
|
3033 |
-
}
|
3034 |
-
return id;
|
3035 |
-
};
|
3036 |
-
|
3037 |
-
return BaseAdapter;
|
3038 |
-
});
|
3039 |
-
|
3040 |
-
S2.define('select2/data/select',[
|
3041 |
-
'./base',
|
3042 |
-
'../utils',
|
3043 |
-
'jquery'
|
3044 |
-
], function (BaseAdapter, Utils, $) {
|
3045 |
-
function SelectAdapter ($element, options) {
|
3046 |
-
this.$element = $element;
|
3047 |
-
this.options = options;
|
3048 |
-
|
3049 |
-
SelectAdapter.__super__.constructor.call(this);
|
3050 |
-
}
|
3051 |
-
|
3052 |
-
Utils.Extend(SelectAdapter, BaseAdapter);
|
3053 |
-
|
3054 |
-
SelectAdapter.prototype.current = function (callback) {
|
3055 |
-
var data = [];
|
3056 |
-
var self = this;
|
3057 |
-
|
3058 |
-
this.$element.find(':selected').each(function () {
|
3059 |
-
var $option = $(this);
|
3060 |
-
|
3061 |
-
var option = self.item($option);
|
3062 |
-
|
3063 |
-
data.push(option);
|
3064 |
-
});
|
3065 |
-
|
3066 |
-
callback(data);
|
3067 |
-
};
|
3068 |
-
|
3069 |
-
SelectAdapter.prototype.select = function (data) {
|
3070 |
-
var self = this;
|
3071 |
-
|
3072 |
-
data.selected = true;
|
3073 |
-
|
3074 |
-
// If data.element is a DOM node, use it instead
|
3075 |
-
if ($(data.element).is('option')) {
|
3076 |
-
data.element.selected = true;
|
3077 |
-
|
3078 |
-
this.$element.trigger('change');
|
3079 |
-
|
3080 |
-
return;
|
3081 |
-
}
|
3082 |
-
|
3083 |
-
if (this.$element.prop('multiple')) {
|
3084 |
-
this.current(function (currentData) {
|
3085 |
-
var val = [];
|
3086 |
-
|
3087 |
-
data = [data];
|
3088 |
-
data.push.apply(data, currentData);
|
3089 |
-
|
3090 |
-
for (var d = 0; d < data.length; d++) {
|
3091 |
-
var id = data[d].id;
|
3092 |
-
|
3093 |
-
if ($.inArray(id, val) === -1) {
|
3094 |
-
val.push(id);
|
3095 |
-
}
|
3096 |
-
}
|
3097 |
-
|
3098 |
-
self.$element.val(val);
|
3099 |
-
self.$element.trigger('change');
|
3100 |
-
});
|
3101 |
-
} else {
|
3102 |
-
var val = data.id;
|
3103 |
-
|
3104 |
-
this.$element.val(val);
|
3105 |
-
this.$element.trigger('change');
|
3106 |
-
}
|
3107 |
-
};
|
3108 |
-
|
3109 |
-
SelectAdapter.prototype.unselect = function (data) {
|
3110 |
-
var self = this;
|
3111 |
-
|
3112 |
-
if (!this.$element.prop('multiple')) {
|
3113 |
-
return;
|
3114 |
-
}
|
3115 |
-
|
3116 |
-
data.selected = false;
|
3117 |
-
|
3118 |
-
if ($(data.element).is('option')) {
|
3119 |
-
data.element.selected = false;
|
3120 |
-
|
3121 |
-
this.$element.trigger('change');
|
3122 |
-
|
3123 |
-
return;
|
3124 |
-
}
|
3125 |
-
|
3126 |
-
this.current(function (currentData) {
|
3127 |
-
var val = [];
|
3128 |
-
|
3129 |
-
for (var d = 0; d < currentData.length; d++) {
|
3130 |
-
var id = currentData[d].id;
|
3131 |
-
|
3132 |
-
if (id !== data.id && $.inArray(id, val) === -1) {
|
3133 |
-
val.push(id);
|
3134 |
-
}
|
3135 |
-
}
|
3136 |
-
|
3137 |
-
self.$element.val(val);
|
3138 |
-
|
3139 |
-
self.$element.trigger('change');
|
3140 |
-
});
|
3141 |
-
};
|
3142 |
-
|
3143 |
-
SelectAdapter.prototype.bind = function (container, $container) {
|
3144 |
-
var self = this;
|
3145 |
-
|
3146 |
-
this.container = container;
|
3147 |
-
|
3148 |
-
container.on('select', function (params) {
|
3149 |
-
self.select(params.data);
|
3150 |
-
});
|
3151 |
-
|
3152 |
-
container.on('unselect', function (params) {
|
3153 |
-
self.unselect(params.data);
|
3154 |
-
});
|
3155 |
-
};
|
3156 |
-
|
3157 |
-
SelectAdapter.prototype.destroy = function () {
|
3158 |
-
// Remove anything added to child elements
|
3159 |
-
this.$element.find('*').each(function () {
|
3160 |
-
// Remove any custom data set by Select2
|
3161 |
-
$.removeData(this, 'data');
|
3162 |
-
});
|
3163 |
-
};
|
3164 |
-
|
3165 |
-
SelectAdapter.prototype.query = function (params, callback) {
|
3166 |
-
var data = [];
|
3167 |
-
var self = this;
|
3168 |
-
|
3169 |
-
var $options = this.$element.children();
|
3170 |
-
|
3171 |
-
$options.each(function () {
|
3172 |
-
var $option = $(this);
|
3173 |
-
|
3174 |
-
if (!$option.is('option') && !$option.is('optgroup')) {
|
3175 |
-
return;
|
3176 |
-
}
|
3177 |
-
|
3178 |
-
var option = self.item($option);
|
3179 |
-
|
3180 |
-
var matches = self.matches(params, option);
|
3181 |
-
|
3182 |
-
if (matches !== null) {
|
3183 |
-
data.push(matches);
|
3184 |
-
}
|
3185 |
-
});
|
3186 |
-
|
3187 |
-
callback({
|
3188 |
-
results: data
|
3189 |
-
});
|
3190 |
-
};
|
3191 |
-
|
3192 |
-
SelectAdapter.prototype.addOptions = function ($options) {
|
3193 |
-
Utils.appendMany(this.$element, $options);
|
3194 |
-
};
|
3195 |
-
|
3196 |
-
SelectAdapter.prototype.option = function (data) {
|
3197 |
-
var option;
|
3198 |
-
|
3199 |
-
if (data.children) {
|
3200 |
-
option = document.createElement('optgroup');
|
3201 |
-
option.label = data.text;
|
3202 |
-
} else {
|
3203 |
-
option = document.createElement('option');
|
3204 |
-
|
3205 |
-
if (option.textContent !== undefined) {
|
3206 |
-
option.textContent = data.text;
|
3207 |
-
} else {
|
3208 |
-
option.innerText = data.text;
|
3209 |
-
}
|
3210 |
-
}
|
3211 |
-
|
3212 |
-
if (data.id !== undefined) {
|
3213 |
-
option.value = data.id;
|
3214 |
-
}
|
3215 |
-
|
3216 |
-
if (data.disabled) {
|
3217 |
-
option.disabled = true;
|
3218 |
-
}
|
3219 |
-
|
3220 |
-
if (data.selected) {
|
3221 |
-
option.selected = true;
|
3222 |
-
}
|
3223 |
-
|
3224 |
-
if (data.title) {
|
3225 |
-
option.title = data.title;
|
3226 |
-
}
|
3227 |
-
|
3228 |
-
var $option = $(option);
|
3229 |
-
|
3230 |
-
var normalizedData = this._normalizeItem(data);
|
3231 |
-
normalizedData.element = option;
|
3232 |
-
|
3233 |
-
// Override the option's data with the combined data
|
3234 |
-
$.data(option, 'data', normalizedData);
|
3235 |
-
|
3236 |
-
return $option;
|
3237 |
-
};
|
3238 |
-
|
3239 |
-
SelectAdapter.prototype.item = function ($option) {
|
3240 |
-
var data = {};
|
3241 |
-
|
3242 |
-
data = $.data($option[0], 'data');
|
3243 |
-
|
3244 |
-
if (data != null) {
|
3245 |
-
return data;
|
3246 |
-
}
|
3247 |
-
|
3248 |
-
if ($option.is('option')) {
|
3249 |
-
data = {
|
3250 |
-
id: $option.val(),
|
3251 |
-
text: $option.text(),
|
3252 |
-
disabled: $option.prop('disabled'),
|
3253 |
-
selected: $option.prop('selected'),
|
3254 |
-
title: $option.prop('title')
|
3255 |
-
};
|
3256 |
-
} else if ($option.is('optgroup')) {
|
3257 |
-
data = {
|
3258 |
-
text: $option.prop('label'),
|
3259 |
-
children: [],
|
3260 |
-
title: $option.prop('title')
|
3261 |
-
};
|
3262 |
-
|
3263 |
-
var $children = $option.children('option');
|
3264 |
-
var children = [];
|
3265 |
-
|
3266 |
-
for (var c = 0; c < $children.length; c++) {
|
3267 |
-
var $child = $($children[c]);
|
3268 |
-
|
3269 |
-
var child = this.item($child);
|
3270 |
-
|
3271 |
-
children.push(child);
|
3272 |
-
}
|
3273 |
-
|
3274 |
-
data.children = children;
|
3275 |
-
}
|
3276 |
-
|
3277 |
-
data = this._normalizeItem(data);
|
3278 |
-
data.element = $option[0];
|
3279 |
-
|
3280 |
-
$.data($option[0], 'data', data);
|
3281 |
-
|
3282 |
-
return data;
|
3283 |
-
};
|
3284 |
-
|
3285 |
-
SelectAdapter.prototype._normalizeItem = function (item) {
|
3286 |
-
if (!$.isPlainObject(item)) {
|
3287 |
-
item = {
|
3288 |
-
id: item,
|
3289 |
-
text: item
|
3290 |
-
};
|
3291 |
-
}
|
3292 |
-
|
3293 |
-
item = $.extend({}, {
|
3294 |
-
text: ''
|
3295 |
-
}, item);
|
3296 |
-
|
3297 |
-
var defaults = {
|
3298 |
-
selected: false,
|
3299 |
-
disabled: false
|
3300 |
-
};
|
3301 |
-
|
3302 |
-
if (item.id != null) {
|
3303 |
-
item.id = item.id.toString();
|
3304 |
-
}
|
3305 |
-
|
3306 |
-
if (item.text != null) {
|
3307 |
-
item.text = item.text.toString();
|
3308 |
-
}
|
3309 |
-
|
3310 |
-
if (item._resultId == null && item.id && this.container != null) {
|
3311 |
-
item._resultId = this.generateResultId(this.container, item);
|
3312 |
-
}
|
3313 |
-
|
3314 |
-
return $.extend({}, defaults, item);
|
3315 |
-
};
|
3316 |
-
|
3317 |
-
SelectAdapter.prototype.matches = function (params, data) {
|
3318 |
-
var matcher = this.options.get('matcher');
|
3319 |
-
|
3320 |
-
return matcher(params, data);
|
3321 |
-
};
|
3322 |
-
|
3323 |
-
return SelectAdapter;
|
3324 |
-
});
|
3325 |
-
|
3326 |
-
S2.define('select2/data/array',[
|
3327 |
-
'./select',
|
3328 |
-
'../utils',
|
3329 |
-
'jquery'
|
3330 |
-
], function (SelectAdapter, Utils, $) {
|
3331 |
-
function ArrayAdapter ($element, options) {
|
3332 |
-
var data = options.get('data') || [];
|
3333 |
-
|
3334 |
-
ArrayAdapter.__super__.constructor.call(this, $element, options);
|
3335 |
-
|
3336 |
-
this.addOptions(this.convertToOptions(data));
|
3337 |
-
}
|
3338 |
-
|
3339 |
-
Utils.Extend(ArrayAdapter, SelectAdapter);
|
3340 |
-
|
3341 |
-
ArrayAdapter.prototype.select = function (data) {
|
3342 |
-
var $option = this.$element.find('option').filter(function (i, elm) {
|
3343 |
-
return elm.value == data.id.toString();
|
3344 |
-
});
|
3345 |
-
|
3346 |
-
if ($option.length === 0) {
|
3347 |
-
$option = this.option(data);
|
3348 |
-
|
3349 |
-
this.addOptions($option);
|
3350 |
-
}
|
3351 |
-
|
3352 |
-
ArrayAdapter.__super__.select.call(this, data);
|
3353 |
-
};
|
3354 |
-
|
3355 |
-
ArrayAdapter.prototype.convertToOptions = function (data) {
|
3356 |
-
var self = this;
|
3357 |
-
|
3358 |
-
var $existing = this.$element.find('option');
|
3359 |
-
var existingIds = $existing.map(function () {
|
3360 |
-
return self.item($(this)).id;
|
3361 |
-
}).get();
|
3362 |
-
|
3363 |
-
var $options = [];
|
3364 |
-
|
3365 |
-
// Filter out all items except for the one passed in the argument
|
3366 |
-
function onlyItem (item) {
|
3367 |
-
return function () {
|
3368 |
-
return $(this).val() == item.id;
|
3369 |
-
};
|
3370 |
-
}
|
3371 |
-
|
3372 |
-
for (var d = 0; d < data.length; d++) {
|
3373 |
-
var item = this._normalizeItem(data[d]);
|
3374 |
-
|
3375 |
-
// Skip items which were pre-loaded, only merge the data
|
3376 |
-
if ($.inArray(item.id, existingIds) >= 0) {
|
3377 |
-
var $existingOption = $existing.filter(onlyItem(item));
|
3378 |
-
|
3379 |
-
var existingData = this.item($existingOption);
|
3380 |
-
var newData = $.extend(true, {}, item, existingData);
|
3381 |
-
|
3382 |
-
var $newOption = this.option(newData);
|
3383 |
-
|
3384 |
-
$existingOption.replaceWith($newOption);
|
3385 |
-
|
3386 |
-
continue;
|
3387 |
-
}
|
3388 |
-
|
3389 |
-
var $option = this.option(item);
|
3390 |
-
|
3391 |
-
if (item.children) {
|
3392 |
-
var $children = this.convertToOptions(item.children);
|
3393 |
-
|
3394 |
-
Utils.appendMany($option, $children);
|
3395 |
-
}
|
3396 |
-
|
3397 |
-
$options.push($option);
|
3398 |
-
}
|
3399 |
-
|
3400 |
-
return $options;
|
3401 |
-
};
|
3402 |
-
|
3403 |
-
return ArrayAdapter;
|
3404 |
-
});
|
3405 |
-
|
3406 |
-
S2.define('select2/data/ajax',[
|
3407 |
-
'./array',
|
3408 |
-
'../utils',
|
3409 |
-
'jquery'
|
3410 |
-
], function (ArrayAdapter, Utils, $) {
|
3411 |
-
function AjaxAdapter ($element, options) {
|
3412 |
-
this.ajaxOptions = this._applyDefaults(options.get('ajax'));
|
3413 |
-
|
3414 |
-
if (this.ajaxOptions.processResults != null) {
|
3415 |
-
this.processResults = this.ajaxOptions.processResults;
|
3416 |
-
}
|
3417 |
-
|
3418 |
-
AjaxAdapter.__super__.constructor.call(this, $element, options);
|
3419 |
-
}
|
3420 |
-
|
3421 |
-
Utils.Extend(AjaxAdapter, ArrayAdapter);
|
3422 |
-
|
3423 |
-
AjaxAdapter.prototype._applyDefaults = function (options) {
|
3424 |
-
var defaults = {
|
3425 |
-
data: function (params) {
|
3426 |
-
return $.extend({}, params, {
|
3427 |
-
q: params.term
|
3428 |
-
});
|
3429 |
-
},
|
3430 |
-
transport: function (params, success, failure) {
|
3431 |
-
var $request = $.ajax(params);
|
3432 |
-
|
3433 |
-
$request.then(success);
|
3434 |
-
$request.fail(failure);
|
3435 |
-
|
3436 |
-
return $request;
|
3437 |
-
}
|
3438 |
-
};
|
3439 |
-
|
3440 |
-
return $.extend({}, defaults, options, true);
|
3441 |
-
};
|
3442 |
-
|
3443 |
-
AjaxAdapter.prototype.processResults = function (results) {
|
3444 |
-
return results;
|
3445 |
-
};
|
3446 |
-
|
3447 |
-
AjaxAdapter.prototype.query = function (params, callback) {
|
3448 |
-
var matches = [];
|
3449 |
-
var self = this;
|
3450 |
-
|
3451 |
-
if (this._request != null) {
|
3452 |
-
// JSONP requests cannot always be aborted
|
3453 |
-
if ($.isFunction(this._request.abort)) {
|
3454 |
-
this._request.abort();
|
3455 |
-
}
|
3456 |
-
|
3457 |
-
this._request = null;
|
3458 |
-
}
|
3459 |
-
|
3460 |
-
var options = $.extend({
|
3461 |
-
type: 'GET'
|
3462 |
-
}, this.ajaxOptions);
|
3463 |
-
|
3464 |
-
if (typeof options.url === 'function') {
|
3465 |
-
options.url = options.url.call(this.$element, params);
|
3466 |
-
}
|
3467 |
-
|
3468 |
-
if (typeof options.data === 'function') {
|
3469 |
-
options.data = options.data.call(this.$element, params);
|
3470 |
-
}
|
3471 |
-
|
3472 |
-
function request () {
|
3473 |
-
var $request = options.transport(options, function (data) {
|
3474 |
-
var results = self.processResults(data, params);
|
3475 |
-
|
3476 |
-
if (self.options.get('debug') && window.console && console.error) {
|
3477 |
-
// Check to make sure that the response included a `results` key.
|
3478 |
-
if (!results || !results.results || !$.isArray(results.results)) {
|
3479 |
-
console.error(
|
3480 |
-
'Select2: The AJAX results did not return an array in the ' +
|
3481 |
-
'`results` key of the response.'
|
3482 |
-
);
|
3483 |
-
}
|
3484 |
-
}
|
3485 |
-
|
3486 |
-
callback(results);
|
3487 |
-
}, function () {
|
3488 |
-
// Attempt to detect if a request was aborted
|
3489 |
-
// Only works if the transport exposes a status property
|
3490 |
-
if ($request.status && $request.status === '0') {
|
3491 |
-
return;
|
3492 |
-
}
|
3493 |
-
|
3494 |
-
self.trigger('results:message', {
|
3495 |
-
message: 'errorLoading'
|
3496 |
-
});
|
3497 |
-
});
|
3498 |
-
|
3499 |
-
self._request = $request;
|
3500 |
-
}
|
3501 |
-
|
3502 |
-
if (this.ajaxOptions.delay && params.term != null) {
|
3503 |
-
if (this._queryTimeout) {
|
3504 |
-
window.clearTimeout(this._queryTimeout);
|
3505 |
-
}
|
3506 |
-
|
3507 |
-
this._queryTimeout = window.setTimeout(request, this.ajaxOptions.delay);
|
3508 |
-
} else {
|
3509 |
-
request();
|
3510 |
-
}
|
3511 |
-
};
|
3512 |
-
|
3513 |
-
return AjaxAdapter;
|
3514 |
-
});
|
3515 |
-
|
3516 |
-
S2.define('select2/data/tags',[
|
3517 |
-
'jquery'
|
3518 |
-
], function ($) {
|
3519 |
-
function Tags (decorated, $element, options) {
|
3520 |
-
var tags = options.get('tags');
|
3521 |
-
|
3522 |
-
var createTag = options.get('createTag');
|
3523 |
-
|
3524 |
-
if (createTag !== undefined) {
|
3525 |
-
this.createTag = createTag;
|
3526 |
-
}
|
3527 |
-
|
3528 |
-
var insertTag = options.get('insertTag');
|
3529 |
-
|
3530 |
-
if (insertTag !== undefined) {
|
3531 |
-
this.insertTag = insertTag;
|
3532 |
-
}
|
3533 |
-
|
3534 |
-
decorated.call(this, $element, options);
|
3535 |
-
|
3536 |
-
if ($.isArray(tags)) {
|
3537 |
-
for (var t = 0; t < tags.length; t++) {
|
3538 |
-
var tag = tags[t];
|
3539 |
-
var item = this._normalizeItem(tag);
|
3540 |
-
|
3541 |
-
var $option = this.option(item);
|
3542 |
-
|
3543 |
-
this.$element.append($option);
|
3544 |
-
}
|
3545 |
-
}
|
3546 |
-
}
|
3547 |
-
|
3548 |
-
Tags.prototype.query = function (decorated, params, callback) {
|
3549 |
-
var self = this;
|
3550 |
-
|
3551 |
-
this._removeOldTags();
|
3552 |
-
|
3553 |
-
if (params.term == null || params.page != null) {
|
3554 |
-
decorated.call(this, params, callback);
|
3555 |
-
return;
|
3556 |
-
}
|
3557 |
-
|
3558 |
-
function wrapper (obj, child) {
|
3559 |
-
var data = obj.results;
|
3560 |
-
|
3561 |
-
for (var i = 0; i < data.length; i++) {
|
3562 |
-
var option = data[i];
|
3563 |
-
|
3564 |
-
var checkChildren = (
|
3565 |
-
option.children != null &&
|
3566 |
-
!wrapper({
|
3567 |
-
results: option.children
|
3568 |
-
}, true)
|
3569 |
-
);
|
3570 |
-
|
3571 |
-
var optionText = (option.text || '').toUpperCase();
|
3572 |
-
var paramsTerm = (params.term || '').toUpperCase();
|
3573 |
-
|
3574 |
-
var checkText = optionText === paramsTerm;
|
3575 |
-
|
3576 |
-
if (checkText || checkChildren) {
|
3577 |
-
if (child) {
|
3578 |
-
return false;
|
3579 |
-
}
|
3580 |
-
|
3581 |
-
obj.data = data;
|
3582 |
-
callback(obj);
|
3583 |
-
|
3584 |
-
return;
|
3585 |
-
}
|
3586 |
-
}
|
3587 |
-
|
3588 |
-
if (child) {
|
3589 |
-
return true;
|
3590 |
-
}
|
3591 |
-
|
3592 |
-
var tag = self.createTag(params);
|
3593 |
-
|
3594 |
-
if (tag != null) {
|
3595 |
-
var $option = self.option(tag);
|
3596 |
-
$option.attr('data-select2-tag', true);
|
3597 |
-
|
3598 |
-
self.addOptions([$option]);
|
3599 |
-
|
3600 |
-
self.insertTag(data, tag);
|
3601 |
-
}
|
3602 |
-
|
3603 |
-
obj.results = data;
|
3604 |
-
|
3605 |
-
callback(obj);
|
3606 |
-
}
|
3607 |
-
|
3608 |
-
decorated.call(this, params, wrapper);
|
3609 |
-
};
|
3610 |
-
|
3611 |
-
Tags.prototype.createTag = function (decorated, params) {
|
3612 |
-
var term = $.trim(params.term);
|
3613 |
-
|
3614 |
-
if (term === '') {
|
3615 |
-
return null;
|
3616 |
-
}
|
3617 |
-
|
3618 |
-
return {
|
3619 |
-
id: term,
|
3620 |
-
text: term
|
3621 |
-
};
|
3622 |
-
};
|
3623 |
-
|
3624 |
-
Tags.prototype.insertTag = function (_, data, tag) {
|
3625 |
-
data.unshift(tag);
|
3626 |
-
};
|
3627 |
-
|
3628 |
-
Tags.prototype._removeOldTags = function (_) {
|
3629 |
-
var tag = this._lastTag;
|
3630 |
-
|
3631 |
-
var $options = this.$element.find('option[data-select2-tag]');
|
3632 |
-
|
3633 |
-
$options.each(function () {
|
3634 |
-
if (this.selected) {
|
3635 |
-
return;
|
3636 |
-
}
|
3637 |
-
|
3638 |
-
$(this).remove();
|
3639 |
-
});
|
3640 |
-
};
|
3641 |
-
|
3642 |
-
return Tags;
|
3643 |
-
});
|
3644 |
-
|
3645 |
-
S2.define('select2/data/tokenizer',[
|
3646 |
-
'jquery'
|
3647 |
-
], function ($) {
|
3648 |
-
function Tokenizer (decorated, $element, options) {
|
3649 |
-
var tokenizer = options.get('tokenizer');
|
3650 |
-
|
3651 |
-
if (tokenizer !== undefined) {
|
3652 |
-
this.tokenizer = tokenizer;
|
3653 |
-
}
|
3654 |
-
|
3655 |
-
decorated.call(this, $element, options);
|
3656 |
-
}
|
3657 |
-
|
3658 |
-
Tokenizer.prototype.bind = function (decorated, container, $container) {
|
3659 |
-
decorated.call(this, container, $container);
|
3660 |
-
|
3661 |
-
this.$search = container.dropdown.$search || container.selection.$search ||
|
3662 |
-
$container.find('.select2-search__field');
|
3663 |
-
};
|
3664 |
-
|
3665 |
-
Tokenizer.prototype.query = function (decorated, params, callback) {
|
3666 |
-
var self = this;
|
3667 |
-
|
3668 |
-
function createAndSelect (data) {
|
3669 |
-
// Normalize the data object so we can use it for checks
|
3670 |
-
var item = self._normalizeItem(data);
|
3671 |
-
|
3672 |
-
// Check if the data object already exists as a tag
|
3673 |
-
// Select it if it doesn't
|
3674 |
-
var $existingOptions = self.$element.find('option').filter(function () {
|
3675 |
-
return $(this).val() === item.id;
|
3676 |
-
});
|
3677 |
-
|
3678 |
-
// If an existing option wasn't found for it, create the option
|
3679 |
-
if (!$existingOptions.length) {
|
3680 |
-
var $option = self.option(item);
|
3681 |
-
$option.attr('data-select2-tag', true);
|
3682 |
-
|
3683 |
-
self._removeOldTags();
|
3684 |
-
self.addOptions([$option]);
|
3685 |
-
}
|
3686 |
-
|
3687 |
-
// Select the item, now that we know there is an option for it
|
3688 |
-
select(item);
|
3689 |
-
}
|
3690 |
-
|
3691 |
-
function select (data) {
|
3692 |
-
self.trigger('select', {
|
3693 |
-
data: data
|
3694 |
-
});
|
3695 |
-
}
|
3696 |
-
|
3697 |
-
params.term = params.term || '';
|
3698 |
-
|
3699 |
-
var tokenData = this.tokenizer(params, this.options, createAndSelect);
|
3700 |
-
|
3701 |
-
if (tokenData.term !== params.term) {
|
3702 |
-
// Replace the search term if we have the search box
|
3703 |
-
if (this.$search.length) {
|
3704 |
-
this.$search.val(tokenData.term);
|
3705 |
-
this.$search.focus();
|
3706 |
-
}
|
3707 |
-
|
3708 |
-
params.term = tokenData.term;
|
3709 |
-
}
|
3710 |
-
|
3711 |
-
decorated.call(this, params, callback);
|
3712 |
-
};
|
3713 |
-
|
3714 |
-
Tokenizer.prototype.tokenizer = function (_, params, options, callback) {
|
3715 |
-
var separators = options.get('tokenSeparators') || [];
|
3716 |
-
var term = params.term;
|
3717 |
-
var i = 0;
|
3718 |
-
|
3719 |
-
var createTag = this.createTag || function (params) {
|
3720 |
-
return {
|
3721 |
-
id: params.term,
|
3722 |
-
text: params.term
|
3723 |
-
};
|
3724 |
-
};
|
3725 |
-
|
3726 |
-
while (i < term.length) {
|
3727 |
-
var termChar = term[i];
|
3728 |
-
|
3729 |
-
if ($.inArray(termChar, separators) === -1) {
|
3730 |
-
i++;
|
3731 |
-
|
3732 |
-
continue;
|
3733 |
-
}
|
3734 |
-
|
3735 |
-
var part = term.substr(0, i);
|
3736 |
-
var partParams = $.extend({}, params, {
|
3737 |
-
term: part
|
3738 |
-
});
|
3739 |
-
|
3740 |
-
var data = createTag(partParams);
|
3741 |
-
|
3742 |
-
if (data == null) {
|
3743 |
-
i++;
|
3744 |
-
continue;
|
3745 |
-
}
|
3746 |
-
|
3747 |
-
callback(data);
|
3748 |
-
|
3749 |
-
// Reset the term to not include the tokenized portion
|
3750 |
-
term = term.substr(i + 1) || '';
|
3751 |
-
i = 0;
|
3752 |
-
}
|
3753 |
-
|
3754 |
-
return {
|
3755 |
-
term: term
|
3756 |
-
};
|
3757 |
-
};
|
3758 |
-
|
3759 |
-
return Tokenizer;
|
3760 |
-
});
|
3761 |
-
|
3762 |
-
S2.define('select2/data/minimumInputLength',[
|
3763 |
-
|
3764 |
-
], function () {
|
3765 |
-
function MinimumInputLength (decorated, $e, options) {
|
3766 |
-
this.minimumInputLength = options.get('minimumInputLength');
|
3767 |
-
|
3768 |
-
decorated.call(this, $e, options);
|
3769 |
-
}
|
3770 |
-
|
3771 |
-
MinimumInputLength.prototype.query = function (decorated, params, callback) {
|
3772 |
-
params.term = params.term || '';
|
3773 |
-
|
3774 |
-
if (params.term.length < this.minimumInputLength) {
|
3775 |
-
this.trigger('results:message', {
|
3776 |
-
message: 'inputTooShort',
|
3777 |
-
args: {
|
3778 |
-
minimum: this.minimumInputLength,
|
3779 |
-
input: params.term,
|
3780 |
-
params: params
|
3781 |
-
}
|
3782 |
-
});
|
3783 |
-
|
3784 |
-
return;
|
3785 |
-
}
|
3786 |
-
|
3787 |
-
decorated.call(this, params, callback);
|
3788 |
-
};
|
3789 |
-
|
3790 |
-
return MinimumInputLength;
|
3791 |
-
});
|
3792 |
-
|
3793 |
-
S2.define('select2/data/maximumInputLength',[
|
3794 |
-
|
3795 |
-
], function () {
|
3796 |
-
function MaximumInputLength (decorated, $e, options) {
|
3797 |
-
this.maximumInputLength = options.get('maximumInputLength');
|
3798 |
-
|
3799 |
-
decorated.call(this, $e, options);
|
3800 |
-
}
|
3801 |
-
|
3802 |
-
MaximumInputLength.prototype.query = function (decorated, params, callback) {
|
3803 |
-
params.term = params.term || '';
|
3804 |
-
|
3805 |
-
if (this.maximumInputLength > 0 &&
|
3806 |
-
params.term.length > this.maximumInputLength) {
|
3807 |
-
this.trigger('results:message', {
|
3808 |
-
message: 'inputTooLong',
|
3809 |
-
args: {
|
3810 |
-
maximum: this.maximumInputLength,
|
3811 |
-
input: params.term,
|
3812 |
-
params: params
|
3813 |
-
}
|
3814 |
-
});
|
3815 |
-
|
3816 |
-
return;
|
3817 |
-
}
|
3818 |
-
|
3819 |
-
decorated.call(this, params, callback);
|
3820 |
-
};
|
3821 |
-
|
3822 |
-
return MaximumInputLength;
|
3823 |
-
});
|
3824 |
-
|
3825 |
-
S2.define('select2/data/maximumSelectionLength',[
|
3826 |
-
|
3827 |
-
], function (){
|
3828 |
-
function MaximumSelectionLength (decorated, $e, options) {
|
3829 |
-
this.maximumSelectionLength = options.get('maximumSelectionLength');
|
3830 |
-
|
3831 |
-
decorated.call(this, $e, options);
|
3832 |
-
}
|
3833 |
-
|
3834 |
-
MaximumSelectionLength.prototype.query =
|
3835 |
-
function (decorated, params, callback) {
|
3836 |
-
var self = this;
|
3837 |
-
|
3838 |
-
this.current(function (currentData) {
|
3839 |
-
var count = currentData != null ? currentData.length : 0;
|
3840 |
-
if (self.maximumSelectionLength > 0 &&
|
3841 |
-
count >= self.maximumSelectionLength) {
|
3842 |
-
self.trigger('results:message', {
|
3843 |
-
message: 'maximumSelected',
|
3844 |
-
args: {
|
3845 |
-
maximum: self.maximumSelectionLength
|
3846 |
-
}
|
3847 |
-
});
|
3848 |
-
return;
|
3849 |
-
}
|
3850 |
-
decorated.call(self, params, callback);
|
3851 |
-
});
|
3852 |
-
};
|
3853 |
-
|
3854 |
-
return MaximumSelectionLength;
|
3855 |
-
});
|
3856 |
-
|
3857 |
-
S2.define('select2/dropdown',[
|
3858 |
-
'jquery',
|
3859 |
-
'./utils'
|
3860 |
-
], function ($, Utils) {
|
3861 |
-
function Dropdown ($element, options) {
|
3862 |
-
this.$element = $element;
|
3863 |
-
this.options = options;
|
3864 |
-
|
3865 |
-
Dropdown.__super__.constructor.call(this);
|
3866 |
-
}
|
3867 |
-
|
3868 |
-
Utils.Extend(Dropdown, Utils.Observable);
|
3869 |
-
|
3870 |
-
Dropdown.prototype.render = function () {
|
3871 |
-
var $dropdown = $(
|
3872 |
-
'<span class="select2-dropdown">' +
|
3873 |
-
'<span class="select2-results"></span>' +
|
3874 |
-
'</span>'
|
3875 |
-
);
|
3876 |
-
|
3877 |
-
$dropdown.attr('dir', this.options.get('dir'));
|
3878 |
-
|
3879 |
-
this.$dropdown = $dropdown;
|
3880 |
-
|
3881 |
-
return $dropdown;
|
3882 |
-
};
|
3883 |
-
|
3884 |
-
Dropdown.prototype.bind = function () {
|
3885 |
-
// Should be implemented in subclasses
|
3886 |
-
};
|
3887 |
-
|
3888 |
-
Dropdown.prototype.position = function ($dropdown, $container) {
|
3889 |
-
// Should be implmented in subclasses
|
3890 |
-
};
|
3891 |
-
|
3892 |
-
Dropdown.prototype.destroy = function () {
|
3893 |
-
// Remove the dropdown from the DOM
|
3894 |
-
this.$dropdown.remove();
|
3895 |
-
};
|
3896 |
-
|
3897 |
-
return Dropdown;
|
3898 |
-
});
|
3899 |
-
|
3900 |
-
S2.define('select2/dropdown/search',[
|
3901 |
-
'jquery',
|
3902 |
-
'../utils'
|
3903 |
-
], function ($, Utils) {
|
3904 |
-
function Search () { }
|
3905 |
-
|
3906 |
-
Search.prototype.render = function (decorated) {
|
3907 |
-
var $rendered = decorated.call(this);
|
3908 |
-
|
3909 |
-
var $search = $(
|
3910 |
-
'<span class="select2-search select2-search--dropdown">' +
|
3911 |
-
'<input class="select2-search__field" type="search" tabindex="-1"' +
|
3912 |
-
' autocomplete="off" autocorrect="off" autocapitalize="none"' +
|
3913 |
-
' spellcheck="false" role="textbox" />' +
|
3914 |
-
'</span>'
|
3915 |
-
);
|
3916 |
-
|
3917 |
-
this.$searchContainer = $search;
|
3918 |
-
this.$search = $search.find('input');
|
3919 |
-
|
3920 |
-
$rendered.prepend($search);
|
3921 |
-
|
3922 |
-
return $rendered;
|
3923 |
-
};
|
3924 |
-
|
3925 |
-
Search.prototype.bind = function (decorated, container, $container) {
|
3926 |
-
var self = this;
|
3927 |
-
|
3928 |
-
decorated.call(this, container, $container);
|
3929 |
-
|
3930 |
-
this.$search.on('keydown', function (evt) {
|
3931 |
-
self.trigger('keypress', evt);
|
3932 |
-
|
3933 |
-
self._keyUpPrevented = evt.isDefaultPrevented();
|
3934 |
-
});
|
3935 |
-
|
3936 |
-
// Workaround for browsers which do not support the `input` event
|
3937 |
-
// This will prevent double-triggering of events for browsers which support
|
3938 |
-
// both the `keyup` and `input` events.
|
3939 |
-
this.$search.on('input', function (evt) {
|
3940 |
-
// Unbind the duplicated `keyup` event
|
3941 |
-
$(this).off('keyup');
|
3942 |
-
});
|
3943 |
-
|
3944 |
-
this.$search.on('keyup input', function (evt) {
|
3945 |
-
self.handleSearch(evt);
|
3946 |
-
});
|
3947 |
-
|
3948 |
-
container.on('open', function () {
|
3949 |
-
self.$search.attr('tabindex', 0);
|
3950 |
-
|
3951 |
-
self.$search.focus();
|
3952 |
-
|
3953 |
-
window.setTimeout(function () {
|
3954 |
-
self.$search.focus();
|
3955 |
-
}, 0);
|
3956 |
-
});
|
3957 |
-
|
3958 |
-
container.on('close', function () {
|
3959 |
-
self.$search.attr('tabindex', -1);
|
3960 |
-
|
3961 |
-
self.$search.val('');
|
3962 |
-
});
|
3963 |
-
|
3964 |
-
container.on('focus', function () {
|
3965 |
-
if (!container.isOpen()) {
|
3966 |
-
self.$search.focus();
|
3967 |
-
}
|
3968 |
-
});
|
3969 |
-
|
3970 |
-
container.on('results:all', function (params) {
|
3971 |
-
if (params.query.term == null || params.query.term === '') {
|
3972 |
-
var showSearch = self.showSearch(params);
|
3973 |
-
|
3974 |
-
if (showSearch) {
|
3975 |
-
self.$searchContainer.removeClass('select2-search--hide');
|
3976 |
-
} else {
|
3977 |
-
self.$searchContainer.addClass('select2-search--hide');
|
3978 |
-
}
|
3979 |
-
}
|
3980 |
-
});
|
3981 |
-
};
|
3982 |
-
|
3983 |
-
Search.prototype.handleSearch = function (evt) {
|
3984 |
-
if (!this._keyUpPrevented) {
|
3985 |
-
var input = this.$search.val();
|
3986 |
-
|
3987 |
-
this.trigger('query', {
|
3988 |
-
term: input
|
3989 |
-
});
|
3990 |
-
}
|
3991 |
-
|
3992 |
-
this._keyUpPrevented = false;
|
3993 |
-
};
|
3994 |
-
|
3995 |
-
Search.prototype.showSearch = function (_, params) {
|
3996 |
-
return true;
|
3997 |
-
};
|
3998 |
-
|
3999 |
-
return Search;
|
4000 |
-
});
|
4001 |
-
|
4002 |
-
S2.define('select2/dropdown/hidePlaceholder',[
|
4003 |
-
|
4004 |
-
], function () {
|
4005 |
-
function HidePlaceholder (decorated, $element, options, dataAdapter) {
|
4006 |
-
this.placeholder = this.normalizePlaceholder(options.get('placeholder'));
|
4007 |
-
|
4008 |
-
decorated.call(this, $element, options, dataAdapter);
|
4009 |
-
}
|
4010 |
-
|
4011 |
-
HidePlaceholder.prototype.append = function (decorated, data) {
|
4012 |
-
data.results = this.removePlaceholder(data.results);
|
4013 |
-
|
4014 |
-
decorated.call(this, data);
|
4015 |
-
};
|
4016 |
-
|
4017 |
-
HidePlaceholder.prototype.normalizePlaceholder = function (_, placeholder) {
|
4018 |
-
if (typeof placeholder === 'string') {
|
4019 |
-
placeholder = {
|
4020 |
-
id: '',
|
4021 |
-
text: placeholder
|
4022 |
-
};
|
4023 |
-
}
|
4024 |
-
|
4025 |
-
return placeholder;
|
4026 |
-
};
|
4027 |
-
|
4028 |
-
HidePlaceholder.prototype.removePlaceholder = function (_, data) {
|
4029 |
-
var modifiedData = data.slice(0);
|
4030 |
-
|
4031 |
-
for (var d = data.length - 1; d >= 0; d--) {
|
4032 |
-
var item = data[d];
|
4033 |
-
|
4034 |
-
if (this.placeholder.id === item.id) {
|
4035 |
-
modifiedData.splice(d, 1);
|
4036 |
-
}
|
4037 |
-
}
|
4038 |
-
|
4039 |
-
return modifiedData;
|
4040 |
-
};
|
4041 |
-
|
4042 |
-
return HidePlaceholder;
|
4043 |
-
});
|
4044 |
-
|
4045 |
-
S2.define('select2/dropdown/infiniteScroll',[
|
4046 |
-
'jquery'
|
4047 |
-
], function ($) {
|
4048 |
-
function InfiniteScroll (decorated, $element, options, dataAdapter) {
|
4049 |
-
this.lastParams = {};
|
4050 |
-
|
4051 |
-
decorated.call(this, $element, options, dataAdapter);
|
4052 |
-
|
4053 |
-
this.$loadingMore = this.createLoadingMore();
|
4054 |
-
this.loading = false;
|
4055 |
-
}
|
4056 |
-
|
4057 |
-
InfiniteScroll.prototype.append = function (decorated, data) {
|
4058 |
-
this.$loadingMore.remove();
|
4059 |
-
this.loading = false;
|
4060 |
-
|
4061 |
-
decorated.call(this, data);
|
4062 |
-
|
4063 |
-
if (this.showLoadingMore(data)) {
|
4064 |
-
this.$results.append(this.$loadingMore);
|
4065 |
-
}
|
4066 |
-
};
|
4067 |
-
|
4068 |
-
InfiniteScroll.prototype.bind = function (decorated, container, $container) {
|
4069 |
-
var self = this;
|
4070 |
-
|
4071 |
-
decorated.call(this, container, $container);
|
4072 |
-
|
4073 |
-
container.on('query', function (params) {
|
4074 |
-
self.lastParams = params;
|
4075 |
-
self.loading = true;
|
4076 |
-
});
|
4077 |
-
|
4078 |
-
container.on('query:append', function (params) {
|
4079 |
-
self.lastParams = params;
|
4080 |
-
self.loading = true;
|
4081 |
-
});
|
4082 |
-
|
4083 |
-
this.$results.on('scroll', function () {
|
4084 |
-
var isLoadMoreVisible = $.contains(
|
4085 |
-
document.documentElement,
|
4086 |
-
self.$loadingMore[0]
|
4087 |
-
);
|
4088 |
-
|
4089 |
-
if (self.loading || !isLoadMoreVisible) {
|
4090 |
-
return;
|
4091 |
-
}
|
4092 |
-
|
4093 |
-
var currentOffset = self.$results.offset().top +
|
4094 |
-
self.$results.outerHeight(false);
|
4095 |
-
var loadingMoreOffset = self.$loadingMore.offset().top +
|
4096 |
-
self.$loadingMore.outerHeight(false);
|
4097 |
-
|
4098 |
-
if (currentOffset + 50 >= loadingMoreOffset) {
|
4099 |
-
self.loadMore();
|
4100 |
-
}
|
4101 |
-
});
|
4102 |
-
};
|
4103 |
-
|
4104 |
-
InfiniteScroll.prototype.loadMore = function () {
|
4105 |
-
this.loading = true;
|
4106 |
-
|
4107 |
-
var params = $.extend({}, {page: 1}, this.lastParams);
|
4108 |
-
|
4109 |
-
params.page++;
|
4110 |
-
|
4111 |
-
this.trigger('query:append', params);
|
4112 |
-
};
|
4113 |
-
|
4114 |
-
InfiniteScroll.prototype.showLoadingMore = function (_, data) {
|
4115 |
-
return data.pagination && data.pagination.more;
|
4116 |
-
};
|
4117 |
-
|
4118 |
-
InfiniteScroll.prototype.createLoadingMore = function () {
|
4119 |
-
var $option = $(
|
4120 |
-
'<li ' +
|
4121 |
-
'class="select2-results__option select2-results__option--load-more"' +
|
4122 |
-
'role="treeitem" aria-disabled="true"></li>'
|
4123 |
-
);
|
4124 |
-
|
4125 |
-
var message = this.options.get('translations').get('loadingMore');
|
4126 |
-
|
4127 |
-
$option.html(message(this.lastParams));
|
4128 |
-
|
4129 |
-
return $option;
|
4130 |
-
};
|
4131 |
-
|
4132 |
-
return InfiniteScroll;
|
4133 |
-
});
|
4134 |
-
|
4135 |
-
S2.define('select2/dropdown/attachBody',[
|
4136 |
-
'jquery',
|
4137 |
-
'../utils'
|
4138 |
-
], function ($, Utils) {
|
4139 |
-
function AttachBody (decorated, $element, options) {
|
4140 |
-
this.$dropdownParent = options.get('dropdownParent') || $(document.body);
|
4141 |
-
|
4142 |
-
decorated.call(this, $element, options);
|
4143 |
-
}
|
4144 |
-
|
4145 |
-
AttachBody.prototype.bind = function (decorated, container, $container) {
|
4146 |
-
var self = this;
|
4147 |
-
|
4148 |
-
var setupResultsEvents = false;
|
4149 |
-
|
4150 |
-
decorated.call(this, container, $container);
|
4151 |
-
|
4152 |
-
container.on('open', function () {
|
4153 |
-
self._showDropdown();
|
4154 |
-
self._attachPositioningHandler(container);
|
4155 |
-
|
4156 |
-
if (!setupResultsEvents) {
|
4157 |
-
setupResultsEvents = true;
|
4158 |
-
|
4159 |
-
container.on('results:all', function () {
|
4160 |
-
self._positionDropdown();
|
4161 |
-
self._resizeDropdown();
|
4162 |
-
});
|
4163 |
-
|
4164 |
-
container.on('results:append', function () {
|
4165 |
-
self._positionDropdown();
|
4166 |
-
self._resizeDropdown();
|
4167 |
-
});
|
4168 |
-
}
|
4169 |
-
});
|
4170 |
-
|
4171 |
-
container.on('close', function () {
|
4172 |
-
self._hideDropdown();
|
4173 |
-
self._detachPositioningHandler(container);
|
4174 |
-
});
|
4175 |
-
|
4176 |
-
this.$dropdownContainer.on('mousedown', function (evt) {
|
4177 |
-
evt.stopPropagation();
|
4178 |
-
});
|
4179 |
-
};
|
4180 |
-
|
4181 |
-
AttachBody.prototype.destroy = function (decorated) {
|
4182 |
-
decorated.call(this);
|
4183 |
-
|
4184 |
-
this.$dropdownContainer.remove();
|
4185 |
-
};
|
4186 |
-
|
4187 |
-
AttachBody.prototype.position = function (decorated, $dropdown, $container) {
|
4188 |
-
// Clone all of the container classes
|
4189 |
-
$dropdown.attr('class', $container.attr('class'));
|
4190 |
-
|
4191 |
-
$dropdown.removeClass('select2');
|
4192 |
-
$dropdown.addClass('select2-container--open');
|
4193 |
-
|
4194 |
-
$dropdown.css({
|
4195 |
-
position: 'absolute',
|
4196 |
-
top: -999999
|
4197 |
-
});
|
4198 |
-
|
4199 |
-
this.$container = $container;
|
4200 |
-
};
|
4201 |
-
|
4202 |
-
AttachBody.prototype.render = function (decorated) {
|
4203 |
-
var $container = $('<span></span>');
|
4204 |
-
|
4205 |
-
var $dropdown = decorated.call(this);
|
4206 |
-
$container.append($dropdown);
|
4207 |
-
|
4208 |
-
this.$dropdownContainer = $container;
|
4209 |
-
|
4210 |
-
return $container;
|
4211 |
-
};
|
4212 |
-
|
4213 |
-
AttachBody.prototype._hideDropdown = function (decorated) {
|
4214 |
-
this.$dropdownContainer.detach();
|
4215 |
-
};
|
4216 |
-
|
4217 |
-
AttachBody.prototype._attachPositioningHandler =
|
4218 |
-
function (decorated, container) {
|
4219 |
-
var self = this;
|
4220 |
-
|
4221 |
-
var scrollEvent = 'scroll.select2.' + container.id;
|
4222 |
-
var resizeEvent = 'resize.select2.' + container.id;
|
4223 |
-
var orientationEvent = 'orientationchange.select2.' + container.id;
|
4224 |
-
|
4225 |
-
var $watchers = this.$container.parents().filter(Utils.hasScroll);
|
4226 |
-
$watchers.each(function () {
|
4227 |
-
$(this).data('select2-scroll-position', {
|
4228 |
-
x: $(this).scrollLeft(),
|
4229 |
-
y: $(this).scrollTop()
|
4230 |
-
});
|
4231 |
-
});
|
4232 |
-
|
4233 |
-
$watchers.on(scrollEvent, function (ev) {
|
4234 |
-
var position = $(this).data('select2-scroll-position');
|
4235 |
-
$(this).scrollTop(position.y);
|
4236 |
-
});
|
4237 |
-
|
4238 |
-
$(window).on(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent,
|
4239 |
-
function (e) {
|
4240 |
-
self._positionDropdown();
|
4241 |
-
self._resizeDropdown();
|
4242 |
-
});
|
4243 |
-
};
|
4244 |
-
|
4245 |
-
AttachBody.prototype._detachPositioningHandler =
|
4246 |
-
function (decorated, container) {
|
4247 |
-
var scrollEvent = 'scroll.select2.' + container.id;
|
4248 |
-
var resizeEvent = 'resize.select2.' + container.id;
|
4249 |
-
var orientationEvent = 'orientationchange.select2.' + container.id;
|
4250 |
-
|
4251 |
-
var $watchers = this.$container.parents().filter(Utils.hasScroll);
|
4252 |
-
$watchers.off(scrollEvent);
|
4253 |
-
|
4254 |
-
$(window).off(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent);
|
4255 |
-
};
|
4256 |
-
|
4257 |
-
AttachBody.prototype._positionDropdown = function () {
|
4258 |
-
var $window = $(window);
|
4259 |
-
|
4260 |
-
var isCurrentlyAbove = this.$dropdown.hasClass('select2-dropdown--above');
|
4261 |
-
var isCurrentlyBelow = this.$dropdown.hasClass('select2-dropdown--below');
|
4262 |
-
|
4263 |
-
var newDirection = null;
|
4264 |
-
|
4265 |
-
var offset = this.$container.offset();
|
4266 |
-
|
4267 |
-
offset.bottom = offset.top + this.$container.outerHeight(false);
|
4268 |
-
|
4269 |
-
var container = {
|
4270 |
-
height: this.$container.outerHeight(false)
|
4271 |
-
};
|
4272 |
-
|
4273 |
-
container.top = offset.top;
|
4274 |
-
container.bottom = offset.top + container.height;
|
4275 |
-
|
4276 |
-
var dropdown = {
|
4277 |
-
height: this.$dropdown.outerHeight(false)
|
4278 |
-
};
|
4279 |
-
|
4280 |
-
var viewport = {
|
4281 |
-
top: $window.scrollTop(),
|
4282 |
-
bottom: $window.scrollTop() + $window.height()
|
4283 |
-
};
|
4284 |
-
|
4285 |
-
var enoughRoomAbove = viewport.top < (offset.top - dropdown.height);
|
4286 |
-
var enoughRoomBelow = viewport.bottom > (offset.bottom + dropdown.height);
|
4287 |
-
|
4288 |
-
var css = {
|
4289 |
-
left: offset.left,
|
4290 |
-
top: container.bottom
|
4291 |
-
};
|
4292 |
-
|
4293 |
-
// Determine what the parent element is to use for calciulating the offset
|
4294 |
-
var $offsetParent = this.$dropdownParent;
|
4295 |
-
|
4296 |
-
// For statically positoned elements, we need to get the element
|
4297 |
-
// that is determining the offset
|
4298 |
-
if ($offsetParent.css('position') === 'static') {
|
4299 |
-
$offsetParent = $offsetParent.offsetParent();
|
4300 |
-
}
|
4301 |
-
|
4302 |
-
var parentOffset = $offsetParent.offset();
|
4303 |
-
|
4304 |
-
css.top -= parentOffset.top;
|
4305 |
-
css.left -= parentOffset.left;
|
4306 |
-
|
4307 |
-
if (!isCurrentlyAbove && !isCurrentlyBelow) {
|
4308 |
-
newDirection = 'below';
|
4309 |
-
}
|
4310 |
-
|
4311 |
-
if (!enoughRoomBelow && enoughRoomAbove && !isCurrentlyAbove) {
|
4312 |
-
newDirection = 'above';
|
4313 |
-
} else if (!enoughRoomAbove && enoughRoomBelow && isCurrentlyAbove) {
|
4314 |
-
newDirection = 'below';
|
4315 |
-
}
|
4316 |
-
|
4317 |
-
if (newDirection == 'above' ||
|
4318 |
-
(isCurrentlyAbove && newDirection !== 'below')) {
|
4319 |
-
css.top = container.top - parentOffset.top - dropdown.height;
|
4320 |
-
}
|
4321 |
-
|
4322 |
-
if (newDirection != null) {
|
4323 |
-
this.$dropdown
|
4324 |
-
.removeClass('select2-dropdown--below select2-dropdown--above')
|
4325 |
-
.addClass('select2-dropdown--' + newDirection);
|
4326 |
-
this.$container
|
4327 |
-
.removeClass('select2-container--below select2-container--above')
|
4328 |
-
.addClass('select2-container--' + newDirection);
|
4329 |
-
}
|
4330 |
-
|
4331 |
-
this.$dropdownContainer.css(css);
|
4332 |
-
};
|
4333 |
-
|
4334 |
-
AttachBody.prototype._resizeDropdown = function () {
|
4335 |
-
var css = {
|
4336 |
-
width: this.$container.outerWidth(false) + 'px'
|
4337 |
-
};
|
4338 |
-
|
4339 |
-
if (this.options.get('dropdownAutoWidth')) {
|
4340 |
-
css.minWidth = css.width;
|
4341 |
-
css.position = 'relative';
|
4342 |
-
css.width = 'auto';
|
4343 |
-
}
|
4344 |
-
|
4345 |
-
this.$dropdown.css(css);
|
4346 |
-
};
|
4347 |
-
|
4348 |
-
AttachBody.prototype._showDropdown = function (decorated) {
|
4349 |
-
this.$dropdownContainer.appendTo(this.$dropdownParent);
|
4350 |
-
|
4351 |
-
this._positionDropdown();
|
4352 |
-
this._resizeDropdown();
|
4353 |
-
};
|
4354 |
-
|
4355 |
-
return AttachBody;
|
4356 |
-
});
|
4357 |
-
|
4358 |
-
S2.define('select2/dropdown/minimumResultsForSearch',[
|
4359 |
-
|
4360 |
-
], function () {
|
4361 |
-
function countResults (data) {
|
4362 |
-
var count = 0;
|
4363 |
-
|
4364 |
-
for (var d = 0; d < data.length; d++) {
|
4365 |
-
var item = data[d];
|
4366 |
-
|
4367 |
-
if (item.children) {
|
4368 |
-
count += countResults(item.children);
|
4369 |
-
} else {
|
4370 |
-
count++;
|
4371 |
-
}
|
4372 |
-
}
|
4373 |
-
|
4374 |
-
return count;
|
4375 |
-
}
|
4376 |
-
|
4377 |
-
function MinimumResultsForSearch (decorated, $element, options, dataAdapter) {
|
4378 |
-
this.minimumResultsForSearch = options.get('minimumResultsForSearch');
|
4379 |
-
|
4380 |
-
if (this.minimumResultsForSearch < 0) {
|
4381 |
-
this.minimumResultsForSearch = Infinity;
|
4382 |
-
}
|
4383 |
-
|
4384 |
-
decorated.call(this, $element, options, dataAdapter);
|
4385 |
-
}
|
4386 |
-
|
4387 |
-
MinimumResultsForSearch.prototype.showSearch = function (decorated, params) {
|
4388 |
-
if (countResults(params.data.results) < this.minimumResultsForSearch) {
|
4389 |
-
return false;
|
4390 |
-
}
|
4391 |
-
|
4392 |
-
return decorated.call(this, params);
|
4393 |
-
};
|
4394 |
-
|
4395 |
-
return MinimumResultsForSearch;
|
4396 |
-
});
|
4397 |
-
|
4398 |
-
S2.define('select2/dropdown/selectOnClose',[
|
4399 |
-
|
4400 |
-
], function () {
|
4401 |
-
function SelectOnClose () { }
|
4402 |
-
|
4403 |
-
SelectOnClose.prototype.bind = function (decorated, container, $container) {
|
4404 |
-
var self = this;
|
4405 |
-
|
4406 |
-
decorated.call(this, container, $container);
|
4407 |
-
|
4408 |
-
container.on('close', function (params) {
|
4409 |
-
self._handleSelectOnClose(params);
|
4410 |
-
});
|
4411 |
-
};
|
4412 |
-
|
4413 |
-
SelectOnClose.prototype._handleSelectOnClose = function (_, params) {
|
4414 |
-
if (params && params.originalSelect2Event != null) {
|
4415 |
-
var event = params.originalSelect2Event;
|
4416 |
-
|
4417 |
-
// Don't select an item if the close event was triggered from a select or
|
4418 |
-
// unselect event
|
4419 |
-
if (event._type === 'select' || event._type === 'unselect') {
|
4420 |
-
return;
|
4421 |
-
}
|
4422 |
-
}
|
4423 |
-
|
4424 |
-
var $highlightedResults = this.getHighlightedResults();
|
4425 |
-
|
4426 |
-
// Only select highlighted results
|
4427 |
-
if ($highlightedResults.length < 1) {
|
4428 |
-
return;
|
4429 |
-
}
|
4430 |
-
|
4431 |
-
var data = $highlightedResults.data('data');
|
4432 |
-
|
4433 |
-
// Don't re-select already selected resulte
|
4434 |
-
if (
|
4435 |
-
(data.element != null && data.element.selected) ||
|
4436 |
-
(data.element == null && data.selected)
|
4437 |
-
) {
|
4438 |
-
return;
|
4439 |
-
}
|
4440 |
-
|
4441 |
-
this.trigger('select', {
|
4442 |
-
data: data
|
4443 |
-
});
|
4444 |
-
};
|
4445 |
-
|
4446 |
-
return SelectOnClose;
|
4447 |
-
});
|
4448 |
-
|
4449 |
-
S2.define('select2/dropdown/closeOnSelect',[
|
4450 |
-
|
4451 |
-
], function () {
|
4452 |
-
function CloseOnSelect () { }
|
4453 |
-
|
4454 |
-
CloseOnSelect.prototype.bind = function (decorated, container, $container) {
|
4455 |
-
var self = this;
|
4456 |
-
|
4457 |
-
decorated.call(this, container, $container);
|
4458 |
-
|
4459 |
-
container.on('select', function (evt) {
|
4460 |
-
self._selectTriggered(evt);
|
4461 |
-
});
|
4462 |
-
|
4463 |
-
container.on('unselect', function (evt) {
|
4464 |
-
self._selectTriggered(evt);
|
4465 |
-
});
|
4466 |
-
};
|
4467 |
-
|
4468 |
-
CloseOnSelect.prototype._selectTriggered = function (_, evt) {
|
4469 |
-
var originalEvent = evt.originalEvent;
|
4470 |
-
|
4471 |
-
// Don't close if the control key is being held
|
4472 |
-
if (originalEvent && originalEvent.ctrlKey) {
|
4473 |
-
return;
|
4474 |
-
}
|
4475 |
-
|
4476 |
-
this.trigger('close', {
|
4477 |
-
originalEvent: originalEvent,
|
4478 |
-
originalSelect2Event: evt
|
4479 |
-
});
|
4480 |
-
};
|
4481 |
-
|
4482 |
-
return CloseOnSelect;
|
4483 |
-
});
|
4484 |
-
|
4485 |
-
S2.define('select2/i18n/en',[],function () {
|
4486 |
-
// English
|
4487 |
-
return {
|
4488 |
-
errorLoading: function () {
|
4489 |
-
return 'The results could not be loaded.';
|
4490 |
-
},
|
4491 |
-
inputTooLong: function (args) {
|
4492 |
-
var overChars = args.input.length - args.maximum;
|
4493 |
-
|
4494 |
-
var message = 'Please delete ' + overChars + ' character';
|
4495 |
-
|
4496 |
-
if (overChars != 1) {
|
4497 |
-
message += 's';
|
4498 |
-
}
|
4499 |
-
|
4500 |
-
return message;
|
4501 |
-
},
|
4502 |
-
inputTooShort: function (args) {
|
4503 |
-
var remainingChars = args.minimum - args.input.length;
|
4504 |
-
|
4505 |
-
var message = 'Please enter ' + remainingChars + ' or more characters';
|
4506 |
-
|
4507 |
-
return message;
|
4508 |
-
},
|
4509 |
-
loadingMore: function () {
|
4510 |
-
return 'Loading more results…';
|
4511 |
-
},
|
4512 |
-
maximumSelected: function (args) {
|
4513 |
-
var message = 'You can only select ' + args.maximum + ' item';
|
4514 |
-
|
4515 |
-
if (args.maximum != 1) {
|
4516 |
-
message += 's';
|
4517 |
-
}
|
4518 |
-
|
4519 |
-
return message;
|
4520 |
-
},
|
4521 |
-
noResults: function () {
|
4522 |
-
return 'No results found';
|
4523 |
-
},
|
4524 |
-
searching: function () {
|
4525 |
-
return 'Searching…';
|
4526 |
-
}
|
4527 |
-
};
|
4528 |
-
});
|
4529 |
-
|
4530 |
-
S2.define('select2/defaults',[
|
4531 |
-
'jquery',
|
4532 |
-
'require',
|
4533 |
-
|
4534 |
-
'./results',
|
4535 |
-
|
4536 |
-
'./selection/single',
|
4537 |
-
'./selection/multiple',
|
4538 |
-
'./selection/placeholder',
|
4539 |
-
'./selection/allowClear',
|
4540 |
-
'./selection/search',
|
4541 |
-
'./selection/eventRelay',
|
4542 |
-
|
4543 |
-
'./utils',
|
4544 |
-
'./translation',
|
4545 |
-
'./diacritics',
|
4546 |
-
|
4547 |
-
'./data/select',
|
4548 |
-
'./data/array',
|
4549 |
-
'./data/ajax',
|
4550 |
-
'./data/tags',
|
4551 |
-
'./data/tokenizer',
|
4552 |
-
'./data/minimumInputLength',
|
4553 |
-
'./data/maximumInputLength',
|
4554 |
-
'./data/maximumSelectionLength',
|
4555 |
-
|
4556 |
-
'./dropdown',
|
4557 |
-
'./dropdown/search',
|
4558 |
-
'./dropdown/hidePlaceholder',
|
4559 |
-
'./dropdown/infiniteScroll',
|
4560 |
-
'./dropdown/attachBody',
|
4561 |
-
'./dropdown/minimumResultsForSearch',
|
4562 |
-
'./dropdown/selectOnClose',
|
4563 |
-
'./dropdown/closeOnSelect',
|
4564 |
-
|
4565 |
-
'./i18n/en'
|
4566 |
-
], function ($, require,
|
4567 |
-
|
4568 |
-
ResultsList,
|
4569 |
-
|
4570 |
-
SingleSelection, MultipleSelection, Placeholder, AllowClear,
|
4571 |
-
SelectionSearch, EventRelay,
|
4572 |
-
|
4573 |
-
Utils, Translation, DIACRITICS,
|
4574 |
-
|
4575 |
-
SelectData, ArrayData, AjaxData, Tags, Tokenizer,
|
4576 |
-
MinimumInputLength, MaximumInputLength, MaximumSelectionLength,
|
4577 |
-
|
4578 |
-
Dropdown, DropdownSearch, HidePlaceholder, InfiniteScroll,
|
4579 |
-
AttachBody, MinimumResultsForSearch, SelectOnClose, CloseOnSelect,
|
4580 |
-
|
4581 |
-
EnglishTranslation) {
|
4582 |
-
function Defaults () {
|
4583 |
-
this.reset();
|
4584 |
-
}
|
4585 |
-
|
4586 |
-
Defaults.prototype.apply = function (options) {
|
4587 |
-
options = $.extend(true, {}, this.defaults, options);
|
4588 |
-
|
4589 |
-
if (options.dataAdapter == null) {
|
4590 |
-
if (options.ajax != null) {
|
4591 |
-
options.dataAdapter = AjaxData;
|
4592 |
-
} else if (options.data != null) {
|
4593 |
-
options.dataAdapter = ArrayData;
|
4594 |
-
} else {
|
4595 |
-
options.dataAdapter = SelectData;
|
4596 |
-
}
|
4597 |
-
|
4598 |
-
if (options.minimumInputLength > 0) {
|
4599 |
-
options.dataAdapter = Utils.Decorate(
|
4600 |
-
options.dataAdapter,
|
4601 |
-
MinimumInputLength
|
4602 |
-
);
|
4603 |
-
}
|
4604 |
-
|
4605 |
-
if (options.maximumInputLength > 0) {
|
4606 |
-
options.dataAdapter = Utils.Decorate(
|
4607 |
-
options.dataAdapter,
|
4608 |
-
MaximumInputLength
|
4609 |
-
);
|
4610 |
-
}
|
4611 |
-
|
4612 |
-
if (options.maximumSelectionLength > 0) {
|
4613 |
-
options.dataAdapter = Utils.Decorate(
|
4614 |
-
options.dataAdapter,
|
4615 |
-
MaximumSelectionLength
|
4616 |
-
);
|
4617 |
-
}
|
4618 |
-
|
4619 |
-
if (options.tags) {
|
4620 |
-
options.dataAdapter = Utils.Decorate(options.dataAdapter, Tags);
|
4621 |
-
}
|
4622 |
-
|
4623 |
-
if (options.tokenSeparators != null || options.tokenizer != null) {
|
4624 |
-
options.dataAdapter = Utils.Decorate(
|
4625 |
-
options.dataAdapter,
|
4626 |
-
Tokenizer
|
4627 |
-
);
|
4628 |
-
}
|
4629 |
-
|
4630 |
-
if (options.query != null) {
|
4631 |
-
var Query = require(options.amdBase + 'compat/query');
|
4632 |
-
|
4633 |
-
options.dataAdapter = Utils.Decorate(
|
4634 |
-
options.dataAdapter,
|
4635 |
-
Query
|
4636 |
-
);
|
4637 |
-
}
|
4638 |
-
|
4639 |
-
if (options.initSelection != null) {
|
4640 |
-
var InitSelection = require(options.amdBase + 'compat/initSelection');
|
4641 |
-
|
4642 |
-
options.dataAdapter = Utils.Decorate(
|
4643 |
-
options.dataAdapter,
|
4644 |
-
InitSelection
|
4645 |
-
);
|
4646 |
-
}
|
4647 |
-
}
|
4648 |
-
|
4649 |
-
if (options.resultsAdapter == null) {
|
4650 |
-
options.resultsAdapter = ResultsList;
|
4651 |
-
|
4652 |
-
if (options.ajax != null) {
|
4653 |
-
options.resultsAdapter = Utils.Decorate(
|
4654 |
-
options.resultsAdapter,
|
4655 |
-
InfiniteScroll
|
4656 |
-
);
|
4657 |
-
}
|
4658 |
-
|
4659 |
-
if (options.placeholder != null) {
|
4660 |
-
options.resultsAdapter = Utils.Decorate(
|
4661 |
-
options.resultsAdapter,
|
4662 |
-
HidePlaceholder
|
4663 |
-
);
|
4664 |
-
}
|
4665 |
-
|
4666 |
-
if (options.selectOnClose) {
|
4667 |
-
options.resultsAdapter = Utils.Decorate(
|
4668 |
-
options.resultsAdapter,
|
4669 |
-
SelectOnClose
|
4670 |
-
);
|
4671 |
-
}
|
4672 |
-
}
|
4673 |
-
|
4674 |
-
if (options.dropdownAdapter == null) {
|
4675 |
-
if (options.multiple) {
|
4676 |
-
options.dropdownAdapter = Dropdown;
|
4677 |
-
} else {
|
4678 |
-
var SearchableDropdown = Utils.Decorate(Dropdown, DropdownSearch);
|
4679 |
-
|
4680 |
-
options.dropdownAdapter = SearchableDropdown;
|
4681 |
-
}
|
4682 |
-
|
4683 |
-
if (options.minimumResultsForSearch !== 0) {
|
4684 |
-
options.dropdownAdapter = Utils.Decorate(
|
4685 |
-
options.dropdownAdapter,
|
4686 |
-
MinimumResultsForSearch
|
4687 |
-
);
|
4688 |
-
}
|
4689 |
-
|
4690 |
-
if (options.closeOnSelect) {
|
4691 |
-
options.dropdownAdapter = Utils.Decorate(
|
4692 |
-
options.dropdownAdapter,
|
4693 |
-
CloseOnSelect
|
4694 |
-
);
|
4695 |
-
}
|
4696 |
-
|
4697 |
-
if (
|
4698 |
-
options.dropdownCssClass != null ||
|
4699 |
-
options.dropdownCss != null ||
|
4700 |
-
options.adaptDropdownCssClass != null
|
4701 |
-
) {
|
4702 |
-
var DropdownCSS = require(options.amdBase + 'compat/dropdownCss');
|
4703 |
-
|
4704 |
-
options.dropdownAdapter = Utils.Decorate(
|
4705 |
-
options.dropdownAdapter,
|
4706 |
-
DropdownCSS
|
4707 |
-
);
|
4708 |
-
}
|
4709 |
-
|
4710 |
-
options.dropdownAdapter = Utils.Decorate(
|
4711 |
-
options.dropdownAdapter,
|
4712 |
-
AttachBody
|
4713 |
-
);
|
4714 |
-
}
|
4715 |
-
|
4716 |
-
if (options.selectionAdapter == null) {
|
4717 |
-
if (options.multiple) {
|
4718 |
-
options.selectionAdapter = MultipleSelection;
|
4719 |
-
} else {
|
4720 |
-
options.selectionAdapter = SingleSelection;
|
4721 |
-
}
|
4722 |
-
|
4723 |
-
// Add the placeholder mixin if a placeholder was specified
|
4724 |
-
if (options.placeholder != null) {
|
4725 |
-
options.selectionAdapter = Utils.Decorate(
|
4726 |
-
options.selectionAdapter,
|
4727 |
-
Placeholder
|
4728 |
-
);
|
4729 |
-
}
|
4730 |
-
|
4731 |
-
if (options.allowClear) {
|
4732 |
-
options.selectionAdapter = Utils.Decorate(
|
4733 |
-
options.selectionAdapter,
|
4734 |
-
AllowClear
|
4735 |
-
);
|
4736 |
-
}
|
4737 |
-
|
4738 |
-
if (options.multiple) {
|
4739 |
-
options.selectionAdapter = Utils.Decorate(
|
4740 |
-
options.selectionAdapter,
|
4741 |
-
SelectionSearch
|
4742 |
-
);
|
4743 |
-
}
|
4744 |
-
|
4745 |
-
if (
|
4746 |
-
options.containerCssClass != null ||
|
4747 |
-
options.containerCss != null ||
|
4748 |
-
options.adaptContainerCssClass != null
|
4749 |
-
) {
|
4750 |
-
var ContainerCSS = require(options.amdBase + 'compat/containerCss');
|
4751 |
-
|
4752 |
-
options.selectionAdapter = Utils.Decorate(
|
4753 |
-
options.selectionAdapter,
|
4754 |
-
ContainerCSS
|
4755 |
-
);
|
4756 |
-
}
|
4757 |
-
|
4758 |
-
options.selectionAdapter = Utils.Decorate(
|
4759 |
-
options.selectionAdapter,
|
4760 |
-
EventRelay
|
4761 |
-
);
|
4762 |
-
}
|
4763 |
-
|
4764 |
-
if (typeof options.language === 'string') {
|
4765 |
-
// Check if the language is specified with a region
|
4766 |
-
if (options.language.indexOf('-') > 0) {
|
4767 |
-
// Extract the region information if it is included
|
4768 |
-
var languageParts = options.language.split('-');
|
4769 |
-
var baseLanguage = languageParts[0];
|
4770 |
-
|
4771 |
-
options.language = [options.language, baseLanguage];
|
4772 |
-
} else {
|
4773 |
-
options.language = [options.language];
|
4774 |
-
}
|
4775 |
-
}
|
4776 |
-
|
4777 |
-
if ($.isArray(options.language)) {
|
4778 |
-
var languages = new Translation();
|
4779 |
-
options.language.push('en');
|
4780 |
-
|
4781 |
-
var languageNames = options.language;
|
4782 |
-
|
4783 |
-
for (var l = 0; l < languageNames.length; l++) {
|
4784 |
-
var name = languageNames[l];
|
4785 |
-
var language = {};
|
4786 |
-
|
4787 |
-
try {
|
4788 |
-
// Try to load it with the original name
|
4789 |
-
language = Translation.loadPath(name);
|
4790 |
-
} catch (e) {
|
4791 |
-
try {
|
4792 |
-
// If we couldn't load it, check if it wasn't the full path
|
4793 |
-
name = this.defaults.amdLanguageBase + name;
|
4794 |
-
language = Translation.loadPath(name);
|
4795 |
-
} catch (ex) {
|
4796 |
-
// The translation could not be loaded at all. Sometimes this is
|
4797 |
-
// because of a configuration problem, other times this can be
|
4798 |
-
// because of how Select2 helps load all possible translation files.
|
4799 |
-
if (options.debug && window.console && console.warn) {
|
4800 |
-
console.warn(
|
4801 |
-
'Select2: The language file for "' + name + '" could not be ' +
|
4802 |
-
'automatically loaded. A fallback will be used instead.'
|
4803 |
-
);
|
4804 |
-
}
|
4805 |
-
|
4806 |
-
continue;
|
4807 |
-
}
|
4808 |
-
}
|
4809 |
-
|
4810 |
-
languages.extend(language);
|
4811 |
-
}
|
4812 |
-
|
4813 |
-
options.translations = languages;
|
4814 |
-
} else {
|
4815 |
-
var baseTranslation = Translation.loadPath(
|
4816 |
-
this.defaults.amdLanguageBase + 'en'
|
4817 |
-
);
|
4818 |
-
var customTranslation = new Translation(options.language);
|
4819 |
-
|
4820 |
-
customTranslation.extend(baseTranslation);
|
4821 |
-
|
4822 |
-
options.translations = customTranslation;
|
4823 |
-
}
|
4824 |
-
|
4825 |
-
return options;
|
4826 |
-
};
|
4827 |
-
|
4828 |
-
Defaults.prototype.reset = function () {
|
4829 |
-
function stripDiacritics (text) {
|
4830 |
-
// Used 'uni range + named function' from http://jsperf.com/diacritics/18
|
4831 |
-
function match(a) {
|
4832 |
-
return DIACRITICS[a] || a;
|
4833 |
-
}
|
4834 |
-
|
4835 |
-
return text.replace(/[^\u0000-\u007E]/g, match);
|
4836 |
-
}
|
4837 |
-
|
4838 |
-
function matcher (params, data) {
|
4839 |
-
// Always return the object if there is nothing to compare
|
4840 |
-
if ($.trim(params.term) === '') {
|
4841 |
-
return data;
|
4842 |
-
}
|
4843 |
-
|
4844 |
-
// Do a recursive check for options with children
|
4845 |
-
if (data.children && data.children.length > 0) {
|
4846 |
-
// Clone the data object if there are children
|
4847 |
-
// This is required as we modify the object to remove any non-matches
|
4848 |
-
var match = $.extend(true, {}, data);
|
4849 |
-
|
4850 |
-
// Check each child of the option
|
4851 |
-
for (var c = data.children.length - 1; c >= 0; c--) {
|
4852 |
-
var child = data.children[c];
|
4853 |
-
|
4854 |
-
var matches = matcher(params, child);
|
4855 |
-
|
4856 |
-
// If there wasn't a match, remove the object in the array
|
4857 |
-
if (matches == null) {
|
4858 |
-
match.children.splice(c, 1);
|
4859 |
-
}
|
4860 |
-
}
|
4861 |
-
|
4862 |
-
// If any children matched, return the new object
|
4863 |
-
if (match.children.length > 0) {
|
4864 |
-
return match;
|
4865 |
-
}
|
4866 |
-
|
4867 |
-
// If there were no matching children, check just the plain object
|
4868 |
-
return matcher(params, match);
|
4869 |
-
}
|
4870 |
-
|
4871 |
-
var original = stripDiacritics(data.text).toUpperCase();
|
4872 |
-
var term = stripDiacritics(params.term).toUpperCase();
|
4873 |
-
|
4874 |
-
// Check if the text contains the term
|
4875 |
-
if (original.indexOf(term) > -1) {
|
4876 |
-
return data;
|
4877 |
-
}
|
4878 |
-
|
4879 |
-
// If it doesn't contain the term, don't return anything
|
4880 |
-
return null;
|
4881 |
-
}
|
4882 |
-
|
4883 |
-
this.defaults = {
|
4884 |
-
amdBase: './',
|
4885 |
-
amdLanguageBase: './i18n/',
|
4886 |
-
closeOnSelect: true,
|
4887 |
-
debug: false,
|
4888 |
-
dropdownAutoWidth: false,
|
4889 |
-
escapeMarkup: Utils.escapeMarkup,
|
4890 |
-
language: EnglishTranslation,
|
4891 |
-
matcher: matcher,
|
4892 |
-
minimumInputLength: 0,
|
4893 |
-
maximumInputLength: 0,
|
4894 |
-
maximumSelectionLength: 0,
|
4895 |
-
minimumResultsForSearch: 0,
|
4896 |
-
selectOnClose: false,
|
4897 |
-
sorter: function (data) {
|
4898 |
-
return data;
|
4899 |
-
},
|
4900 |
-
templateResult: function (result) {
|
4901 |
-
return result.text;
|
4902 |
-
},
|
4903 |
-
templateSelection: function (selection) {
|
4904 |
-
return selection.text;
|
4905 |
-
},
|
4906 |
-
theme: 'default',
|
4907 |
-
width: 'resolve'
|
4908 |
-
};
|
4909 |
-
};
|
4910 |
-
|
4911 |
-
Defaults.prototype.set = function (key, value) {
|
4912 |
-
var camelKey = $.camelCase(key);
|
4913 |
-
|
4914 |
-
var data = {};
|
4915 |
-
data[camelKey] = value;
|
4916 |
-
|
4917 |
-
var convertedData = Utils._convertData(data);
|
4918 |
-
|
4919 |
-
$.extend(this.defaults, convertedData);
|
4920 |
-
};
|
4921 |
-
|
4922 |
-
var defaults = new Defaults();
|
4923 |
-
|
4924 |
-
return defaults;
|
4925 |
-
});
|
4926 |
-
|
4927 |
-
S2.define('select2/options',[
|
4928 |
-
'require',
|
4929 |
-
'jquery',
|
4930 |
-
'./defaults',
|
4931 |
-
'./utils'
|
4932 |
-
], function (require, $, Defaults, Utils) {
|
4933 |
-
function Options (options, $element) {
|
4934 |
-
this.options = options;
|
4935 |
-
|
4936 |
-
if ($element != null) {
|
4937 |
-
this.fromElement($element);
|
4938 |
-
}
|
4939 |
-
|
4940 |
-
this.options = Defaults.apply(this.options);
|
4941 |
-
|
4942 |
-
if ($element && $element.is('input')) {
|
4943 |
-
var InputCompat = require(this.get('amdBase') + 'compat/inputData');
|
4944 |
-
|
4945 |
-
this.options.dataAdapter = Utils.Decorate(
|
4946 |
-
this.options.dataAdapter,
|
4947 |
-
InputCompat
|
4948 |
-
);
|
4949 |
-
}
|
4950 |
-
}
|
4951 |
-
|
4952 |
-
Options.prototype.fromElement = function ($e) {
|
4953 |
-
var excludedData = ['select2'];
|
4954 |
-
|
4955 |
-
if (this.options.multiple == null) {
|
4956 |
-
this.options.multiple = $e.prop('multiple');
|
4957 |
-
}
|
4958 |
-
|
4959 |
-
if (this.options.disabled == null) {
|
4960 |
-
this.options.disabled = $e.prop('disabled');
|
4961 |
-
}
|
4962 |
-
|
4963 |
-
if (this.options.language == null) {
|
4964 |
-
if ($e.prop('lang')) {
|
4965 |
-
this.options.language = $e.prop('lang').toLowerCase();
|
4966 |
-
} else if ($e.closest('[lang]').prop('lang')) {
|
4967 |
-
this.options.language = $e.closest('[lang]').prop('lang');
|
4968 |
-
}
|
4969 |
-
}
|
4970 |
-
|
4971 |
-
if (this.options.dir == null) {
|
4972 |
-
if ($e.prop('dir')) {
|
4973 |
-
this.options.dir = $e.prop('dir');
|
4974 |
-
} else if ($e.closest('[dir]').prop('dir')) {
|
4975 |
-
this.options.dir = $e.closest('[dir]').prop('dir');
|
4976 |
-
} else {
|
4977 |
-
this.options.dir = 'ltr';
|
4978 |
-
}
|
4979 |
-
}
|
4980 |
-
|
4981 |
-
$e.prop('disabled', this.options.disabled);
|
4982 |
-
$e.prop('multiple', this.options.multiple);
|
4983 |
-
|
4984 |
-
if ($e.data('select2Tags')) {
|
4985 |
-
if (this.options.debug && window.console && console.warn) {
|
4986 |
-
console.warn(
|
4987 |
-
'Select2: The `data-select2-tags` attribute has been changed to ' +
|
4988 |
-
'use the `data-data` and `data-tags="true"` attributes and will be ' +
|
4989 |
-
'removed in future versions of Select2.'
|
4990 |
-
);
|
4991 |
-
}
|
4992 |
-
|
4993 |
-
$e.data('data', $e.data('select2Tags'));
|
4994 |
-
$e.data('tags', true);
|
4995 |
-
}
|
4996 |
-
|
4997 |
-
if ($e.data('ajaxUrl')) {
|
4998 |
-
if (this.options.debug && window.console && console.warn) {
|
4999 |
-
console.warn(
|
5000 |
-
'Select2: The `data-ajax-url` attribute has been changed to ' +
|
5001 |
-
'`data-ajax--url` and support for the old attribute will be removed' +
|
5002 |
-
' in future versions of Select2.'
|
5003 |
-
);
|
5004 |
-
}
|
5005 |
-
|
5006 |
-
$e.attr('ajax--url', $e.data('ajaxUrl'));
|
5007 |
-
$e.data('ajax--url', $e.data('ajaxUrl'));
|
5008 |
-
}
|
5009 |
-
|
5010 |
-
var dataset = {};
|
5011 |
-
|
5012 |
-
// Prefer the element's `dataset` attribute if it exists
|
5013 |
-
// jQuery 1.x does not correctly handle data attributes with multiple dashes
|
5014 |
-
if ($.fn.jquery && $.fn.jquery.substr(0, 2) == '1.' && $e[0].dataset) {
|
5015 |
-
dataset = $.extend(true, {}, $e[0].dataset, $e.data());
|
5016 |
-
} else {
|
5017 |
-
dataset = $e.data();
|
5018 |
-
}
|
5019 |
-
|
5020 |
-
var data = $.extend(true, {}, dataset);
|
5021 |
-
|
5022 |
-
data = Utils._convertData(data);
|
5023 |
-
|
5024 |
-
for (var key in data) {
|
5025 |
-
if ($.inArray(key, excludedData) > -1) {
|
5026 |
-
continue;
|
5027 |
-
}
|
5028 |
-
|
5029 |
-
if ($.isPlainObject(this.options[key])) {
|
5030 |
-
$.extend(this.options[key], data[key]);
|
5031 |
-
} else {
|
5032 |
-
this.options[key] = data[key];
|
5033 |
-
}
|
5034 |
-
}
|
5035 |
-
|
5036 |
-
return this;
|
5037 |
-
};
|
5038 |
-
|
5039 |
-
Options.prototype.get = function (key) {
|
5040 |
-
return this.options[key];
|
5041 |
-
};
|
5042 |
-
|
5043 |
-
Options.prototype.set = function (key, val) {
|
5044 |
-
this.options[key] = val;
|
5045 |
-
};
|
5046 |
-
|
5047 |
-
return Options;
|
5048 |
-
});
|
5049 |
-
|
5050 |
-
S2.define('select2/core',[
|
5051 |
-
'jquery',
|
5052 |
-
'./options',
|
5053 |
-
'./utils',
|
5054 |
-
'./keys'
|
5055 |
-
], function ($, Options, Utils, KEYS) {
|
5056 |
-
var Select2 = function ($element, options) {
|
5057 |
-
if ($element.data('select2') != null) {
|
5058 |
-
$element.data('select2').destroy();
|
5059 |
-
}
|
5060 |
-
|
5061 |
-
this.$element = $element;
|
5062 |
-
|
5063 |
-
this.id = this._generateId($element);
|
5064 |
-
|
5065 |
-
options = options || {};
|
5066 |
-
|
5067 |
-
this.options = new Options(options, $element);
|
5068 |
-
|
5069 |
-
Select2.__super__.constructor.call(this);
|
5070 |
-
|
5071 |
-
// Set up the tabindex
|
5072 |
-
|
5073 |
-
var tabindex = $element.attr('tabindex') || 0;
|
5074 |
-
$element.data('old-tabindex', tabindex);
|
5075 |
-
$element.attr('tabindex', '-1');
|
5076 |
-
|
5077 |
-
// Set up containers and adapters
|
5078 |
-
|
5079 |
-
var DataAdapter = this.options.get('dataAdapter');
|
5080 |
-
this.dataAdapter = new DataAdapter($element, this.options);
|
5081 |
-
|
5082 |
-
var $container = this.render();
|
5083 |
-
|
5084 |
-
this._placeContainer($container);
|
5085 |
-
|
5086 |
-
var SelectionAdapter = this.options.get('selectionAdapter');
|
5087 |
-
this.selection = new SelectionAdapter($element, this.options);
|
5088 |
-
this.$selection = this.selection.render();
|
5089 |
-
|
5090 |
-
this.selection.position(this.$selection, $container);
|
5091 |
-
|
5092 |
-
var DropdownAdapter = this.options.get('dropdownAdapter');
|
5093 |
-
this.dropdown = new DropdownAdapter($element, this.options);
|
5094 |
-
this.$dropdown = this.dropdown.render();
|
5095 |
-
|
5096 |
-
this.dropdown.position(this.$dropdown, $container);
|
5097 |
-
|
5098 |
-
var ResultsAdapter = this.options.get('resultsAdapter');
|
5099 |
-
this.results = new ResultsAdapter($element, this.options, this.dataAdapter);
|
5100 |
-
this.$results = this.results.render();
|
5101 |
-
|
5102 |
-
this.results.position(this.$results, this.$dropdown);
|
5103 |
-
|
5104 |
-
// Bind events
|
5105 |
-
|
5106 |
-
var self = this;
|
5107 |
-
|
5108 |
-
// Bind the container to all of the adapters
|
5109 |
-
this._bindAdapters();
|
5110 |
-
|
5111 |
-
// Register any DOM event handlers
|
5112 |
-
this._registerDomEvents();
|
5113 |
-
|
5114 |
-
// Register any internal event handlers
|
5115 |
-
this._registerDataEvents();
|
5116 |
-
this._registerSelectionEvents();
|
5117 |
-
this._registerDropdownEvents();
|
5118 |
-
this._registerResultsEvents();
|
5119 |
-
this._registerEvents();
|
5120 |
-
|
5121 |
-
// Set the initial state
|
5122 |
-
this.dataAdapter.current(function (initialData) {
|
5123 |
-
self.trigger('selection:update', {
|
5124 |
-
data: initialData
|
5125 |
-
});
|
5126 |
-
});
|
5127 |
-
|
5128 |
-
// Hide the original select
|
5129 |
-
$element.addClass('select2-hidden-accessible');
|
5130 |
-
$element.attr('aria-hidden', 'true');
|
5131 |
-
|
5132 |
-
// Synchronize any monitored attributes
|
5133 |
-
this._syncAttributes();
|
5134 |
-
|
5135 |
-
$element.data('select2', this);
|
5136 |
-
};
|
5137 |
-
|
5138 |
-
Utils.Extend(Select2, Utils.Observable);
|
5139 |
-
|
5140 |
-
Select2.prototype._generateId = function ($element) {
|
5141 |
-
var id = '';
|
5142 |
-
|
5143 |
-
if ($element.attr('id') != null) {
|
5144 |
-
id = $element.attr('id');
|
5145 |
-
} else if ($element.attr('name') != null) {
|
5146 |
-
id = $element.attr('name') + '-' + Utils.generateChars(2);
|
5147 |
-
} else {
|
5148 |
-
id = Utils.generateChars(4);
|
5149 |
-
}
|
5150 |
-
|
5151 |
-
id = id.replace(/(:|\.|\[|\]|,)/g, '');
|
5152 |
-
id = 'select2-' + id;
|
5153 |
-
|
5154 |
-
return id;
|
5155 |
-
};
|
5156 |
-
|
5157 |
-
Select2.prototype._placeContainer = function ($container) {
|
5158 |
-
$container.insertAfter(this.$element);
|
5159 |
-
|
5160 |
-
var width = this._resolveWidth(this.$element, this.options.get('width'));
|
5161 |
-
|
5162 |
-
if (width != null) {
|
5163 |
-
$container.css('width', width);
|
5164 |
-
}
|
5165 |
-
};
|
5166 |
-
|
5167 |
-
Select2.prototype._resolveWidth = function ($element, method) {
|
5168 |
-
var WIDTH = /^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;
|
5169 |
-
|
5170 |
-
if (method == 'resolve') {
|
5171 |
-
var styleWidth = this._resolveWidth($element, 'style');
|
5172 |
-
|
5173 |
-
if (styleWidth != null) {
|
5174 |
-
return styleWidth;
|
5175 |
-
}
|
5176 |
-
|
5177 |
-
return this._resolveWidth($element, 'element');
|
5178 |
-
}
|
5179 |
-
|
5180 |
-
if (method == 'element') {
|
5181 |
-
var elementWidth = $element.outerWidth(false);
|
5182 |
-
|
5183 |
-
if (elementWidth <= 0) {
|
5184 |
-
return 'auto';
|
5185 |
-
}
|
5186 |
-
|
5187 |
-
return elementWidth + 'px';
|
5188 |
-
}
|
5189 |
-
|
5190 |
-
if (method == 'style') {
|
5191 |
-
var style = $element.attr('style');
|
5192 |
-
|
5193 |
-
if (typeof(style) !== 'string') {
|
5194 |
-
return null;
|
5195 |
-
}
|
5196 |
-
|
5197 |
-
var attrs = style.split(';');
|
5198 |
-
|
5199 |
-
for (var i = 0, l = attrs.length; i < l; i = i + 1) {
|
5200 |
-
var attr = attrs[i].replace(/\s/g, '');
|
5201 |
-
var matches = attr.match(WIDTH);
|
5202 |
-
|
5203 |
-
if (matches !== null && matches.length >= 1) {
|
5204 |
-
return matches[1];
|
5205 |
-
}
|
5206 |
-
}
|
5207 |
-
|
5208 |
-
return null;
|
5209 |
-
}
|
5210 |
-
|
5211 |
-
return method;
|
5212 |
-
};
|
5213 |
-
|
5214 |
-
Select2.prototype._bindAdapters = function () {
|
5215 |
-
this.dataAdapter.bind(this, this.$container);
|
5216 |
-
this.selection.bind(this, this.$container);
|
5217 |
-
|
5218 |
-
this.dropdown.bind(this, this.$container);
|
5219 |
-
this.results.bind(this, this.$container);
|
5220 |
-
};
|
5221 |
-
|
5222 |
-
Select2.prototype._registerDomEvents = function () {
|
5223 |
-
var self = this;
|
5224 |
-
|
5225 |
-
this.$element.on('change.select2', function () {
|
5226 |
-
self.dataAdapter.current(function (data) {
|
5227 |
-
self.trigger('selection:update', {
|
5228 |
-
data: data
|
5229 |
-
});
|
5230 |
-
});
|
5231 |
-
});
|
5232 |
-
|
5233 |
-
this.$element.on('focus.select2', function (evt) {
|
5234 |
-
self.trigger('focus', evt);
|
5235 |
-
});
|
5236 |
-
|
5237 |
-
this._syncA = Utils.bind(this._syncAttributes, this);
|
5238 |
-
this._syncS = Utils.bind(this._syncSubtree, this);
|
5239 |
-
|
5240 |
-
if (this.$element[0].attachEvent) {
|
5241 |
-
this.$element[0].attachEvent('onpropertychange', this._syncA);
|
5242 |
-
}
|
5243 |
-
|
5244 |
-
var observer = window.MutationObserver ||
|
5245 |
-
window.WebKitMutationObserver ||
|
5246 |
-
window.MozMutationObserver
|
5247 |
-
;
|
5248 |
-
|
5249 |
-
if (observer != null) {
|
5250 |
-
this._observer = new observer(function (mutations) {
|
5251 |
-
$.each(mutations, self._syncA);
|
5252 |
-
$.each(mutations, self._syncS);
|
5253 |
-
});
|
5254 |
-
this._observer.observe(this.$element[0], {
|
5255 |
-
attributes: true,
|
5256 |
-
childList: true,
|
5257 |
-
subtree: false
|
5258 |
-
});
|
5259 |
-
} else if (this.$element[0].addEventListener) {
|
5260 |
-
this.$element[0].addEventListener(
|
5261 |
-
'DOMAttrModified',
|
5262 |
-
self._syncA,
|
5263 |
-
false
|
5264 |
-
);
|
5265 |
-
this.$element[0].addEventListener(
|
5266 |
-
'DOMNodeInserted',
|
5267 |
-
self._syncS,
|
5268 |
-
false
|
5269 |
-
);
|
5270 |
-
this.$element[0].addEventListener(
|
5271 |
-
'DOMNodeRemoved',
|
5272 |
-
self._syncS,
|
5273 |
-
false
|
5274 |
-
);
|
5275 |
-
}
|
5276 |
-
};
|
5277 |
-
|
5278 |
-
Select2.prototype._registerDataEvents = function () {
|
5279 |
-
var self = this;
|
5280 |
-
|
5281 |
-
this.dataAdapter.on('*', function (name, params) {
|
5282 |
-
self.trigger(name, params);
|
5283 |
-
});
|
5284 |
-
};
|
5285 |
-
|
5286 |
-
Select2.prototype._registerSelectionEvents = function () {
|
5287 |
-
var self = this;
|
5288 |
-
var nonRelayEvents = ['toggle', 'focus'];
|
5289 |
-
|
5290 |
-
this.selection.on('toggle', function () {
|
5291 |
-
self.toggleDropdown();
|
5292 |
-
});
|
5293 |
-
|
5294 |
-
this.selection.on('focus', function (params) {
|
5295 |
-
self.focus(params);
|
5296 |
-
});
|
5297 |
-
|
5298 |
-
this.selection.on('*', function (name, params) {
|
5299 |
-
if ($.inArray(name, nonRelayEvents) !== -1) {
|
5300 |
-
return;
|
5301 |
-
}
|
5302 |
-
|
5303 |
-
self.trigger(name, params);
|
5304 |
-
});
|
5305 |
-
};
|
5306 |
-
|
5307 |
-
Select2.prototype._registerDropdownEvents = function () {
|
5308 |
-
var self = this;
|
5309 |
-
|
5310 |
-
this.dropdown.on('*', function (name, params) {
|
5311 |
-
self.trigger(name, params);
|
5312 |
-
});
|
5313 |
-
};
|
5314 |
-
|
5315 |
-
Select2.prototype._registerResultsEvents = function () {
|
5316 |
-
var self = this;
|
5317 |
-
|
5318 |
-
this.results.on('*', function (name, params) {
|
5319 |
-
self.trigger(name, params);
|
5320 |
-
});
|
5321 |
-
};
|
5322 |
-
|
5323 |
-
Select2.prototype._registerEvents = function () {
|
5324 |
-
var self = this;
|
5325 |
-
|
5326 |
-
this.on('open', function () {
|
5327 |
-
self.$container.addClass('select2-container--open');
|
5328 |
-
});
|
5329 |
-
|
5330 |
-
this.on('close', function () {
|
5331 |
-
self.$container.removeClass('select2-container--open');
|
5332 |
-
});
|
5333 |
-
|
5334 |
-
this.on('enable', function () {
|
5335 |
-
self.$container.removeClass('select2-container--disabled');
|
5336 |
-
});
|
5337 |
-
|
5338 |
-
this.on('disable', function () {
|
5339 |
-
self.$container.addClass('select2-container--disabled');
|
5340 |
-
});
|
5341 |
-
|
5342 |
-
this.on('blur', function () {
|
5343 |
-
self.$container.removeClass('select2-container--focus');
|
5344 |
-
});
|
5345 |
-
|
5346 |
-
this.on('query', function (params) {
|
5347 |
-
if (!self.isOpen()) {
|
5348 |
-
self.trigger('open', {});
|
5349 |
-
}
|
5350 |
-
|
5351 |
-
this.dataAdapter.query(params, function (data) {
|
5352 |
-
self.trigger('results:all', {
|
5353 |
-
data: data,
|
5354 |
-
query: params
|
5355 |
-
});
|
5356 |
-
});
|
5357 |
-
});
|
5358 |
-
|
5359 |
-
this.on('query:append', function (params) {
|
5360 |
-
this.dataAdapter.query(params, function (data) {
|
5361 |
-
self.trigger('results:append', {
|
5362 |
-
data: data,
|
5363 |
-
query: params
|
5364 |
-
});
|
5365 |
-
});
|
5366 |
-
});
|
5367 |
-
|
5368 |
-
this.on('keypress', function (evt) {
|
5369 |
-
var key = evt.which;
|
5370 |
-
|
5371 |
-
if (self.isOpen()) {
|
5372 |
-
if (key === KEYS.ESC || key === KEYS.TAB ||
|
5373 |
-
(key === KEYS.UP && evt.altKey)) {
|
5374 |
-
self.close();
|
5375 |
-
|
5376 |
-
evt.preventDefault();
|
5377 |
-
} else if (key === KEYS.ENTER) {
|
5378 |
-
self.trigger('results:select', {});
|
5379 |
-
|
5380 |
-
evt.preventDefault();
|
5381 |
-
} else if ((key === KEYS.SPACE && evt.ctrlKey)) {
|
5382 |
-
self.trigger('results:toggle', {});
|
5383 |
-
|
5384 |
-
evt.preventDefault();
|
5385 |
-
} else if (key === KEYS.UP) {
|
5386 |
-
self.trigger('results:previous', {});
|
5387 |
-
|
5388 |
-
evt.preventDefault();
|
5389 |
-
} else if (key === KEYS.DOWN) {
|
5390 |
-
self.trigger('results:next', {});
|
5391 |
-
|
5392 |
-
evt.preventDefault();
|
5393 |
-
}
|
5394 |
-
} else {
|
5395 |
-
if (key === KEYS.ENTER || key === KEYS.SPACE ||
|
5396 |
-
(key === KEYS.DOWN && evt.altKey)) {
|
5397 |
-
self.open();
|
5398 |
-
|
5399 |
-
evt.preventDefault();
|
5400 |
-
}
|
5401 |
-
}
|
5402 |
-
});
|
5403 |
-
};
|
5404 |
-
|
5405 |
-
Select2.prototype._syncAttributes = function () {
|
5406 |
-
this.options.set('disabled', this.$element.prop('disabled'));
|
5407 |
-
|
5408 |
-
if (this.options.get('disabled')) {
|
5409 |
-
if (this.isOpen()) {
|
5410 |
-
this.close();
|
5411 |
-
}
|
5412 |
-
|
5413 |
-
this.trigger('disable', {});
|
5414 |
-
} else {
|
5415 |
-
this.trigger('enable', {});
|
5416 |
-
}
|
5417 |
-
};
|
5418 |
-
|
5419 |
-
Select2.prototype._syncSubtree = function (evt, mutations) {
|
5420 |
-
var changed = false;
|
5421 |
-
var self = this;
|
5422 |
-
|
5423 |
-
// Ignore any mutation events raised for elements that aren't options or
|
5424 |
-
// optgroups. This handles the case when the select element is destroyed
|
5425 |
-
if (
|
5426 |
-
evt && evt.target && (
|
5427 |
-
evt.target.nodeName !== 'OPTION' && evt.target.nodeName !== 'OPTGROUP'
|
5428 |
-
)
|
5429 |
-
) {
|
5430 |
-
return;
|
5431 |
-
}
|
5432 |
-
|
5433 |
-
if (!mutations) {
|
5434 |
-
// If mutation events aren't supported, then we can only assume that the
|
5435 |
-
// change affected the selections
|
5436 |
-
changed = true;
|
5437 |
-
} else if (mutations.addedNodes && mutations.addedNodes.length > 0) {
|
5438 |
-
for (var n = 0; n < mutations.addedNodes.length; n++) {
|
5439 |
-
var node = mutations.addedNodes[n];
|
5440 |
-
|
5441 |
-
if (node.selected) {
|
5442 |
-
changed = true;
|
5443 |
-
}
|
5444 |
-
}
|
5445 |
-
} else if (mutations.removedNodes && mutations.removedNodes.length > 0) {
|
5446 |
-
changed = true;
|
5447 |
-
}
|
5448 |
-
|
5449 |
-
// Only re-pull the data if we think there is a change
|
5450 |
-
if (changed) {
|
5451 |
-
this.dataAdapter.current(function (currentData) {
|
5452 |
-
self.trigger('selection:update', {
|
5453 |
-
data: currentData
|
5454 |
-
});
|
5455 |
-
});
|
5456 |
-
}
|
5457 |
-
};
|
5458 |
-
|
5459 |
-
/**
|
5460 |
-
* Override the trigger method to automatically trigger pre-events when
|
5461 |
-
* there are events that can be prevented.
|
5462 |
-
*/
|
5463 |
-
Select2.prototype.trigger = function (name, args) {
|
5464 |
-
var actualTrigger = Select2.__super__.trigger;
|
5465 |
-
var preTriggerMap = {
|
5466 |
-
'open': 'opening',
|
5467 |
-
'close': 'closing',
|
5468 |
-
'select': 'selecting',
|
5469 |
-
'unselect': 'unselecting'
|
5470 |
-
};
|
5471 |
-
|
5472 |
-
if (args === undefined) {
|
5473 |
-
args = {};
|
5474 |
-
}
|
5475 |
-
|
5476 |
-
if (name in preTriggerMap) {
|
5477 |
-
var preTriggerName = preTriggerMap[name];
|
5478 |
-
var preTriggerArgs = {
|
5479 |
-
prevented: false,
|
5480 |
-
name: name,
|
5481 |
-
args: args
|
5482 |
-
};
|
5483 |
-
|
5484 |
-
actualTrigger.call(this, preTriggerName, preTriggerArgs);
|
5485 |
-
|
5486 |
-
if (preTriggerArgs.prevented) {
|
5487 |
-
args.prevented = true;
|
5488 |
-
|
5489 |
-
return;
|
5490 |
-
}
|
5491 |
-
}
|
5492 |
-
|
5493 |
-
actualTrigger.call(this, name, args);
|
5494 |
-
};
|
5495 |
-
|
5496 |
-
Select2.prototype.toggleDropdown = function () {
|
5497 |
-
if (this.options.get('disabled')) {
|
5498 |
-
return;
|
5499 |
-
}
|
5500 |
-
|
5501 |
-
if (this.isOpen()) {
|
5502 |
-
this.close();
|
5503 |
-
} else {
|
5504 |
-
this.open();
|
5505 |
-
}
|
5506 |
-
};
|
5507 |
-
|
5508 |
-
Select2.prototype.open = function () {
|
5509 |
-
if (this.isOpen()) {
|
5510 |
-
return;
|
5511 |
-
}
|
5512 |
-
|
5513 |
-
this.trigger('query', {});
|
5514 |
-
};
|
5515 |
-
|
5516 |
-
Select2.prototype.close = function () {
|
5517 |
-
if (!this.isOpen()) {
|
5518 |
-
return;
|
5519 |
-
}
|
5520 |
-
|
5521 |
-
this.trigger('close', {});
|
5522 |
-
};
|
5523 |
-
|
5524 |
-
Select2.prototype.isOpen = function () {
|
5525 |
-
return this.$container.hasClass('select2-container--open');
|
5526 |
-
};
|
5527 |
-
|
5528 |
-
Select2.prototype.hasFocus = function () {
|
5529 |
-
return this.$container.hasClass('select2-container--focus');
|
5530 |
-
};
|
5531 |
-
|
5532 |
-
Select2.prototype.focus = function (data) {
|
5533 |
-
// No need to re-trigger focus events if we are already focused
|
5534 |
-
if (this.hasFocus()) {
|
5535 |
-
return;
|
5536 |
-
}
|
5537 |
-
|
5538 |
-
this.$container.addClass('select2-container--focus');
|
5539 |
-
this.trigger('focus', {});
|
5540 |
-
};
|
5541 |
-
|
5542 |
-
Select2.prototype.enable = function (args) {
|
5543 |
-
if (this.options.get('debug') && window.console && console.warn) {
|
5544 |
-
console.warn(
|
5545 |
-
'Select2: The `select2("enable")` method has been deprecated and will' +
|
5546 |
-
' be removed in later Select2 versions. Use $element.prop("disabled")' +
|
5547 |
-
' instead.'
|
5548 |
-
);
|
5549 |
-
}
|
5550 |
-
|
5551 |
-
if (args == null || args.length === 0) {
|
5552 |
-
args = [true];
|
5553 |
-
}
|
5554 |
-
|
5555 |
-
var disabled = !args[0];
|
5556 |
-
|
5557 |
-
this.$element.prop('disabled', disabled);
|
5558 |
-
};
|
5559 |
-
|
5560 |
-
Select2.prototype.data = function () {
|
5561 |
-
if (this.options.get('debug') &&
|
5562 |
-
arguments.length > 0 && window.console && console.warn) {
|
5563 |
-
console.warn(
|
5564 |
-
'Select2: Data can no longer be set using `select2("data")`. You ' +
|
5565 |
-
'should consider setting the value instead using `$element.val()`.'
|
5566 |
-
);
|
5567 |
-
}
|
5568 |
-
|
5569 |
-
var data = [];
|
5570 |
-
|
5571 |
-
this.dataAdapter.current(function (currentData) {
|
5572 |
-
data = currentData;
|
5573 |
-
});
|
5574 |
-
|
5575 |
-
return data;
|
5576 |
-
};
|
5577 |
-
|
5578 |
-
Select2.prototype.val = function (args) {
|
5579 |
-
if (this.options.get('debug') && window.console && console.warn) {
|
5580 |
-
console.warn(
|
5581 |
-
'Select2: The `select2("val")` method has been deprecated and will be' +
|
5582 |
-
' removed in later Select2 versions. Use $element.val() instead.'
|
5583 |
-
);
|
5584 |
-
}
|
5585 |
-
|
5586 |
-
if (args == null || args.length === 0) {
|
5587 |
-
return this.$element.val();
|
5588 |
-
}
|
5589 |
-
|
5590 |
-
var newVal = args[0];
|
5591 |
-
|
5592 |
-
if ($.isArray(newVal)) {
|
5593 |
-
newVal = $.map(newVal, function (obj) {
|
5594 |
-
return obj.toString();
|
5595 |
-
});
|
5596 |
-
}
|
5597 |
-
|
5598 |
-
this.$element.val(newVal).trigger('change');
|
5599 |
-
};
|
5600 |
-
|
5601 |
-
Select2.prototype.destroy = function () {
|
5602 |
-
this.$container.remove();
|
5603 |
-
|
5604 |
-
if (this.$element[0].detachEvent) {
|
5605 |
-
this.$element[0].detachEvent('onpropertychange', this._syncA);
|
5606 |
-
}
|
5607 |
-
|
5608 |
-
if (this._observer != null) {
|
5609 |
-
this._observer.disconnect();
|
5610 |
-
this._observer = null;
|
5611 |
-
} else if (this.$element[0].removeEventListener) {
|
5612 |
-
this.$element[0]
|
5613 |
-
.removeEventListener('DOMAttrModified', this._syncA, false);
|
5614 |
-
this.$element[0]
|
5615 |
-
.removeEventListener('DOMNodeInserted', this._syncS, false);
|
5616 |
-
this.$element[0]
|
5617 |
-
.removeEventListener('DOMNodeRemoved', this._syncS, false);
|
5618 |
-
}
|
5619 |
-
|
5620 |
-
this._syncA = null;
|
5621 |
-
this._syncS = null;
|
5622 |
-
|
5623 |
-
this.$element.off('.select2');
|
5624 |
-
this.$element.attr('tabindex', this.$element.data('old-tabindex'));
|
5625 |
-
|
5626 |
-
this.$element.removeClass('select2-hidden-accessible');
|
5627 |
-
this.$element.attr('aria-hidden', 'false');
|
5628 |
-
this.$element.removeData('select2');
|
5629 |
-
|
5630 |
-
this.dataAdapter.destroy();
|
5631 |
-
this.selection.destroy();
|
5632 |
-
this.dropdown.destroy();
|
5633 |
-
this.results.destroy();
|
5634 |
-
|
5635 |
-
this.dataAdapter = null;
|
5636 |
-
this.selection = null;
|
5637 |
-
this.dropdown = null;
|
5638 |
-
this.results = null;
|
5639 |
-
};
|
5640 |
-
|
5641 |
-
Select2.prototype.render = function () {
|
5642 |
-
var $container = $(
|
5643 |
-
'<span class="select2 select2-container">' +
|
5644 |
-
'<span class="selection"></span>' +
|
5645 |
-
'<span class="dropdown-wrapper" aria-hidden="true"></span>' +
|
5646 |
-
'</span>'
|
5647 |
-
);
|
5648 |
-
|
5649 |
-
$container.attr('dir', this.options.get('dir'));
|
5650 |
-
|
5651 |
-
this.$container = $container;
|
5652 |
-
|
5653 |
-
this.$container.addClass('select2-container--' + this.options.get('theme'));
|
5654 |
-
|
5655 |
-
$container.data('element', this.$element);
|
5656 |
-
|
5657 |
-
return $container;
|
5658 |
-
};
|
5659 |
-
|
5660 |
-
return Select2;
|
5661 |
-
});
|
5662 |
-
|
5663 |
-
S2.define('jquery-mousewheel',[
|
5664 |
-
'jquery'
|
5665 |
-
], function ($) {
|
5666 |
-
// Used to shim jQuery.mousewheel for non-full builds.
|
5667 |
-
return $;
|
5668 |
-
});
|
5669 |
-
|
5670 |
-
S2.define('jquery.select2',[
|
5671 |
-
'jquery',
|
5672 |
-
'jquery-mousewheel',
|
5673 |
-
|
5674 |
-
'./select2/core',
|
5675 |
-
'./select2/defaults'
|
5676 |
-
], function ($, _, Select2, Defaults) {
|
5677 |
-
if ($.fn.select2 == null) {
|
5678 |
-
// All methods that should return the element
|
5679 |
-
var thisMethods = ['open', 'close', 'destroy'];
|
5680 |
-
|
5681 |
-
$.fn.select2 = function (options) {
|
5682 |
-
options = options || {};
|
5683 |
-
|
5684 |
-
if (typeof options === 'object') {
|
5685 |
-
this.each(function () {
|
5686 |
-
var instanceOptions = $.extend(true, {}, options);
|
5687 |
-
|
5688 |
-
var instance = new Select2($(this), instanceOptions);
|
5689 |
-
});
|
5690 |
-
|
5691 |
-
return this;
|
5692 |
-
} else if (typeof options === 'string') {
|
5693 |
-
var ret;
|
5694 |
-
var args = Array.prototype.slice.call(arguments, 1);
|
5695 |
-
|
5696 |
-
this.each(function () {
|
5697 |
-
var instance = $(this).data('select2');
|
5698 |
-
|
5699 |
-
if (instance == null && window.console && console.error) {
|
5700 |
-
console.error(
|
5701 |
-
'The select2(\'' + options + '\') method was called on an ' +
|
5702 |
-
'element that is not using Select2.'
|
5703 |
-
);
|
5704 |
-
}
|
5705 |
-
|
5706 |
-
ret = instance[options].apply(instance, args);
|
5707 |
-
});
|
5708 |
-
|
5709 |
-
// Check if we should be returning `this`
|
5710 |
-
if ($.inArray(options, thisMethods) > -1) {
|
5711 |
-
return this;
|
5712 |
-
}
|
5713 |
-
|
5714 |
-
return ret;
|
5715 |
-
} else {
|
5716 |
-
throw new Error('Invalid arguments for Select2: ' + options);
|
5717 |
-
}
|
5718 |
-
};
|
5719 |
-
}
|
5720 |
-
|
5721 |
-
if ($.fn.select2.defaults == null) {
|
5722 |
-
$.fn.select2.defaults = Defaults;
|
5723 |
-
}
|
5724 |
-
|
5725 |
-
return Select2;
|
5726 |
-
});
|
5727 |
-
|
5728 |
-
// Return the AMD loader configuration so it can be used outside of this file
|
5729 |
-
return {
|
5730 |
-
define: S2.define,
|
5731 |
-
require: S2.require
|
5732 |
-
};
|
5733 |
-
}());
|
5734 |
-
|
5735 |
-
// Autoload the jQuery bindings
|
5736 |
-
// We know that all of the modules exist above this, so we're safe
|
5737 |
-
var select2 = S2.require('jquery.select2');
|
5738 |
-
|
5739 |
-
// Hold the AMD module references on the jQuery function that was just loaded
|
5740 |
-
// This allows Select2 to use the internal loader outside of this file, such
|
5741 |
-
// as in the language files.
|
5742 |
-
jQuery.fn.select2.amd = S2;
|
5743 |
-
|
5744 |
-
// Return the Select2 instance for anyone who is importing it.
|
5745 |
-
return select2;
|
5746 |
-
}));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/lib/select2/select2.min.js
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
/*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c),c}:a(jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return v.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o=b&&b.split("/"),p=t.map,q=p&&p["*"]||{};if(a){for(a=a.split("/"),g=a.length-1,t.nodeIdCompat&&x.test(a[g])&&(a[g]=a[g].replace(x,"")),"."===a[0].charAt(0)&&o&&(n=o.slice(0,o.length-1),a=n.concat(a)),k=0;k<a.length;k++)if("."===(m=a[k]))a.splice(k,1),k-=1;else if(".."===m){if(0===k||1===k&&".."===a[2]||".."===a[k-1])continue;k>0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}if((o||q)&&p){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),o)for(l=o.length;l>0;l-=1)if((e=p[o.slice(0,l).join("/")])&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&q&&q[d]&&(i=q[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){var d=w.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),o.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){r[a]=b}}function j(a){if(e(s,a)){var c=s[a];delete s[a],u[a]=!0,n.apply(b,c)}if(!e(r,a)&&!e(u,a))throw new Error("No "+a);return r[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return a?k(a):[]}function m(a){return function(){return t&&t.config&&t.config[a]||{}}}var n,o,p,q,r={},s={},t={},u={},v=Object.prototype.hasOwnProperty,w=[].slice,x=/\.js$/;p=function(a,b){var c,d=k(a),e=d[0],g=b[1];return a=d[1],e&&(e=f(e,g),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(g)):f(a,g):(a=f(a,g),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},q={require:function(a){return g(a)},exports:function(a){var b=r[a];return void 0!==b?b:r[a]={}},module:function(a){return{id:a,uri:"",exports:r[a],config:m(a)}}},n=function(a,c,d,f){var h,k,m,n,o,t,v,w=[],x=typeof d;if(f=f||a,t=l(f),"undefined"===x||"function"===x){for(c=!c.length&&d.length?["require","exports","module"]:c,o=0;o<c.length;o+=1)if(n=p(c[o],t),"require"===(k=n.f))w[o]=q.require(a);else if("exports"===k)w[o]=q.exports(a),v=!0;else if("module"===k)h=w[o]=q.module(a);else if(e(r,k)||e(s,k)||e(u,k))w[o]=j(k);else{if(!n.p)throw new Error(a+" missing "+k);n.p.load(n.n,g(f,!0),i(k),{}),w[o]=r[k]}m=d?d.apply(r[a],w):void 0,a&&(h&&h.exports!==b&&h.exports!==r[a]?r[a]=h.exports:m===b&&v||(r[a]=m))}else a&&(r[a]=d)},a=c=o=function(a,c,d,e,f){if("string"==typeof a)return q[a]?q[a](c):j(p(a,l(c)).f);if(!a.splice){if(t=a,t.deps&&o(t.deps,t.callback),!c)return;c.splice?(a=c,c=d,d=null):a=b}return c=c||function(){},"function"==typeof d&&(d=e,e=f),e?n(b,a,c,d):setTimeout(function(){n(b,a,c,d)},4),o},o.config=function(a){return o(a)},a._defined=r,d=function(a,b,c){if("string"!=typeof a)throw new Error("See almond README: incorrect module build, no module name");b.splice||(c=b,b=[]),e(r,a)||e(s,a)||(s[a]=[a,b,c])},d.amd={jQuery:!0}}(),b.requirejs=a,b.require=c,b.define=d}}(),b.define("almond",function(){}),b.define("jquery",[],function(){var b=a||$;return null==b&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),b}),b.define("select2/utils",["jquery"],function(a){function b(a){var b=a.prototype,c=[];for(var d in b){"function"==typeof b[d]&&("constructor"!==d&&c.push(d))}return c}var c={};c.Extend=function(a,b){function c(){this.constructor=a}var d={}.hasOwnProperty;for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},c.Decorate=function(a,c){function d(){var b=Array.prototype.unshift,d=c.prototype.constructor.length,e=a.prototype.constructor;d>0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;h<g.length;h++){var i=g[h];d.prototype[i]=a.prototype[i]}for(var j=(function(a){var b=function(){};a in d.prototype&&(b=d.prototype[a]);var e=c.prototype[a];return function(){return Array.prototype.unshift.call(arguments,b),e.apply(this,arguments)}}),k=0;k<f.length;k++){var l=f[k];d.prototype[l]=j(l)}return d};var d=function(){this.listeners={}};return d.prototype.on=function(a,b){this.listeners=this.listeners||{},a in this.listeners?this.listeners[a].push(b):this.listeners[a]=[b]},d.prototype.trigger=function(a){var b=Array.prototype.slice,c=b.call(arguments,1);this.listeners=this.listeners||{},null==c&&(c=[]),0===c.length&&c.push({}),c[0]._type=a,a in this.listeners&&this.invoke(this.listeners[a],b.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},d.prototype.invoke=function(a,b){for(var c=0,d=a.length;c<d;c++)a[c].apply(this,b)},c.Observable=d,c.generateChars=function(a){for(var b="",c=0;c<a;c++){b+=Math.floor(36*Math.random()).toString(36)}return b},c.bind=function(a,b){return function(){a.apply(b,arguments)}},c._convertData=function(a){for(var b in a){var c=b.split("-"),d=a;if(1!==c.length){for(var e=0;e<c.length;e++){var f=c[e];f=f.substring(0,1).toLowerCase()+f.substring(1),f in d||(d[f]={}),e==c.length-1&&(d[f]=a[b]),d=d[f]}delete a[b]}}return a},c.hasScroll=function(b,c){var d=a(c),e=c.style.overflowX,f=c.style.overflowY;return(e!==f||"hidden"!==f&&"visible"!==f)&&("scroll"===e||"scroll"===f||(d.innerHeight()<c.scrollHeight||d.innerWidth()<c.scrollWidth))},c.escapeMarkup=function(a){var b={"\\":"\","&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<ul class="select2-results__options" role="tree"></ul>');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a('<li role="treeitem" aria-live="assertive" class="select2-results__option"></li>'),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c<a.results.length;c++){var d=a.results[c],e=this.option(d);b.push(e)}this.$results.append(b)},c.prototype.position=function(a,b){b.find(".select2-results").append(a)},c.prototype.sort=function(a){return this.options.get("sorter")(a)},c.prototype.highlightFirstItem=function(){var a=this.$results.find(".select2-results__option[aria-selected]"),b=a.filter("[aria-selected=true]");b.length>0?b.first().trigger("mouseenter"):a.first().trigger("mouseenter"),this.ensureHighlightVisible()},c.prototype.setClasses=function(){var b=this;this.data.current(function(c){var d=a.map(c,function(a){return a.id.toString()});b.$results.find(".select2-results__option[aria-selected]").each(function(){var b=a(this),c=a.data(this,"data"),e=""+c.id;null!=c.element&&c.element.selected||null==c.element&&a.inArray(e,d)>-1?b.attr("aria-selected","true"):b.attr("aria-selected","false")})})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"treeitem","aria-selected":"false"};b.disabled&&(delete d["aria-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["aria-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d.role="group",d["aria-label"]=b.text,delete d["aria-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group";a(h);this.template(b,h);for(var i=[],j=0;j<b.children.length;j++){var k=b.children[j],l=this.option(k);i.push(l)}var m=a("<ul></ul>",{class:"select2-results__options select2-results__options--nested"});m.append(i),g.append(h),g.append(m)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b,c){var d=this,e=b.id+"-results";this.$results.attr("id",e),b.on("results:all",function(a){d.clear(),d.append(a.data),b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("results:append",function(a){d.append(a.data),b.isOpen()&&d.setClasses()}),b.on("query",function(a){d.hideMessages(),d.showLoading(a)}),b.on("select",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("unselect",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("open",function(){d.$results.attr("aria-expanded","true"),d.$results.attr("aria-hidden","false"),d.setClasses(),d.ensureHighlightVisible()}),b.on("close",function(){d.$results.attr("aria-expanded","false"),d.$results.attr("aria-hidden","true"),d.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=d.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=d.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("aria-selected")?d.trigger("close",{}):d.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a);if(0!==c){var e=c-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top,h=f.offset().top,i=d.$results.scrollTop()+(h-g);0===e?d.$results.scrollTop(0):h-g<0&&d.$results.scrollTop(i)}}),b.on("results:next",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a),e=c+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top+d.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=d.$results.scrollTop()+h-g;0===e?d.$results.scrollTop(0):h>g&&d.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted")}),b.on("results:message",function(a){d.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=d.$results.scrollTop(),c=d.$results.get(0).scrollHeight-b+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=d.$results.height();e?(d.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(d.$results.scrollTop(d.$results.get(0).scrollHeight-d.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(b){var c=a(this),e=c.data("data");if("true"===c.attr("aria-selected"))return void(d.options.get("multiple")?d.trigger("unselect",{originalEvent:b,data:e}):d.trigger("close",{}));d.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(b){var c=a(this).data("data");d.getHighlightedResults().removeClass("select2-results__option--highlighted"),d.trigger("results:focus",{data:c,element:a(this)})})},c.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[aria-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),c<=2?this.$results.scrollTop(0):(g>this.$results.outerHeight()||g<0)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a('<span class="select2-selection" role="combobox" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a,b){var d=this,e=(a.id,a.id+"-results");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),d.$selection.focus(),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2");a(".select2.select2-container--open").each(function(){var b=a(this);this!=d[0]&&b.data("element").select2("close")})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){b.find(".selection").append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d),this.$selection.attr("aria-labelledby",d),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("blur",function(a){}),a.on("focus",function(b){a.isOpen()||c.$selection.focus()}),a.on("selection:update",function(a){c.update(a.data)})},e.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},e.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},e.prototype.selectionContainer=function(){return a("<span></span>")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.$selection.find(".select2-selection__rendered"),d=this.display(b,c);c.empty().append(d),c.prop("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html('<ul class="select2-selection__rendered"></ul>'),a},d.prototype.bind=function(b,c){var e=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){e.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!e.options.get("disabled")){var c=a(this),d=c.parent(),f=d.data("data");e.trigger("unselect",{originalEvent:b,data:f})}})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},d.prototype.selectionContainer=function(){return a('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">×</span></li>')},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d<a.length;d++){var e=a[d],f=this.selectionContainer(),g=this.display(e,f);f.append(g),f.prop("title",e.title||e.text),f.data("data",e),b.push(f)}var h=this.$selection.find(".select2-selection__rendered");c.appendMany(h,b)}},d}),b.define("select2/selection/placeholder",["../utils"],function(a){function b(a,b,c){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c)}return b.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},b.prototype.createPlaceholder=function(a,b){var c=this.selectionContainer();return c.html(this.display(b)),c.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),c},b.prototype.update=function(a,b){var c=1==b.length&&b[0].id!=this.placeholder.id;if(b.length>1||c)return a.call(this,b);this.clear();var d=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(d)},b}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e<d.length;e++){var f={data:d[e]};if(this.trigger("unselect",f),f.prevented)return}this.$element.val(this.placeholder.id).trigger("change"),this.trigger("toggle",{})}}},c.prototype._handleKeyboardClear=function(a,c,d){d.isOpen()||c.which!=b.DELETE&&c.which!=b.BACKSPACE||this._handleClear(c)},c.prototype.update=function(b,c){if(b.call(this,c),!(this.$selection.find(".select2-selection__placeholder").length>0||0===c.length)){var d=a('<span class="select2-selection__clear">×</span>');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="textbox" aria-autocomplete="list" /></li>');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,b,d){var e=this;a.call(this,b,d),b.on("open",function(){e.$search.trigger("focus")}),b.on("close",function(){e.$search.val(""),e.$search.removeAttr("aria-activedescendant"),e.$search.trigger("focus")}),b.on("enable",function(){e.$search.prop("disabled",!1),e._transferTabIndex()}),b.on("disable",function(){e.$search.prop("disabled",!0)}),b.on("focus",function(a){e.$search.trigger("focus")}),b.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.id)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){if(a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented(),a.which===c.BACKSPACE&&""===e.$search.val()){var b=e.$searchContainer.prev(".select2-selection__choice");if(b.length>0){var d=b.data("data");e.searchRemoveChoice(d),a.preventDefault()}}});var f=document.documentMode,g=f&&f<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){if(g)return void e.$selection.off("input.search input.searchcheck");e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(g&&"input"===a.type)return void e.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&e.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{a=.75*(this.$search.val().length+1)+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"}}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d=b.id+"-result-";return d+=a.generateChars(4),null!=c.id?d+="-"+c.id.toString():d+="-"+a.generateChars(4),d},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f<a.length;f++){var g=a[f].id;-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")});else{var d=a.id;this.$element.val(d),this.$element.trigger("change")}},d.prototype.unselect=function(a){var b=this;if(this.$element.prop("multiple")){if(a.selected=!1,c(a.element).is("option"))return a.element.selected=!1,void this.$element.trigger("change");this.current(function(d){for(var e=[],f=0;f<d.length;f++){var g=d[f].id;g!==a.id&&-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")})}},d.prototype.bind=function(a,b){var c=this;this.container=a,a.on("select",function(a){c.select(a.data)}),a.on("unselect",function(a){c.unselect(a.data)})},d.prototype.destroy=function(){this.$element.find("*").each(function(){c.removeData(this,"data")})},d.prototype.query=function(a,b){var d=[],e=this;this.$element.children().each(function(){var b=c(this);if(b.is("option")||b.is("optgroup")){var f=e.item(b),g=e.matches(a,f);null!==g&&d.push(g)}}),b({results:d})},d.prototype.addOptions=function(a){b.appendMany(this.$element,a)},d.prototype.option=function(a){var b;a.children?(b=document.createElement("optgroup"),b.label=a.text):(b=document.createElement("option"),void 0!==b.textContent?b.textContent=a.text:b.innerText=a.text),void 0!==a.id&&(b.value=a.id),a.disabled&&(b.disabled=!0),a.selected&&(b.selected=!0),a.title&&(b.title=a.title);var d=c(b),e=this._normalizeItem(a);return e.element=b,c.data(b,"data",e),d},d.prototype.item=function(a){var b={};if(null!=(b=c.data(a[0],"data")))return b;if(a.is("option"))b={id:a.val(),text:a.text(),disabled:a.prop("disabled"),selected:a.prop("selected"),title:a.prop("title")};else if(a.is("optgroup")){b={text:a.prop("label"),children:[],title:a.prop("title")};for(var d=a.children("option"),e=[],f=0;f<d.length;f++){var g=c(d[f]),h=this.item(g);e.push(h)}b.children=e}return b=this._normalizeItem(b),b.element=a[0],c.data(a[0],"data",b),b},d.prototype._normalizeItem=function(a){c.isPlainObject(a)||(a={id:a,text:a}),a=c.extend({},{text:""},a);var b={selected:!1,disabled:!1};return null!=a.id&&(a.id=a.id.toString()),null!=a.text&&(a.text=a.text.toString()),null==a._resultId&&a.id&&null!=this.container&&(a._resultId=this.generateResultId(this.container,a)),c.extend({},b,a)},d.prototype.matches=function(a,b){return this.options.get("matcher")(a,b)},d}),b.define("select2/data/array",["./select","../utils","jquery"],function(a,b,c){function d(a,b){var c=b.get("data")||[];d.__super__.constructor.call(this,a,b),this.addOptions(this.convertToOptions(c))}return b.Extend(d,a),d.prototype.select=function(a){var b=this.$element.find("option").filter(function(b,c){return c.value==a.id.toString()});0===b.length&&(b=this.option(a),this.addOptions(b)),d.__super__.select.call(this,a)},d.prototype.convertToOptions=function(a){function d(a){return function(){return c(this).val()==a.id}}for(var e=this,f=this.$element.find("option"),g=f.map(function(){return e.item(c(this)).id}).get(),h=[],i=0;i<a.length;i++){var j=this._normalizeItem(a[i]);if(c.inArray(j.id,g)>=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f)},function(){d.status&&"0"===d.status||e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&null!=a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h<e.length;h++){var i=e[h],j=this._normalizeItem(i),k=this.option(j);this.$element.append(k)}}return b.prototype.query=function(a,b,c){function d(a,f){for(var g=a.results,h=0;h<g.length;h++){var i=g[h],j=null!=i.children&&!d({results:i.children},!0);if((i.text||"").toUpperCase()===(b.term||"").toUpperCase()||j)return!f&&(a.data=g,void c(a))}if(f)return!0;var k=e.createTag(b);if(null!=k){var l=e.option(k);l.attr("data-select2-tag",!0),e.addOptions([l]),e.insertTag(g,k)}a.results=g,c(a)}var e=this;if(this._removeOldTags(),null==b.term||null!=b.page)return void a.call(this,b,c);a.call(this,b,d)},b.prototype.createTag=function(b,c){var d=a.trim(c.term);return""===d?null:{id:d,text:d}},b.prototype.insertTag=function(a,b,c){b.unshift(c)},b.prototype._removeOldTags=function(b){this._lastTag;this.$element.find("option[data-select2-tag]").each(function(){this.selected||a(this).remove()})},b}),b.define("select2/data/tokenizer",["jquery"],function(a){function b(a,b,c){var d=c.get("tokenizer");void 0!==d&&(this.tokenizer=d),a.call(this,b,c)}return b.prototype.bind=function(a,b,c){a.call(this,b,c),this.$search=b.dropdown.$search||b.selection.$search||c.find(".select2-search__field")},b.prototype.query=function(b,c,d){function e(b){var c=g._normalizeItem(b);if(!g.$element.find("option").filter(function(){return a(this).val()===c.id}).length){var d=g.option(c);d.attr("data-select2-tag",!0),g._removeOldTags(),g.addOptions([d])}f(c)}function f(a){g.trigger("select",{data:a})}var g=this;c.term=c.term||"";var h=this.tokenizer(c,this.options,e);h.term!==c.term&&(this.$search.length&&(this.$search.val(h.term),this.$search.focus()),c.term=h.term),b.call(this,c,d)},b.prototype.tokenizer=function(b,c,d,e){for(var f=d.get("tokenSeparators")||[],g=c.term,h=0,i=this.createTag||function(a){return{id:a.term,text:a.term}};h<g.length;){var j=g[h];if(-1!==a.inArray(j,f)){var k=g.substr(0,h),l=a.extend({},c,{term:k}),m=i(l);null!=m?(e(m),g=g.substr(h+1)||"",h=0):h++}else h++}return{term:g}},b}),b.define("select2/data/minimumInputLength",[],function(){function a(a,b,c){this.minimumInputLength=c.get("minimumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){if(b.term=b.term||"",b.term.length<this.minimumInputLength)return void this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:b.term,params:b}});a.call(this,b,c)},a}),b.define("select2/data/maximumInputLength",[],function(){function a(a,b,c){this.maximumInputLength=c.get("maximumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){if(b.term=b.term||"",this.maximumInputLength>0&&b.term.length>this.maximumInputLength)return void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}});a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;if(d.maximumSelectionLength>0&&f>=d.maximumSelectionLength)return void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}});a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<span class="select2-dropdown"><span class="select2-results"></span></span>');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="textbox" /></span>');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val("")}),c.on("focus",function(){c.isOpen()||e.$search.focus()}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){e.showSearch(a)?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){e.$results.offset().top+e.$results.outerHeight(!1)+50>=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1)&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('<li class="select2-results__option select2-results__option--load-more"role="treeitem" aria-disabled="true"></li>'),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a("<span></span>"),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(b){var c=a(this).data("select2-scroll-position");a(this).scrollTop(c.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id;this.$container.parents().filter(b.hasScroll).off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.top<f.top-h.height,k=i.bottom>f.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-n.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative",a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d<b.length;d++){var e=b[d];e.children?c+=a(e.children):c++}return c}function b(a,b,c,d){this.minimumResultsForSearch=c.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),a.call(this,b,c,d)}return b.prototype.showSearch=function(b,c){return!(a(c.data.results)<this.minimumResultsForSearch)&&b.call(this,c)},b}),b.define("select2/dropdown/selectOnClose",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("close",function(a){d._handleSelectOnClose(a)})},a.prototype._handleSelectOnClose=function(a,b){if(b&&null!=b.originalSelect2Event){var c=b.originalSelect2Event;if("select"===c._type||"unselect"===c._type)return}var d=this.getHighlightedResults();if(!(d.length<1)){var e=d.data("data");null!=e.element&&e.element.selected||null==e.element&&e.selected||this.trigger("select",{data:e})}},a}),b.define("select2/dropdown/closeOnSelect",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("select",function(a){d._selectTriggered(a)}),b.on("unselect",function(a){d._selectTriggered(a)})},a.prototype._selectTriggered=function(a,b){var c=b.originalEvent;c&&c.ctrlKey||this.trigger("close",{originalEvent:c,originalSelect2Event:b})},a}),b.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(a){var b=a.input.length-a.maximum,c="Please delete "+b+" character";return 1!=b&&(c+="s"),c},inputTooShort:function(a){return"Please enter "+(a.minimum-a.input.length)+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(a){var b="You can only select "+a.maximum+" item";return 1!=a.maximum&&(b+="s"),b},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),b.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C){function D(){this.reset()}return D.prototype.apply=function(l){if(l=a.extend(!0,{},this.defaults,l),null==l.dataAdapter){if(null!=l.ajax?l.dataAdapter=o:null!=l.data?l.dataAdapter=n:l.dataAdapter=m,l.minimumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),null==l.tokenSeparators&&null==l.tokenizer||(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L<K.length;L++){var M=K[L],N={};try{N=k.loadPath(M)}catch(a){try{M=this.defaults.amdLanguageBase+M,N=k.loadPath(M)}catch(a){l.debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+M+'" could not be automatically loaded. A fallback will be used instead.');continue}}J.extend(N)}l.translations=J}else{var O=k.loadPath(this.defaults.amdLanguageBase+"en"),P=new k(l.language);P.extend(O),l.translations=P}return l},D.prototype.reset=function(){function b(a){function b(a){return l[a]||a}return a.replace(/[^\u0000-\u007E]/g,b)}function c(d,e){if(""===a.trim(d.term))return e;if(e.children&&e.children.length>0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){null==c(d,e.children[g])&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var h=b(e.text).toUpperCase(),i=b(d.term).toUpperCase();return h.indexOf(i)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)},new D}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return e<=0?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;h<i;h+=1){var j=g[h].replace(/\s/g,""),k=j.match(c);if(null!==k&&k.length>=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this.$element.on("focus.select2",function(a){b.trigger("focus",a)}),this._syncA=c.bind(this._syncAttributes,this),this._syncS=c.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._syncA),a.each(c,b._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",b._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",b._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",b._syncS,!1))},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var a=this;this.on("open",function(){a.$container.addClass("select2-container--open")}),this.on("close",function(){a.$container.removeClass("select2-container--open")}),this.on("enable",function(){a.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){a.$container.addClass("select2-container--disabled")}),this.on("blur",function(){a.$container.removeClass("select2-container--focus")}),this.on("query",function(b){a.isOpen()||a.trigger("open",{}),this.dataAdapter.query(b,function(c){a.trigger("results:all",{data:c,query:b})})}),this.on("query:append",function(b){this.dataAdapter.query(b,function(c){a.trigger("results:append",{data:c,query:b})})}),this.on("keypress",function(b){var c=b.which;a.isOpen()?c===d.ESC||c===d.TAB||c===d.UP&&b.altKey?(a.close(),b.preventDefault()):c===d.ENTER?(a.trigger("results:select",{}),b.preventDefault()):c===d.SPACE&&b.ctrlKey?(a.trigger("results:toggle",{}),b.preventDefault()):c===d.UP?(a.trigger("results:previous",{}),b.preventDefault()):c===d.DOWN&&(a.trigger("results:next",{}),b.preventDefault()):(c===d.ENTER||c===d.SPACE||c===d.DOWN&&b.altKey)&&(a.open(),b.preventDefault())})},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype._syncSubtree=function(a,b){var c=!1,d=this;if(!a||!a.target||"OPTION"===a.target.nodeName||"OPTGROUP"===a.target.nodeName){if(b)if(b.addedNodes&&b.addedNodes.length>0)for(var e=0;e<b.addedNodes.length;e++){var f=b.addedNodes[e];f.selected&&(c=!0)}else b.removedNodes&&b.removedNodes.length>0&&(c=!0);else c=!0;c&&this.dataAdapter.current(function(a){d.trigger("selection:update",{data:a})})}},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=a&&0!==a.length||(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},e.prototype.render=function(){var b=a('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("jquery-mousewheel",["jquery"],function(a){return a}),b.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(a,b,c,d){if(null==a.fn.select2){var e=["open","close","destroy"];a.fn.select2=function(b){if("object"==typeof(b=b||{}))return this.each(function(){var d=a.extend(!0,{},b);new c(a(this),d)}),this;if("string"==typeof b){var d,f=Array.prototype.slice.call(arguments,1);return this.each(function(){var c=a(this).data("select2");null==c&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2."),d=c[b].apply(c,f)}),a.inArray(b,e)>-1?this:d}throw new Error("Invalid arguments for Select2: "+b)}}return null==a.fn.select2.defaults&&(a.fn.select2.defaults=d),c}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,c});
|
|
assets/lib/wp-color-picker-alpha/wp-color-picker-alpha.js
DELETED
@@ -1,496 +0,0 @@
|
|
1 |
-
/**!
|
2 |
-
* wp-color-picker-alpha
|
3 |
-
*
|
4 |
-
* Overwrite Automattic Iris for enabled Alpha Channel in wpColorPicker
|
5 |
-
* Only run in input and is defined data alpha in true
|
6 |
-
*
|
7 |
-
* Version: 2.1.3
|
8 |
-
* https://github.com/kallookoo/wp-color-picker-alpha
|
9 |
-
* Licensed under the GPLv2 license.
|
10 |
-
*/
|
11 |
-
( function( $ ) {
|
12 |
-
// Prevent double-init.
|
13 |
-
if ( $.wp.wpColorPicker.prototype._hasAlpha ) {
|
14 |
-
return;
|
15 |
-
}
|
16 |
-
|
17 |
-
// Variable for some backgrounds ( grid )
|
18 |
-
var image = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAAHnlligAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNpi+P///4EDBxiAGMgCCCAGFB5AADGCRBgYDh48CCRZIJS9vT2QBAggFBkmBiSAogxFBiCAoHogAKIKAlBUYTELAiAmEtABEECk20G6BOmuIl0CIMBQ/IEMkO0myiSSraaaBhZcbkUOs0HuBwDplz5uFJ3Z4gAAAABJRU5ErkJggg==',
|
19 |
-
// html stuff for wpColorPicker copy of the original color-picker.js
|
20 |
-
_after = '<div class="wp-picker-holder" />',
|
21 |
-
_wrap = '<div class="wp-picker-container" />',
|
22 |
-
_button = '<input type="button" class="button button-small" />',
|
23 |
-
// Prevent CSS issues in < WordPress 4.9
|
24 |
-
_deprecated = ( wpColorPickerL10n.current !== undefined );
|
25 |
-
// Declare some global variables when is deprecated or not
|
26 |
-
if ( _deprecated ) {
|
27 |
-
var _before = '<a tabindex="0" class="wp-color-result" />';
|
28 |
-
} else {
|
29 |
-
var _before = '<button type="button" class="button wp-color-result" aria-expanded="false"><span class="wp-color-result-text"></span></button>',
|
30 |
-
_wrappingLabel = '<label></label>',
|
31 |
-
_wrappingLabelText = '<span class="screen-reader-text"></span>';
|
32 |
-
}
|
33 |
-
/**
|
34 |
-
* Overwrite Color
|
35 |
-
* for enable support rbga
|
36 |
-
*/
|
37 |
-
Color.fn.toString = function() {
|
38 |
-
if ( this._alpha < 1 )
|
39 |
-
return this.toCSS( 'rgba', this._alpha ).replace( /\s+/g, '' );
|
40 |
-
|
41 |
-
var hex = parseInt( this._color, 10 ).toString( 16 );
|
42 |
-
|
43 |
-
if ( this.error )
|
44 |
-
return '';
|
45 |
-
|
46 |
-
if ( hex.length < 6 )
|
47 |
-
hex = ( '00000' + hex ).substr( -6 );
|
48 |
-
|
49 |
-
return '#' + hex;
|
50 |
-
};
|
51 |
-
|
52 |
-
/**
|
53 |
-
* Overwrite wpColorPicker
|
54 |
-
*/
|
55 |
-
$.widget( 'wp.wpColorPicker', $.wp.wpColorPicker, {
|
56 |
-
_hasAlpha: true,
|
57 |
-
/**
|
58 |
-
* @summary Creates the color picker.
|
59 |
-
*
|
60 |
-
* Creates the color picker, sets default values, css classes and wraps it all in HTML.
|
61 |
-
*
|
62 |
-
* @since 3.5.0
|
63 |
-
*
|
64 |
-
* @access private
|
65 |
-
*
|
66 |
-
* @returns {void}
|
67 |
-
*/
|
68 |
-
_create: function() {
|
69 |
-
// Return early if Iris support is missing.
|
70 |
-
if ( ! $.support.iris ) {
|
71 |
-
return;
|
72 |
-
}
|
73 |
-
|
74 |
-
var self = this,
|
75 |
-
el = self.element;
|
76 |
-
|
77 |
-
// Override default options with options bound to the element.
|
78 |
-
$.extend( self.options, el.data() );
|
79 |
-
|
80 |
-
// Create a color picker which only allows adjustments to the hue.
|
81 |
-
if ( self.options.type === 'hue' ) {
|
82 |
-
return self._createHueOnly();
|
83 |
-
}
|
84 |
-
|
85 |
-
// Bind the close event.
|
86 |
-
self.close = $.proxy( self.close, self );
|
87 |
-
|
88 |
-
self.initialValue = el.val();
|
89 |
-
|
90 |
-
// Add a CSS class to the input field.
|
91 |
-
el.addClass( 'wp-color-picker' );
|
92 |
-
|
93 |
-
if ( _deprecated ) {
|
94 |
-
el.hide().wrap( _wrap );
|
95 |
-
self.wrap = el.parent();
|
96 |
-
self.toggler = $( _before )
|
97 |
-
.insertBefore( el )
|
98 |
-
.css( { backgroundColor : self.initialValue } )
|
99 |
-
.attr( 'title', wpColorPickerL10n.pick )
|
100 |
-
.attr( 'data-current', wpColorPickerL10n.current );
|
101 |
-
self.pickerContainer = $( _after ).insertAfter( el );
|
102 |
-
self.button = $( _button ).addClass('hidden');
|
103 |
-
} else {
|
104 |
-
/*
|
105 |
-
* Check if there's already a wrapping label, e.g. in the Customizer.
|
106 |
-
* If there's no label, add a default one to match the Customizer template.
|
107 |
-
*/
|
108 |
-
if ( ! el.parent( 'label' ).length ) {
|
109 |
-
// Wrap the input field in the default label.
|
110 |
-
el.wrap( _wrappingLabel );
|
111 |
-
// Insert the default label text.
|
112 |
-
self.wrappingLabelText = $( _wrappingLabelText )
|
113 |
-
.insertBefore( el )
|
114 |
-
.text( wpColorPickerL10n.defaultLabel );
|
115 |
-
}
|
116 |
-
|
117 |
-
/*
|
118 |
-
* At this point, either it's the standalone version or the Customizer
|
119 |
-
* one, we have a wrapping label to use as hook in the DOM, let's store it.
|
120 |
-
*/
|
121 |
-
self.wrappingLabel = el.parent();
|
122 |
-
|
123 |
-
// Wrap the label in the main wrapper.
|
124 |
-
self.wrappingLabel.wrap( _wrap );
|
125 |
-
// Store a reference to the main wrapper.
|
126 |
-
self.wrap = self.wrappingLabel.parent();
|
127 |
-
// Set up the toggle button and insert it before the wrapping label.
|
128 |
-
self.toggler = $( _before )
|
129 |
-
.insertBefore( self.wrappingLabel )
|
130 |
-
.css( { backgroundColor: self.initialValue } );
|
131 |
-
// Set the toggle button span element text.
|
132 |
-
self.toggler.find( '.wp-color-result-text' ).text( wpColorPickerL10n.pick );
|
133 |
-
// Set up the Iris container and insert it after the wrapping label.
|
134 |
-
self.pickerContainer = $( _after ).insertAfter( self.wrappingLabel );
|
135 |
-
// Store a reference to the Clear/Default button.
|
136 |
-
self.button = $( _button );
|
137 |
-
}
|
138 |
-
|
139 |
-
// Set up the Clear/Default button.
|
140 |
-
if ( self.options.defaultColor ) {
|
141 |
-
self.button.addClass( 'wp-picker-default' ).val( wpColorPickerL10n.defaultString );
|
142 |
-
if ( ! _deprecated ) {
|
143 |
-
self.button.attr( 'aria-label', wpColorPickerL10n.defaultAriaLabel );
|
144 |
-
}
|
145 |
-
} else {
|
146 |
-
self.button.addClass( 'wp-picker-clear' ).val( wpColorPickerL10n.clear );
|
147 |
-
if ( ! _deprecated ) {
|
148 |
-
self.button.attr( 'aria-label', wpColorPickerL10n.clearAriaLabel );
|
149 |
-
}
|
150 |
-
}
|
151 |
-
|
152 |
-
if ( _deprecated ) {
|
153 |
-
el.wrap( '<span class="wp-picker-input-wrap" />' ).after( self.button );
|
154 |
-
} else {
|
155 |
-
// Wrap the wrapping label in its wrapper and append the Clear/Default button.
|
156 |
-
self.wrappingLabel
|
157 |
-
.wrap( '<span class="wp-picker-input-wrap hidden" />' )
|
158 |
-
.after( self.button );
|
159 |
-
|
160 |
-
/*
|
161 |
-
* The input wrapper now contains the label+input+Clear/Default button.
|
162 |
-
* Store a reference to the input wrapper: we'll use this to toggle
|
163 |
-
* the controls visibility.
|
164 |
-
*/
|
165 |
-
self.inputWrapper = el.closest( '.wp-picker-input-wrap' );
|
166 |
-
}
|
167 |
-
|
168 |
-
el.iris( {
|
169 |
-
target: self.pickerContainer,
|
170 |
-
hide: self.options.hide,
|
171 |
-
width: self.options.width,
|
172 |
-
mode: self.options.mode,
|
173 |
-
palettes: self.options.palettes,
|
174 |
-
/**
|
175 |
-
* @summary Handles the onChange event if one has been defined in the options.
|
176 |
-
*
|
177 |
-
* Handles the onChange event if one has been defined in the options and additionally
|
178 |
-
* sets the background color for the toggler element.
|
179 |
-
*
|
180 |
-
* @since 3.5.0
|
181 |
-
*
|
182 |
-
* @param {Event} event The event that's being called.
|
183 |
-
* @param {HTMLElement} ui The HTMLElement containing the color picker.
|
184 |
-
*
|
185 |
-
* @returns {void}
|
186 |
-
*/
|
187 |
-
change: function( event, ui ) {
|
188 |
-
if ( self.options.alpha ) {
|
189 |
-
self.toggler.css( { 'background-image' : 'url(' + image + ')' } );
|
190 |
-
if ( _deprecated ) {
|
191 |
-
self.toggler.html( '<span class="color-alpha" />' );
|
192 |
-
} else {
|
193 |
-
self.toggler.css( {
|
194 |
-
'position' : 'relative'
|
195 |
-
} );
|
196 |
-
if ( self.toggler.find('span.color-alpha').length == 0 ) {
|
197 |
-
self.toggler.append('<span class="color-alpha" />');
|
198 |
-
}
|
199 |
-
}
|
200 |
-
|
201 |
-
self.toggler.find( 'span.color-alpha' ).css( {
|
202 |
-
'width' : '30px',
|
203 |
-
'height' : '24px',
|
204 |
-
'position' : 'absolute',
|
205 |
-
'top' : 0,
|
206 |
-
'left' : 0,
|
207 |
-
'border-top-left-radius' : '2px',
|
208 |
-
'border-bottom-left-radius' : '2px',
|
209 |
-
'background' : ui.color.toString()
|
210 |
-
} );
|
211 |
-
} else {
|
212 |
-
self.toggler.css( { backgroundColor : ui.color.toString() } );
|
213 |
-
}
|
214 |
-
|
215 |
-
if ( $.isFunction( self.options.change ) ) {
|
216 |
-
self.options.change.call( this, event, ui );
|
217 |
-
}
|
218 |
-
}
|
219 |
-
} );
|
220 |
-
|
221 |
-
el.val( self.initialValue );
|
222 |
-
self._addListeners();
|
223 |
-
|
224 |
-
// Force the color picker to always be closed on initial load.
|
225 |
-
if ( ! self.options.hide ) {
|
226 |
-
self.toggler.click();
|
227 |
-
}
|
228 |
-
},
|
229 |
-
/**
|
230 |
-
* @summary Binds event listeners to the color picker.
|
231 |
-
*
|
232 |
-
* @since 3.5.0
|
233 |
-
*
|
234 |
-
* @access private
|
235 |
-
*
|
236 |
-
* @returns {void}
|
237 |
-
*/
|
238 |
-
_addListeners: function() {
|
239 |
-
var self = this;
|
240 |
-
|
241 |
-
/**
|
242 |
-
* @summary Prevent any clicks inside this widget from leaking to the top and closing it.
|
243 |
-
*
|
244 |
-
* @since 3.5.0
|
245 |
-
*
|
246 |
-
* @param {Event} event The event that's being called.
|
247 |
-
*
|
248 |
-
* @returs {void}
|
249 |
-
*/
|
250 |
-
self.wrap.on( 'click.wpcolorpicker', function( event ) {
|
251 |
-
event.stopPropagation();
|
252 |
-
});
|
253 |
-
|
254 |
-
/**
|
255 |
-
* @summary Open or close the color picker depending on the class.
|
256 |
-
*
|
257 |
-
* @since 3.5
|
258 |
-
*/
|
259 |
-
self.toggler.click( function(){
|
260 |
-
if ( self.toggler.hasClass( 'wp-picker-open' ) ) {
|
261 |
-
self.close();
|
262 |
-
} else {
|
263 |
-
self.open();
|
264 |
-
}
|
265 |
-
});
|
266 |
-
|
267 |
-
/**
|
268 |
-
* @summary Checks if value is empty when changing the color in the color picker.
|
269 |
-
*
|
270 |
-
* Checks if value is empty when changing the color in the color picker.
|
271 |
-
* If so, the background color is cleared.
|
272 |
-
*
|
273 |
-
* @since 3.5.0
|
274 |
-
*
|
275 |
-
* @param {Event} event The event that's being called.
|
276 |
-
*
|
277 |
-
* @returns {void}
|
278 |
-
*/
|
279 |
-
self.element.on( 'change', function( event ) {
|
280 |
-
// Empty or Error = clear
|
281 |
-
if ( $( this ).val() === '' || self.element.hasClass( 'iris-error' ) ) {
|
282 |
-
if ( self.options.alpha ) {
|
283 |
-
if ( _deprecated ) {
|
284 |
-
self.toggler.removeAttr( 'style' );
|
285 |
-
}
|
286 |
-
self.toggler.find( 'span.color-alpha' ).css( 'backgroundColor', '' );
|
287 |
-
} else {
|
288 |
-
self.toggler.css( 'backgroundColor', '' );
|
289 |
-
}
|
290 |
-
|
291 |
-
// fire clear callback if we have one
|
292 |
-
if ( $.isFunction( self.options.clear ) )
|
293 |
-
self.options.clear.call( this, event );
|
294 |
-
}
|
295 |
-
} );
|
296 |
-
|
297 |
-
/**
|
298 |
-
* @summary Enables the user to clear or revert the color in the color picker.
|
299 |
-
*
|
300 |
-
* Enables the user to either clear the color in the color picker or revert back to the default color.
|
301 |
-
*
|
302 |
-
* @since 3.5.0
|
303 |
-
*
|
304 |
-
* @param {Event} event The event that's being called.
|
305 |
-
*
|
306 |
-
* @returns {void}
|
307 |
-
*/
|
308 |
-
self.button.on( 'click', function( event ) {
|
309 |
-
if ( $( this ).hasClass( 'wp-picker-clear' ) ) {
|
310 |
-
self.element.val( '' );
|
311 |
-
if ( self.options.alpha ) {
|
312 |
-
if ( _deprecated ) {
|
313 |
-
self.toggler.removeAttr( 'style' );
|
314 |
-
}
|
315 |
-
self.toggler.find( 'span.color-alpha' ).css( 'backgroundColor', '' );
|
316 |
-
} else {
|
317 |
-
self.toggler.css( 'backgroundColor', '' );
|
318 |
-
}
|
319 |
-
|
320 |
-
if ( $.isFunction( self.options.clear ) )
|
321 |
-
self.options.clear.call( this, event );
|
322 |
-
|
323 |
-
} else if ( $( this ).hasClass( 'wp-picker-default' ) ) {
|
324 |
-
self.element.val( self.options.defaultColor ).change();
|
325 |
-
}
|
326 |
-
});
|
327 |
-
},
|
328 |
-
});
|
329 |
-
|
330 |
-
/**
|
331 |
-
* Overwrite iris
|
332 |
-
*/
|
333 |
-
$.widget( 'a8c.iris', $.a8c.iris, {
|
334 |
-
_create: function() {
|
335 |
-
this._super();
|
336 |
-
|
337 |
-
// Global option for check is mode rbga is enabled
|
338 |
-
this.options.alpha = this.element.data( 'alpha' ) || false;
|
339 |
-
|
340 |
-
// Is not input disabled
|
341 |
-
if ( ! this.element.is( ':input' ) )
|
342 |
-
this.options.alpha = false;
|
343 |
-
|
344 |
-
if ( typeof this.options.alpha !== 'undefined' && this.options.alpha ) {
|
345 |
-
var self = this,
|
346 |
-
el = self.element,
|
347 |
-
_html = '<div class="iris-strip iris-slider iris-alpha-slider"><div class="iris-slider-offset iris-slider-offset-alpha"></div></div>',
|
348 |
-
aContainer = $( _html ).appendTo( self.picker.find( '.iris-picker-inner' ) ),
|
349 |
-
aSlider = aContainer.find( '.iris-slider-offset-alpha' ),
|
350 |
-
controls = {
|
351 |
-
aContainer : aContainer,
|
352 |
-
aSlider : aSlider
|
353 |
-
};
|
354 |
-
|
355 |
-
if ( typeof el.data( 'custom-width' ) !== 'undefined' ) {
|
356 |
-
self.options.customWidth = parseInt( el.data( 'custom-width' ) ) || 0;
|
357 |
-
} else {
|
358 |
-
self.options.customWidth = 100;
|
359 |
-
}
|
360 |
-
|
361 |
-
// Set default width for input reset
|
362 |
-
self.options.defaultWidth = el.width();
|
363 |
-
|
364 |
-
// Update width for input
|
365 |
-
if ( self._color._alpha < 1 || self._color.toString().indexOf('rgb') != -1 )
|
366 |
-
el.width( parseInt( self.options.defaultWidth + self.options.customWidth ) );
|
367 |
-
|
368 |
-
// Push new controls
|
369 |
-
$.each( controls, function( k, v ) {
|
370 |
-
self.controls[k] = v;
|
371 |
-
} );
|
372 |
-
|
373 |
-
// Change size strip and add margin for sliders
|
374 |
-
self.controls.square.css( { 'margin-right': '0' } );
|
375 |
-
var emptyWidth = ( self.picker.width() - self.controls.square.width() - 20 ),
|
376 |
-
stripsMargin = ( emptyWidth / 6 ),
|
377 |
-
stripsWidth = ( ( emptyWidth / 2 ) - stripsMargin );
|
378 |
-
|
379 |
-
$.each( [ 'aContainer', 'strip' ], function( k, v ) {
|
380 |
-
self.controls[v].width( stripsWidth ).css( { 'margin-left' : stripsMargin + 'px' } );
|
381 |
-
} );
|
382 |
-
|
383 |
-
// Add new slider
|
384 |
-
self._initControls();
|
385 |
-
|
386 |
-
// For updated widget
|
387 |
-
self._change();
|
388 |
-
}
|
389 |
-
},
|
390 |
-
_initControls: function() {
|
391 |
-
this._super();
|
392 |
-
|
393 |
-
if ( this.options.alpha ) {
|
394 |
-
var self = this,
|
395 |
-
controls = self.controls;
|
396 |
-
|
397 |
-
controls.aSlider.slider({
|
398 |
-
orientation : 'vertical',
|
399 |
-
min : 0,
|
400 |
-
max : 100,
|
401 |
-
step : 1,
|
402 |
-
value : parseInt( self._color._alpha * 100 ),
|
403 |
-
slide : function( event, ui ) {
|
404 |
-
// Update alpha value
|
405 |
-
self._color._alpha = parseFloat( ui.value / 100 );
|
406 |
-
self._change.apply( self, arguments );
|
407 |
-
}
|
408 |
-
});
|
409 |
-
}
|
410 |
-
},
|
411 |
-
_change: function() {
|
412 |
-
this._super();
|
413 |
-
|
414 |
-
var self = this,
|
415 |
-
el = self.element;
|
416 |
-
|
417 |
-
if ( this.options.alpha ) {
|
418 |
-
var controls = self.controls,
|
419 |
-
alpha = parseInt( self._color._alpha * 100 ),
|
420 |
-
color = self._color.toRgb(),
|
421 |
-
gradient = [
|
422 |
-
'rgb(' + color.r + ',' + color.g + ',' + color.b + ') 0%',
|
423 |
-
'rgba(' + color.r + ',' + color.g + ',' + color.b + ', 0) 100%'
|
424 |
-
],
|
425 |
-
defaultWidth = self.options.defaultWidth,
|
426 |
-
customWidth = self.options.customWidth,
|
427 |
-
target = self.picker.closest( '.wp-picker-container' ).find( '.wp-color-result' );
|
428 |
-
|
429 |
-
// Generate background slider alpha, only for CSS3 old browser fuck!! :)
|
430 |
-
controls.aContainer.css( { 'background' : 'linear-gradient(to bottom, ' + gradient.join( ', ' ) + '), url(' + image + ')' } );
|
431 |
-
|
432 |
-
if ( target.hasClass( 'wp-picker-open' ) ) {
|
433 |
-
// Update alpha value
|
434 |
-
controls.aSlider.slider( 'value', alpha );
|
435 |
-
|
436 |
-
/**
|
437 |
-
* Disabled change opacity in default slider Saturation ( only is alpha enabled )
|
438 |
-
* and change input width for view all value
|
439 |
-
*/
|
440 |
-
if ( self._color._alpha < 1 ) {
|
441 |
-
controls.strip.attr( 'style', controls.strip.attr( 'style' ).replace( /rgba\(([0-9]+,)(\s+)?([0-9]+,)(\s+)?([0-9]+)(,(\s+)?[0-9\.]+)\)/g, 'rgb($1$3$5)' ) );
|
442 |
-
el.width( parseInt( defaultWidth + customWidth ) );
|
443 |
-
} else {
|
444 |
-
el.width( defaultWidth );
|
445 |
-
}
|
446 |
-
}
|
447 |
-
}
|
448 |
-
|
449 |
-
var reset = el.data( 'reset-alpha' ) || false;
|
450 |
-
|
451 |
-
if ( reset ) {
|
452 |
-
self.picker.find( '.iris-palette-container' ).on( 'click.palette', '.iris-palette', function() {
|
453 |
-
self._color._alpha = 1;
|
454 |
-
self.active = 'external';
|
455 |
-
self._change();
|
456 |
-
} );
|
457 |
-
}
|
458 |
-
},
|
459 |
-
_addInputListeners: function( input ) {
|
460 |
-
var self = this,
|
461 |
-
debounceTimeout = 100,
|
462 |
-
callback = function( event ) {
|
463 |
-
var color = new Color( input.val() ),
|
464 |
-
val = input.val();
|
465 |
-
|
466 |
-
input.removeClass( 'iris-error' );
|
467 |
-
// we gave a bad color
|
468 |
-
if ( color.error ) {
|
469 |
-
// don't error on an empty input
|
470 |
-
if ( val !== '' )
|
471 |
-
input.addClass( 'iris-error' );
|
472 |
-
} else {
|
473 |
-
if ( color.toString() !== self._color.toString() ) {
|
474 |
-
// let's not do this on keyup for hex shortcodes
|
475 |
-
if ( ! ( event.type === 'keyup' && val.match( /^[0-9a-fA-F]{3}$/ ) ) )
|
476 |
-
self._setOption( 'color', color.toString() );
|
477 |
-
}
|
478 |
-
}
|
479 |
-
};
|
480 |
-
|
481 |
-
input.on( 'change', callback ).on( 'keyup', self._debounce( callback, debounceTimeout ) );
|
482 |
-
|
483 |
-
// If we initialized hidden, show on first focus. The rest is up to you.
|
484 |
-
if ( self.options.hide ) {
|
485 |
-
input.on( 'focus', function() {
|
486 |
-
self.show();
|
487 |
-
} );
|
488 |
-
}
|
489 |
-
}
|
490 |
-
} );
|
491 |
-
}( jQuery ) );
|
492 |
-
|
493 |
-
// Auto Call plugin is class is color-picker
|
494 |
-
jQuery( document ).ready( function( $ ) {
|
495 |
-
$( '.color-picker' ).wpColorPicker();
|
496 |
-
} );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/lib/wp-color-picker-alpha/wp-color-picker-alpha.min.js
DELETED
@@ -1,11 +0,0 @@
|
|
1 |
-
/**!
|
2 |
-
* wp-color-picker-alpha
|
3 |
-
*
|
4 |
-
* Overwrite Automattic Iris for enabled Alpha Channel in wpColorPicker
|
5 |
-
* Only run in input and is defined data alpha in true
|
6 |
-
*
|
7 |
-
* Version: 2.1.3
|
8 |
-
* https://github.com/kallookoo/wp-color-picker-alpha
|
9 |
-
* Licensed under the GPLv2 license.
|
10 |
-
*/
|
11 |
-
!function(a){if(!a.wp.wpColorPicker.prototype._hasAlpha){var b="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAAHnlligAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNpi+P///4EDBxiAGMgCCCAGFB5AADGCRBgYDh48CCRZIJS9vT2QBAggFBkmBiSAogxFBiCAoHogAKIKAlBUYTELAiAmEtABEECk20G6BOmuIl0CIMBQ/IEMkO0myiSSraaaBhZcbkUOs0HuBwDplz5uFJ3Z4gAAAABJRU5ErkJggg==",c='<div class="wp-picker-holder" />',d='<div class="wp-picker-container" />',e='<input type="button" class="button button-small" />',f=void 0!==wpColorPickerL10n.current;if(f)var g='<a tabindex="0" class="wp-color-result" />';else var g='<button type="button" class="button wp-color-result" aria-expanded="false"><span class="wp-color-result-text"></span></button>',h="<label></label>",i='<span class="screen-reader-text"></span>';Color.fn.toString=function(){if(this._alpha<1)return this.toCSS("rgba",this._alpha).replace(/\s+/g,"");var a=parseInt(this._color,10).toString(16);return this.error?"":(a.length<6&&(a=("00000"+a).substr(-6)),"#"+a)},a.widget("wp.wpColorPicker",a.wp.wpColorPicker,{_hasAlpha:!0,_create:function(){if(a.support.iris){var j=this,k=j.element;if(a.extend(j.options,k.data()),"hue"===j.options.type)return j._createHueOnly();j.close=a.proxy(j.close,j),j.initialValue=k.val(),k.addClass("wp-color-picker"),f?(k.hide().wrap(d),j.wrap=k.parent(),j.toggler=a(g).insertBefore(k).css({backgroundColor:j.initialValue}).attr("title",wpColorPickerL10n.pick).attr("data-current",wpColorPickerL10n.current),j.pickerContainer=a(c).insertAfter(k),j.button=a(e).addClass("hidden")):(k.parent("label").length||(k.wrap(h),j.wrappingLabelText=a(i).insertBefore(k).text(wpColorPickerL10n.defaultLabel)),j.wrappingLabel=k.parent(),j.wrappingLabel.wrap(d),j.wrap=j.wrappingLabel.parent(),j.toggler=a(g).insertBefore(j.wrappingLabel).css({backgroundColor:j.initialValue}),j.toggler.find(".wp-color-result-text").text(wpColorPickerL10n.pick),j.pickerContainer=a(c).insertAfter(j.wrappingLabel),j.button=a(e)),j.options.defaultColor?(j.button.addClass("wp-picker-default").val(wpColorPickerL10n.defaultString),f||j.button.attr("aria-label",wpColorPickerL10n.defaultAriaLabel)):(j.button.addClass("wp-picker-clear").val(wpColorPickerL10n.clear),f||j.button.attr("aria-label",wpColorPickerL10n.clearAriaLabel)),f?k.wrap('<span class="wp-picker-input-wrap" />').after(j.button):(j.wrappingLabel.wrap('<span class="wp-picker-input-wrap hidden" />').after(j.button),j.inputWrapper=k.closest(".wp-picker-input-wrap")),k.iris({target:j.pickerContainer,hide:j.options.hide,width:j.options.width,mode:j.options.mode,palettes:j.options.palettes,change:function(c,d){j.options.alpha?(j.toggler.css({"background-image":"url("+b+")"}),f?j.toggler.html('<span class="color-alpha" />'):(j.toggler.css({position:"relative"}),0==j.toggler.find("span.color-alpha").length&&j.toggler.append('<span class="color-alpha" />')),j.toggler.find("span.color-alpha").css({width:"30px",height:"24px",position:"absolute",top:0,left:0,"border-top-left-radius":"2px","border-bottom-left-radius":"2px",background:d.color.toString()})):j.toggler.css({backgroundColor:d.color.toString()}),a.isFunction(j.options.change)&&j.options.change.call(this,c,d)}}),k.val(j.initialValue),j._addListeners(),j.options.hide||j.toggler.click()}},_addListeners:function(){var b=this;b.wrap.on("click.wpcolorpicker",function(a){a.stopPropagation()}),b.toggler.click(function(){b.toggler.hasClass("wp-picker-open")?b.close():b.open()}),b.element.on("change",function(c){(""===a(this).val()||b.element.hasClass("iris-error"))&&(b.options.alpha?(f&&b.toggler.removeAttr("style"),b.toggler.find("span.color-alpha").css("backgroundColor","")):b.toggler.css("backgroundColor",""),a.isFunction(b.options.clear)&&b.options.clear.call(this,c))}),b.button.on("click",function(c){a(this).hasClass("wp-picker-clear")?(b.element.val(""),b.options.alpha?(f&&b.toggler.removeAttr("style"),b.toggler.find("span.color-alpha").css("backgroundColor","")):b.toggler.css("backgroundColor",""),a.isFunction(b.options.clear)&&b.options.clear.call(this,c)):a(this).hasClass("wp-picker-default")&&b.element.val(b.options.defaultColor).change()})}}),a.widget("a8c.iris",a.a8c.iris,{_create:function(){if(this._super(),this.options.alpha=this.element.data("alpha")||!1,this.element.is(":input")||(this.options.alpha=!1),"undefined"!=typeof this.options.alpha&&this.options.alpha){var b=this,c=b.element,d='<div class="iris-strip iris-slider iris-alpha-slider"><div class="iris-slider-offset iris-slider-offset-alpha"></div></div>',e=a(d).appendTo(b.picker.find(".iris-picker-inner")),f=e.find(".iris-slider-offset-alpha"),g={aContainer:e,aSlider:f};"undefined"!=typeof c.data("custom-width")?b.options.customWidth=parseInt(c.data("custom-width"))||0:b.options.customWidth=100,b.options.defaultWidth=c.width(),(b._color._alpha<1||-1!=b._color.toString().indexOf("rgb"))&&c.width(parseInt(b.options.defaultWidth+b.options.customWidth)),a.each(g,function(a,c){b.controls[a]=c}),b.controls.square.css({"margin-right":"0"});var h=b.picker.width()-b.controls.square.width()-20,i=h/6,j=h/2-i;a.each(["aContainer","strip"],function(a,c){b.controls[c].width(j).css({"margin-left":i+"px"})}),b._initControls(),b._change()}},_initControls:function(){if(this._super(),this.options.alpha){var a=this,b=a.controls;b.aSlider.slider({orientation:"vertical",min:0,max:100,step:1,value:parseInt(100*a._color._alpha),slide:function(b,c){a._color._alpha=parseFloat(c.value/100),a._change.apply(a,arguments)}})}},_change:function(){this._super();var a=this,c=a.element;if(this.options.alpha){var d=a.controls,e=parseInt(100*a._color._alpha),f=a._color.toRgb(),g=["rgb("+f.r+","+f.g+","+f.b+") 0%","rgba("+f.r+","+f.g+","+f.b+", 0) 100%"],h=a.options.defaultWidth,i=a.options.customWidth,j=a.picker.closest(".wp-picker-container").find(".wp-color-result");d.aContainer.css({background:"linear-gradient(to bottom, "+g.join(", ")+"), url("+b+")"}),j.hasClass("wp-picker-open")&&(d.aSlider.slider("value",e),a._color._alpha<1?(d.strip.attr("style",d.strip.attr("style").replace(/rgba\(([0-9]+,)(\s+)?([0-9]+,)(\s+)?([0-9]+)(,(\s+)?[0-9\.]+)\)/g,"rgb($1$3$5)")),c.width(parseInt(h+i))):c.width(h))}var k=c.data("reset-alpha")||!1;k&&a.picker.find(".iris-palette-container").on("click.palette",".iris-palette",function(){a._color._alpha=1,a.active="external",a._change()})},_addInputListeners:function(a){var b=this,c=100,d=function(c){var d=new Color(a.val()),e=a.val();a.removeClass("iris-error"),d.error?""!==e&&a.addClass("iris-error"):d.toString()!==b._color.toString()&&("keyup"===c.type&&e.match(/^[0-9a-fA-F]{3}$/)||b._setOption("color",d.toString()))};a.on("change",d).on("keyup",b._debounce(d,c)),b.options.hide&&a.on("focus",function(){b.show()})}})}}(jQuery),jQuery(document).ready(function(a){a(".color-picker").wpColorPicker()});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/static-images/logo.svg
CHANGED
@@ -1,121 +1,59 @@
|
|
1 |
-
<?xml version="1.0" encoding="UTF-8"
|
2 |
-
<svg
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:56.25px;font-family:Lobster;-inkscape-font-specification:Lobster;text-align:center;text-anchor:middle;fill:#00d1b2;fill-opacity:1"
|
61 |
-
d="m 128.05884,379.47266 5.96008,-28.125 8.10242,0 -0.71411,3.48816 q 0.74157,-0.65918 1.51062,-1.2909 0.76904,-0.63171 1.59301,-1.09863 0.85144,-0.49439 1.75782,-0.79651 0.90637,-0.30212 1.9226,-0.30212 0.96131,0 1.67542,0.35705 0.74158,0.35706 1.23596,0.93384 0.49439,0.57678 0.74158,1.34582 0.24719,0.76905 0.24719,1.59302 0,0.74158 -0.24719,1.48316 -0.24719,0.71411 -0.76904,1.29089 -0.49439,0.57678 -1.26343,0.9613 -0.76905,0.35706 -1.78528,0.35706 -0.79651,0 -1.23596,-0.27466 -0.41199,-0.27466 -0.63172,-0.68664 -0.21972,-0.41199 -0.32959,-0.87891 -0.0824,-0.49438 -0.19226,-0.90637 -0.10986,-0.41199 -0.30212,-0.68665 -0.1648,-0.27466 -0.57678,-0.27466 -1.2909,0 -2.1698,0.60425 -0.87891,0.57678 -1.92261,1.53809 l -4.5044,21.36841 -8.10241,0 z"
|
62 |
-
inkscape:connector-curvature="0"/>
|
63 |
-
<path id="path3461"
|
64 |
-
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:56.25px;font-family:Lobster;-inkscape-font-specification:Lobster;text-align:center;text-anchor:middle;fill:#00d1b2;fill-opacity:1"
|
65 |
-
d="m 183.01794,358.10425 q -1.64794,1.73034 -4.2572,2.93884 -2.60925,1.2085 -5.71289,1.73035 -0.32959,3.90014 -1.51062,7.03125 -1.15356,3.1311 -2.93884,5.32837 -1.78528,2.19726 -4.09241,3.37829 -2.30713,1.18103 -4.88891,1.18103 -1.95008,0 -3.62549,-0.46692 -1.64795,-0.49438 -2.85645,-1.53808 -1.18103,-1.07117 -1.84021,-2.74658 -0.68664,-1.70288 -0.68664,-4.11988 0,-1.64795 0.35705,-3.73535 0.32959,-2.11487 1.07117,-4.3396 0.76904,-2.22473 1.95007,-4.3396 1.2085,-2.14233 2.91138,-3.81775 1.73035,-1.67541 3.98254,-2.69165 2.2522,-1.0437 5.13611,-1.0437 7.22351,0 7.22351,8.98132 l 0,0.0549 q 0.13733,0.0549 0.24719,0.0549 0.13733,0 0.35706,0 0.98877,0 2.11487,-0.27466 1.15356,-0.30212 2.30713,-0.76904 1.15356,-0.46692 2.25219,-1.07117 1.09864,-0.63171 2.00501,-1.26343 l 0.49438,1.53809 z m -14.63928,4.83398 q -0.8789,-0.21972 -1.20849,-0.85144 -0.30213,-0.65918 -0.30213,-1.51062 0,-1.18103 0.46692,-1.92261 0.49439,-0.76904 1.29089,-1.12609 -0.0549,-0.90638 -0.19226,-1.51062 -0.13733,-0.63172 -0.38452,-1.01624 -0.24719,-0.41199 -0.63171,-0.57678 -0.35706,-0.1648 -0.93384,-0.1648 -1.01623,0 -1.95007,0.79651 -0.93384,0.76904 -1.78528,2.05994 -0.82398,1.29089 -1.53809,2.96631 -0.68664,1.64795 -1.18103,3.40576 -0.49438,1.75781 -0.76904,3.48816 -0.27466,1.70288 -0.27466,3.10364 0,1.40075 0.13733,2.27966 0.1648,0.87891 0.49439,1.40076 0.35705,0.49438 0.90637,0.68664 0.54931,0.19226 1.34582,0.19226 1.01624,0 2.03247,-0.90637 1.0437,-0.90637 1.92261,-2.47192 0.87891,-1.56556 1.53809,-3.70789 0.68664,-2.14233 1.01623,-4.61426 z"
|
66 |
-
inkscape:connector-curvature="0"/>
|
67 |
-
<path id="path3463"
|
68 |
-
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:56.25px;font-family:Lobster;-inkscape-font-specification:Lobster;text-align:center;text-anchor:middle;fill:#00d1b2;fill-opacity:1"
|
69 |
-
d="m 206.88574,369.3927 q -0.79651,2.27966 -1.73034,3.95508 -0.93384,1.67541 -1.95008,2.82898 -0.98877,1.15356 -2.03247,1.86767 -1.0437,0.71411 -2.03247,1.09864 -0.98877,0.38452 -1.89514,0.52185 -0.90637,0.13733 -1.64795,0.13733 -2.41699,0 -3.84521,-1.31836 -1.42823,-1.34583 -1.73035,-4.01001 -1.07117,1.73034 -2.1698,2.77404 -1.09863,1.04371 -2.1698,1.62049 -1.07117,0.57678 -2.0874,0.74158 -1.01624,0.19226 -1.89515,0.19226 -1.26342,0 -2.36206,-0.38453 -1.09863,-0.38452 -1.9226,-1.20849 -0.79651,-0.82398 -1.26343,-2.0874 -0.46692,-1.26343 -0.46692,-3.04871 0,-0.76904 0.10986,-1.67541 0.10987,-0.93384 0.32959,-2.00501 l 3.81775,-18.04504 8.10242,0 -4.03748,19.11621 q -0.16479,0.8789 -0.16479,1.59301 0,0.96131 0.35705,1.64795 0.35706,0.65918 1.31836,0.65918 0.82398,0 1.51062,-0.35705 0.68665,-0.38452 1.23597,-1.0437 0.57678,-0.65918 0.98877,-1.56555 0.43945,-0.93384 0.76904,-2.00501 l 3.81775,-18.04504 8.10241,0 -4.03747,19.11621 q -0.13733,0.46692 -0.19226,0.93384 -0.0549,0.43945 -0.0549,0.8789 0,1.18103 0.54931,1.64795 0.57679,0.43945 1.75782,0.43945 0.82397,0 1.51062,-0.35705 0.71411,-0.38452 1.29089,-1.0437 0.57678,-0.65918 1.01623,-1.56555 0.43946,-0.93384 0.74158,-2.00501 l 2.36206,0 z"
|
70 |
-
inkscape:connector-curvature="0"/>
|
71 |
-
<path id="path3465"
|
72 |
-
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:56.25px;font-family:Lobster;-inkscape-font-specification:Lobster;text-align:center;text-anchor:middle;fill:#00d1b2;fill-opacity:1"
|
73 |
-
d="m 228.41895,369.3927 q -2.19727,2.55432 -4.422,4.22974 -2.19727,1.64795 -4.17481,2.80151 -0.8789,0.93384 -1.97754,1.59302 -1.07116,0.63171 -2.25219,1.0437 -1.15357,0.38452 -2.36206,0.54932 -1.18103,0.19226 -2.2522,0.19226 -2.11487,0 -3.68042,-0.63172 -1.53809,-0.65918 -2.55432,-1.67541 -1.01624,-1.0437 -1.48316,-2.30713 -0.49438,-1.2909 -0.49438,-2.58179 0,-0.98877 0.27466,-1.81274 0.24719,-0.85144 0.65918,-1.51062 0.41198,-0.65918 0.93383,-1.1261 0.54932,-0.49439 1.1261,-0.76904 2.36206,-4.22974 3.98255,-8.34961 1.62048,-4.14734 2.93884,-8.32215 l 8.32214,-1.09863 q 0.1648,3.65295 0.30213,6.3446 0.16479,2.66419 0.30212,4.64173 0.13733,1.95007 0.24719,3.32336 0.10987,1.37329 0.19226,2.44446 0.10987,1.0437 0.13733,1.92261 0.0549,0.85144 0.0549,1.78528 0,0.63171 -0.0549,1.15356 -0.0275,0.52185 -0.16479,0.98877 1.23596,-0.71411 2.22473,-1.40076 1.01624,-0.71411 1.81274,-1.42822 l 2.36207,0 z m -22.65931,2.03247 q 0,1.97754 0.76905,2.96631 0.79651,0.9613 2.66418,0.9613 0.93384,0 1.81275,-0.24719 0.8789,-0.27466 1.56555,-0.87891 0.68664,-0.63171 1.09863,-1.62048 0.41199,-0.98877 0.41199,-2.47192 0,-0.71411 -0.0549,-1.37329 -0.0275,-0.68665 -0.0824,-1.42823 -0.0549,-0.76904 -0.1648,-1.70288 -0.0824,-0.93384 -0.21972,-2.1698 -0.10987,-1.23596 -0.2472,-2.85644 -0.13732,-1.62049 -0.30212,-3.79029 -0.85144,2.74659 -2.005,5.32837 -1.15357,2.58179 -2.55433,5.30091 0.54932,0.30212 0.90638,0.76904 0.38452,0.46692 0.38452,1.18103 0,0.52185 -0.1648,1.01624 -0.16479,0.49438 -0.49438,0.90637 -0.32959,0.38452 -0.79651,0.63171 -0.43945,0.21973 -1.01624,0.21973 -0.46692,0 -0.8789,-0.13733 -0.41199,-0.13733 -0.63172,-0.60425 z"
|
74 |
-
inkscape:connector-curvature="0"/>
|
75 |
-
<path id="path3467"
|
76 |
-
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:56.25px;font-family:Lobster;-inkscape-font-specification:Lobster;text-align:center;text-anchor:middle;fill:#00d1b2;fill-opacity:1"
|
77 |
-
d="m 249.62256,369.3927 q -1.18103,1.97754 -2.71912,3.84522 -1.51062,1.86767 -3.43323,3.32336 -1.89514,1.45569 -4.22973,2.36206 -2.30713,0.87891 -5.08118,0.87891 -2.005,0 -3.62549,-0.49439 -1.62048,-0.52185 -2.77404,-1.59302 -1.15357,-1.07116 -1.75782,-2.74658 -0.63171,-1.70288 -0.63171,-4.09241 0,-1.62048 0.32959,-3.73535 0.32959,-2.11487 1.0437,-4.3396 0.71411,-2.22473 1.89514,-4.36706 1.18103,-2.14234 2.85645,-3.81775 1.67541,-1.70288 3.92761,-2.71912 2.2522,-1.0437 5.13611,-1.0437 1.89514,0 3.07617,0.46692 1.2085,0.43945 1.89514,1.18103 0.71411,0.74158 0.96131,1.73035 0.27465,0.9613 0.27465,2.005 0,2.44446 -1.07116,4.55933 -1.07117,2.0874 -2.88391,3.65295 -1.78528,1.56555 -4.11988,2.52686 -2.33459,0.9613 -4.86145,1.1261 -0.0549,0.63171 -0.10986,1.20849 -0.0275,0.54932 -0.0275,1.0437 0,1.42823 0.2472,2.36206 0.27465,0.90638 0.76904,1.42823 0.52185,0.52185 1.26343,0.74157 0.76904,0.19226 1.78527,0.19226 1.67542,0 3.02124,-0.43945 1.3733,-0.43945 2.55433,-1.20849 1.18103,-0.76905 2.22473,-1.81275 1.07116,-1.0437 2.14233,-2.22473 l 1.92261,0 z m -15.35339,-3.98254 q 1.59301,-0.10987 3.07617,-0.90638 1.48315,-0.7965 2.60925,-2.05993 1.1261,-1.2909 1.78528,-2.91138 0.68664,-1.64795 0.68664,-3.40576 0,-1.0437 -0.30212,-1.67542 -0.30212,-0.63171 -1.09863,-0.63171 -1.07117,0 -2.11487,1.0437 -1.01624,1.01624 -1.92261,2.66419 -0.90637,1.64795 -1.62048,3.73535 -0.68665,2.05993 -1.09863,4.14734 z"
|
78 |
-
inkscape:connector-curvature="0"/>
|
79 |
-
<path id="path3469"
|
80 |
-
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:56.25px;font-family:Lobster;-inkscape-font-specification:Lobster;text-align:center;text-anchor:middle;fill:#00d1b2;fill-opacity:1"
|
81 |
-
d="m 253.66003,341.10291 8.32215,-1.1261 -6.45447,30.37719 q -0.13733,0.46692 -0.19226,0.87891 -0.0549,0.38452 -0.0549,0.76904 0,0.96131 0.49438,1.62049 0.49439,0.63171 1.81275,0.63171 0.79651,0 1.15356,-0.10986 0.35706,-0.10987 0.65918,-0.2472 -0.10986,1.51062 -0.68664,2.63672 -0.54932,1.09864 -1.40076,1.84021 -0.85144,0.71411 -1.92261,1.07117 -1.07117,0.35706 -2.1698,0.35706 -1.26343,0 -2.36206,-0.38453 -1.09863,-0.41198 -1.92261,-1.23596 -0.79651,-0.85144 -1.26342,-2.14233 -0.46692,-1.29089 -0.46692,-3.10364 0,-0.74158 0.10986,-1.64795 0.10986,-0.93384 0.32959,-2.005 l 6.01501,-28.17993 z"
|
82 |
-
inkscape:connector-curvature="0"/>
|
83 |
-
<path id="path3471"
|
84 |
-
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:56.25px;font-family:Lobster;-inkscape-font-specification:Lobster;text-align:center;text-anchor:middle;fill:#00d1b2;fill-opacity:1"
|
85 |
-
d="m 302.68652,344.86572 q 0,1.18103 -0.32959,2.1698 -0.30212,0.96131 -0.85144,1.67542 -0.54931,0.68664 -1.34582,1.07116 -0.79651,0.38453 -1.73035,0.38453 -1.07117,0 -1.95007,-0.43946 -0.85144,-0.46692 -1.48316,-1.31836 1.0437,-0.76904 1.67542,-2.03247 0.63171,-1.29089 0.63171,-2.74658 0,-1.81274 -1.07116,-2.85644 -1.07117,-1.07117 -2.93885,-1.07117 -1.1261,0 -2.0874,0.43945 -0.93384,0.41199 -1.62048,1.18103 -0.65918,0.74158 -1.0437,1.78528 -0.35706,1.0437 -0.35706,2.27966 0,1.86768 0.90637,3.51563 0.90637,1.64795 2.27967,3.24097 1.37329,1.59301 2.9663,3.24096 1.59302,1.62049 2.96631,3.48816 1.37329,1.84021 2.27967,4.01001 0.90637,2.14233 0.90637,4.75159 0,2.77405 -1.15357,5.13611 -1.15356,2.33459 -3.2135,4.06494 -2.03247,1.70288 -4.80652,2.66418 -2.74658,0.98877 -5.96008,0.98877 -2.69165,0 -4.88892,-0.71411 -2.1698,-0.68665 -3.73535,-1.97754 -1.53808,-1.31836 -2.38952,-3.1311 -0.85144,-1.81275 -0.85144,-4.03748 0,-1.86767 0.60424,-3.48816 0.60425,-1.62048 1.64795,-2.80151 1.0437,-1.2085 2.47193,-1.89514 1.42822,-0.68665 3.0487,-0.68665 1.97754,0 3.32337,0.98877 1.34582,0.98877 1.67541,2.71912 -1.48315,0 -2.66418,0.41199 -1.18103,0.41198 -2.00501,1.15356 -0.82397,0.74158 -1.29089,1.81274 -0.43945,1.0437 -0.43945,2.36206 0,2.47193 1.42822,3.92762 1.45569,1.42822 3.90015,1.42822 1.48315,0 2.74658,-0.52185 1.26343,-0.54932 2.1698,-1.48316 0.90637,-0.93383 1.42822,-2.22473 0.52185,-1.29089 0.52185,-2.80151 0,-1.53809 -0.52185,-2.93884 -0.49438,-1.42823 -1.34582,-2.74659 -0.85145,-1.34582 -1.92261,-2.63671 -1.07117,-1.2909 -2.19727,-2.58179 -1.1261,-1.31836 -2.19726,-2.63672 -1.07117,-1.31836 -1.92261,-2.69165 -0.85144,-1.40076 -1.37329,-2.88391 -0.49439,-1.48316 -0.49439,-3.13111 0,-2.22473 0.93384,-4.0924 0.9613,-1.89514 2.63672,-3.26844 1.70288,-1.37329 4.01001,-2.14233 2.30713,-0.79651 5.02624,-0.79651 2.27967,0 4.11988,0.57678 1.84021,0.54932 3.1311,1.59302 1.31836,1.01624 2.03247,2.47193 0.71411,1.45568 0.71411,3.24096 z"
|
86 |
-
inkscape:connector-curvature="0"/>
|
87 |
-
<path id="path3473"
|
88 |
-
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:56.25px;font-family:Lobster;-inkscape-font-specification:Lobster;text-align:center;text-anchor:middle;fill:#00d1b2;fill-opacity:1"
|
89 |
-
d="m 321.06116,369.3927 q -0.79651,2.27966 -1.78528,3.95508 -0.9613,1.67541 -2.03247,2.82898 -1.0437,1.15356 -2.1698,1.86767 -1.09863,0.71411 -2.14234,1.09864 -1.0437,0.38452 -2.005,0.52185 -0.93384,0.13733 -1.67542,0.13733 -1.26342,0 -2.36206,-0.38453 -1.09863,-0.38452 -1.9226,-1.20849 -0.79651,-0.82398 -1.26343,-2.0874 -0.46692,-1.26343 -0.46692,-3.04871 0,-0.76904 0.10986,-1.67541 0.10987,-0.93384 0.32959,-2.00501 l 6.01502,-28.17993 8.32214,-1.1261 -6.45447,30.3772 q -0.13733,0.46692 -0.19226,0.93384 -0.0275,0.43945 -0.0275,0.8789 0,1.18103 0.54931,1.64795 0.54932,0.43945 1.73035,0.43945 0.82397,0 1.59302,-0.35705 0.79651,-0.38452 1.45569,-1.0437 0.65918,-0.65918 1.18103,-1.56555 0.52185,-0.93384 0.85144,-2.00501 l 2.36206,0 z"
|
90 |
-
inkscape:connector-curvature="0"/>
|
91 |
-
<path id="path3475"
|
92 |
-
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:56.25px;font-family:Lobster;-inkscape-font-specification:Lobster;text-align:center;text-anchor:middle;fill:#00d1b2;fill-opacity:1"
|
93 |
-
d="m 332.62427,343.87695 q 0,0.93384 -0.35706,1.75782 -0.35705,0.7965 -0.98877,1.40075 -0.60425,0.57678 -1.42822,0.93384 -0.79651,0.32959 -1.73035,0.32959 -0.93383,0 -1.75781,-0.32959 -0.79651,-0.35706 -1.40076,-0.93384 -0.60424,-0.60425 -0.9613,-1.40075 -0.32959,-0.82398 -0.32959,-1.75782 0,-0.93383 0.32959,-1.73034 0.35706,-0.82398 0.9613,-1.42823 0.60425,-0.63171 1.40076,-0.98877 0.82398,-0.35705 1.75781,-0.35705 0.93384,0 1.73035,0.35705 0.82397,0.35706 1.42822,0.98877 0.63172,0.60425 0.98877,1.42823 0.35706,0.79651 0.35706,1.73034 z m 3.48816,25.51575 q -0.79651,2.27966 -1.78528,3.95508 -0.96131,1.67541 -2.03247,2.82898 -1.0437,1.15356 -2.1698,1.86767 -1.09863,0.71411 -2.14234,1.09864 -1.0437,0.38452 -2.005,0.52185 -0.93384,0.13733 -1.67542,0.13733 -1.26342,0 -2.36206,-0.38453 -1.09863,-0.38452 -1.9226,-1.20849 -0.79651,-0.82398 -1.26343,-2.0874 -0.46692,-1.26343 -0.46692,-3.04871 0,-0.76904 0.10986,-1.67541 0.10987,-0.93384 0.32959,-2.00501 l 3.81775,-18.04504 8.10242,0 -4.03748,19.11621 q -0.13733,0.46692 -0.19226,0.93384 -0.0275,0.43945 -0.0275,0.8789 0,1.18103 0.54931,1.64795 0.54932,0.43945 1.73035,0.43945 0.82397,0 1.59302,-0.35705 0.79651,-0.38452 1.45569,-1.0437 0.65918,-0.65918 1.18103,-1.56555 0.52185,-0.93384 0.85144,-2.00501 l 2.36206,0 z"
|
94 |
-
inkscape:connector-curvature="0"/>
|
95 |
-
<path id="path3477"
|
96 |
-
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:56.25px;font-family:Lobster;-inkscape-font-specification:Lobster;text-align:center;text-anchor:middle;fill:#00d1b2;fill-opacity:1"
|
97 |
-
d="m 365.66565,369.3927 q -0.79651,2.27966 -1.73035,3.92761 -0.93384,1.64795 -1.95007,2.77405 -0.98877,1.09863 -2.03247,1.78528 -1.0437,0.65918 -2.03247,1.01623 -0.98877,0.35706 -1.89514,0.46692 -0.90638,0.10987 -1.64795,0.10987 -2.3346,0 -3.76282,-1.2085 -1.42822,-1.23596 -1.75781,-3.62549 -0.63172,0.96131 -1.45569,1.89514 -0.79651,0.90638 -1.84021,1.64795 -1.01624,0.71411 -2.27966,1.18103 -1.26343,0.43946 -2.74659,0.43946 -1.45568,0 -2.80151,-0.46692 -1.34583,-0.46692 -2.38953,-1.53809 -1.0437,-1.07117 -1.67541,-2.80151 -0.63172,-1.73035 -0.63172,-4.22974 0,-1.92261 0.38453,-4.11987 0.38452,-2.19727 1.18103,-4.39453 0.79651,-2.19727 1.97754,-4.20227 1.20849,-2.03247 2.80151,-3.57056 1.62048,-1.56555 3.65295,-2.47192 2.03247,-0.93384 4.47693,-0.93384 2.38953,0 3.4607,0.82397 1.09863,0.82398 1.09863,2.03247 l 0,0.21973 2.74658,-12.9364 8.32214,-1.1261 -6.45446,30.3772 q -0.13733,0.46692 -0.19226,0.93384 -0.0549,0.43945 -0.0549,0.8789 0,1.18103 0.54932,1.64795 0.57678,0.43945 1.75781,0.43945 0.82398,0 1.51062,-0.35705 0.71411,-0.38452 1.26343,-1.0437 0.57678,-0.65918 1.01624,-1.56555 0.43945,-0.93384 0.76904,-2.00501 l 2.36206,0 z m -16.86401,0 2.74658,-12.88147 q -0.0549,-0.24719 -0.19226,-0.57678 -0.10987,-0.32959 -0.35706,-0.63172 -0.24719,-0.32959 -0.68664,-0.52185 -0.41199,-0.21972 -1.07117,-0.21972 -1.18103,0 -2.2522,0.76904 -1.0437,0.76904 -1.92261,2.05994 -0.8789,1.26342 -1.56555,2.88391 -0.68664,1.62048 -1.18103,3.35083 -0.46692,1.70288 -0.71411,3.37829 -0.24719,1.64795 -0.24719,2.96631 0,1.62049 0.30212,2.49939 0.30213,0.87891 0.71411,1.31836 0.43946,0.41199 0.93384,0.49439 0.49439,0.0824 0.87891,0.0824 0.57678,0 1.26343,-0.27465 0.71411,-0.30213 1.34582,-0.87891 0.65918,-0.57678 1.18103,-1.45569 0.54932,-0.87891 0.82398,-2.05994 l 0,-0.30212 z"
|
98 |
-
inkscape:connector-curvature="0"/>
|
99 |
-
<path id="path3479"
|
100 |
-
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:56.25px;font-family:Lobster;-inkscape-font-specification:Lobster;text-align:center;text-anchor:middle;fill:#00d1b2;fill-opacity:1"
|
101 |
-
d="m 386.8418,369.3927 q -1.18103,1.97754 -2.71912,3.84522 -1.51062,1.86767 -3.43323,3.32336 -1.89514,1.45569 -4.22973,2.36206 -2.30713,0.87891 -5.08118,0.87891 -2.005,0 -3.62549,-0.49439 -1.62048,-0.52185 -2.77405,-1.59302 -1.15356,-1.07116 -1.75781,-2.74658 -0.63171,-1.70288 -0.63171,-4.09241 0,-1.62048 0.32959,-3.73535 0.32959,-2.11487 1.0437,-4.3396 0.71411,-2.22473 1.89514,-4.36706 1.18103,-2.14234 2.85645,-3.81775 1.67541,-1.70288 3.92761,-2.71912 2.2522,-1.0437 5.13611,-1.0437 1.89514,0 3.07617,0.46692 1.20849,0.43945 1.89514,1.18103 0.71411,0.74158 0.9613,1.73035 0.27466,0.9613 0.27466,2.005 0,2.44446 -1.07117,4.55933 -1.07116,2.0874 -2.88391,3.65295 -1.78527,1.56555 -4.11987,2.52686 -2.33459,0.9613 -4.86145,1.1261 -0.0549,0.63171 -0.10986,1.20849 -0.0275,0.54932 -0.0275,1.0437 0,1.42823 0.24719,2.36206 0.27466,0.90638 0.76905,1.42823 0.52185,0.52185 1.26342,0.74157 0.76905,0.19226 1.78528,0.19226 1.67542,0 3.02124,-0.43945 1.37329,-0.43945 2.55432,-1.20849 1.18103,-0.76905 2.22474,-1.81275 1.07116,-1.0437 2.14233,-2.22473 l 1.92261,0 z m -15.3534,-3.98254 q 1.59302,-0.10987 3.07618,-0.90638 1.48315,-0.7965 2.60925,-2.05993 1.1261,-1.2909 1.78528,-2.91138 0.68664,-1.64795 0.68664,-3.40576 0,-1.0437 -0.30212,-1.67542 -0.30213,-0.63171 -1.09863,-0.63171 -1.07117,0 -2.11487,1.0437 -1.01624,1.01624 -1.92261,2.66419 -0.90637,1.64795 -1.62048,3.73535 -0.68665,2.05993 -1.09864,4.14734 z"
|
102 |
-
inkscape:connector-curvature="0"/>
|
103 |
-
<path id="path3481"
|
104 |
-
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:56.25px;font-family:Lobster;-inkscape-font-specification:Lobster;text-align:center;text-anchor:middle;fill:#00d1b2;fill-opacity:1"
|
105 |
-
d="m 382.83179,379.47266 5.96008,-28.125 8.10242,0 -0.71411,3.48816 q 0.74157,-0.65918 1.51062,-1.2909 0.76904,-0.63171 1.59301,-1.09863 0.85144,-0.49439 1.75782,-0.79651 0.90637,-0.30212 1.9226,-0.30212 0.96131,0 1.67542,0.35705 0.74158,0.35706 1.23596,0.93384 0.49439,0.57678 0.74158,1.34582 0.24719,0.76905 0.24719,1.59302 0,0.74158 -0.24719,1.48316 -0.24719,0.71411 -0.76905,1.29089 -0.49438,0.57678 -1.26342,0.9613 -0.76905,0.35706 -1.78528,0.35706 -0.79651,0 -1.23596,-0.27466 -0.41199,-0.27466 -0.63172,-0.68664 -0.21972,-0.41199 -0.32959,-0.87891 -0.0824,-0.49438 -0.19226,-0.90637 -0.10986,-0.41199 -0.30212,-0.68665 -0.1648,-0.27466 -0.57678,-0.27466 -1.2909,0 -2.1698,0.60425 -0.87891,0.57678 -1.92261,1.53809 l -4.5044,21.36841 -8.10241,0 z"
|
106 |
-
inkscape:connector-curvature="0"/>
|
107 |
-
</g>
|
108 |
-
</g>
|
109 |
-
<g id="g4359" transform="translate(13.72272,4.8433532)">
|
110 |
-
<rect y="852.39502" x="199.99997" height="10" width="10" id="rect4315" style="fill:#000000;fill-opacity:1"/>
|
111 |
-
<rect y="852.36774" x="214.99846" height="10" width="10" id="rect4315-3"
|
112 |
-
style="fill:#000000;fill-opacity:1"/>
|
113 |
-
<rect y="852.37762" x="230.01768" height="10" width="10" id="rect4315-6"
|
114 |
-
style="fill:#000000;fill-opacity:1"/>
|
115 |
-
<rect y="852.3526" x="245.05391" height="10" width="10" id="rect4315-7"
|
116 |
-
style="fill:#000000;fill-opacity:1"/>
|
117 |
-
<rect y="852.32104" x="260.0347" height="10" width="10" id="rect4315-7-5"
|
118 |
-
style="fill:#000000;fill-opacity:1"/>
|
119 |
-
</g>
|
120 |
-
</g>
|
121 |
-
</svg>
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<svg width="256" height="256" version="1.1" viewBox="0 0 500 500" xmlns="http://www.w3.org/2000/svg">
|
3 |
+
<g transform="translate(0 -552.36)">
|
4 |
+
<g transform="translate(9.4332 -.18496)">
|
5 |
+
<g>
|
6 |
+
<rect x="70" y="642.36" width="100" height="200" fill="#f44336"/>
|
7 |
+
<rect x="190.02" y="642.36" width="100" height="200" fill="#4caf50"/>
|
8 |
+
<rect x="310.02" y="642.36" width="100" height="200" fill="#2196f3"/>
|
9 |
+
</g>
|
10 |
+
<g transform="matrix(2.5 0 0 2.5 19.919 722.36)">
|
11 |
+
<rect width="20" height="20" fill="none"/>
|
12 |
+
<path d="m14 5-5 5 5 5-1 2-7-7 7-7z"/>
|
13 |
+
</g>
|
14 |
+
<g transform="matrix(2.5 0 0 2.5 410.01 722.36)">
|
15 |
+
<rect width="20" height="20" fill="none"/>
|
16 |
+
<path d="m6 15 5-5-5-5 1-2 7 7-7 7z"/>
|
17 |
+
</g>
|
18 |
+
</g>
|
19 |
+
<g transform="matrix(1.0251 0 0 1.9523 2.3335 231.47)" fill="#00d1b2" stroke-width="1px">
|
20 |
+
<g fill="#00d1b2">
|
21 |
+
<path
|
22 |
+
d="m102.05 369.91q-1.1261 2.829-3.0487 4.834-1.9226 1.9775-4.1748 3.241-2.2247 1.236-4.5593 1.8128-2.3071 0.57678-4.2572 0.57678-3.1311 0-5.4382-0.74158-2.3071-0.74158-3.8452-2.3895-1.5106-1.6479-2.2797-4.2847-0.74158-2.6367-0.74158-6.427 0-1.9226 0.21973-4.1748 0.24719-2.2797 0.76904-4.6967 0.52185-2.417 1.3184-4.8614 0.82398-2.4444 1.9775-4.6966 1.1536-2.2797 2.6642-4.2572t3.4058-3.4332q1.8951-1.4557 4.2023-2.2797 2.3071-0.85144 5.0812-0.85144 1.9501 0 3.653 0.43945 1.7303 0.41199 2.9938 1.3184 1.2909 0.90637 2.005 2.3346 0.74158 1.4282 0.74158 3.4332 0 1.1261-0.21972 2.0874-0.19227 0.93384-0.68665 1.648-0.46692 0.68665-1.236 1.0712-0.74158 0.38452-1.8127 0.38452-0.65918 0-1.5381-0.24719-0.85144-0.24719-1.6479-1.2085 0.49438-0.24719 0.9613-0.76904 0.46692-0.54932 0.82398-1.236 0.35706-0.71411 0.57678-1.5381 0.21973-0.82397 0.21973-1.648 0-0.65918-0.19226-1.2909-0.1648-0.63171-0.57678-1.0986-0.41199-0.46692-1.0712-0.74158-0.65918-0.30213-1.593-0.30213-1.5656 0-3.0487 1.1536-1.4557 1.1536-2.774 3.1311-1.2909 1.9501-2.3895 4.5593-1.0712 2.6092-1.8402 5.5206t-1.2085 5.9876q-0.43945 3.0762-0.43945 5.9326 0 1.9501 0.27466 3.5706 0.30212 1.593 1.0437 2.7466 0.76904 1.1536 2.0599 1.8128 1.3184 0.63171 3.3783 0.63171 3.3234 0 6.1523-1.4832 2.829-1.4832 4.8065-4.1473l1.2909 0.57678z"/>
|
23 |
+
<path
|
24 |
+
d="m132.59 369.39q-0.79651 2.2797-1.7304 3.9551-0.93384 1.6754-1.9501 2.829-0.98877 1.1536-2.0325 1.8677t-2.0325 1.0986q-0.98877 0.38452-1.8951 0.52185-0.90638 0.13733-1.648 0.13733-2.3895 0-3.8178-1.2909-1.4008-1.3184-1.7029-3.8727-0.68665 0.96131-1.5106 1.8951-0.82398 0.90638-1.8402 1.648-1.0162 0.71411-2.2797 1.181-1.236 0.43946-2.7466 0.43946-1.4557 0-2.8015-0.46692-1.3458-0.46692-2.3895-1.5381t-1.6754-2.8015q-0.63172-1.7304-0.63172-4.2297 0-1.9226 0.38452-4.1199 0.38453-2.1973 1.181-4.3945 0.79651-2.1973 1.9775-4.2023 1.2085-2.0325 2.8015-3.5706 1.6205-1.5656 3.653-2.4719 2.0325-0.93384 4.4769-0.93384 2.3895 0 3.4607 0.82397 1.0986 0.82398 1.0986 2.0325v0.41199l0.60424-2.9938h8.1024l-4.0375 19.116q-0.13733 0.46692-0.19227 0.93384-0.0549 0.43945-0.0549 0.8789 0 2.417 2.3071 2.417 0.82398 0 1.5106-0.41198 0.71411-0.43946 1.2909-1.1536 0.57678-0.71411 1.0162-1.6754 0.43945-0.98877 0.74158-2.0599h2.3621zm-14.172-12.689q0-0.24719-0.10986-0.60425-0.10986-0.38452-0.38452-0.71411-0.24719-0.35705-0.68665-0.57678-0.43945-0.24719-1.1261-0.24719-1.181 0-2.2522 0.76904-1.0437 0.76904-1.9226 2.0599-0.8789 1.2634-1.5656 2.8839-0.68665 1.6205-1.181 3.3508-0.46692 1.7029-0.71411 3.3783-0.24719 1.648-0.24719 2.9663 0 1.6205 0.30212 2.4994 0.30212 0.87891 0.71411 1.3184 0.43945 0.41199 0.93384 0.49439 0.49438 0.0824 0.87891 0.0824 0.63171 0 1.3184-0.30212 0.71412-0.32959 1.3458-0.93384 0.65918-0.63171 1.181-1.5656 0.54932-0.93384 0.82397-2.1698l2.6916-12.689z"/>
|
25 |
+
<path
|
26 |
+
d="m128.06 379.47 5.9601-28.125h8.1024l-0.71411 3.4882q0.74157-0.65918 1.5106-1.2909 0.76904-0.63171 1.593-1.0986 0.85144-0.49439 1.7578-0.79651 0.90637-0.30212 1.9226-0.30212 0.96131 0 1.6754 0.35705 0.74158 0.35706 1.236 0.93384 0.49439 0.57678 0.74158 1.3458 0.24719 0.76905 0.24719 1.593 0 0.74158-0.24719 1.4832-0.24719 0.71411-0.76904 1.2909-0.49439 0.57678-1.2634 0.9613-0.76905 0.35706-1.7853 0.35706-0.79651 0-1.236-0.27466-0.41199-0.27466-0.63172-0.68664-0.21972-0.41199-0.32959-0.87891-0.0824-0.49438-0.19226-0.90637t-0.30212-0.68665q-0.1648-0.27466-0.57678-0.27466-1.2909 0-2.1698 0.60425-0.87891 0.57678-1.9226 1.5381l-4.5044 21.368h-8.1024z"/>
|
27 |
+
<path
|
28 |
+
d="m183.02 358.1q-1.6479 1.7303-4.2572 2.9388-2.6092 1.2085-5.7129 1.7304-0.32959 3.9001-1.5106 7.0312-1.1536 3.1311-2.9388 5.3284-1.7853 2.1973-4.0924 3.3783t-4.8889 1.181q-1.9501 0-3.6255-0.46692-1.648-0.49438-2.8564-1.5381-1.181-1.0712-1.8402-2.7466-0.68664-1.7029-0.68664-4.1199 0-1.648 0.35705-3.7354 0.32959-2.1149 1.0712-4.3396 0.76904-2.2247 1.9501-4.3396 1.2085-2.1423 2.9114-3.8178 1.7304-1.6754 3.9825-2.6916 2.2522-1.0437 5.1361-1.0437 7.2235 0 7.2235 8.9813v0.0549q0.13733 0.0549 0.24719 0.0549 0.13733 0 0.35706 0 0.98877 0 2.1149-0.27466 1.1536-0.30212 2.3071-0.76904 1.1536-0.46692 2.2522-1.0712 1.0986-0.63171 2.005-1.2634l0.49438 1.5381zm-14.639 4.834q-0.8789-0.21972-1.2085-0.85144-0.30213-0.65918-0.30213-1.5106 0-1.181 0.46692-1.9226 0.49439-0.76904 1.2909-1.1261-0.0549-0.90638-0.19226-1.5106-0.13733-0.63172-0.38452-1.0162-0.24719-0.41199-0.63171-0.57678-0.35706-0.1648-0.93384-0.1648-1.0162 0-1.9501 0.79651-0.93384 0.76904-1.7853 2.0599-0.82398 1.2909-1.5381 2.9663-0.68664 1.648-1.181 3.4058-0.49438 1.7578-0.76904 3.4882-0.27466 1.7029-0.27466 3.1036 0 1.4008 0.13733 2.2797 0.1648 0.87891 0.49439 1.4008 0.35705 0.49438 0.90637 0.68664 0.54931 0.19226 1.3458 0.19226 1.0162 0 2.0325-0.90637 1.0437-0.90637 1.9226-2.4719 0.87891-1.5656 1.5381-3.7079 0.68664-2.1423 1.0162-4.6143z"/>
|
29 |
+
<path
|
30 |
+
d="m206.89 369.39q-0.79651 2.2797-1.7303 3.9551-0.93384 1.6754-1.9501 2.829-0.98877 1.1536-2.0325 1.8677t-2.0325 1.0986q-0.98877 0.38452-1.8951 0.52185t-1.648 0.13733q-2.417 0-3.8452-1.3184-1.4282-1.3458-1.7304-4.01-1.0712 1.7303-2.1698 2.774-1.0986 1.0437-2.1698 1.6205t-2.0874 0.74158q-1.0162 0.19226-1.8952 0.19226-1.2634 0-2.3621-0.38453-1.0986-0.38452-1.9226-1.2085-0.79651-0.82398-1.2634-2.0874-0.46692-1.2634-0.46692-3.0487 0-0.76904 0.10986-1.6754 0.10987-0.93384 0.32959-2.005l3.8178-18.045h8.1024l-4.0375 19.116q-0.16479 0.8789-0.16479 1.593 0 0.96131 0.35705 1.648 0.35706 0.65918 1.3184 0.65918 0.82398 0 1.5106-0.35705 0.68665-0.38452 1.236-1.0437 0.57678-0.65918 0.98877-1.5656 0.43945-0.93384 0.76904-2.005l3.8178-18.045h8.1024l-4.0375 19.116q-0.13733 0.46692-0.19226 0.93384-0.0549 0.43945-0.0549 0.8789 0 1.181 0.54931 1.648 0.57679 0.43945 1.7578 0.43945 0.82397 0 1.5106-0.35705 0.71411-0.38452 1.2909-1.0437t1.0162-1.5656q0.43946-0.93384 0.74158-2.005h2.3621z"/>
|
31 |
+
<path
|
32 |
+
d="m228.42 369.39q-2.1973 2.5543-4.422 4.2297-2.1973 1.648-4.1748 2.8015-0.8789 0.93384-1.9775 1.593-1.0712 0.63171-2.2522 1.0437-1.1536 0.38452-2.3621 0.54932-1.181 0.19226-2.2522 0.19226-2.1149 0-3.6804-0.63172-1.5381-0.65918-2.5543-1.6754-1.0162-1.0437-1.4832-2.3071-0.49438-1.2909-0.49438-2.5818 0-0.98877 0.27466-1.8127 0.24719-0.85144 0.65918-1.5106 0.41198-0.65918 0.93383-1.1261 0.54932-0.49439 1.1261-0.76904 2.3621-4.2297 3.9826-8.3496 1.6205-4.1473 2.9388-8.3222l8.3221-1.0986q0.1648 3.653 0.30213 6.3446 0.16479 2.6642 0.30212 4.6417 0.13733 1.9501 0.24719 3.3234 0.10987 1.3733 0.19226 2.4445 0.10987 1.0437 0.13733 1.9226 0.0549 0.85144 0.0549 1.7853 0 0.63171-0.0549 1.1536-0.0275 0.52185-0.16479 0.98877 1.236-0.71411 2.2247-1.4008 1.0162-0.71411 1.8127-1.4282h2.3621zm-22.659 2.0325q0 1.9775 0.76905 2.9663 0.79651 0.9613 2.6642 0.9613 0.93384 0 1.8128-0.24719 0.8789-0.27466 1.5656-0.87891 0.68664-0.63171 1.0986-1.6205t0.41199-2.4719q0-0.71411-0.0549-1.3733-0.0275-0.68665-0.0824-1.4282-0.0549-0.76904-0.1648-1.7029-0.0824-0.93384-0.21972-2.1698-0.10987-1.236-0.2472-2.8564-0.13732-1.6205-0.30212-3.7903-0.85144 2.7466-2.005 5.3284-1.1536 2.5818-2.5543 5.3009 0.54932 0.30212 0.90638 0.76904 0.38452 0.46692 0.38452 1.181 0 0.52185-0.1648 1.0162-0.16479 0.49438-0.49438 0.90637-0.32959 0.38452-0.79651 0.63171-0.43945 0.21973-1.0162 0.21973-0.46692 0-0.8789-0.13733-0.41199-0.13733-0.63172-0.60425z"/>
|
33 |
+
<path
|
34 |
+
d="m249.62 369.39q-1.181 1.9775-2.7191 3.8452-1.5106 1.8677-3.4332 3.3234-1.8951 1.4557-4.2297 2.3621-2.3071 0.87891-5.0812 0.87891-2.005 0-3.6255-0.49439-1.6205-0.52185-2.774-1.593-1.1536-1.0712-1.7578-2.7466-0.63171-1.7029-0.63171-4.0924 0-1.6205 0.32959-3.7354t1.0437-4.3396 1.8951-4.3671q1.181-2.1423 2.8564-3.8178 1.6754-1.7029 3.9276-2.7191 2.2522-1.0437 5.1361-1.0437 1.8951 0 3.0762 0.46692 1.2085 0.43945 1.8951 1.181 0.71411 0.74158 0.96131 1.7304 0.27465 0.9613 0.27465 2.005 0 2.4445-1.0712 4.5593-1.0712 2.0874-2.8839 3.653-1.7853 1.5656-4.1199 2.5269-2.3346 0.9613-4.8614 1.1261-0.0549 0.63171-0.10986 1.2085-0.0275 0.54932-0.0275 1.0437 0 1.4282 0.2472 2.3621 0.27465 0.90638 0.76904 1.4282 0.52185 0.52185 1.2634 0.74157 0.76904 0.19226 1.7853 0.19226 1.6754 0 3.0212-0.43945 1.3733-0.43945 2.5543-1.2085 1.181-0.76905 2.2247-1.8128 1.0712-1.0437 2.1423-2.2247h1.9226zm-15.353-3.9825q1.593-0.10987 3.0762-0.90638 1.4832-0.7965 2.6092-2.0599 1.1261-1.2909 1.7853-2.9114 0.68664-1.648 0.68664-3.4058 0-1.0437-0.30212-1.6754-0.30212-0.63171-1.0986-0.63171-1.0712 0-2.1149 1.0437-1.0162 1.0162-1.9226 2.6642t-1.6205 3.7354q-0.68665 2.0599-1.0986 4.1473z"/>
|
35 |
+
<path
|
36 |
+
d="m253.66 341.1 8.3222-1.1261-6.4545 30.377q-0.13733 0.46692-0.19226 0.87891-0.0549 0.38452-0.0549 0.76904 0 0.96131 0.49438 1.6205 0.49439 0.63171 1.8128 0.63171 0.79651 0 1.1536-0.10986 0.35706-0.10987 0.65918-0.2472-0.10986 1.5106-0.68664 2.6367-0.54932 1.0986-1.4008 1.8402-0.85144 0.71411-1.9226 1.0712t-2.1698 0.35706q-1.2634 0-2.3621-0.38453-1.0986-0.41198-1.9226-1.236-0.79651-0.85144-1.2634-2.1423-0.46692-1.2909-0.46692-3.1036 0-0.74158 0.10986-1.648 0.10986-0.93384 0.32959-2.005l6.015-28.18z"/>
|
37 |
+
<path
|
38 |
+
d="m302.69 344.87q0 1.181-0.32959 2.1698-0.30212 0.96131-0.85144 1.6754-0.54931 0.68664-1.3458 1.0712-0.79651 0.38453-1.7304 0.38453-1.0712 0-1.9501-0.43946-0.85144-0.46692-1.4832-1.3184 1.0437-0.76904 1.6754-2.0325 0.63171-1.2909 0.63171-2.7466 0-1.8127-1.0712-2.8564-1.0712-1.0712-2.9388-1.0712-1.1261 0-2.0874 0.43945-0.93384 0.41199-1.6205 1.181-0.65918 0.74158-1.0437 1.7853-0.35706 1.0437-0.35706 2.2797 0 1.8677 0.90637 3.5156t2.2797 3.241q1.3733 1.593 2.9663 3.241 1.593 1.6205 2.9663 3.4882 1.3733 1.8402 2.2797 4.01 0.90637 2.1423 0.90637 4.7516 0 2.774-1.1536 5.1361-1.1536 2.3346-3.2135 4.0649-2.0325 1.7029-4.8065 2.6642-2.7466 0.98877-5.9601 0.98877-2.6916 0-4.8889-0.71411-2.1698-0.68665-3.7354-1.9775-1.5381-1.3184-2.3895-3.1311-0.85144-1.8128-0.85144-4.0375 0-1.8677 0.60424-3.4882 0.60425-1.6205 1.648-2.8015 1.0437-1.2085 2.4719-1.8951 1.4282-0.68665 3.0487-0.68665 1.9775 0 3.3234 0.98877 1.3458 0.98877 1.6754 2.7191-1.4832 0-2.6642 0.41199-1.181 0.41198-2.005 1.1536-0.82397 0.74158-1.2909 1.8127-0.43945 1.0437-0.43945 2.3621 0 2.4719 1.4282 3.9276 1.4557 1.4282 3.9002 1.4282 1.4832 0 2.7466-0.52185 1.2634-0.54932 2.1698-1.4832 0.90637-0.93383 1.4282-2.2247 0.52185-1.2909 0.52185-2.8015 0-1.5381-0.52185-2.9388-0.49438-1.4282-1.3458-2.7466-0.85145-1.3458-1.9226-2.6367-1.0712-1.2909-2.1973-2.5818-1.1261-1.3184-2.1973-2.6367-1.0712-1.3184-1.9226-2.6916-0.85144-1.4008-1.3733-2.8839-0.49439-1.4832-0.49439-3.1311 0-2.2247 0.93384-4.0924 0.9613-1.8951 2.6367-3.2684 1.7029-1.3733 4.01-2.1423 2.3071-0.79651 5.0262-0.79651 2.2797 0 4.1199 0.57678 1.8402 0.54932 3.1311 1.593 1.3184 1.0162 2.0325 2.4719 0.71411 1.4557 0.71411 3.241z"/>
|
39 |
+
<path
|
40 |
+
d="m321.06 369.39q-0.79651 2.2797-1.7853 3.9551-0.9613 1.6754-2.0325 2.829-1.0437 1.1536-2.1698 1.8677-1.0986 0.71411-2.1423 1.0986-1.0437 0.38452-2.005 0.52185-0.93384 0.13733-1.6754 0.13733-1.2634 0-2.3621-0.38453-1.0986-0.38452-1.9226-1.2085-0.79651-0.82398-1.2634-2.0874-0.46692-1.2634-0.46692-3.0487 0-0.76904 0.10986-1.6754 0.10987-0.93384 0.32959-2.005l6.015-28.18 8.3221-1.1261-6.4545 30.377q-0.13733 0.46692-0.19226 0.93384-0.0275 0.43945-0.0275 0.8789 0 1.181 0.54931 1.648 0.54932 0.43945 1.7304 0.43945 0.82397 0 1.593-0.35705 0.79651-0.38452 1.4557-1.0437t1.181-1.5656q0.52185-0.93384 0.85144-2.005h2.3621z"/>
|
41 |
+
<path
|
42 |
+
d="m332.62 343.88q0 0.93384-0.35706 1.7578-0.35705 0.7965-0.98877 1.4008-0.60425 0.57678-1.4282 0.93384-0.79651 0.32959-1.7304 0.32959-0.93383 0-1.7578-0.32959-0.79651-0.35706-1.4008-0.93384-0.60424-0.60425-0.9613-1.4008-0.32959-0.82398-0.32959-1.7578 0-0.93383 0.32959-1.7303 0.35706-0.82398 0.9613-1.4282 0.60425-0.63171 1.4008-0.98877 0.82398-0.35705 1.7578-0.35705 0.93384 0 1.7304 0.35705 0.82397 0.35706 1.4282 0.98877 0.63172 0.60425 0.98877 1.4282 0.35706 0.79651 0.35706 1.7303zm3.4882 25.516q-0.79651 2.2797-1.7853 3.9551-0.96131 1.6754-2.0325 2.829-1.0437 1.1536-2.1698 1.8677-1.0986 0.71411-2.1423 1.0986-1.0437 0.38452-2.005 0.52185-0.93384 0.13733-1.6754 0.13733-1.2634 0-2.3621-0.38453-1.0986-0.38452-1.9226-1.2085-0.79651-0.82398-1.2634-2.0874-0.46692-1.2634-0.46692-3.0487 0-0.76904 0.10986-1.6754 0.10987-0.93384 0.32959-2.005l3.8178-18.045h8.1024l-4.0375 19.116q-0.13733 0.46692-0.19226 0.93384-0.0275 0.43945-0.0275 0.8789 0 1.181 0.54931 1.648 0.54932 0.43945 1.7304 0.43945 0.82397 0 1.593-0.35705 0.79651-0.38452 1.4557-1.0437t1.181-1.5656q0.52185-0.93384 0.85144-2.005h2.3621z"/>
|
43 |
+
<path
|
44 |
+
d="m365.67 369.39q-0.79651 2.2797-1.7304 3.9276t-1.9501 2.774q-0.98877 1.0986-2.0325 1.7853-1.0437 0.65918-2.0325 1.0162-0.98877 0.35706-1.8951 0.46692-0.90638 0.10987-1.648 0.10987-2.3346 0-3.7628-1.2085-1.4282-1.236-1.7578-3.6255-0.63172 0.96131-1.4557 1.8951-0.79651 0.90638-1.8402 1.648-1.0162 0.71411-2.2797 1.181-1.2634 0.43946-2.7466 0.43946-1.4557 0-2.8015-0.46692t-2.3895-1.5381-1.6754-2.8015q-0.63172-1.7304-0.63172-4.2297 0-1.9226 0.38453-4.1199 0.38452-2.1973 1.181-4.3945 0.79651-2.1973 1.9775-4.2023 1.2085-2.0325 2.8015-3.5706 1.6205-1.5656 3.653-2.4719 2.0325-0.93384 4.4769-0.93384 2.3895 0 3.4607 0.82397 1.0986 0.82398 1.0986 2.0325v0.21973l2.7466-12.936 8.3221-1.1261-6.4545 30.377q-0.13733 0.46692-0.19226 0.93384-0.0549 0.43945-0.0549 0.8789 0 1.181 0.54932 1.648 0.57678 0.43945 1.7578 0.43945 0.82398 0 1.5106-0.35705 0.71411-0.38452 1.2634-1.0437 0.57678-0.65918 1.0162-1.5656 0.43945-0.93384 0.76904-2.005h2.3621zm-16.864 0 2.7466-12.881q-0.0549-0.24719-0.19226-0.57678-0.10987-0.32959-0.35706-0.63172-0.24719-0.32959-0.68664-0.52185-0.41199-0.21972-1.0712-0.21972-1.181 0-2.2522 0.76904-1.0437 0.76904-1.9226 2.0599-0.8789 1.2634-1.5656 2.8839-0.68664 1.6205-1.181 3.3508-0.46692 1.7029-0.71411 3.3783-0.24719 1.648-0.24719 2.9663 0 1.6205 0.30212 2.4994 0.30213 0.87891 0.71411 1.3184 0.43946 0.41199 0.93384 0.49439 0.49439 0.0824 0.87891 0.0824 0.57678 0 1.2634-0.27465 0.71411-0.30213 1.3458-0.87891 0.65918-0.57678 1.181-1.4557 0.54932-0.87891 0.82398-2.0599v-0.30212z"/>
|
45 |
+
<path
|
46 |
+
d="m386.84 369.39q-1.181 1.9775-2.7191 3.8452-1.5106 1.8677-3.4332 3.3234-1.8951 1.4557-4.2297 2.3621-2.3071 0.87891-5.0812 0.87891-2.005 0-3.6255-0.49439-1.6205-0.52185-2.774-1.593-1.1536-1.0712-1.7578-2.7466-0.63171-1.7029-0.63171-4.0924 0-1.6205 0.32959-3.7354t1.0437-4.3396 1.8951-4.3671q1.181-2.1423 2.8564-3.8178 1.6754-1.7029 3.9276-2.7191 2.2522-1.0437 5.1361-1.0437 1.8951 0 3.0762 0.46692 1.2085 0.43945 1.8951 1.181 0.71411 0.74158 0.9613 1.7304 0.27466 0.9613 0.27466 2.005 0 2.4445-1.0712 4.5593-1.0712 2.0874-2.8839 3.653-1.7853 1.5656-4.1199 2.5269-2.3346 0.9613-4.8614 1.1261-0.0549 0.63171-0.10986 1.2085-0.0275 0.54932-0.0275 1.0437 0 1.4282 0.24719 2.3621 0.27466 0.90638 0.76905 1.4282 0.52185 0.52185 1.2634 0.74157 0.76905 0.19226 1.7853 0.19226 1.6754 0 3.0212-0.43945 1.3733-0.43945 2.5543-1.2085 1.181-0.76905 2.2247-1.8128 1.0712-1.0437 2.1423-2.2247h1.9226zm-15.353-3.9825q1.593-0.10987 3.0762-0.90638 1.4832-0.7965 2.6092-2.0599 1.1261-1.2909 1.7853-2.9114 0.68664-1.648 0.68664-3.4058 0-1.0437-0.30212-1.6754-0.30213-0.63171-1.0986-0.63171-1.0712 0-2.1149 1.0437-1.0162 1.0162-1.9226 2.6642t-1.6205 3.7354q-0.68665 2.0599-1.0986 4.1473z"/>
|
47 |
+
<path
|
48 |
+
d="m382.83 379.47 5.9601-28.125h8.1024l-0.71411 3.4882q0.74157-0.65918 1.5106-1.2909 0.76904-0.63171 1.593-1.0986 0.85144-0.49439 1.7578-0.79651 0.90637-0.30212 1.9226-0.30212 0.96131 0 1.6754 0.35705 0.74158 0.35706 1.236 0.93384 0.49439 0.57678 0.74158 1.3458 0.24719 0.76905 0.24719 1.593 0 0.74158-0.24719 1.4832-0.24719 0.71411-0.76905 1.2909-0.49438 0.57678-1.2634 0.9613-0.76905 0.35706-1.7853 0.35706-0.79651 0-1.236-0.27466-0.41199-0.27466-0.63172-0.68664-0.21972-0.41199-0.32959-0.87891-0.0824-0.49438-0.19226-0.90637t-0.30212-0.68665q-0.1648-0.27466-0.57678-0.27466-1.2909 0-2.1698 0.60425-0.87891 0.57678-1.9226 1.5381l-4.5044 21.368h-8.1024z"/>
|
49 |
+
</g>
|
50 |
+
</g>
|
51 |
+
<g transform="translate(13.723 4.8434)">
|
52 |
+
<rect x="200" y="852.4" width="10" height="10"/>
|
53 |
+
<rect x="215" y="852.37" width="10" height="10"/>
|
54 |
+
<rect x="230.02" y="852.38" width="10" height="10"/>
|
55 |
+
<rect x="245.05" y="852.35" width="10" height="10"/>
|
56 |
+
<rect x="260.03" y="852.32" width="10" height="10"/>
|
57 |
+
</g>
|
58 |
+
</g>
|
59 |
+
</svg>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
carousel-slider.php
CHANGED
@@ -1,17 +1,17 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Plugin Name: Carousel Slider
|
4 |
-
* Plugin URI:
|
5 |
* Description: <strong>Carousel Slider</strong> allows you to create beautiful, touch enabled, responsive carousels and sliders. It let you create SEO friendly Image carousel from Media Library or from custom URL, Video carousel using Youtube and Vimeo video, Post carousel, Hero banner slider and various types of WooCommerce products carousels.
|
6 |
-
* Version:
|
7 |
* Author: Sayful Islam
|
8 |
* Author URI: https://sayfulislam.com
|
9 |
* Requires PHP: 7.0
|
10 |
-
* Requires at least: 5.
|
11 |
* Tested up to: 5.8
|
12 |
*
|
13 |
-
* WC requires at least:
|
14 |
-
* WC tested up to:
|
15 |
*
|
16 |
* Text Domain: carousel-slider
|
17 |
*
|
@@ -22,12 +22,15 @@
|
|
22 |
* @author Sayful Islam
|
23 |
*/
|
24 |
|
25 |
-
|
26 |
-
|
27 |
-
}
|
28 |
|
29 |
if ( ! class_exists( 'Carousel_Slider' ) ) {
|
30 |
-
|
|
|
|
|
|
|
|
|
31 |
final class Carousel_Slider {
|
32 |
|
33 |
/**
|
@@ -49,7 +52,7 @@ if ( ! class_exists( 'Carousel_Slider' ) ) {
|
|
49 |
*
|
50 |
* @var string
|
51 |
*/
|
52 |
-
private $version = '
|
53 |
|
54 |
/**
|
55 |
* Minimum PHP version required
|
@@ -76,29 +79,29 @@ if ( ! class_exists( 'Carousel_Slider' ) ) {
|
|
76 |
if ( is_null( self::$instance ) ) {
|
77 |
self::$instance = new self();
|
78 |
|
79 |
-
// define constants
|
80 |
self::$instance->define_constants();
|
81 |
|
82 |
-
// Register autoloader
|
83 |
self::$instance->register_autoloader();
|
84 |
|
85 |
-
// Check if PHP version is supported for our plugin
|
86 |
if ( ! self::$instance->is_supported_php() ) {
|
87 |
-
register_activation_hook( __FILE__,
|
88 |
-
add_action( 'admin_notices',
|
89 |
|
90 |
return self::$instance;
|
91 |
}
|
92 |
|
93 |
-
|
94 |
-
self::$instance->bootstrap_plugin();
|
95 |
|
96 |
-
|
|
|
97 |
|
98 |
-
register_activation_hook( __FILE__,
|
99 |
-
register_deactivation_hook( __FILE__,
|
100 |
|
101 |
-
do_action( '
|
102 |
}
|
103 |
|
104 |
return self::$instance;
|
@@ -113,9 +116,6 @@ if ( ! class_exists( 'Carousel_Slider' ) ) {
|
|
113 |
define( 'CAROUSEL_SLIDER_POST_TYPE', $this->post_type );
|
114 |
define( 'CAROUSEL_SLIDER_FILE', __FILE__ );
|
115 |
define( 'CAROUSEL_SLIDER_PATH', dirname( CAROUSEL_SLIDER_FILE ) );
|
116 |
-
define( 'CAROUSEL_SLIDER_INCLUDES', CAROUSEL_SLIDER_PATH . '/includes' );
|
117 |
-
define( 'CAROUSEL_SLIDER_TEMPLATES', CAROUSEL_SLIDER_PATH . '/templates' );
|
118 |
-
define( 'CAROUSEL_SLIDER_WIDGETS', CAROUSEL_SLIDER_PATH . '/widgets' );
|
119 |
define( 'CAROUSEL_SLIDER_URL', plugins_url( '', CAROUSEL_SLIDER_FILE ) );
|
120 |
define( 'CAROUSEL_SLIDER_ASSETS', CAROUSEL_SLIDER_URL . '/assets' );
|
121 |
}
|
@@ -127,16 +127,16 @@ if ( ! class_exists( 'Carousel_Slider' ) ) {
|
|
127 |
if ( file_exists( CAROUSEL_SLIDER_PATH . '/vendor/autoload.php' ) ) {
|
128 |
include CAROUSEL_SLIDER_PATH . '/vendor/autoload.php';
|
129 |
} else {
|
130 |
-
include_once CAROUSEL_SLIDER_PATH . '/
|
131 |
|
132 |
-
// instantiate the loader
|
133 |
-
$loader = new CarouselSlider\Autoloader;
|
134 |
|
135 |
-
// register the base directories for the namespace prefix
|
136 |
-
$loader->add_namespace( 'CarouselSlider', CAROUSEL_SLIDER_PATH . '/
|
137 |
$loader->add_namespace( 'CarouselSlider\Modules', CAROUSEL_SLIDER_PATH . '/modules' );
|
138 |
|
139 |
-
// register the autoloader
|
140 |
$loader->register();
|
141 |
}
|
142 |
}
|
@@ -150,24 +150,9 @@ if ( ! class_exists( 'Carousel_Slider' ) ) {
|
|
150 |
CarouselSlider\Plugin::init();
|
151 |
}
|
152 |
|
153 |
-
/**
|
154 |
-
* Include admin and front facing files
|
155 |
-
*/
|
156 |
-
private function includes() {
|
157 |
-
require_once CAROUSEL_SLIDER_INCLUDES . '/functions-carousel-slider.php';
|
158 |
-
require_once CAROUSEL_SLIDER_INCLUDES . '/class-carousel-slider-activator.php';
|
159 |
-
require_once CAROUSEL_SLIDER_INCLUDES . '/class-carousel-slider-product.php';
|
160 |
-
|
161 |
-
if ( $this->is_request( 'admin' ) ) {
|
162 |
-
require_once CAROUSEL_SLIDER_INCLUDES . '/class-carousel-slider-form.php';
|
163 |
-
require_once CAROUSEL_SLIDER_INCLUDES . '/class-carousel-slider-admin.php';
|
164 |
-
require_once CAROUSEL_SLIDER_INCLUDES . '/class-carousel-slider-meta-box.php';
|
165 |
-
require_once CAROUSEL_SLIDER_INCLUDES . '/class-carousel-slider-hero-carousel.php';
|
166 |
-
}
|
167 |
-
}
|
168 |
-
|
169 |
/**
|
170 |
* To be run when the plugin is activated
|
|
|
171 |
* @return void
|
172 |
*/
|
173 |
public function activation() {
|
@@ -176,6 +161,7 @@ if ( ! class_exists( 'Carousel_Slider' ) ) {
|
|
176 |
|
177 |
/**
|
178 |
* To be run when the plugin is deactivated
|
|
|
179 |
* @return void
|
180 |
*/
|
181 |
public function deactivation() {
|
@@ -193,12 +179,15 @@ if ( ! class_exists( 'Carousel_Slider' ) ) {
|
|
193 |
return;
|
194 |
}
|
195 |
|
196 |
-
$error
|
197 |
-
$error .= sprintf(
|
198 |
-
|
|
|
|
|
|
|
199 |
?>
|
200 |
<div class="error">
|
201 |
-
<p><?php printf( $error ); ?></p>
|
202 |
</div>
|
203 |
<?php
|
204 |
}
|
@@ -215,58 +204,29 @@ if ( ! class_exists( 'Carousel_Slider' ) ) {
|
|
215 |
|
216 |
deactivate_plugins( plugin_basename( __FILE__ ) );
|
217 |
|
218 |
-
$error
|
219 |
$error .= '<h2>' . __( 'Your installed PHP Version is: ', 'carousel-slider' ) . PHP_VERSION . '</h2>';
|
220 |
-
|
221 |
-
|
222 |
-
$error .= '<p>' . sprintf(
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
/**
|
234 |
-
* What type of request is this?
|
235 |
-
*
|
236 |
-
* @param string $type admin, ajax, cron or frontend.
|
237 |
-
*
|
238 |
-
* @return bool
|
239 |
-
*/
|
240 |
-
public function is_request( $type ) {
|
241 |
-
switch ( $type ) {
|
242 |
-
case 'admin':
|
243 |
-
return is_admin();
|
244 |
-
case 'ajax':
|
245 |
-
return defined( 'DOING_AJAX' );
|
246 |
-
case 'cron':
|
247 |
-
return defined( 'DOING_CRON' );
|
248 |
-
case 'frontend':
|
249 |
-
return ( ! is_admin() || defined( 'DOING_AJAX' ) ) && ! defined( 'DOING_CRON' );
|
250 |
-
}
|
251 |
-
|
252 |
-
return false;
|
253 |
}
|
254 |
|
255 |
/**
|
256 |
* Check if the PHP version is supported
|
257 |
*
|
258 |
-
* @param null $min_php
|
259 |
-
*
|
260 |
* @return bool
|
261 |
*/
|
262 |
-
private function is_supported_php(
|
263 |
-
|
264 |
-
|
265 |
-
if ( version_compare( PHP_VERSION, $min_php, '<=' ) ) {
|
266 |
-
return false;
|
267 |
-
}
|
268 |
-
|
269 |
-
return true;
|
270 |
}
|
271 |
}
|
272 |
}
|
1 |
<?php
|
2 |
/**
|
3 |
* Plugin Name: Carousel Slider
|
4 |
+
* Plugin URI: https://wordpress.org/plugins/carousel-slider
|
5 |
* Description: <strong>Carousel Slider</strong> allows you to create beautiful, touch enabled, responsive carousels and sliders. It let you create SEO friendly Image carousel from Media Library or from custom URL, Video carousel using Youtube and Vimeo video, Post carousel, Hero banner slider and various types of WooCommerce products carousels.
|
6 |
+
* Version: 2.0.7
|
7 |
* Author: Sayful Islam
|
8 |
* Author URI: https://sayfulislam.com
|
9 |
* Requires PHP: 7.0
|
10 |
+
* Requires at least: 5.6
|
11 |
* Tested up to: 5.8
|
12 |
*
|
13 |
+
* WC requires at least: 3.0
|
14 |
+
* WC tested up to: 6.0
|
15 |
*
|
16 |
* Text Domain: carousel-slider
|
17 |
*
|
22 |
* @author Sayful Islam
|
23 |
*/
|
24 |
|
25 |
+
// If this file is called directly, abort.
|
26 |
+
defined( 'ABSPATH' ) || exit;
|
|
|
27 |
|
28 |
if ( ! class_exists( 'Carousel_Slider' ) ) {
|
29 |
+
/**
|
30 |
+
* The core plugin class.
|
31 |
+
* This is used to define internationalization, admin-specific hooks, and public-facing site hooks.
|
32 |
+
* Also maintains the unique identifier of this plugin as well as the current version of the plugin.
|
33 |
+
*/
|
34 |
final class Carousel_Slider {
|
35 |
|
36 |
/**
|
52 |
*
|
53 |
* @var string
|
54 |
*/
|
55 |
+
private $version = '2.0.7';
|
56 |
|
57 |
/**
|
58 |
* Minimum PHP version required
|
79 |
if ( is_null( self::$instance ) ) {
|
80 |
self::$instance = new self();
|
81 |
|
82 |
+
// define plugin constants.
|
83 |
self::$instance->define_constants();
|
84 |
|
85 |
+
// Register autoloader.
|
86 |
self::$instance->register_autoloader();
|
87 |
|
88 |
+
// Check if PHP version is supported for our plugin.
|
89 |
if ( ! self::$instance->is_supported_php() ) {
|
90 |
+
register_activation_hook( __FILE__, [ self::$instance, 'auto_deactivate' ] );
|
91 |
+
add_action( 'admin_notices', [ self::$instance, 'php_version_notice' ] );
|
92 |
|
93 |
return self::$instance;
|
94 |
}
|
95 |
|
96 |
+
do_action( 'carousel_slider/init' );
|
|
|
97 |
|
98 |
+
// bootstrap plugin main class.
|
99 |
+
self::$instance->bootstrap_plugin();
|
100 |
|
101 |
+
register_activation_hook( __FILE__, [ self::$instance, 'activation' ] );
|
102 |
+
register_deactivation_hook( __FILE__, [ self::$instance, 'deactivation' ] );
|
103 |
|
104 |
+
do_action( 'carousel_slider/loaded' );
|
105 |
}
|
106 |
|
107 |
return self::$instance;
|
116 |
define( 'CAROUSEL_SLIDER_POST_TYPE', $this->post_type );
|
117 |
define( 'CAROUSEL_SLIDER_FILE', __FILE__ );
|
118 |
define( 'CAROUSEL_SLIDER_PATH', dirname( CAROUSEL_SLIDER_FILE ) );
|
|
|
|
|
|
|
119 |
define( 'CAROUSEL_SLIDER_URL', plugins_url( '', CAROUSEL_SLIDER_FILE ) );
|
120 |
define( 'CAROUSEL_SLIDER_ASSETS', CAROUSEL_SLIDER_URL . '/assets' );
|
121 |
}
|
127 |
if ( file_exists( CAROUSEL_SLIDER_PATH . '/vendor/autoload.php' ) ) {
|
128 |
include CAROUSEL_SLIDER_PATH . '/vendor/autoload.php';
|
129 |
} else {
|
130 |
+
include_once CAROUSEL_SLIDER_PATH . '/includes/Autoloader.php';
|
131 |
|
132 |
+
// instantiate the loader.
|
133 |
+
$loader = new CarouselSlider\Autoloader();
|
134 |
|
135 |
+
// register the base directories for the namespace prefix.
|
136 |
+
$loader->add_namespace( 'CarouselSlider', CAROUSEL_SLIDER_PATH . '/includes' );
|
137 |
$loader->add_namespace( 'CarouselSlider\Modules', CAROUSEL_SLIDER_PATH . '/modules' );
|
138 |
|
139 |
+
// register the autoloader.
|
140 |
$loader->register();
|
141 |
}
|
142 |
}
|
150 |
CarouselSlider\Plugin::init();
|
151 |
}
|
152 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
/**
|
154 |
* To be run when the plugin is activated
|
155 |
+
*
|
156 |
* @return void
|
157 |
*/
|
158 |
public function activation() {
|
161 |
|
162 |
/**
|
163 |
* To be run when the plugin is deactivated
|
164 |
+
*
|
165 |
* @return void
|
166 |
*/
|
167 |
public function deactivation() {
|
179 |
return;
|
180 |
}
|
181 |
|
182 |
+
$error = __( 'Your installed PHP Version is: ', 'carousel-slider' ) . PHP_VERSION . '. ';
|
183 |
+
$error .= sprintf(
|
184 |
+
/* translators: 1: min php version requires */
|
185 |
+
__( 'The Carousel Slider plugin requires PHP version %s or greater.', 'carousel-slider' ),
|
186 |
+
$this->min_php
|
187 |
+
);
|
188 |
?>
|
189 |
<div class="error">
|
190 |
+
<p><?php printf( esc_html( $error ) ); ?></p>
|
191 |
</div>
|
192 |
<?php
|
193 |
}
|
204 |
|
205 |
deactivate_plugins( plugin_basename( __FILE__ ) );
|
206 |
|
207 |
+
$error = '<h1>' . __( 'An Error Occurred', 'carousel-slider' ) . '</h1>';
|
208 |
$error .= '<h2>' . __( 'Your installed PHP Version is: ', 'carousel-slider' ) . PHP_VERSION . '</h2>';
|
209 |
+
/* translators: 1: min php version requires */
|
210 |
+
$error .= '<p>' . sprintf( __( 'The Carousel Slider plugin requires PHP version %s or greater', 'carousel-slider' ), $this->min_php ) . '</p>';
|
211 |
+
$error .= '<p>' . sprintf(
|
212 |
+
/* translators: 1: php doc page link start, 2: php doc page link end */
|
213 |
+
__( 'The version of your PHP is %1$s unsupported and old %2$s. ', 'carousel-slider' ),
|
214 |
+
'<a href="https://php.net/supported-versions.php" target="_blank"><strong>',
|
215 |
+
'</strong></a>'
|
216 |
+
);
|
217 |
+
$error .= __( 'You should update your PHP software or contact your host regarding this matter.', 'carousel-slider' ) . '</p>';
|
218 |
+
|
219 |
+
$title = __( 'Plugin Activation Error', 'carousel-slider' );
|
220 |
+
wp_die( wp_kses_post( $error ), esc_html( $title ), [ 'back_link' => true ] );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
221 |
}
|
222 |
|
223 |
/**
|
224 |
* Check if the PHP version is supported
|
225 |
*
|
|
|
|
|
226 |
* @return bool
|
227 |
*/
|
228 |
+
private function is_supported_php() {
|
229 |
+
return ! version_compare( PHP_VERSION, $this->min_php, '<=' );
|
|
|
|
|
|
|
|
|
|
|
|
|
230 |
}
|
231 |
}
|
232 |
}
|
classes/Admin/Admin.php
DELETED
@@ -1,98 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace CarouselSlider\Admin;
|
4 |
-
|
5 |
-
defined( 'ABSPATH' ) || exit;
|
6 |
-
|
7 |
-
class Admin {
|
8 |
-
|
9 |
-
/**
|
10 |
-
* The instance of the class
|
11 |
-
*
|
12 |
-
* @var self
|
13 |
-
*/
|
14 |
-
protected static $instance;
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Ensures only one instance of the class is loaded or can be loaded.
|
18 |
-
*
|
19 |
-
* @return self
|
20 |
-
*/
|
21 |
-
public static function init() {
|
22 |
-
if ( is_null( self::$instance ) ) {
|
23 |
-
self::$instance = new self();
|
24 |
-
|
25 |
-
add_action( 'admin_enqueue_scripts', [ self::$instance, 'admin_scripts' ], 10 );
|
26 |
-
add_action( 'admin_menu', [ self::$instance, 'documentation_menu' ] );
|
27 |
-
add_filter( 'admin_footer_text', [ self::$instance, 'admin_footer_text' ] );
|
28 |
-
}
|
29 |
-
|
30 |
-
return self::$instance;
|
31 |
-
}
|
32 |
-
|
33 |
-
/**
|
34 |
-
* Load admin scripts
|
35 |
-
*
|
36 |
-
* @param $hook
|
37 |
-
*/
|
38 |
-
public function admin_scripts( $hook ) {
|
39 |
-
global $post;
|
40 |
-
|
41 |
-
$_is_carousel = is_a( $post, 'WP_Post' ) && ( 'carousels' == $post->post_type );
|
42 |
-
$_is_doc = ( 'carousels_page_carousel-slider-documentation' == $hook );
|
43 |
-
$_is_plugin_page = 'plugins.php' == $hook;
|
44 |
-
|
45 |
-
if ( ! ( $_is_carousel || $_is_doc || $_is_plugin_page ) ) {
|
46 |
-
return;
|
47 |
-
}
|
48 |
-
|
49 |
-
wp_enqueue_media();
|
50 |
-
wp_enqueue_style( 'carousel-slider-admin' );
|
51 |
-
wp_enqueue_script( 'carousel-slider-admin' );
|
52 |
-
}
|
53 |
-
|
54 |
-
/**
|
55 |
-
* Add documentation menu
|
56 |
-
*/
|
57 |
-
public function documentation_menu() {
|
58 |
-
add_submenu_page(
|
59 |
-
'edit.php?post_type=carousels',
|
60 |
-
__( 'Documentation', 'carousel-slider' ),
|
61 |
-
__( 'Documentation', 'carousel-slider' ),
|
62 |
-
'manage_options',
|
63 |
-
'carousel-slider-documentation',
|
64 |
-
[ $this, 'documentation_page_callback' ]
|
65 |
-
);
|
66 |
-
}
|
67 |
-
|
68 |
-
/**
|
69 |
-
* Documentation page callback
|
70 |
-
*/
|
71 |
-
public function documentation_page_callback() {
|
72 |
-
include_once CAROUSEL_SLIDER_TEMPLATES . '/admin/documentation.php';
|
73 |
-
}
|
74 |
-
|
75 |
-
/**
|
76 |
-
* Add custom footer text on plugins page.
|
77 |
-
*
|
78 |
-
* @param string $text
|
79 |
-
*
|
80 |
-
* @return string
|
81 |
-
*/
|
82 |
-
public function admin_footer_text( $text ) {
|
83 |
-
global $post_type, $hook_suffix;
|
84 |
-
|
85 |
-
$footer_text = sprintf(
|
86 |
-
__( 'If you like %1$s Carousel Slider %2$s please leave us a %3$s rating. A huge thanks in advance!', 'carousel-slider' ),
|
87 |
-
'<strong>',
|
88 |
-
'</strong>',
|
89 |
-
'<a href="https://wordpress.org/support/view/plugin-reviews/carousel-slider?filter=5#postform" target="_blank" data-rated="Thanks :)">★★★★★</a>'
|
90 |
-
);
|
91 |
-
|
92 |
-
if ( $post_type == 'carousels' || $hook_suffix == 'carousels_page_carousel-slider-documentation' ) {
|
93 |
-
return $footer_text;
|
94 |
-
}
|
95 |
-
|
96 |
-
return $text;
|
97 |
-
}
|
98 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
classes/Admin/GutenbergBlock.php
DELETED
@@ -1,91 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace CarouselSlider\Admin;
|
4 |
-
|
5 |
-
use WP_Post;
|
6 |
-
|
7 |
-
defined( 'ABSPATH' ) || exit;
|
8 |
-
|
9 |
-
class GutenbergBlock {
|
10 |
-
/**
|
11 |
-
* The instance of the class
|
12 |
-
*
|
13 |
-
* @var self
|
14 |
-
*/
|
15 |
-
protected static $instance;
|
16 |
-
|
17 |
-
/**
|
18 |
-
* Ensures only one instance of this class is loaded or can be loaded.
|
19 |
-
*
|
20 |
-
* @return self
|
21 |
-
*/
|
22 |
-
public static function init() {
|
23 |
-
if ( is_null( self::$instance ) ) {
|
24 |
-
self::$instance = new self();
|
25 |
-
|
26 |
-
add_action( 'init', array( self::$instance, 'gutenberg_block' ) );
|
27 |
-
}
|
28 |
-
|
29 |
-
return self::$instance;
|
30 |
-
}
|
31 |
-
|
32 |
-
/**
|
33 |
-
* Register gutenberg block
|
34 |
-
*/
|
35 |
-
public function gutenberg_block() {
|
36 |
-
if ( ! function_exists( 'register_block_type' ) ) {
|
37 |
-
return;
|
38 |
-
}
|
39 |
-
wp_register_script( 'carousel-slider-gutenberg-block',
|
40 |
-
CAROUSEL_SLIDER_ASSETS . '/js/gutenberg-block.js',
|
41 |
-
[ 'underscore', 'wp-blocks', 'wp-element', 'wp-components', 'wp-editor', 'wp-i18n' ]
|
42 |
-
);
|
43 |
-
wp_register_style( 'carousel-slider-gutenberg-style',
|
44 |
-
CAROUSEL_SLIDER_ASSETS . '/css/gutenberg-block.css',
|
45 |
-
[ 'wp-edit-blocks' ]
|
46 |
-
);
|
47 |
-
wp_localize_script( 'carousel-slider-gutenberg-block',
|
48 |
-
'carousel_slider_gutenberg_block', $this->block_localize_data()
|
49 |
-
);
|
50 |
-
|
51 |
-
register_block_type( 'carousel-slider/slider', [
|
52 |
-
'editor_script' => 'carousel-slider-gutenberg-block',
|
53 |
-
'editor_style' => 'carousel-slider-gutenberg-style',
|
54 |
-
] );
|
55 |
-
}
|
56 |
-
|
57 |
-
/**
|
58 |
-
* Get localize data
|
59 |
-
*
|
60 |
-
* @return array
|
61 |
-
*/
|
62 |
-
private function block_localize_data(): array {
|
63 |
-
$_sliders = get_posts( [
|
64 |
-
'posts_per_page' => - 1,
|
65 |
-
'orderby' => 'date',
|
66 |
-
'order' => 'DESC',
|
67 |
-
'post_type' => 'carousels',
|
68 |
-
'post_status' => 'publish',
|
69 |
-
] );
|
70 |
-
$sliders = [];
|
71 |
-
foreach ( $_sliders as $form ) {
|
72 |
-
if ( ! $form instanceof WP_Post ) {
|
73 |
-
continue;
|
74 |
-
}
|
75 |
-
$sliders[] = array(
|
76 |
-
'value' => absint( $form->ID ),
|
77 |
-
'label' => esc_attr( $form->post_title ),
|
78 |
-
);
|
79 |
-
}
|
80 |
-
|
81 |
-
return array(
|
82 |
-
'sliders' => $sliders,
|
83 |
-
'site_url' => site_url(),
|
84 |
-
'block_logo' => CAROUSEL_SLIDER_ASSETS . '/static-images/logo.svg',
|
85 |
-
'block_title' => __( 'Carousel Slider', 'carousel-slider' ),
|
86 |
-
'select_slider' => __( 'Select a Slider', 'carousel-slider' ),
|
87 |
-
'selected_slider' => __( 'Current Selected Slider', 'carousel-slider' ),
|
88 |
-
'filter_slider' => __( 'Type to filter sliders', 'carousel-slider' ),
|
89 |
-
);
|
90 |
-
}
|
91 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
classes/Admin/Setting.php
DELETED
@@ -1,66 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace CarouselSlider\Admin;
|
4 |
-
|
5 |
-
use CarouselSlider\Supports\SettingAPI;
|
6 |
-
use Exception;
|
7 |
-
|
8 |
-
defined( 'ABSPATH' ) || exit;
|
9 |
-
|
10 |
-
class Setting {
|
11 |
-
/**
|
12 |
-
* Instance of current class
|
13 |
-
*
|
14 |
-
* @var self
|
15 |
-
*/
|
16 |
-
private static $instance;
|
17 |
-
|
18 |
-
/**
|
19 |
-
* @return self
|
20 |
-
*/
|
21 |
-
public static function init() {
|
22 |
-
if ( is_null( self::$instance ) ) {
|
23 |
-
self::$instance = new self();
|
24 |
-
|
25 |
-
add_action( 'init', array( self::$instance, 'settings' ) );
|
26 |
-
}
|
27 |
-
|
28 |
-
return self::$instance;
|
29 |
-
}
|
30 |
-
|
31 |
-
/**
|
32 |
-
* Plugin setting fields
|
33 |
-
*
|
34 |
-
* @throws Exception
|
35 |
-
*/
|
36 |
-
public function settings() {
|
37 |
-
$settings = new SettingAPI;
|
38 |
-
$settings->add_menu( array(
|
39 |
-
'page_title' => __( 'Carousel Slider Settings', 'carousel-slider' ),
|
40 |
-
'menu_title' => __( 'Settings', 'carousel-slider' ),
|
41 |
-
'about_text' => __( 'Thank you for choosing Carousel Slider. We hope you enjoy it!', 'carousel-slider' ),
|
42 |
-
'menu_slug' => 'settings',
|
43 |
-
'parent_slug' => 'edit.php?post_type=carousels',
|
44 |
-
'option_name' => 'carousel_slider_settings',
|
45 |
-
) );
|
46 |
-
|
47 |
-
// Add settings page tab
|
48 |
-
$settings->add_tab( array(
|
49 |
-
'id' => 'general',
|
50 |
-
'title' => __( 'General', 'carousel-slider' ),
|
51 |
-
) );
|
52 |
-
|
53 |
-
$settings->add_field( array(
|
54 |
-
'id' => 'load_scripts',
|
55 |
-
'type' => 'radio',
|
56 |
-
'std' => 'optimized',
|
57 |
-
'name' => __( 'Style & Scrips', 'carousel-slider' ),
|
58 |
-
'desc' => __( 'If you choose Optimized, then scrips and styles will be loaded only on page where you are using shortcode. If Optimized is not working for you then choose Always.', 'carousel-slider' ),
|
59 |
-
'options' => array(
|
60 |
-
'always' => __( 'Always', 'carousel-slider' ),
|
61 |
-
'optimized' => __( 'Optimized (recommended)', 'carousel-slider' ),
|
62 |
-
),
|
63 |
-
'tab' => 'general',
|
64 |
-
) );
|
65 |
-
}
|
66 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
classes/Frontend/Frontend.php
DELETED
@@ -1,62 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace CarouselSlider\Frontend;
|
4 |
-
|
5 |
-
defined( 'ABSPATH' ) || exit;
|
6 |
-
|
7 |
-
class Frontend {
|
8 |
-
|
9 |
-
/**
|
10 |
-
* The instance of the class
|
11 |
-
*
|
12 |
-
* @var self
|
13 |
-
*/
|
14 |
-
protected static $instance;
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Ensures only one instance of the class is loaded or can be loaded.
|
18 |
-
*
|
19 |
-
* @return self
|
20 |
-
*/
|
21 |
-
public static function init() {
|
22 |
-
if ( is_null( self::$instance ) ) {
|
23 |
-
self::$instance = new self();
|
24 |
-
|
25 |
-
add_action( 'wp_enqueue_scripts', [ self::$instance, 'frontend_scripts' ], 15 );
|
26 |
-
}
|
27 |
-
|
28 |
-
return self::$instance;
|
29 |
-
}
|
30 |
-
|
31 |
-
/**
|
32 |
-
* Load frontend scripts
|
33 |
-
*/
|
34 |
-
public function frontend_scripts() {
|
35 |
-
if ( ! $this->should_load_scripts() ) {
|
36 |
-
return;
|
37 |
-
}
|
38 |
-
|
39 |
-
wp_enqueue_style( 'carousel-slider-frontend' );
|
40 |
-
wp_enqueue_script( 'carousel-slider-frontend' );
|
41 |
-
}
|
42 |
-
|
43 |
-
/**
|
44 |
-
* Check if it should load frontend scripts
|
45 |
-
*
|
46 |
-
* @return bool
|
47 |
-
*/
|
48 |
-
private function should_load_scripts(): bool {
|
49 |
-
$settings = get_option( 'carousel_slider_settings' );
|
50 |
-
$settings = is_array( $settings ) ? $settings : [];
|
51 |
-
if ( isset( $settings['load_scripts'] ) && 'always' == $settings['load_scripts'] ) {
|
52 |
-
return true;
|
53 |
-
}
|
54 |
-
|
55 |
-
global $post;
|
56 |
-
$load_scripts = is_active_widget( false, false, 'widget_carousel_slider', true ) ||
|
57 |
-
( is_a( $post, 'WP_Post' ) && has_shortcode( $post->post_content, 'carousel_slide' ) ) ||
|
58 |
-
( is_a( $post, 'WP_Post' ) && has_shortcode( $post->post_content, 'carousel' ) );
|
59 |
-
|
60 |
-
return apply_filters( 'carousel_slider_load_scripts', $load_scripts );
|
61 |
-
}
|
62 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
classes/Frontend/Preview.php
DELETED
@@ -1,44 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace CarouselSlider\Frontend;
|
4 |
-
|
5 |
-
class Preview {
|
6 |
-
/**
|
7 |
-
* The instance of the class
|
8 |
-
*
|
9 |
-
* @var self
|
10 |
-
*/
|
11 |
-
protected static $instance;
|
12 |
-
|
13 |
-
/**
|
14 |
-
* Ensures only one instance of this class is loaded or can be loaded.
|
15 |
-
*
|
16 |
-
* @return self
|
17 |
-
*/
|
18 |
-
public static function init() {
|
19 |
-
if ( is_null( self::$instance ) ) {
|
20 |
-
self::$instance = new self();
|
21 |
-
|
22 |
-
add_filter( 'template_include', array( self::$instance, 'template_include' ) );
|
23 |
-
}
|
24 |
-
|
25 |
-
return self::$instance;
|
26 |
-
}
|
27 |
-
|
28 |
-
/**
|
29 |
-
* Include custom template
|
30 |
-
*
|
31 |
-
* @param $template
|
32 |
-
*
|
33 |
-
* @return mixed|string
|
34 |
-
*/
|
35 |
-
public function template_include( $template ) {
|
36 |
-
if ( isset( $_GET['carousel_slider_preview'], $_GET['carousel_slider_iframe'], $_GET['slider_id'] ) ) {
|
37 |
-
if ( current_user_can( 'edit_pages' ) ) {
|
38 |
-
$template = CAROUSEL_SLIDER_TEMPLATES . '/public/preview-slider.php';
|
39 |
-
}
|
40 |
-
}
|
41 |
-
|
42 |
-
return $template;
|
43 |
-
}
|
44 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
classes/Frontend/Shortcode.php
DELETED
@@ -1,376 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace CarouselSlider\Frontend;
|
4 |
-
|
5 |
-
defined( 'ABSPATH' ) || exit;
|
6 |
-
|
7 |
-
class Shortcode {
|
8 |
-
|
9 |
-
/**
|
10 |
-
* The instance of the class
|
11 |
-
*
|
12 |
-
* @var self
|
13 |
-
*/
|
14 |
-
protected static $instance = null;
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Ensures only one instance of this class is loaded or can be loaded.
|
18 |
-
*
|
19 |
-
* @return self
|
20 |
-
*/
|
21 |
-
public static function init() {
|
22 |
-
if ( is_null( self::$instance ) ) {
|
23 |
-
self::$instance = new self();
|
24 |
-
|
25 |
-
add_shortcode( 'carousel_slide', [ self::$instance, 'carousel_slide' ] );
|
26 |
-
}
|
27 |
-
|
28 |
-
return self::$instance;
|
29 |
-
}
|
30 |
-
|
31 |
-
/**
|
32 |
-
* A shortcode for rendering the carousel slide.
|
33 |
-
*
|
34 |
-
* @param array $attributes Shortcode attributes.
|
35 |
-
*
|
36 |
-
* @return string The shortcode output
|
37 |
-
*/
|
38 |
-
public function carousel_slide( $attributes ) {
|
39 |
-
if ( empty( $attributes['id'] ) ) {
|
40 |
-
return '';
|
41 |
-
}
|
42 |
-
|
43 |
-
$id = intval( $attributes['id'] );
|
44 |
-
|
45 |
-
$slide_type = get_post_meta( $id, '_slide_type', true );
|
46 |
-
$slide_type = in_array( $slide_type, carousel_slider_slide_type() ) ? $slide_type : 'image-carousel';
|
47 |
-
|
48 |
-
if ( $slide_type == 'post-carousel' ) {
|
49 |
-
ob_start();
|
50 |
-
require CAROUSEL_SLIDER_TEMPLATES . '/public/post-carousel.php';
|
51 |
-
$html = ob_get_contents();
|
52 |
-
ob_end_clean();
|
53 |
-
|
54 |
-
return apply_filters( 'carousel_slider_posts_carousel', $html, $id );
|
55 |
-
}
|
56 |
-
|
57 |
-
if ( $slide_type == 'video-carousel' ) {
|
58 |
-
wp_enqueue_script( 'magnific-popup' );
|
59 |
-
$_video_urls = array_filter( explode( ',', $this->get_meta( $id, '_video_url' ) ) );
|
60 |
-
$urls = $this->get_video_url( $_video_urls );
|
61 |
-
|
62 |
-
ob_start();
|
63 |
-
require CAROUSEL_SLIDER_TEMPLATES . '/public/video-carousel.php';
|
64 |
-
$html = ob_get_contents();
|
65 |
-
ob_end_clean();
|
66 |
-
|
67 |
-
return apply_filters( 'carousel_slider_videos_carousel', $html, $id );
|
68 |
-
}
|
69 |
-
|
70 |
-
if ( $slide_type == 'image-carousel-url' ) {
|
71 |
-
ob_start();
|
72 |
-
require CAROUSEL_SLIDER_TEMPLATES . '/public/images-carousel-url.php';
|
73 |
-
$html = ob_get_contents();
|
74 |
-
ob_end_clean();
|
75 |
-
|
76 |
-
return apply_filters( 'carousel_slider_link_images_carousel', $html, $id );
|
77 |
-
}
|
78 |
-
|
79 |
-
if ( $slide_type == 'image-carousel' ) {
|
80 |
-
ob_start();
|
81 |
-
require CAROUSEL_SLIDER_TEMPLATES . '/public/images-carousel.php';
|
82 |
-
$html = ob_get_contents();
|
83 |
-
ob_end_clean();
|
84 |
-
|
85 |
-
return apply_filters( 'carousel_slider_gallery_images_carousel', $html, $id );
|
86 |
-
}
|
87 |
-
|
88 |
-
if ( $slide_type == 'product-carousel' ) {
|
89 |
-
|
90 |
-
$query_type = get_post_meta( $id, '_product_query_type', true );
|
91 |
-
$query_type = empty( $query_type ) ? 'query_product' : $query_type;
|
92 |
-
// Type mistake
|
93 |
-
$query_type = ( 'query_porduct' == $query_type ) ? 'query_product' : $query_type;
|
94 |
-
$product_query = get_post_meta( $id, '_product_query', true );
|
95 |
-
|
96 |
-
if ( $query_type == 'query_product' && $product_query == 'product_categories_list' ) {
|
97 |
-
ob_start();
|
98 |
-
|
99 |
-
echo $this->product_categories( $id );
|
100 |
-
$html = ob_get_contents();
|
101 |
-
ob_end_clean();
|
102 |
-
|
103 |
-
return apply_filters( 'carousel_slider_product_carousel', $html, $id );
|
104 |
-
}
|
105 |
-
|
106 |
-
ob_start();
|
107 |
-
require CAROUSEL_SLIDER_TEMPLATES . '/public/product-carousel.php';
|
108 |
-
$html = ob_get_contents();
|
109 |
-
ob_end_clean();
|
110 |
-
|
111 |
-
return apply_filters( 'carousel_slider_product_carousel', $html, $id );
|
112 |
-
}
|
113 |
-
|
114 |
-
if ( $slide_type == 'hero-banner-slider' ) {
|
115 |
-
|
116 |
-
ob_start();
|
117 |
-
require CAROUSEL_SLIDER_TEMPLATES . '/public/hero-banner-slider.php';
|
118 |
-
$html = ob_get_contents();
|
119 |
-
ob_end_clean();
|
120 |
-
|
121 |
-
return apply_filters( 'Carousel_Slider_Hero_Carousel', $html, $id );
|
122 |
-
}
|
123 |
-
|
124 |
-
return '';
|
125 |
-
}
|
126 |
-
|
127 |
-
/**
|
128 |
-
* Generate carousel options for slider
|
129 |
-
*
|
130 |
-
* @param $id
|
131 |
-
*
|
132 |
-
* @return array
|
133 |
-
*/
|
134 |
-
private function carousel_options( $id ) {
|
135 |
-
$_nav_button = get_post_meta( $id, '_nav_button', true );
|
136 |
-
$_arrow_position = get_post_meta( $id, '_arrow_position', true );
|
137 |
-
$_dot_nav = get_post_meta( $id, '_dot_nav', true );
|
138 |
-
$_bullet_position = get_post_meta( $id, '_bullet_position', true );
|
139 |
-
$_bullet_shape = get_post_meta( $id, '_bullet_shape', true );
|
140 |
-
|
141 |
-
$class = 'owl-carousel carousel-slider';
|
142 |
-
|
143 |
-
// Arrows position
|
144 |
-
if ( $_arrow_position == 'inside' ) {
|
145 |
-
$class .= ' arrows-inside';
|
146 |
-
} else {
|
147 |
-
$class .= ' arrows-outside';
|
148 |
-
}
|
149 |
-
|
150 |
-
// Arrows visibility
|
151 |
-
if ( $_nav_button == 'always' ) {
|
152 |
-
$class .= ' arrows-visible-always';
|
153 |
-
} elseif ( $_nav_button == 'off' ) {
|
154 |
-
$class .= ' arrows-hidden';
|
155 |
-
} else {
|
156 |
-
$class .= ' arrows-visible-hover';
|
157 |
-
}
|
158 |
-
|
159 |
-
// Dots visibility
|
160 |
-
if ( $_dot_nav == 'on' ) {
|
161 |
-
$class .= ' dots-visible-always';
|
162 |
-
} elseif ( $_dot_nav == 'off' ) {
|
163 |
-
$class .= ' dots-hidden';
|
164 |
-
} else {
|
165 |
-
$class .= ' dots-visible-hover';
|
166 |
-
}
|
167 |
-
|
168 |
-
// Dots position
|
169 |
-
if ( $_bullet_position == 'left' ) {
|
170 |
-
$class .= ' dots-left';
|
171 |
-
} elseif ( $_bullet_position == 'right' ) {
|
172 |
-
$class .= ' dots-right';
|
173 |
-
} else {
|
174 |
-
$class .= ' dots-center';
|
175 |
-
}
|
176 |
-
|
177 |
-
// Dots shape
|
178 |
-
if ( $_bullet_shape == 'circle' ) {
|
179 |
-
$class .= ' dots-circle';
|
180 |
-
} else {
|
181 |
-
$class .= ' dots-square';
|
182 |
-
}
|
183 |
-
|
184 |
-
$_dot_nav = ( get_post_meta( $id, '_dot_nav', true ) != 'off' );
|
185 |
-
$_nav_button = ( get_post_meta( $id, '_nav_button', true ) != 'off' );
|
186 |
-
|
187 |
-
$options_array = array(
|
188 |
-
'id' => 'id-' . $id,
|
189 |
-
'class' => $class,
|
190 |
-
// General
|
191 |
-
'data-slide-type' => $this->get_meta( $id, '_slide_type', 'image-carousel' ),
|
192 |
-
'data-margin' => $this->get_meta( $id, '_margin_right', '10' ),
|
193 |
-
'data-slide-by' => $this->get_meta( $id, '_slide_by', '1' ),
|
194 |
-
'data-loop' => $this->get_meta( $id, '_inifnity_loop', 'true' ),
|
195 |
-
'data-lazy-load' => $this->get_meta( $id, '_lazy_load_image', 'false' ),
|
196 |
-
'data-stage-padding' => $this->get_meta( $id, '_stage_padding', '0' ),
|
197 |
-
'data-auto-width' => $this->get_meta( $id, '_auto_width', 'false' ),
|
198 |
-
// Navigation
|
199 |
-
'data-dots' => $_dot_nav,
|
200 |
-
'data-nav' => $_nav_button,
|
201 |
-
// Autoplay
|
202 |
-
'data-autoplay' => $this->get_meta( $id, '_autoplay', 'true' ),
|
203 |
-
'data-autoplay-timeout' => $this->get_meta( $id, '_autoplay_timeout', '5000' ),
|
204 |
-
'data-autoplay-speed' => $this->get_meta( $id, '_autoplay_speed', '500' ),
|
205 |
-
'data-autoplay-hover-pause' => $this->get_meta( $id, '_autoplay_pause', 'false' ),
|
206 |
-
// Responsive
|
207 |
-
'data-colums' => $this->get_meta( $id, '_items', '4' ),
|
208 |
-
'data-colums-desktop' => $this->get_meta( $id, '_items_desktop', '4' ),
|
209 |
-
'data-colums-small-desktop' => $this->get_meta( $id, '_items_small_desktop', '4' ),
|
210 |
-
'data-colums-tablet' => $this->get_meta( $id, '_items_portrait_tablet', '3' ),
|
211 |
-
'data-colums-small-tablet' => $this->get_meta( $id, '_items_small_portrait_tablet', '2' ),
|
212 |
-
'data-colums-mobile' => $this->get_meta( $id, '_items_portrait_mobile', '1' ),
|
213 |
-
);
|
214 |
-
|
215 |
-
return $this->array_to_data( $options_array );
|
216 |
-
}
|
217 |
-
|
218 |
-
/**
|
219 |
-
* Get post meta by id and key
|
220 |
-
*
|
221 |
-
* @param $id
|
222 |
-
* @param $key
|
223 |
-
* @param null $default
|
224 |
-
*
|
225 |
-
* @return string
|
226 |
-
*/
|
227 |
-
public function get_meta( $id, $key, $default = null ) {
|
228 |
-
return carousel_slider_get_meta( $id, $key, $default );
|
229 |
-
}
|
230 |
-
|
231 |
-
/**
|
232 |
-
* Convert array to html data attribute
|
233 |
-
*
|
234 |
-
* @param $array
|
235 |
-
*
|
236 |
-
* @return array
|
237 |
-
*/
|
238 |
-
public function array_to_data( $array ) {
|
239 |
-
return carousel_slider_array_to_attribute( $array );
|
240 |
-
}
|
241 |
-
|
242 |
-
/**
|
243 |
-
* Get product categories list carousel
|
244 |
-
*
|
245 |
-
* @param int $id
|
246 |
-
*
|
247 |
-
* @return string
|
248 |
-
*/
|
249 |
-
private function product_categories( $id = 0 ) {
|
250 |
-
$product_categories = get_terms( array(
|
251 |
-
'taxonomy' => 'product_cat',
|
252 |
-
'hide_empty' => 1,
|
253 |
-
'orderby' => 'name',
|
254 |
-
'order' => 'ASC',
|
255 |
-
) );
|
256 |
-
|
257 |
-
$options = $this->carousel_options( $id );
|
258 |
-
$options = join( " ", $options );
|
259 |
-
|
260 |
-
ob_start();
|
261 |
-
if ( $product_categories ) {
|
262 |
-
echo '<div class="carousel-slider-outer carousel-slider-outer-products carousel-slider-outer-' . $id . '">';
|
263 |
-
carousel_slider_inline_style( $id );
|
264 |
-
echo '<div ' . $options . '>';
|
265 |
-
|
266 |
-
|
267 |
-
foreach ( $product_categories as $category ) {
|
268 |
-
echo '<div class="product carousel-slider__product">';
|
269 |
-
do_action( 'woocommerce_before_subcategory', $category );
|
270 |
-
do_action( 'woocommerce_before_subcategory_title', $category );
|
271 |
-
do_action( 'woocommerce_shop_loop_subcategory_title', $category );
|
272 |
-
do_action( 'woocommerce_after_subcategory_title', $category );
|
273 |
-
do_action( 'woocommerce_after_subcategory', $category );
|
274 |
-
echo '</div>';
|
275 |
-
}
|
276 |
-
|
277 |
-
echo '</div>';
|
278 |
-
echo '</div>';
|
279 |
-
}
|
280 |
-
|
281 |
-
$html = ob_get_contents();
|
282 |
-
ob_end_clean();
|
283 |
-
|
284 |
-
return $html;
|
285 |
-
}
|
286 |
-
|
287 |
-
/**
|
288 |
-
* Get Youtube video ID from URL
|
289 |
-
*
|
290 |
-
* @param string $url
|
291 |
-
*
|
292 |
-
* @return mixed Youtube video ID or FALSE if not found
|
293 |
-
*/
|
294 |
-
private function get_youtube_id_from_url( $url ) {
|
295 |
-
$parts = parse_url( $url );
|
296 |
-
if ( isset( $parts['query'] ) ) {
|
297 |
-
parse_str( $parts['query'], $qs );
|
298 |
-
if ( isset( $qs['v'] ) ) {
|
299 |
-
return $qs['v'];
|
300 |
-
} elseif ( isset( $qs['vi'] ) ) {
|
301 |
-
return $qs['vi'];
|
302 |
-
}
|
303 |
-
}
|
304 |
-
if ( isset( $parts['path'] ) ) {
|
305 |
-
$path = explode( '/', trim( $parts['path'], '/' ) );
|
306 |
-
|
307 |
-
return $path[ count( $path ) - 1 ];
|
308 |
-
}
|
309 |
-
|
310 |
-
return false;
|
311 |
-
}
|
312 |
-
|
313 |
-
/**
|
314 |
-
* Get Vimeo video ID from URL
|
315 |
-
*
|
316 |
-
* @param string $url
|
317 |
-
*
|
318 |
-
* @return mixed Vimeo video ID or FALSE if not found
|
319 |
-
*/
|
320 |
-
private function get_vimeo_id_from_url( $url ) {
|
321 |
-
$parts = parse_url( $url );
|
322 |
-
if ( isset( $parts['path'] ) ) {
|
323 |
-
$path = explode( '/', trim( $parts['path'], '/' ) );
|
324 |
-
|
325 |
-
return $path[ count( $path ) - 1 ];
|
326 |
-
}
|
327 |
-
|
328 |
-
return false;
|
329 |
-
}
|
330 |
-
|
331 |
-
/**
|
332 |
-
* @param $video_urls
|
333 |
-
*
|
334 |
-
* @return array
|
335 |
-
*/
|
336 |
-
public function get_video_url( array $video_urls ) {
|
337 |
-
$_url = array();
|
338 |
-
foreach ( $video_urls as $video_url ) {
|
339 |
-
if ( ! filter_var( $video_url, FILTER_VALIDATE_URL ) ) {
|
340 |
-
continue;
|
341 |
-
}
|
342 |
-
$provider = '';
|
343 |
-
$video_id = '';
|
344 |
-
$thumbnail = '';
|
345 |
-
if ( false !== strpos( $video_url, 'youtube.com' ) ) {
|
346 |
-
$provider = 'youtube';
|
347 |
-
$video_id = $this->get_youtube_id_from_url( $video_url );
|
348 |
-
$thumbnail = array(
|
349 |
-
'large' => 'https://img.youtube.com/vi/' . $video_id . '/hqdefault.jpg',
|
350 |
-
'medium' => 'https://img.youtube.com/vi/' . $video_id . '/mqdefault.jpg',
|
351 |
-
'small' => 'https://img.youtube.com/vi/' . $video_id . '/sddefault.jpg',
|
352 |
-
);
|
353 |
-
|
354 |
-
} elseif ( false !== strpos( $video_url, 'vimeo.com' ) ) {
|
355 |
-
$provider = 'vimeo';
|
356 |
-
$video_id = $this->get_vimeo_id_from_url( $video_url );
|
357 |
-
$response = wp_remote_get( "https://vimeo.com/api/v2/video/$video_id.json" );
|
358 |
-
$thumbnail = json_decode( wp_remote_retrieve_body( $response ), true );
|
359 |
-
$thumbnail = array(
|
360 |
-
'large' => isset( $thumbnail[0]['thumbnail_large'] ) ? $thumbnail[0]['thumbnail_large'] : null,
|
361 |
-
'medium' => isset( $thumbnail[0]['thumbnail_medium'] ) ? $thumbnail[0]['thumbnail_medium'] : null,
|
362 |
-
'small' => isset( $thumbnail[0]['thumbnail_small'] ) ? $thumbnail[0]['thumbnail_small'] : null,
|
363 |
-
);
|
364 |
-
}
|
365 |
-
|
366 |
-
$_url[] = array(
|
367 |
-
'provider' => $provider,
|
368 |
-
'url' => $video_url,
|
369 |
-
'video_id' => $video_id,
|
370 |
-
'thumbnail' => $thumbnail,
|
371 |
-
);
|
372 |
-
}
|
373 |
-
|
374 |
-
return $_url;
|
375 |
-
}
|
376 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
classes/Integration/VisualComposerElement.php
DELETED
@@ -1,81 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace CarouselSlider\Integration;
|
4 |
-
|
5 |
-
defined( 'ABSPATH' ) || exit;
|
6 |
-
|
7 |
-
class VisualComposerElement {
|
8 |
-
/**
|
9 |
-
* The instance of the class
|
10 |
-
*
|
11 |
-
* @var self
|
12 |
-
*/
|
13 |
-
private static $instance = null;
|
14 |
-
|
15 |
-
/**
|
16 |
-
* Ensures only one instance of this class is loaded or can be loaded.
|
17 |
-
*
|
18 |
-
* @return self
|
19 |
-
*/
|
20 |
-
public static function init() {
|
21 |
-
if ( is_null( self::$instance ) ) {
|
22 |
-
self::$instance = new self();
|
23 |
-
|
24 |
-
add_action( 'init', array( self::$instance, 'integrate_with_vc' ) );
|
25 |
-
}
|
26 |
-
|
27 |
-
return self::$instance;
|
28 |
-
}
|
29 |
-
|
30 |
-
/**
|
31 |
-
* Integrate with visual composer
|
32 |
-
*/
|
33 |
-
public function integrate_with_vc() {
|
34 |
-
// Check if Visual Composer is installed
|
35 |
-
if ( ! function_exists( 'vc_map' ) ) {
|
36 |
-
return;
|
37 |
-
}
|
38 |
-
|
39 |
-
vc_map( array(
|
40 |
-
"name" => __( "Carousel Slider", 'carousel-slider' ),
|
41 |
-
"description" => __( "Place Carousel Slider.", 'carousel-slider' ),
|
42 |
-
"base" => "carousel_slide",
|
43 |
-
"controls" => "full",
|
44 |
-
"icon" => CAROUSEL_SLIDER_ASSETS . '/static-images/logo.svg',
|
45 |
-
"category" => __( 'Content', 'carousel-slider' ),
|
46 |
-
"params" => array(
|
47 |
-
array(
|
48 |
-
"type" => "dropdown",
|
49 |
-
"holder" => "div",
|
50 |
-
"class" => "carousel-slider-id",
|
51 |
-
"param_name" => "id",
|
52 |
-
"value" => $this->carousels_list(),
|
53 |
-
"heading" => __( "Choose Carousel Slide", 'carousel-slider' ),
|
54 |
-
),
|
55 |
-
),
|
56 |
-
) );
|
57 |
-
}
|
58 |
-
|
59 |
-
/**
|
60 |
-
* Generate array for carousel slider
|
61 |
-
*
|
62 |
-
* @return array
|
63 |
-
*/
|
64 |
-
private function carousels_list(): array {
|
65 |
-
$carousels = get_posts( [
|
66 |
-
'post_type' => 'carousels',
|
67 |
-
'post_status' => 'publish',
|
68 |
-
'posts_per_page' => - 1,
|
69 |
-
] );
|
70 |
-
|
71 |
-
$result = [];
|
72 |
-
|
73 |
-
if ( count( $carousels ) ) {
|
74 |
-
foreach ( $carousels as $carousel ) {
|
75 |
-
$result[ esc_html( $carousel->post_title ) ] = $carousel->ID;
|
76 |
-
}
|
77 |
-
}
|
78 |
-
|
79 |
-
return $result;
|
80 |
-
}
|
81 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/Abstracts/AbstractTemplate.php
ADDED
@@ -0,0 +1,126 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace CarouselSlider\Abstracts;
|
4 |
+
|
5 |
+
use CarouselSlider\Helper;
|
6 |
+
use WP_Error;
|
7 |
+
|
8 |
+
defined( 'ABSPATH' ) || exit;
|
9 |
+
|
10 |
+
/**
|
11 |
+
* AbstractTemplate class
|
12 |
+
* The base template class for any slider type
|
13 |
+
*
|
14 |
+
* @package CarouselSlider/Abstracts
|
15 |
+
*/
|
16 |
+
abstract class AbstractTemplate {
|
17 |
+
/**
|
18 |
+
* Get default image carousel settings
|
19 |
+
*
|
20 |
+
* @return array
|
21 |
+
*/
|
22 |
+
public static function get_default_settings(): array {
|
23 |
+
return [
|
24 |
+
// General Settings.
|
25 |
+
'_image_size' => 'medium',
|
26 |
+
'_stage_padding' => '0',
|
27 |
+
'_margin_right' => (string) Helper::get_default_setting( 'margin_right' ),
|
28 |
+
'_lazy_load_image' => Helper::get_default_setting( 'lazy_load_image' ),
|
29 |
+
'_infinity_loop' => 'on',
|
30 |
+
'_auto_width' => 'off',
|
31 |
+
// Autoplay Settings.
|
32 |
+
'_autoplay' => 'on',
|
33 |
+
'_autoplay_pause' => 'on',
|
34 |
+
'_autoplay_timeout' => '5000',
|
35 |
+
'_autoplay_speed' => '500',
|
36 |
+
// Navigation Settings.
|
37 |
+
'_nav_button' => 'always',
|
38 |
+
'_slide_by' => '1',
|
39 |
+
'_arrow_position' => 'outside',
|
40 |
+
'_arrow_size' => '48',
|
41 |
+
'_dot_nav' => 'on', // Always.
|
42 |
+
'_bullet_position' => 'center',
|
43 |
+
'_bullet_size' => '10',
|
44 |
+
'_bullet_shape' => 'circle',
|
45 |
+
'_nav_color' => Helper::get_default_setting( 'nav_color' ),
|
46 |
+
'_nav_active_color' => Helper::get_default_setting( 'nav_active_color' ),
|
47 |
+
// Responsive Settings.
|
48 |
+
'_items_portrait_mobile' => '1',
|
49 |
+
'_items_small_portrait_tablet' => '2',
|
50 |
+
'_items_portrait_tablet' => '3',
|
51 |
+
'_items_small_desktop' => '3',
|
52 |
+
'_items_desktop' => '3',
|
53 |
+
'_items' => '4',
|
54 |
+
];
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Get list of images sorted by its width and height
|
59 |
+
*
|
60 |
+
* @param string $image_size The image size.
|
61 |
+
* @param int $per_page Item per page.
|
62 |
+
*
|
63 |
+
* @return array
|
64 |
+
*/
|
65 |
+
public static function get_images( string $image_size = 'full', int $per_page = 100 ): array {
|
66 |
+
$args = array(
|
67 |
+
'order' => 'DESC',
|
68 |
+
'post_type' => 'attachment',
|
69 |
+
'post_mime_type' => 'image',
|
70 |
+
'post_status' => 'any',
|
71 |
+
'posts_per_page' => $per_page,
|
72 |
+
);
|
73 |
+
$attachments = get_posts( $args );
|
74 |
+
|
75 |
+
$images = [];
|
76 |
+
|
77 |
+
foreach ( $attachments as $attachment ) {
|
78 |
+
if ( ! in_array( $attachment->post_mime_type, [ 'image/jpeg', 'image/png' ], true ) ) {
|
79 |
+
continue;
|
80 |
+
}
|
81 |
+
|
82 |
+
$src = wp_get_attachment_image_src( $attachment->ID, $image_size );
|
83 |
+
$_link_url = get_post_meta( $attachment->ID, '_carousel_slider_link_url', true );
|
84 |
+
$_image_alt = get_post_meta( $attachment->ID, '_wp_attachment_image_alt', true );
|
85 |
+
|
86 |
+
$images[] = [
|
87 |
+
'id' => $attachment->ID,
|
88 |
+
'title' => $attachment->post_title,
|
89 |
+
'description' => $attachment->post_content,
|
90 |
+
'caption' => $attachment->post_excerpt,
|
91 |
+
'alt_text' => $_image_alt,
|
92 |
+
'link_url' => $_link_url,
|
93 |
+
'image_src' => $src[0],
|
94 |
+
'image_width' => $src[1],
|
95 |
+
'image_height' => $src[2],
|
96 |
+
];
|
97 |
+
}
|
98 |
+
|
99 |
+
$widths = wp_list_pluck( $images, 'image_width' );
|
100 |
+
$heights = wp_list_pluck( $images, 'image_height' );
|
101 |
+
|
102 |
+
// Sort the $images with $widths and $heights descending.
|
103 |
+
array_multisort( $widths, SORT_DESC, $heights, SORT_DESC, $images );
|
104 |
+
|
105 |
+
return $images;
|
106 |
+
}
|
107 |
+
|
108 |
+
/**
|
109 |
+
* Create a new slider.
|
110 |
+
*
|
111 |
+
* @param string $slider_title The slider title.
|
112 |
+
*
|
113 |
+
* @return int|WP_Error The post ID on success. The value 0 or \WP_Error on failure.
|
114 |
+
*/
|
115 |
+
public static function create_slider( string $slider_title ) {
|
116 |
+
return wp_insert_post(
|
117 |
+
[
|
118 |
+
'post_title' => $slider_title,
|
119 |
+
'post_status' => 'publish',
|
120 |
+
'post_type' => 'carousels',
|
121 |
+
'comment_status' => 'closed',
|
122 |
+
'ping_status' => 'closed',
|
123 |
+
]
|
124 |
+
);
|
125 |
+
}
|
126 |
+
}
|
includes/Abstracts/AbstractView.php
ADDED
@@ -0,0 +1,204 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace CarouselSlider\Abstracts;
|
4 |
+
|
5 |
+
use CarouselSlider\Helper;
|
6 |
+
use CarouselSlider\Interfaces\SliderViewInterface;
|
7 |
+
|
8 |
+
defined( 'ABSPATH' ) || exit;
|
9 |
+
|
10 |
+
/**
|
11 |
+
* AbstractView class
|
12 |
+
* The base view class for any slider type
|
13 |
+
*
|
14 |
+
* @package CarouselSlider/Abstracts
|
15 |
+
*/
|
16 |
+
abstract class AbstractView implements SliderViewInterface {
|
17 |
+
/**
|
18 |
+
* Slider id
|
19 |
+
*
|
20 |
+
* @var int
|
21 |
+
*/
|
22 |
+
protected $slider_id = 0;
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Slider type
|
26 |
+
*
|
27 |
+
* @var string
|
28 |
+
*/
|
29 |
+
protected $slider_type = '';
|
30 |
+
|
31 |
+
/**
|
32 |
+
* The slider setting class
|
33 |
+
*
|
34 |
+
* @var SliderSetting
|
35 |
+
*/
|
36 |
+
protected $slider_setting;
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Render element.
|
40 |
+
* Generates the final HTML on the frontend.
|
41 |
+
*
|
42 |
+
* @return string
|
43 |
+
*/
|
44 |
+
abstract public function render(): string;
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Get slider id
|
48 |
+
*
|
49 |
+
* @return int
|
50 |
+
*/
|
51 |
+
public function get_slider_id(): int {
|
52 |
+
return $this->slider_id;
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Set slider id
|
57 |
+
*
|
58 |
+
* @param int $slider_id The slider id.
|
59 |
+
*/
|
60 |
+
public function set_slider_id( int $slider_id ) {
|
61 |
+
$this->slider_id = $slider_id;
|
62 |
+
}
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Get slider type
|
66 |
+
*
|
67 |
+
* @return string
|
68 |
+
*/
|
69 |
+
public function get_slider_type(): string {
|
70 |
+
return $this->slider_type;
|
71 |
+
}
|
72 |
+
|
73 |
+
/**
|
74 |
+
* Set slider type
|
75 |
+
*
|
76 |
+
* @param string $slider_type The slider type.
|
77 |
+
*/
|
78 |
+
public function set_slider_type( string $slider_type ) {
|
79 |
+
$this->slider_type = $slider_type;
|
80 |
+
}
|
81 |
+
|
82 |
+
/**
|
83 |
+
* Get slider setting
|
84 |
+
*
|
85 |
+
* @return SliderSetting
|
86 |
+
*/
|
87 |
+
public function get_slider_setting(): SliderSetting {
|
88 |
+
if ( ! $this->slider_setting instanceof SliderSetting ) {
|
89 |
+
$this->slider_setting = new SliderSetting( $this->get_slider_id() );
|
90 |
+
}
|
91 |
+
|
92 |
+
return $this->slider_setting;
|
93 |
+
}
|
94 |
+
|
95 |
+
/**
|
96 |
+
* Set slider setting class
|
97 |
+
*
|
98 |
+
* @param SliderSetting $slider_setting The SliderSetting class.
|
99 |
+
*/
|
100 |
+
public function set_slider_setting( SliderSetting $slider_setting ) {
|
101 |
+
$this->slider_setting = $slider_setting;
|
102 |
+
}
|
103 |
+
|
104 |
+
/**
|
105 |
+
* Get slider start wrapper html
|
106 |
+
*
|
107 |
+
* @param array $args The additional arguments.
|
108 |
+
*
|
109 |
+
* @return string
|
110 |
+
*/
|
111 |
+
public function start_wrapper_html( array $args = [] ): string {
|
112 |
+
$css_classes = [
|
113 |
+
'carousel-slider-outer',
|
114 |
+
'carousel-slider-outer-' . $this->get_slider_type(),
|
115 |
+
'carousel-slider-outer-' . $this->get_slider_id(),
|
116 |
+
];
|
117 |
+
|
118 |
+
$attributes_array = $this->get_slider_attributes( $args );
|
119 |
+
|
120 |
+
$html = '<div class="' . join( ' ', $css_classes ) . '">' . PHP_EOL;
|
121 |
+
$html .= '<div ' . join( ' ', $attributes_array ) . '>' . PHP_EOL;
|
122 |
+
|
123 |
+
return $html;
|
124 |
+
}
|
125 |
+
|
126 |
+
/**
|
127 |
+
* Get slider end wrapper html
|
128 |
+
*
|
129 |
+
* @return string
|
130 |
+
*/
|
131 |
+
public function end_wrapper_html(): string {
|
132 |
+
$html = '</div><!-- .carousel-slider-' . $this->get_slider_id() . ' -->' . PHP_EOL;
|
133 |
+
$html .= '</div><!-- .carousel-slider-outer-' . $this->get_slider_id() . ' -->' . PHP_EOL;
|
134 |
+
|
135 |
+
return $html;
|
136 |
+
}
|
137 |
+
|
138 |
+
/**
|
139 |
+
* Get slider default attributes
|
140 |
+
*
|
141 |
+
* @param array $args The additional arguments.
|
142 |
+
*
|
143 |
+
* @return array
|
144 |
+
*/
|
145 |
+
protected function get_slider_attributes( array $args = [] ): array {
|
146 |
+
$owl_settings = ( new OwlSetting( $this->get_slider_setting() ) )->all();
|
147 |
+
$default_attributes = [
|
148 |
+
'id' => sprintf( "'id-%s", $this->get_slider_id() ),
|
149 |
+
'class' => implode( ' ', $this->get_css_classes() ),
|
150 |
+
'style' => Helper::array_to_style( $this->get_css_variable() ),
|
151 |
+
'data-slide-type' => $this->get_slider_type(),
|
152 |
+
'data-owl-settings' => wp_json_encode( $owl_settings ),
|
153 |
+
];
|
154 |
+
$attributes = array_merge( $default_attributes, $this->extra_slider_attributes(), $args );
|
155 |
+
|
156 |
+
return Helper::array_to_attribute( $attributes );
|
157 |
+
}
|
158 |
+
|
159 |
+
/**
|
160 |
+
* Get extra slider attributes
|
161 |
+
*
|
162 |
+
* @return array
|
163 |
+
*/
|
164 |
+
protected function extra_slider_attributes(): array {
|
165 |
+
return [];
|
166 |
+
}
|
167 |
+
|
168 |
+
/**
|
169 |
+
* Get slider CSS style variables
|
170 |
+
*
|
171 |
+
* @return array
|
172 |
+
*/
|
173 |
+
public function get_css_variable(): array {
|
174 |
+
$setting = $this->get_slider_setting();
|
175 |
+
$css_var = [
|
176 |
+
'--carousel-slider-nav-color' => $setting->get_prop( 'nav_color' ),
|
177 |
+
'--carousel-slider-active-nav-color' => $setting->get_prop( 'nav_active_color' ),
|
178 |
+
'--carousel-slider-arrow-size' => $setting->get_prop( 'nav_size' ) . 'px',
|
179 |
+
'--carousel-slider-bullet-size' => $setting->get_prop( 'pagination_size' ) . 'px',
|
180 |
+
];
|
181 |
+
|
182 |
+
return apply_filters( 'carousel_slider/css_var', $css_var, $this->get_slider_id() );
|
183 |
+
}
|
184 |
+
|
185 |
+
/**
|
186 |
+
* Get slider css classes
|
187 |
+
*
|
188 |
+
* @return string[]
|
189 |
+
*/
|
190 |
+
public function get_css_classes(): array {
|
191 |
+
$setting = $this->get_slider_setting();
|
192 |
+
|
193 |
+
return [
|
194 |
+
'owl-carousel',
|
195 |
+
'carousel-slider',
|
196 |
+
'carousel-slider-' . $this->get_slider_id(),
|
197 |
+
'arrows-visibility-' . $setting->get_prop( 'nav_visibility' ),
|
198 |
+
'arrows-' . $setting->get_prop( 'nav_position' ),
|
199 |
+
'dots-visibility-' . $setting->get_prop( 'pagination_visibility' ),
|
200 |
+
'dots-' . $setting->get_prop( 'pagination_position' ),
|
201 |
+
'dots-' . $setting->get_prop( 'pagination_shape' ),
|
202 |
+
];
|
203 |
+
}
|
204 |
+
}
|
includes/Abstracts/Data.php
ADDED
@@ -0,0 +1,166 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace CarouselSlider\Abstracts;
|
4 |
+
|
5 |
+
use ArrayAccess;
|
6 |
+
use JsonSerializable;
|
7 |
+
|
8 |
+
defined( 'ABSPATH' ) || exit;
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Class Data
|
12 |
+
*
|
13 |
+
* @package CarouselSlider\Abstracts
|
14 |
+
*/
|
15 |
+
class Data implements ArrayAccess, JsonSerializable {
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Object data
|
19 |
+
*
|
20 |
+
* @var array
|
21 |
+
*/
|
22 |
+
protected $data = [];
|
23 |
+
|
24 |
+
/**
|
25 |
+
* String representation of the class
|
26 |
+
*
|
27 |
+
* @return string
|
28 |
+
*/
|
29 |
+
public function __toString() {
|
30 |
+
return wp_json_encode( $this->to_array() );
|
31 |
+
}
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Get collection item for key
|
35 |
+
*
|
36 |
+
* @param string $name The property name.
|
37 |
+
*
|
38 |
+
* @return mixed
|
39 |
+
*/
|
40 |
+
public function __get( string $name ) {
|
41 |
+
return $this->get_prop( $name );
|
42 |
+
}
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Does this collection have a given key?
|
46 |
+
*
|
47 |
+
* @param string $name The property name.
|
48 |
+
*
|
49 |
+
* @return bool
|
50 |
+
*/
|
51 |
+
public function __isset( string $name ) {
|
52 |
+
return $this->has_prop( $name );
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Array representation of the class
|
57 |
+
*
|
58 |
+
* @return array
|
59 |
+
*/
|
60 |
+
public function to_array(): array {
|
61 |
+
return $this->data;
|
62 |
+
}
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Does this collection have a given key?
|
66 |
+
*
|
67 |
+
* @param string $key The data key.
|
68 |
+
*
|
69 |
+
* @return bool
|
70 |
+
*/
|
71 |
+
public function has_prop( string $key ): bool {
|
72 |
+
return isset( $this->data[ $key ] );
|
73 |
+
}
|
74 |
+
|
75 |
+
/**
|
76 |
+
* Set collection item
|
77 |
+
*
|
78 |
+
* @param string $key The data key.
|
79 |
+
* @param mixed $value The data value.
|
80 |
+
*/
|
81 |
+
public function set_prop( string $key, $value ) {
|
82 |
+
$this->data[ $key ] = $value;
|
83 |
+
}
|
84 |
+
|
85 |
+
/**
|
86 |
+
* Get collection item for key
|
87 |
+
*
|
88 |
+
* @param string $key The data key.
|
89 |
+
* @param mixed $default The default value to return if data key does not exist.
|
90 |
+
*
|
91 |
+
* @return mixed The key's value, or the default value
|
92 |
+
*/
|
93 |
+
public function get_prop( string $key, $default = '' ) {
|
94 |
+
if ( $this->has_prop( $key ) ) {
|
95 |
+
return $this->data[ $key ];
|
96 |
+
}
|
97 |
+
|
98 |
+
return $default;
|
99 |
+
}
|
100 |
+
|
101 |
+
/**
|
102 |
+
* Remove item from collection
|
103 |
+
*
|
104 |
+
* @param string $key The data key.
|
105 |
+
*/
|
106 |
+
public function remove_prop( string $key ) {
|
107 |
+
if ( $this->has_prop( $key ) ) {
|
108 |
+
unset( $this->data[ $key ] );
|
109 |
+
}
|
110 |
+
}
|
111 |
+
|
112 |
+
/**
|
113 |
+
* Whether an offset exists
|
114 |
+
*
|
115 |
+
* @param mixed $offset An offset to check for.
|
116 |
+
*
|
117 |
+
* @return boolean true on success or false on failure.
|
118 |
+
*/
|
119 |
+
public function offsetExists( $offset ): bool {
|
120 |
+
return $this->has_prop( $offset );
|
121 |
+
}
|
122 |
+
|
123 |
+
/**
|
124 |
+
* Offset to retrieve
|
125 |
+
*
|
126 |
+
* @param mixed $offset The offset to retrieve.
|
127 |
+
*
|
128 |
+
* @return mixed Can return all value types.
|
129 |
+
*/
|
130 |
+
public function offsetGet( $offset ) {
|
131 |
+
return $this->get_prop( $offset );
|
132 |
+
}
|
133 |
+
|
134 |
+
/**
|
135 |
+
* Offset to set
|
136 |
+
*
|
137 |
+
* @param mixed $offset The offset to assign the value to.
|
138 |
+
* @param mixed $value The value to set.
|
139 |
+
*
|
140 |
+
* @return void
|
141 |
+
*/
|
142 |
+
public function offsetSet( $offset, $value ) {
|
143 |
+
$this->set_prop( $offset, $value );
|
144 |
+
}
|
145 |
+
|
146 |
+
/**
|
147 |
+
* Offset to unset
|
148 |
+
*
|
149 |
+
* @param mixed $offset The offset to unset.
|
150 |
+
*
|
151 |
+
* @return void
|
152 |
+
*/
|
153 |
+
public function offsetUnset( $offset ) {
|
154 |
+
$this->remove_prop( $offset );
|
155 |
+
}
|
156 |
+
|
157 |
+
/**
|
158 |
+
* Specify data which should be serialized to JSON
|
159 |
+
*
|
160 |
+
* @return array data which can be serialized by json_encode
|
161 |
+
* which is a value of any type other than a resource.
|
162 |
+
*/
|
163 |
+
public function jsonSerialize(): array {
|
164 |
+
return $this->to_array();
|
165 |
+
}
|
166 |
+
}
|
includes/Abstracts/OwlSetting.php
ADDED
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace CarouselSlider\Abstracts;
|
4 |
+
|
5 |
+
/**
|
6 |
+
* OwlSetting class
|
7 |
+
* The owl carousel javascript option generator.
|
8 |
+
*
|
9 |
+
* @package CarouselSlider/Abstracts
|
10 |
+
*/
|
11 |
+
class OwlSetting {
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Owl settings
|
15 |
+
*
|
16 |
+
* @var array
|
17 |
+
*/
|
18 |
+
protected $settings = [];
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Class constructor
|
22 |
+
*
|
23 |
+
* @param SliderSetting $slider_setting slider setting class.
|
24 |
+
*/
|
25 |
+
public function __construct( SliderSetting $slider_setting ) {
|
26 |
+
$this->read( $slider_setting );
|
27 |
+
}
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Read settings
|
31 |
+
*
|
32 |
+
* @param SliderSetting $setting slider setting class.
|
33 |
+
*
|
34 |
+
* @return void
|
35 |
+
*/
|
36 |
+
public function read( SliderSetting $setting ) {
|
37 |
+
$this->settings = [
|
38 |
+
'nav' => $setting->get_prop( 'nav_visibility' ) !== 'never',
|
39 |
+
'dots' => $setting->get_prop( 'pagination_visibility' ) !== 'never',
|
40 |
+
'slideBy' => $setting->get_prop( 'nav_steps' ),
|
41 |
+
'stagePadding' => $setting->get_prop( 'stage_padding' ),
|
42 |
+
'margin' => $setting->get_prop( 'space_between' ),
|
43 |
+
'loop' => $setting->get_prop( 'loop' ),
|
44 |
+
'autoplay' => $setting->get_prop( 'autoplay' ),
|
45 |
+
'autoplayTimeout' => $setting->get_prop( 'autoplay_delay' ),
|
46 |
+
'autoplaySpeed' => $setting->get_prop( 'autoplay_speed' ),
|
47 |
+
'autoplayHoverPause' => $setting->get_prop( 'autoplay_hover_pause' ),
|
48 |
+
'lazyLoad' => $setting->get_prop( 'lazy_load' ),
|
49 |
+
'autoWidth' => $setting->get_prop( 'auto_width' ),
|
50 |
+
'responsive' => [
|
51 |
+
300 => [ 'items' => $setting->get_prop( 'items_on_mobile' ) ],
|
52 |
+
600 => [ 'items' => $setting->get_prop( 'items_on_small_tablet' ) ],
|
53 |
+
768 => [ 'items' => $setting->get_prop( 'items_on_tablet' ) ],
|
54 |
+
1024 => [ 'items' => $setting->get_prop( 'items_on_desktop' ) ],
|
55 |
+
1200 => [ 'items' => $setting->get_prop( 'items_on_widescreen' ) ],
|
56 |
+
1921 => [ 'items' => $setting->get_prop( 'items_on_fullhd' ) ],
|
57 |
+
],
|
58 |
+
];
|
59 |
+
}
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Get all settings
|
63 |
+
*
|
64 |
+
* @return array
|
65 |
+
*/
|
66 |
+
public function all(): array {
|
67 |
+
return $this->settings;
|
68 |
+
}
|
69 |
+
}
|
includes/Abstracts/SliderSetting.php
ADDED
@@ -0,0 +1,328 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace CarouselSlider\Abstracts;
|
4 |
+
|
5 |
+
use CarouselSlider\Helper;
|
6 |
+
use CarouselSlider\Supports\Validate;
|
7 |
+
|
8 |
+
/**
|
9 |
+
* SliderSetting class
|
10 |
+
* The base slider setting for any slider type
|
11 |
+
*
|
12 |
+
* @package CarouselSlider/Abstracts
|
13 |
+
*/
|
14 |
+
class SliderSetting extends Data {
|
15 |
+
/**
|
16 |
+
* The slider id.
|
17 |
+
*
|
18 |
+
* @var int
|
19 |
+
*/
|
20 |
+
protected $slider_id = 0;
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Is data read from server?
|
24 |
+
*
|
25 |
+
* @var bool
|
26 |
+
*/
|
27 |
+
protected $data_read = false;
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Class constructor
|
31 |
+
*
|
32 |
+
* @param int $slider_id The slider id.
|
33 |
+
*/
|
34 |
+
public function __construct( int $slider_id ) {
|
35 |
+
$this->slider_id = $slider_id;
|
36 |
+
$this->data = self::get_defaults();
|
37 |
+
$this->read_metadata();
|
38 |
+
}
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Get slider Id
|
42 |
+
*
|
43 |
+
* @return int
|
44 |
+
*/
|
45 |
+
public function get_slider_id(): int {
|
46 |
+
return $this->slider_id;
|
47 |
+
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Set nav visibility
|
51 |
+
*
|
52 |
+
* @param mixed $value The navigation visibility.
|
53 |
+
*/
|
54 |
+
public function set_nav_visibility( $value ) {
|
55 |
+
// For backup compatability.
|
56 |
+
$value = str_replace( [ 'off', 'on' ], [ 'never', 'hover' ], $value );
|
57 |
+
|
58 |
+
if ( in_array( $value, [ 'always', 'never', 'hover' ], true ) ) {
|
59 |
+
$this->data['nav_visibility'] = $value;
|
60 |
+
}
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Set nav position
|
65 |
+
*
|
66 |
+
* @param mixed $value The navigation position.
|
67 |
+
*/
|
68 |
+
public function set_nav_position( $value ) {
|
69 |
+
if ( in_array( $value, [ 'inside', 'outside' ], true ) ) {
|
70 |
+
$this->data['nav_position'] = $value;
|
71 |
+
}
|
72 |
+
}
|
73 |
+
|
74 |
+
/**
|
75 |
+
* Set nav steps
|
76 |
+
*
|
77 |
+
* @param mixed $value The navigation steps.
|
78 |
+
*/
|
79 |
+
public function set_nav_steps( $value ) {
|
80 |
+
if ( in_array( $value, [ 'page', '-1', - 1 ], true ) ) {
|
81 |
+
$this->data['nav_steps'] = 'page';
|
82 |
+
} else {
|
83 |
+
$this->data['nav_steps'] = max( 1, intval( $value ) );
|
84 |
+
}
|
85 |
+
}
|
86 |
+
|
87 |
+
/**
|
88 |
+
* Set pagination visibility
|
89 |
+
*
|
90 |
+
* @param mixed $value The pagination visibility value.
|
91 |
+
*/
|
92 |
+
public function set_pagination_visibility( $value ) {
|
93 |
+
// For backup compatability.
|
94 |
+
$value = str_replace( [ 'off', 'on' ], [ 'never', 'always' ], $value );
|
95 |
+
|
96 |
+
if ( in_array( $value, [ 'always', 'never', 'hover' ], true ) ) {
|
97 |
+
$this->data['pagination_visibility'] = $value;
|
98 |
+
}
|
99 |
+
}
|
100 |
+
|
101 |
+
/**
|
102 |
+
* Read setting from database
|
103 |
+
*
|
104 |
+
* @return void
|
105 |
+
*/
|
106 |
+
protected function read_metadata() {
|
107 |
+
if ( $this->data_read ) {
|
108 |
+
return;
|
109 |
+
}
|
110 |
+
$attribute_meta_key = static::props();
|
111 |
+
foreach ( $attribute_meta_key as $attribute => $config ) {
|
112 |
+
$method_name = 'set_' . $attribute;
|
113 |
+
$value = get_post_meta( $this->get_slider_id(), $config['meta_key'], true );
|
114 |
+
if ( method_exists( $this, $method_name ) ) {
|
115 |
+
$this->$method_name( $value );
|
116 |
+
} else {
|
117 |
+
$value = $this->sanitize_by_type( $config['type'], $value );
|
118 |
+
$this->set_prop( $attribute, $value );
|
119 |
+
}
|
120 |
+
}
|
121 |
+
$this->data_read = true;
|
122 |
+
}
|
123 |
+
|
124 |
+
/**
|
125 |
+
* Sanitize value by data type
|
126 |
+
*
|
127 |
+
* @param string $type The type.
|
128 |
+
* @param mixed $value The value.
|
129 |
+
*
|
130 |
+
* @return mixed
|
131 |
+
*/
|
132 |
+
protected function sanitize_by_type( string $type, $value ) {
|
133 |
+
if ( 'array' === $type && is_string( $value ) ) {
|
134 |
+
$value = explode( ',', $value );
|
135 |
+
}
|
136 |
+
if ( 'int[]' === $type && is_string( $value ) ) {
|
137 |
+
$value = array_filter( array_map( 'intval', explode( ',', $value ) ) );
|
138 |
+
}
|
139 |
+
if ( 'int' === $type ) {
|
140 |
+
$value = (int) $value;
|
141 |
+
}
|
142 |
+
if ( 'bool' === $type ) {
|
143 |
+
$value = Validate::checked( $value );
|
144 |
+
}
|
145 |
+
|
146 |
+
return $value;
|
147 |
+
}
|
148 |
+
|
149 |
+
/**
|
150 |
+
* Write metadata
|
151 |
+
*
|
152 |
+
* @return void
|
153 |
+
* @todo make sure to backward compatibility for the following props
|
154 |
+
* --- nav_visibility, pagination_visibility, nav_steps
|
155 |
+
*/
|
156 |
+
public function write_metadata() {
|
157 |
+
$props_to_meta_keys = self::props_to_meta_keys();
|
158 |
+
foreach ( $props_to_meta_keys as $prop_name => $meta_key ) {
|
159 |
+
// @TODO convert bool value to yes no.
|
160 |
+
update_post_meta( $this->slider_id, $meta_key, $this->get_prop( $prop_name ) );
|
161 |
+
}
|
162 |
+
}
|
163 |
+
|
164 |
+
/**
|
165 |
+
* Get default values
|
166 |
+
*
|
167 |
+
* @return array
|
168 |
+
*/
|
169 |
+
public static function get_defaults(): array {
|
170 |
+
$props = static::props();
|
171 |
+
$data = [];
|
172 |
+
foreach ( $props as $prop => $config ) {
|
173 |
+
$data[ $prop ] = $config['default'];
|
174 |
+
}
|
175 |
+
|
176 |
+
return $data;
|
177 |
+
}
|
178 |
+
|
179 |
+
/**
|
180 |
+
* Map prop name to meta key
|
181 |
+
*
|
182 |
+
* @return string[]
|
183 |
+
*/
|
184 |
+
public static function props_to_meta_keys(): array {
|
185 |
+
$props = static::props();
|
186 |
+
$data = [];
|
187 |
+
foreach ( $props as $prop => $config ) {
|
188 |
+
$data[ $prop ] = $config['meta_key'];
|
189 |
+
}
|
190 |
+
|
191 |
+
return $data;
|
192 |
+
}
|
193 |
+
|
194 |
+
/**
|
195 |
+
* Default properties
|
196 |
+
*
|
197 |
+
* @return array
|
198 |
+
*/
|
199 |
+
public static function props(): array {
|
200 |
+
return [
|
201 |
+
'nav_visibility' => [
|
202 |
+
'meta_key' => '_nav_button',
|
203 |
+
'type' => 'string',
|
204 |
+
'default' => 'hover',
|
205 |
+
],
|
206 |
+
'nav_position' => [
|
207 |
+
'meta_key' => '_arrow_position',
|
208 |
+
'type' => 'string',
|
209 |
+
'default' => 'outside',
|
210 |
+
],
|
211 |
+
'nav_size' => [
|
212 |
+
'meta_key' => '_arrow_size',
|
213 |
+
'type' => 'int',
|
214 |
+
'default' => 48,
|
215 |
+
],
|
216 |
+
'nav_steps' => [
|
217 |
+
'meta_key' => '_slide_by',
|
218 |
+
'type' => [ 'string', 'int' ],
|
219 |
+
'default' => 1,
|
220 |
+
],
|
221 |
+
'pagination_visibility' => [
|
222 |
+
'meta_key' => '_dot_nav',
|
223 |
+
'type' => 'string',
|
224 |
+
'default' => 'never',
|
225 |
+
],
|
226 |
+
'pagination_position' => [
|
227 |
+
'meta_key' => '_bullet_position',
|
228 |
+
'type' => 'string',
|
229 |
+
'default' => 'center',
|
230 |
+
],
|
231 |
+
'pagination_size' => [
|
232 |
+
'meta_key' => '_bullet_size',
|
233 |
+
'type' => 'int',
|
234 |
+
'default' => 10,
|
235 |
+
],
|
236 |
+
'pagination_shape' => [
|
237 |
+
'meta_key' => '_bullet_shape',
|
238 |
+
'type' => 'string',
|
239 |
+
'default' => 'circle',
|
240 |
+
],
|
241 |
+
'nav_color' => [
|
242 |
+
'meta_key' => '_nav_color',
|
243 |
+
'type' => 'string',
|
244 |
+
'default' => Helper::get_default_setting( 'nav_color' ),
|
245 |
+
],
|
246 |
+
'nav_active_color' => [
|
247 |
+
'meta_key' => '_nav_active_color',
|
248 |
+
'type' => 'string',
|
249 |
+
'default' => Helper::get_default_setting( 'nav_active_color' ),
|
250 |
+
],
|
251 |
+
'items_on_mobile' => [
|
252 |
+
'meta_key' => '_items_portrait_mobile',
|
253 |
+
'type' => 'int',
|
254 |
+
'default' => 1,
|
255 |
+
],
|
256 |
+
'items_on_small_tablet' => [
|
257 |
+
'meta_key' => '_items_small_portrait_tablet',
|
258 |
+
'type' => 'int',
|
259 |
+
'default' => 1,
|
260 |
+
],
|
261 |
+
'items_on_tablet' => [
|
262 |
+
'meta_key' => '_items_portrait_tablet',
|
263 |
+
'type' => 'int',
|
264 |
+
'default' => 2,
|
265 |
+
],
|
266 |
+
'items_on_desktop' => [
|
267 |
+
'meta_key' => '_items_small_desktop',
|
268 |
+
'type' => 'int',
|
269 |
+
'default' => 3,
|
270 |
+
],
|
271 |
+
'items_on_widescreen' => [
|
272 |
+
'meta_key' => '_items_desktop',
|
273 |
+
'type' => 'int',
|
274 |
+
'default' => 4,
|
275 |
+
],
|
276 |
+
'items_on_fullhd' => [
|
277 |
+
'meta_key' => '_items',
|
278 |
+
'type' => 'int',
|
279 |
+
'default' => 5,
|
280 |
+
],
|
281 |
+
'space_between' => [
|
282 |
+
'meta_key' => '_margin_right',
|
283 |
+
'type' => 'int',
|
284 |
+
'default' => 30,
|
285 |
+
],
|
286 |
+
'stage_padding' => [
|
287 |
+
'meta_key' => '_stage_padding',
|
288 |
+
'type' => 'int',
|
289 |
+
'default' => 0,
|
290 |
+
],
|
291 |
+
'autoplay_delay' => [
|
292 |
+
'meta_key' => '_autoplay_timeout',
|
293 |
+
'type' => 'int',
|
294 |
+
'default' => 5000,
|
295 |
+
],
|
296 |
+
'autoplay_speed' => [
|
297 |
+
'meta_key' => '_autoplay_speed',
|
298 |
+
'type' => 'int',
|
299 |
+
'default' => 300,
|
300 |
+
],
|
301 |
+
'autoplay' => [
|
302 |
+
'meta_key' => '_autoplay',
|
303 |
+
'type' => 'bool',
|
304 |
+
'default' => true,
|
305 |
+
],
|
306 |
+
'autoplay_hover_pause' => [
|
307 |
+
'meta_key' => '_autoplay_pause',
|
308 |
+
'type' => 'bool',
|
309 |
+
'default' => true,
|
310 |
+
],
|
311 |
+
'loop' => [
|
312 |
+
'meta_key' => '_infinity_loop',
|
313 |
+
'type' => 'bool',
|
314 |
+
'default' => true,
|
315 |
+
],
|
316 |
+
'lazy_load' => [
|
317 |
+
'meta_key' => '_lazy_load_image',
|
318 |
+
'type' => 'bool',
|
319 |
+
'default' => true,
|
320 |
+
],
|
321 |
+
'auto_width' => [
|
322 |
+
'meta_key' => '_auto_width',
|
323 |
+
'type' => 'bool',
|
324 |
+
'default' => false,
|
325 |
+
],
|
326 |
+
];
|
327 |
+
}
|
328 |
+
}
|
includes/Admin/Admin.php
ADDED
@@ -0,0 +1,327 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace CarouselSlider\Admin;
|
4 |
+
|
5 |
+
use CarouselSlider\Helper;
|
6 |
+
use WP_Post;
|
7 |
+
|
8 |
+
defined( 'ABSPATH' ) || exit;
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Admin class
|
12 |
+
* The admin functionality specific class of the plugin
|
13 |
+
*
|
14 |
+
* @package CarouselSlider/Admin
|
15 |
+
*/
|
16 |
+
class Admin {
|
17 |
+
|
18 |
+
const POST_TYPE = 'carousels';
|
19 |
+
|
20 |
+
/**
|
21 |
+
* The instance of the class
|
22 |
+
*
|
23 |
+
* @var self
|
24 |
+
*/
|
25 |
+
protected static $instance;
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Ensures only one instance of the class is loaded or can be loaded.
|
29 |
+
*
|
30 |
+
* @return self
|
31 |
+
*/
|
32 |
+
public static function init() {
|
33 |
+
if ( is_null( self::$instance ) ) {
|
34 |
+
self::$instance = new self();
|
35 |
+
|
36 |
+
// Register custom post type.
|
37 |
+
add_action( 'init', [ self::$instance, 'register_post_type' ] );
|
38 |
+
// Modify carousel slider list table columns.
|
39 |
+
add_filter( 'manage_edit-' . self::POST_TYPE . '_columns', [ self::$instance, 'columns_head' ] );
|
40 |
+
add_filter(
|
41 |
+
'manage_' . self::POST_TYPE . '_posts_custom_column',
|
42 |
+
[ self::$instance, 'columns_content' ],
|
43 |
+
10,
|
44 |
+
2
|
45 |
+
);
|
46 |
+
// Remove view and Quick Edit from Carousels.
|
47 |
+
add_filter( 'post_row_actions', [ self::$instance, 'post_row_actions' ], 10, 2 );
|
48 |
+
add_filter( 'preview_post_link', [ self::$instance, 'preview_post_link' ], 10, 2 );
|
49 |
+
|
50 |
+
add_action( 'admin_enqueue_scripts', [ self::$instance, 'admin_scripts' ], 10 );
|
51 |
+
add_action( 'admin_menu', [ self::$instance, 'documentation_menu' ] );
|
52 |
+
add_filter( 'admin_footer_text', [ self::$instance, 'admin_footer_text' ] );
|
53 |
+
}
|
54 |
+
|
55 |
+
return self::$instance;
|
56 |
+
}
|
57 |
+
|
58 |
+
/**
|
59 |
+
* Modify preview post link for carousel slider
|
60 |
+
*
|
61 |
+
* @param string $preview_link The preview link.
|
62 |
+
* @param WP_Post $post The WP_Post object.
|
63 |
+
*
|
64 |
+
* @return string
|
65 |
+
*/
|
66 |
+
public function preview_post_link( string $preview_link, WP_Post $post ): string {
|
67 |
+
if ( self::POST_TYPE === $post->post_type ) {
|
68 |
+
$preview_link = Helper::get_preview_link( $post );
|
69 |
+
}
|
70 |
+
|
71 |
+
return $preview_link;
|
72 |
+
}
|
73 |
+
|
74 |
+
/**
|
75 |
+
* Carousel slider post type
|
76 |
+
*/
|
77 |
+
public function register_post_type() {
|
78 |
+
$labels = [
|
79 |
+
'name' => _x( 'Sliders', 'Post Type General Name', 'carousel-slider' ),
|
80 |
+
'singular_name' => _x( 'Slider', 'Post Type Singular Name', 'carousel-slider' ),
|
81 |
+
'menu_name' => __( 'Carousel Slider', 'carousel-slider' ),
|
82 |
+
'parent_item_colon' => __( 'Parent Slider:', 'carousel-slider' ),
|
83 |
+
'all_items' => __( 'All Sliders', 'carousel-slider' ),
|
84 |
+
'view_item' => __( 'View Slider', 'carousel-slider' ),
|
85 |
+
'add_new_item' => __( 'Add New Slider', 'carousel-slider' ),
|
86 |
+
'add_new' => __( 'Add New', 'carousel-slider' ),
|
87 |
+
'edit_item' => __( 'Edit Slider', 'carousel-slider' ),
|
88 |
+
'update_item' => __( 'Update Slider', 'carousel-slider' ),
|
89 |
+
'search_items' => __( 'Search Slider', 'carousel-slider' ),
|
90 |
+
'not_found' => __( 'Not found', 'carousel-slider' ),
|
91 |
+
'not_found_in_trash' => __( 'Not found in Trash', 'carousel-slider' ),
|
92 |
+
];
|
93 |
+
$args = [
|
94 |
+
'label' => __( 'Slider', 'carousel-slider' ),
|
95 |
+
'description' => __( 'The easiest way to create carousel slider', 'carousel-slider' ),
|
96 |
+
'labels' => $labels,
|
97 |
+
'supports' => [ 'title' ],
|
98 |
+
'hierarchical' => false,
|
99 |
+
'public' => false,
|
100 |
+
'show_ui' => true,
|
101 |
+
'show_in_menu' => true,
|
102 |
+
'show_in_nav_menus' => true,
|
103 |
+
'show_in_admin_bar' => false,
|
104 |
+
'menu_position' => 5.55525,
|
105 |
+
'menu_icon' => 'dashicons-slides',
|
106 |
+
'can_export' => true,
|
107 |
+
'has_archive' => false,
|
108 |
+
'exclude_from_search' => true,
|
109 |
+
'publicly_queryable' => true,
|
110 |
+
'rewrite' => false,
|
111 |
+
'capability_type' => 'post',
|
112 |
+
];
|
113 |
+
|
114 |
+
register_post_type( self::POST_TYPE, $args );
|
115 |
+
}
|
116 |
+
|
117 |
+
/**
|
118 |
+
* Customize Carousel slider list table head
|
119 |
+
*
|
120 |
+
* @return array A list of column headers.
|
121 |
+
*/
|
122 |
+
public function columns_head(): array {
|
123 |
+
return [
|
124 |
+
'cb' => '<input type="checkbox">',
|
125 |
+
'title' => __( 'Carousel Slide Title', 'carousel-slider' ),
|
126 |
+
'usage' => __( 'Shortcode', 'carousel-slider' ),
|
127 |
+
'slide_type' => __( 'Slide Type', 'carousel-slider' ),
|
128 |
+
];
|
129 |
+
}
|
130 |
+
|
131 |
+
/**
|
132 |
+
* Generate carousel slider list table content for each custom column
|
133 |
+
*
|
134 |
+
* @param string $column_name The name of the column to display.
|
135 |
+
* @param int $post_id The current post ID.
|
136 |
+
*
|
137 |
+
* @return void
|
138 |
+
*/
|
139 |
+
public function columns_content( string $column_name, int $post_id ) {
|
140 |
+
$slide_types = Helper::get_slide_types();
|
141 |
+
switch ( $column_name ) {
|
142 |
+
|
143 |
+
case 'usage':
|
144 |
+
?>
|
145 |
+
<label class="screen-reader-text" for="carousel_slider_usage_<?php echo esc_attr( $post_id ); ?>">
|
146 |
+
Copy shortcode
|
147 |
+
</label>
|
148 |
+
<input
|
149 |
+
id="carousel_slider_usage_<?php echo esc_attr( $post_id ); ?>"
|
150 |
+
type="text"
|
151 |
+
onmousedown="this.clicked = 1;"
|
152 |
+
onfocus="if (!this.clicked) this.select(); else this.clicked = 2;"
|
153 |
+
onclick="if (this.clicked === 2) this.select(); this.clicked = 0;"
|
154 |
+
value="[carousel_slide id='<?php echo esc_attr( $post_id ); ?>']"
|
155 |
+
style="background-color: #f1f1f1;min-width: 250px;padding: 5px 8px;"
|
156 |
+
>
|
157 |
+
<?php
|
158 |
+
break;
|
159 |
+
|
160 |
+
case 'slide_type':
|
161 |
+
$slide_type = get_post_meta( $post_id, '_slide_type', true );
|
162 |
+
echo isset( $slide_types[ $slide_type ] ) ? esc_attr( $slide_types[ $slide_type ] ) : '';
|
163 |
+
|
164 |
+
break;
|
165 |
+
default:
|
166 |
+
break;
|
167 |
+
}
|
168 |
+
}
|
169 |
+
|
170 |
+
/**
|
171 |
+
* Hide view and quick edit from carousel slider admin
|
172 |
+
*
|
173 |
+
* @param array $actions The post row actions list.
|
174 |
+
* @param WP_Post $post The WP_Post object.
|
175 |
+
*
|
176 |
+
* @return array
|
177 |
+
*/
|
178 |
+
public function post_row_actions( array $actions, WP_Post $post ): array {
|
179 |
+
if ( self::POST_TYPE !== $post->post_type ) {
|
180 |
+
return $actions;
|
181 |
+
}
|
182 |
+
|
183 |
+
$view_url = Helper::get_preview_link( $post );
|
184 |
+
$actions['view'] = '<a href="' . $view_url . '" target="_blank">' . esc_html__( 'Preview', 'carousel-slider' ) . '</a>';
|
185 |
+
|
186 |
+
unset( $actions['inline hide-if-no-js'] );
|
187 |
+
|
188 |
+
return $actions;
|
189 |
+
}
|
190 |
+
|
191 |
+
/**
|
192 |
+
* Load admin scripts
|
193 |
+
*
|
194 |
+
* @param string|mixed $hook Page hook.
|
195 |
+
*/
|
196 |
+
public function admin_scripts( $hook ) {
|
197 |
+
global $post;
|
198 |
+
|
199 |
+
$_is_carousel = is_a( $post, 'WP_Post' ) && ( 'carousels' === $post->post_type );
|
200 |
+
$_is_doc = ( 'carousels_page_carousel-slider-documentation' === $hook );
|
201 |
+
$_is_plugin_page = 'plugins.php' === $hook;
|
202 |
+
|
203 |
+
if ( ! ( $_is_carousel || $_is_doc || $_is_plugin_page ) ) {
|
204 |
+
return;
|
205 |
+
}
|
206 |
+
|
207 |
+
wp_enqueue_media();
|
208 |
+
wp_enqueue_style( 'carousel-slider-admin' );
|
209 |
+
wp_enqueue_script( 'carousel-slider-admin' );
|
210 |
+
wp_localize_script(
|
211 |
+
'carousel-slider-admin',
|
212 |
+
'CarouselSliderAdminL10n',
|
213 |
+
[
|
214 |
+
'url' => esc_html__( 'URL', 'carousel-slider' ),
|
215 |
+
'title' => esc_html__( 'Title', 'carousel-slider' ),
|
216 |
+
'caption' => esc_html__( 'Caption', 'carousel-slider' ),
|
217 |
+
'altText' => esc_html__( 'Alt Text', 'carousel-slider' ),
|
218 |
+
'linkToUrl' => esc_html__( 'Link To URL', 'carousel-slider' ),
|
219 |
+
'addNew' => esc_html__( 'Add New Item', 'carousel-slider' ),
|
220 |
+
'moveCurrent' => esc_html__( 'Move Current Item', 'carousel-slider' ),
|
221 |
+
'deleteCurrent' => esc_html__( 'Delete Current Item', 'carousel-slider' ),
|
222 |
+
]
|
223 |
+
);
|
224 |
+
}
|
225 |
+
|
226 |
+
/**
|
227 |
+
* Add documentation menu
|
228 |
+
*/
|
229 |
+
public function documentation_menu() {
|
230 |
+
add_submenu_page(
|
231 |
+
'edit.php?post_type=carousels',
|
232 |
+
__( 'Documentation', 'carousel-slider' ),
|
233 |
+
__( 'Documentation', 'carousel-slider' ),
|
234 |
+
'manage_options',
|
235 |
+
'carousel-slider-documentation',
|
236 |
+
[ $this, 'documentation_page_callback' ]
|
237 |
+
);
|
238 |
+
}
|
239 |
+
|
240 |
+
/**
|
241 |
+
* Documentation page callback
|
242 |
+
*/
|
243 |
+
public function documentation_page_callback() {
|
244 |
+
$items = [
|
245 |
+
[
|
246 |
+
'youtube_id' => '_hVsamgr1k4',
|
247 |
+
'title' => __( 'Hero Image Carousel', 'carousel-slider' ),
|
248 |
+
],
|
249 |
+
[
|
250 |
+
'youtube_id' => 'ZzI1JhElrxc',
|
251 |
+
'title' => __( 'Image carousel (gallery images)', 'carousel-slider' ),
|
252 |
+
],
|
253 |
+
[
|
254 |
+
'youtube_id' => 'a7hqn1yNzwM',
|
255 |
+
'title' => __( 'Image carousel (custom URLs)', 'carousel-slider' ),
|
256 |
+
],
|
257 |
+
[
|
258 |
+
'youtube_id' => 'ImJB946azy0',
|
259 |
+
'title' => __( 'Posts Carousel', 'carousel-slider' ),
|
260 |
+
],
|
261 |
+
[
|
262 |
+
'youtube_id' => 'yiAkvXyfakg',
|
263 |
+
'title' => __( 'WooCommerce Product Carousel', 'carousel-slider' ),
|
264 |
+
],
|
265 |
+
[
|
266 |
+
'youtube_id' => 'kYgp6wp27lM',
|
267 |
+
'title' => __( 'In Widget Areas', 'carousel-slider' ),
|
268 |
+
],
|
269 |
+
[
|
270 |
+
'youtube_id' => '-OaYQZfr1RM',
|
271 |
+
'title' => __( 'With Page Builder by SiteOrigin', 'carousel-slider' ),
|
272 |
+
],
|
273 |
+
[
|
274 |
+
'youtube_id' => '4LhDXH81whk',
|
275 |
+
'title' => __( 'With Visual Composer Website Builder', 'carousel-slider' ),
|
276 |
+
],
|
277 |
+
];
|
278 |
+
$html = '<div class="wrap">';
|
279 |
+
$html .= '<h1 class="wp-heading">' . esc_html__( 'Carousel Slider Documentation', 'carousel-slider' ) . '</h1>';
|
280 |
+
$html .= '<div class="clear"></div>';
|
281 |
+
$html .= '<div class="postbox"><div class="inside">';
|
282 |
+
$html .= '<div class="carousel_slider_columns">';
|
283 |
+
foreach ( $items as $item ) {
|
284 |
+
$html .= '<div class="carousel_slider_column">';
|
285 |
+
$html .= '<div class="carousel_slider_iframe">';
|
286 |
+
$html .= sprintf(
|
287 |
+
'<iframe width="1280" height="720" src="https://www.youtube.com/embed/%s" allowfullscreen></iframe>',
|
288 |
+
$item['youtube_id']
|
289 |
+
);
|
290 |
+
$html .= '</div>';
|
291 |
+
if ( ! empty( $item['title'] ) ) {
|
292 |
+
$html .= '<label>' . esc_html( $item['title'] ) . '</label>';
|
293 |
+
}
|
294 |
+
if ( ! empty( $item['description'] ) ) {
|
295 |
+
$html .= '<p class="description">' . esc_html( $item['description'] ) . '</p>';
|
296 |
+
}
|
297 |
+
$html .= '</div>';
|
298 |
+
}
|
299 |
+
$html .= '</div>';
|
300 |
+
$html .= '</div></div>';
|
301 |
+
$html .= '</div>';
|
302 |
+
echo $html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
303 |
+
}
|
304 |
+
|
305 |
+
/**
|
306 |
+
* Add custom footer text on plugins page.
|
307 |
+
*
|
308 |
+
* @param string|null $text The custom admin footer text.
|
309 |
+
*
|
310 |
+
* @return string
|
311 |
+
*/
|
312 |
+
public function admin_footer_text( $text ): string {
|
313 |
+
global $post_type, $hook_suffix;
|
314 |
+
|
315 |
+
$footer_text = sprintf(
|
316 |
+
/* translators: 1: plugin review page link */
|
317 |
+
__( 'If you like <strong>Carousel Slider</strong> please leave us a %s rating. A huge thanks in advance!', 'carousel-slider' ),
|
318 |
+
'<a href="https://wordpress.org/support/view/plugin-reviews/carousel-slider?filter=5#postform" target="_blank" data-rated="Thanks :)">★★★★★</a>'
|
319 |
+
);
|
320 |
+
|
321 |
+
if ( 'carousels' === $post_type || 'carousels_page_carousel-slider-documentation' === $hook_suffix ) {
|
322 |
+
return $footer_text;
|
323 |
+
}
|
324 |
+
|
325 |
+
return $text;
|
326 |
+
}
|
327 |
+
}
|
includes/Admin/GutenbergBlock.php
ADDED
@@ -0,0 +1,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace CarouselSlider\Admin;
|
4 |
+
|
5 |
+
use CarouselSlider\Helper;
|
6 |
+
use WP_Post;
|
7 |
+
|
8 |
+
defined( 'ABSPATH' ) || exit;
|
9 |
+
|
10 |
+
/**
|
11 |
+
* GutenbergBlock class
|
12 |
+
* The admin gutenberg editor functionality specific class of the plugin
|
13 |
+
*
|
14 |
+
* @package CarouselSlider/Admin
|
15 |
+
*/
|
16 |
+
class GutenbergBlock {
|
17 |
+
/**
|
18 |
+
* The instance of the class
|
19 |
+
*
|
20 |
+
* @var self
|
21 |
+
*/
|
22 |
+
protected static $instance;
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Ensures only one instance of this class is loaded or can be loaded.
|
26 |
+
*
|
27 |
+
* @return self
|
28 |
+
*/
|
29 |
+
public static function init() {
|
30 |
+
if ( is_null( self::$instance ) ) {
|
31 |
+
self::$instance = new self();
|
32 |
+
|
33 |
+
add_action( 'init', array( self::$instance, 'gutenberg_block' ) );
|
34 |
+
}
|
35 |
+
|
36 |
+
return self::$instance;
|
37 |
+
}
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Register gutenberg block
|
41 |
+
*/
|
42 |
+
public function gutenberg_block() {
|
43 |
+
if ( ! function_exists( 'register_block_type' ) ) {
|
44 |
+
return;
|
45 |
+
}
|
46 |
+
wp_register_script(
|
47 |
+
'carousel-slider-gutenberg-block',
|
48 |
+
CAROUSEL_SLIDER_ASSETS . '/js/gutenberg-block.js',
|
49 |
+
[ 'wp-blocks', 'wp-components', 'wp-block-editor' ],
|
50 |
+
CAROUSEL_SLIDER_VERSION,
|
51 |
+
true
|
52 |
+
);
|
53 |
+
wp_register_style(
|
54 |
+
'carousel-slider-gutenberg-style',
|
55 |
+
CAROUSEL_SLIDER_ASSETS . '/css/gutenberg-block.css',
|
56 |
+
[ 'wp-edit-blocks' ],
|
57 |
+
CAROUSEL_SLIDER_VERSION
|
58 |
+
);
|
59 |
+
wp_localize_script(
|
60 |
+
'carousel-slider-gutenberg-block',
|
61 |
+
'i18nCarouselSliderBlock',
|
62 |
+
$this->block_localize_data()
|
63 |
+
);
|
64 |
+
|
65 |
+
register_block_type(
|
66 |
+
'carousel-slider/slider',
|
67 |
+
[
|
68 |
+
'editor_script' => 'carousel-slider-gutenberg-block',
|
69 |
+
'editor_style' => 'carousel-slider-gutenberg-style',
|
70 |
+
]
|
71 |
+
);
|
72 |
+
}
|
73 |
+
|
74 |
+
/**
|
75 |
+
* Get localize data
|
76 |
+
*
|
77 |
+
* @return array
|
78 |
+
*/
|
79 |
+
private function block_localize_data(): array {
|
80 |
+
$_sliders = Helper::get_sliders();
|
81 |
+
$sliders = [
|
82 |
+
[
|
83 |
+
'value' => '',
|
84 |
+
'label' => __( 'Select a Slider', 'carousel-slider' ),
|
85 |
+
],
|
86 |
+
];
|
87 |
+
foreach ( $_sliders as $form ) {
|
88 |
+
if ( ! $form instanceof WP_Post ) {
|
89 |
+
continue;
|
90 |
+
}
|
91 |
+
$sliders[] = [
|
92 |
+
'value' => absint( $form->ID ),
|
93 |
+
'label' => esc_attr( $form->post_title ),
|
94 |
+
];
|
95 |
+
}
|
96 |
+
|
97 |
+
return [
|
98 |
+
'sliders' => $sliders,
|
99 |
+
'site_url' => site_url(),
|
100 |
+
'block_logo' => CAROUSEL_SLIDER_ASSETS . '/static-images/logo.svg',
|
101 |
+
'block_title' => __( 'Carousel Slider', 'carousel-slider' ),
|
102 |
+
'select_slider' => __( 'Select a Slider', 'carousel-slider' ),
|
103 |
+
];
|
104 |
+
}
|
105 |
+
}
|
includes/Admin/MetaBox.php
ADDED
@@ -0,0 +1,552 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* The slider meta box specific file of the plugin
|
4 |
+
*
|
5 |
+
* @package CarouselSlider/Admin
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace CarouselSlider\Admin;
|
9 |
+
|
10 |
+
use CarouselSlider\Helper;
|
11 |
+
use CarouselSlider\Supports\MetaBoxForm;
|
12 |
+
use WP_Post;
|
13 |
+
|
14 |
+
defined( 'ABSPATH' ) || exit;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* MetaBox class
|
18 |
+
*/
|
19 |
+
class MetaBox {
|
20 |
+
|
21 |
+
/**
|
22 |
+
* The instance of the class
|
23 |
+
*
|
24 |
+
* @var self
|
25 |
+
*/
|
26 |
+
private static $instance = null;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Post type
|
30 |
+
*
|
31 |
+
* @var string
|
32 |
+
*/
|
33 |
+
private $post_type;
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Ensures only one instance of this class is loaded or can be loaded.
|
37 |
+
*
|
38 |
+
* @return MetaBox
|
39 |
+
*/
|
40 |
+
public static function init() {
|
41 |
+
if ( is_null( self::$instance ) ) {
|
42 |
+
self::$instance = new self();
|
43 |
+
|
44 |
+
self::$instance->post_type = CAROUSEL_SLIDER_POST_TYPE;
|
45 |
+
add_action( 'add_meta_boxes', array( self::$instance, 'add_meta_boxes' ) );
|
46 |
+
add_action( 'save_post', array( self::$instance, 'save_meta_box' ) );
|
47 |
+
}
|
48 |
+
|
49 |
+
return self::$instance;
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Check current user can save slider
|
54 |
+
*
|
55 |
+
* @param int $post_id post id.
|
56 |
+
*
|
57 |
+
* @return bool
|
58 |
+
*/
|
59 |
+
public function current_user_can_save( int $post_id ): bool {
|
60 |
+
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
|
61 |
+
return false;
|
62 |
+
}
|
63 |
+
|
64 |
+
if ( ! current_user_can( 'edit_post', $post_id ) ) {
|
65 |
+
return false;
|
66 |
+
}
|
67 |
+
|
68 |
+
return false !== wp_verify_nonce( $_POST['_carousel_slider_nonce'] ?? '', 'carousel_slider_nonce' );
|
69 |
+
}
|
70 |
+
|
71 |
+
/**
|
72 |
+
* Save custom meta box
|
73 |
+
*
|
74 |
+
* @param int $post_id The post ID.
|
75 |
+
*/
|
76 |
+
public function save_meta_box( int $post_id ) {
|
77 |
+
// Check if user has permissions to save data.
|
78 |
+
if ( ! $this->current_user_can_save( $post_id ) ) {
|
79 |
+
return;
|
80 |
+
}
|
81 |
+
|
82 |
+
// phpcs:ignore: WordPress.Security.NonceVerification.Missing
|
83 |
+
foreach ( $_POST['carousel_slider'] as $key => $val ) {
|
84 |
+
if ( is_array( $val ) ) {
|
85 |
+
$val = implode( ',', $val );
|
86 |
+
}
|
87 |
+
|
88 |
+
if ( '_margin_right' === $key && 0 === $val ) {
|
89 |
+
$val = 'zero';
|
90 |
+
}
|
91 |
+
update_post_meta( $post_id, $key, sanitize_text_field( $val ) );
|
92 |
+
}
|
93 |
+
|
94 |
+
do_action( 'carousel_slider/save_slider', $post_id );
|
95 |
+
}
|
96 |
+
|
97 |
+
/**
|
98 |
+
* Add carousel slider meta box
|
99 |
+
*/
|
100 |
+
public function add_meta_boxes() {
|
101 |
+
add_meta_box(
|
102 |
+
'carousel-slider-meta-boxes',
|
103 |
+
__( 'Carousel Slider', 'carousel-slider' ),
|
104 |
+
array( $this, 'carousel_slider_meta_boxes' ),
|
105 |
+
$this->post_type,
|
106 |
+
'normal',
|
107 |
+
'high'
|
108 |
+
);
|
109 |
+
add_meta_box(
|
110 |
+
'carousel-slider-usages-info',
|
111 |
+
__( 'Usage (Shortcode)', 'carousel-slider' ),
|
112 |
+
array( $this, 'usages_callback' ),
|
113 |
+
$this->post_type,
|
114 |
+
'side',
|
115 |
+
'high'
|
116 |
+
);
|
117 |
+
add_meta_box(
|
118 |
+
'carousel-slider-navigation-settings',
|
119 |
+
__( 'Navigation Settings', 'carousel-slider' ),
|
120 |
+
array( $this, 'navigation_settings_callback' ),
|
121 |
+
$this->post_type,
|
122 |
+
'side',
|
123 |
+
'low'
|
124 |
+
);
|
125 |
+
add_meta_box(
|
126 |
+
'carousel-slider-autoplay-settings',
|
127 |
+
__( 'Autoplay Settings', 'carousel-slider' ),
|
128 |
+
array( $this, 'autoplay_settings_callback' ),
|
129 |
+
$this->post_type,
|
130 |
+
'side',
|
131 |
+
'low'
|
132 |
+
);
|
133 |
+
add_meta_box(
|
134 |
+
'carousel-slider-responsive-settings',
|
135 |
+
__( 'Responsive Settings', 'carousel-slider' ),
|
136 |
+
array( $this, 'responsive_settings_callback' ),
|
137 |
+
$this->post_type,
|
138 |
+
'side',
|
139 |
+
'low'
|
140 |
+
);
|
141 |
+
add_meta_box(
|
142 |
+
'carousel-slider-general-settings',
|
143 |
+
__( 'General Settings', 'carousel-slider' ),
|
144 |
+
array( $this, 'general_settings_callback' ),
|
145 |
+
$this->post_type,
|
146 |
+
'advanced',
|
147 |
+
'low'
|
148 |
+
);
|
149 |
+
}
|
150 |
+
|
151 |
+
/**
|
152 |
+
* Load meta box content
|
153 |
+
*
|
154 |
+
* @param WP_Post $post The WP_Post object.
|
155 |
+
*/
|
156 |
+
public function carousel_slider_meta_boxes( WP_Post $post ) {
|
157 |
+
wp_nonce_field( 'carousel_slider_nonce', '_carousel_slider_nonce' );
|
158 |
+
|
159 |
+
$slide_type = get_post_meta( $post->ID, '_slide_type', true );
|
160 |
+
$slide_type = array_key_exists( $slide_type, Helper::get_slide_types() ) ? $slide_type : 'image-carousel';
|
161 |
+
|
162 |
+
$slide_types = Helper::get_slide_types();
|
163 |
+
?>
|
164 |
+
<div class="sp-input-group" style="margin: 10px 0 30px;">
|
165 |
+
<div class="sp-input-label">
|
166 |
+
<label for="_carousel_slider_slide_type">
|
167 |
+
<?php esc_html_e( 'Slide Type', 'carousel-slider' ); ?>
|
168 |
+
</label>
|
169 |
+
</div>
|
170 |
+
<div class="sp-input-field">
|
171 |
+
<select name="carousel_slider[_slide_type]" id="_carousel_slider_slide_type" class="sp-input-text">
|
172 |
+
<?php
|
173 |
+
foreach ( $slide_types as $slug => $label ) {
|
174 |
+
$selected = ( $slug === $slide_type ) ? 'selected' : '';
|
175 |
+
|
176 |
+
if ( 'product-carousel' === $slug ) {
|
177 |
+
$disabled = Helper::is_woocommerce_active() ? '' : 'disabled';
|
178 |
+
echo sprintf(
|
179 |
+
'<option value="%s" %s %s>%s</option>',
|
180 |
+
esc_attr( $slug ),
|
181 |
+
esc_attr( $selected ),
|
182 |
+
esc_attr( $disabled ),
|
183 |
+
esc_html( $label )
|
184 |
+
);
|
185 |
+
continue;
|
186 |
+
}
|
187 |
+
|
188 |
+
echo '<option value="' . esc_attr( $slug ) . '" ' . esc_attr( $selected ) . '>' . esc_html( $label ) . '</option>';
|
189 |
+
}
|
190 |
+
?>
|
191 |
+
</select>
|
192 |
+
</div>
|
193 |
+
</div>
|
194 |
+
<?php
|
195 |
+
|
196 |
+
/**
|
197 |
+
* Allow third part plugin to add custom fields
|
198 |
+
*/
|
199 |
+
do_action( 'carousel_slider/meta_box_content', $post->ID, $slide_type );
|
200 |
+
}
|
201 |
+
|
202 |
+
/**
|
203 |
+
* General settings
|
204 |
+
*/
|
205 |
+
public function general_settings_callback() {
|
206 |
+
$form = new MetaBoxForm();
|
207 |
+
$form->image_sizes(
|
208 |
+
array(
|
209 |
+
'id' => esc_html__( '_image_size', 'carousel-slider' ),
|
210 |
+
'name' => esc_html__( 'Carousel Image size', 'carousel-slider' ),
|
211 |
+
'desc' => sprintf(
|
212 |
+
/* translators: 1: setting media page link start, 2: setting media page link end */
|
213 |
+
esc_html__( 'Choose "original uploaded image" for full size image or your desired image size for carousel image. You can change the default size for thumbnail, medium and large from %1$s Settings >> Media %2$s.', 'carousel-slider' ),
|
214 |
+
'<a target="_blank" href="' . get_admin_url() . 'options-media.php">',
|
215 |
+
'</a>'
|
216 |
+
),
|
217 |
+
)
|
218 |
+
);
|
219 |
+
$form->select(
|
220 |
+
array(
|
221 |
+
'id' => '_lazy_load_image',
|
222 |
+
'name' => esc_html__( 'Lazy Loading', 'carousel-slider' ),
|
223 |
+
'desc' => esc_html__( 'Enable image with lazy loading.', 'carousel-slider' ),
|
224 |
+
'std' => Helper::get_default_setting( 'lazy_load_image' ),
|
225 |
+
'options' => array(
|
226 |
+
'on' => esc_html__( 'Enable', 'carousel-slider' ),
|
227 |
+
'off' => esc_html__( 'Disable', 'carousel-slider' ),
|
228 |
+
),
|
229 |
+
)
|
230 |
+
);
|
231 |
+
$form->number(
|
232 |
+
array(
|
233 |
+
'id' => '_margin_right',
|
234 |
+
'name' => esc_html__( 'Item Spacing.', 'carousel-slider' ),
|
235 |
+
'desc' => esc_html__( 'Space between two slide. Enter 10 for 10px', 'carousel-slider' ),
|
236 |
+
'std' => Helper::get_default_setting( 'margin_right' ),
|
237 |
+
)
|
238 |
+
);
|
239 |
+
$form->select(
|
240 |
+
array(
|
241 |
+
'id' => '_infinity_loop',
|
242 |
+
'name' => esc_html__( 'Infinity loop', 'carousel-slider' ),
|
243 |
+
'desc' => esc_html__( 'Enable or disable loop(circular) of carousel.', 'carousel-slider' ),
|
244 |
+
'std' => 'on',
|
245 |
+
'options' => array(
|
246 |
+
'on' => esc_html__( 'Enable', 'carousel-slider' ),
|
247 |
+
'off' => esc_html__( 'Disable', 'carousel-slider' ),
|
248 |
+
),
|
249 |
+
)
|
250 |
+
);
|
251 |
+
$form->number(
|
252 |
+
array(
|
253 |
+
'id' => '_stage_padding',
|
254 |
+
'name' => esc_html__( 'Stage Padding', 'carousel-slider' ),
|
255 |
+
'desc' => esc_html__( 'Add left and right padding on carousel slider stage wrapper.', 'carousel-slider' ),
|
256 |
+
'std' => '0',
|
257 |
+
)
|
258 |
+
);
|
259 |
+
$form->select(
|
260 |
+
array(
|
261 |
+
'id' => '_auto_width',
|
262 |
+
'name' => esc_html__( 'Auto Width', 'carousel-slider' ),
|
263 |
+
'desc' => esc_html__( 'Set item width according to its content width. Use width style on item to get the result you want. ', 'carousel-slider' ),
|
264 |
+
'std' => 'off',
|
265 |
+
'options' => array(
|
266 |
+
'on' => esc_html__( 'Enable', 'carousel-slider' ),
|
267 |
+
'off' => esc_html__( 'Disable', 'carousel-slider' ),
|
268 |
+
),
|
269 |
+
)
|
270 |
+
);
|
271 |
+
}
|
272 |
+
|
273 |
+
/**
|
274 |
+
* Render short code meta box content
|
275 |
+
*
|
276 |
+
* @param WP_Post $post The WP_Post object.
|
277 |
+
*/
|
278 |
+
public function usages_callback( WP_Post $post ) {
|
279 |
+
ob_start();
|
280 |
+
?>
|
281 |
+
<p>
|
282 |
+
<strong>
|
283 |
+
<?php esc_html_e( 'Copy the following shortcode and paste in post or page where you want to show.', 'carousel-slider' ); ?>
|
284 |
+
</strong>
|
285 |
+
</p>
|
286 |
+
<input type="text" onmousedown="this.clicked = 1;"
|
287 |
+
onfocus="if (!this.clicked) this.select(); else this.clicked = 2;"
|
288 |
+
onclick="if (this.clicked === 2) this.select(); this.clicked = 0;"
|
289 |
+
value="[carousel_slide id='<?php echo absint( $post->ID ); ?>']"
|
290 |
+
style="background-color: #f1f1f1; width: 100%; padding: 8px;"
|
291 |
+
>
|
292 |
+
<?php
|
293 |
+
echo ob_get_clean(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
294 |
+
}
|
295 |
+
|
296 |
+
/**
|
297 |
+
* Navigation settings callback
|
298 |
+
*
|
299 |
+
* @return void
|
300 |
+
*/
|
301 |
+
public function navigation_settings_callback() {
|
302 |
+
$form = new MetaBoxForm();
|
303 |
+
$form->field(
|
304 |
+
[
|
305 |
+
'type' => 'select',
|
306 |
+
'id' => '_nav_button',
|
307 |
+
'class' => 'small-text',
|
308 |
+
'name' => esc_html__( 'Show Arrow Nav', 'carousel-slider' ),
|
309 |
+
'desc' => esc_html__( 'Choose when to show arrow navigator.', 'carousel-slider' ),
|
310 |
+
'options' => [
|
311 |
+
'off' => esc_html__( 'Never', 'carousel-slider' ),
|
312 |
+
'on' => esc_html__( 'Mouse Over', 'carousel-slider' ),
|
313 |
+
'always' => esc_html__( 'Always', 'carousel-slider' ),
|
314 |
+
],
|
315 |
+
'std' => 'on',
|
316 |
+
'context' => 'side',
|
317 |
+
]
|
318 |
+
);
|
319 |
+
$form->field(
|
320 |
+
[
|
321 |
+
'type' => 'text',
|
322 |
+
'id' => '_slide_by',
|
323 |
+
'class' => 'small-text',
|
324 |
+
'name' => esc_html__( 'Arrow Steps', 'carousel-slider' ),
|
325 |
+
'desc' => esc_html__( 'Steps to go for each navigation request. Write "page" with inverted comma to slide by page.', 'carousel-slider' ),
|
326 |
+
'std' => 1,
|
327 |
+
'context' => 'side',
|
328 |
+
]
|
329 |
+
);
|
330 |
+
$form->select(
|
331 |
+
[
|
332 |
+
'id' => '_arrow_position',
|
333 |
+
'class' => 'small-text',
|
334 |
+
'name' => esc_html__( 'Arrow Position', 'carousel-slider' ),
|
335 |
+
'desc' => esc_html__( 'Choose where to show arrow. Inside slider or outside slider.', 'carousel-slider' ),
|
336 |
+
'options' => [
|
337 |
+
'outside' => esc_html__( 'Outside', 'carousel-slider' ),
|
338 |
+
'inside' => esc_html__( 'Inside', 'carousel-slider' ),
|
339 |
+
],
|
340 |
+
'std' => 'outside',
|
341 |
+
'context' => 'side',
|
342 |
+
]
|
343 |
+
);
|
344 |
+
$form->number(
|
345 |
+
[
|
346 |
+
'id' => '_arrow_size',
|
347 |
+
'class' => 'small-text',
|
348 |
+
'name' => esc_html__( 'Arrow Size', 'carousel-slider' ),
|
349 |
+
'desc' => esc_html__( 'Enter arrow size in pixels.', 'carousel-slider' ),
|
350 |
+
'std' => 48,
|
351 |
+
'context' => 'side',
|
352 |
+
]
|
353 |
+
);
|
354 |
+
|
355 |
+
echo '<hr>';
|
356 |
+
|
357 |
+
$form->select(
|
358 |
+
[
|
359 |
+
'id' => '_dot_nav',
|
360 |
+
'class' => 'small-text',
|
361 |
+
'name' => esc_html__( 'Show Bullet Nav', 'carousel-slider' ),
|
362 |
+
'desc' => esc_html__( 'Choose when to show bullet navigator.', 'carousel-slider' ),
|
363 |
+
'options' => [
|
364 |
+
'off' => esc_html__( 'Never', 'carousel-slider' ),
|
365 |
+
'on' => esc_html__( 'Always', 'carousel-slider' ),
|
366 |
+
'hover' => esc_html__( 'Mouse Over', 'carousel-slider' ),
|
367 |
+
],
|
368 |
+
'std' => 'off',
|
369 |
+
'context' => 'side',
|
370 |
+
]
|
371 |
+
);
|
372 |
+
|
373 |
+
$form->select(
|
374 |
+
[
|
375 |
+
'id' => '_bullet_position',
|
376 |
+
'class' => 'small-text',
|
377 |
+
'name' => esc_html__( 'Bullet Position', 'carousel-slider' ),
|
378 |
+
'desc' => esc_html__( 'Choose where to show bullets.', 'carousel-slider' ),
|
379 |
+
'options' => [
|
380 |
+
'left' => esc_html__( 'Left', 'carousel-slider' ),
|
381 |
+
'center' => esc_html__( 'Center', 'carousel-slider' ),
|
382 |
+
'right' => esc_html__( 'Right', 'carousel-slider' ),
|
383 |
+
],
|
384 |
+
'std' => 'center',
|
385 |
+
'context' => 'side',
|
386 |
+
]
|
387 |
+
);
|
388 |
+
$form->number(
|
389 |
+
[
|
390 |
+
'id' => '_bullet_size',
|
391 |
+
'class' => 'small-text',
|
392 |
+
'name' => esc_html__( 'Bullet Size', 'carousel-slider' ),
|
393 |
+
'desc' => esc_html__( 'Enter bullet size in pixels.', 'carousel-slider' ),
|
394 |
+
'std' => 10,
|
395 |
+
'context' => 'side',
|
396 |
+
]
|
397 |
+
);
|
398 |
+
$form->select(
|
399 |
+
[
|
400 |
+
'id' => '_bullet_shape',
|
401 |
+
'class' => 'small-text',
|
402 |
+
'name' => esc_html__( 'Bullet Shape', 'carousel-slider' ),
|
403 |
+
'desc' => esc_html__( 'Choose bullet nav shape.', 'carousel-slider' ),
|
404 |
+
'options' => [
|
405 |
+
'square' => esc_html__( 'Square', 'carousel-slider' ),
|
406 |
+
'circle' => esc_html__( 'Circle', 'carousel-slider' ),
|
407 |
+
],
|
408 |
+
'std' => 'circle',
|
409 |
+
'context' => 'side',
|
410 |
+
]
|
411 |
+
);
|
412 |
+
echo '<hr>';
|
413 |
+
$form->color(
|
414 |
+
[
|
415 |
+
'id' => '_nav_color',
|
416 |
+
'name' => esc_html__( 'Arrows & Dots Color', 'carousel-slider' ),
|
417 |
+
'std' => Helper::get_default_setting( 'nav_color' ),
|
418 |
+
'context' => 'side',
|
419 |
+
]
|
420 |
+
);
|
421 |
+
$form->color(
|
422 |
+
[
|
423 |
+
'id' => '_nav_active_color',
|
424 |
+
'name' => esc_html__( 'Arrows & Dots Hover Color', 'carousel-slider' ),
|
425 |
+
'std' => Helper::get_default_setting( 'nav_active_color' ),
|
426 |
+
'context' => 'side',
|
427 |
+
]
|
428 |
+
);
|
429 |
+
}
|
430 |
+
|
431 |
+
/**
|
432 |
+
* Autoplay settings
|
433 |
+
*/
|
434 |
+
public function autoplay_settings_callback() {
|
435 |
+
$form = new MetaBoxForm();
|
436 |
+
$form->select(
|
437 |
+
[
|
438 |
+
'id' => '_autoplay',
|
439 |
+
'class' => 'small-text',
|
440 |
+
'name' => esc_html__( 'AutoPlay', 'carousel-slider' ),
|
441 |
+
'desc' => esc_html__( 'Choose whether slideshow should play automatically.', 'carousel-slider' ),
|
442 |
+
'options' => [
|
443 |
+
'on' => esc_html__( 'Enable', 'carousel-slider' ),
|
444 |
+
'off' => esc_html__( 'Disable', 'carousel-slider' ),
|
445 |
+
],
|
446 |
+
'std' => 'on',
|
447 |
+
'context' => 'side',
|
448 |
+
]
|
449 |
+
);
|
450 |
+
$form->select(
|
451 |
+
[
|
452 |
+
'id' => '_autoplay_pause',
|
453 |
+
'class' => 'small-text',
|
454 |
+
'name' => esc_html__( 'Pause On Hover', 'carousel-slider' ),
|
455 |
+
'desc' => esc_html__( 'Pause automatic play on mouse hover.', 'carousel-slider' ),
|
456 |
+
'options' => [
|
457 |
+
'on' => esc_html__( 'Enable', 'carousel-slider' ),
|
458 |
+
'off' => esc_html__( 'Disable', 'carousel-slider' ),
|
459 |
+
],
|
460 |
+
'std' => 'on',
|
461 |
+
'context' => 'side',
|
462 |
+
]
|
463 |
+
);
|
464 |
+
$form->number(
|
465 |
+
[
|
466 |
+
'id' => '_autoplay_timeout',
|
467 |
+
'class' => 'small-text',
|
468 |
+
'name' => esc_html__( 'Autoplay Timeout', 'carousel-slider' ),
|
469 |
+
'desc' => esc_html__( 'Automatic play interval timeout in millisecond.', 'carousel-slider' ),
|
470 |
+
'std' => 5000,
|
471 |
+
'context' => 'side',
|
472 |
+
]
|
473 |
+
);
|
474 |
+
$form->number(
|
475 |
+
[
|
476 |
+
'id' => '_autoplay_speed',
|
477 |
+
'class' => 'small-text',
|
478 |
+
'name' => esc_html__( 'Autoplay Speed', 'carousel-slider' ),
|
479 |
+
'desc' => esc_html__( 'Automatic play speed in millisecond.', 'carousel-slider' ),
|
480 |
+
'std' => 500,
|
481 |
+
'context' => 'side',
|
482 |
+
]
|
483 |
+
);
|
484 |
+
}
|
485 |
+
|
486 |
+
/**
|
487 |
+
* Renders the meta box.
|
488 |
+
*/
|
489 |
+
public function responsive_settings_callback() {
|
490 |
+
$form = new MetaBoxForm();
|
491 |
+
$form->number(
|
492 |
+
[
|
493 |
+
'id' => '_items',
|
494 |
+
'class' => 'small-text',
|
495 |
+
'name' => esc_html__( 'Columns', 'carousel-slider' ),
|
496 |
+
'desc' => esc_html__( 'The number of items you want to see on the Extra Large Desktop Layout (Screens size greater than 1921 pixels DP)', 'carousel-slider' ),
|
497 |
+
'std' => 4,
|
498 |
+
'context' => 'side',
|
499 |
+
]
|
500 |
+
);
|
501 |
+
$form->number(
|
502 |
+
[
|
503 |
+
'id' => '_items_desktop',
|
504 |
+
'class' => 'small-text',
|
505 |
+
'name' => esc_html__( 'Columns : Desktop', 'carousel-slider' ),
|
506 |
+
'desc' => esc_html__( 'The number of items you want to see on the Desktop Layout (Screens size from 1200 pixels DP to 1920 pixels DP)', 'carousel-slider' ),
|
507 |
+
'std' => 4,
|
508 |
+
'context' => 'side',
|
509 |
+
]
|
510 |
+
);
|
511 |
+
$form->number(
|
512 |
+
[
|
513 |
+
'id' => '_items_small_desktop',
|
514 |
+
'class' => 'small-text',
|
515 |
+
'name' => esc_html__( 'Columns : Small Desktop', 'carousel-slider' ),
|
516 |
+
'desc' => esc_html__( 'The number of items you want to see on the Small Desktop Layout (Screens size from 993 pixels DP to 1199 pixels DP)', 'carousel-slider' ),
|
517 |
+
'std' => 3,
|
518 |
+
'context' => 'side',
|
519 |
+
]
|
520 |
+
);
|
521 |
+
$form->number(
|
522 |
+
[
|
523 |
+
'id' => '_items_portrait_tablet',
|
524 |
+
'class' => 'small-text',
|
525 |
+
'name' => esc_html__( 'Columns : Tablet', 'carousel-slider' ),
|
526 |
+
'desc' => esc_html__( 'The number of items you want to see on the Tablet Layout (Screens size from 768 pixels DP to 992 pixels DP)', 'carousel-slider' ),
|
527 |
+
'std' => 2,
|
528 |
+
'context' => 'side',
|
529 |
+
]
|
530 |
+
);
|
531 |
+
$form->number(
|
532 |
+
[
|
533 |
+
'id' => '_items_small_portrait_tablet',
|
534 |
+
'class' => 'small-text',
|
535 |
+
'name' => esc_html__( 'Columns : Small Tablet', 'carousel-slider' ),
|
536 |
+
'desc' => esc_html__( 'The number of items you want to see on the Small Tablet Layout(Screens size from 600 pixels DP to 767 pixels DP)', 'carousel-slider' ),
|
537 |
+
'std' => 2,
|
538 |
+
'context' => 'side',
|
539 |
+
]
|
540 |
+
);
|
541 |
+
$form->number(
|
542 |
+
[
|
543 |
+
'id' => '_items_portrait_mobile',
|
544 |
+
'class' => 'small-text',
|
545 |
+
'name' => esc_html__( 'Columns : Mobile', 'carousel-slider' ),
|
546 |
+
'desc' => esc_html__( 'The number of items you want to see on the Mobile Layout (Screens size from 320 pixels DP to 599 pixels DP)', 'carousel-slider' ),
|
547 |
+
'std' => 1,
|
548 |
+
'context' => 'side',
|
549 |
+
]
|
550 |
+
);
|
551 |
+
}
|
552 |
+
}
|
includes/Admin/Setting.php
ADDED
@@ -0,0 +1,150 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace CarouselSlider\Admin;
|
4 |
+
|
5 |
+
use CarouselSlider\Supports\SettingApi\DefaultSettingApi;
|
6 |
+
use Exception;
|
7 |
+
|
8 |
+
defined( 'ABSPATH' ) || exit;
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Setting class to register global setting.
|
12 |
+
*
|
13 |
+
* @package CarouselSlider/Admin
|
14 |
+
*/
|
15 |
+
class Setting {
|
16 |
+
/**
|
17 |
+
* Instance of current class
|
18 |
+
*
|
19 |
+
* @var self
|
20 |
+
*/
|
21 |
+
private static $instance;
|
22 |
+
|
23 |
+
/**
|
24 |
+
* The only one instance of the class can be loaded
|
25 |
+
*
|
26 |
+
* @return self
|
27 |
+
*/
|
28 |
+
public static function init() {
|
29 |
+
if ( is_null( self::$instance ) ) {
|
30 |
+
self::$instance = new self();
|
31 |
+
|
32 |
+
add_action( 'init', array( self::$instance, 'settings' ) );
|
33 |
+
}
|
34 |
+
|
35 |
+
return self::$instance;
|
36 |
+
}
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Get option
|
40 |
+
*
|
41 |
+
* @param string $key option key.
|
42 |
+
* @param mixed $default default value.
|
43 |
+
*
|
44 |
+
* @return mixed
|
45 |
+
*/
|
46 |
+
public static function get_option( string $key, $default = '' ) {
|
47 |
+
$default_args = [
|
48 |
+
'load_scripts' => 'optimized',
|
49 |
+
'show_structured_data' => '1',
|
50 |
+
'woocommerce_shop_loop_item_template' => 'v1-compatibility',
|
51 |
+
];
|
52 |
+
$options = wp_parse_args( get_option( 'carousel_slider_settings', [] ), $default_args );
|
53 |
+
|
54 |
+
return $options[ $key ] ?? $default;
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Plugin setting fields
|
59 |
+
*
|
60 |
+
* @throws Exception It throws exception if you don't set name and id field.
|
61 |
+
*/
|
62 |
+
public function settings() {
|
63 |
+
$settings = new DefaultSettingApi();
|
64 |
+
$settings->add_menu(
|
65 |
+
[
|
66 |
+
'page_title' => __( 'Carousel Slider Settings', 'carousel-slider' ),
|
67 |
+
'menu_title' => __( 'Settings', 'carousel-slider' ),
|
68 |
+
'about_text' => __( 'Thank you for choosing Carousel Slider. We hope you enjoy it!', 'carousel-slider' ),
|
69 |
+
'menu_slug' => 'settings',
|
70 |
+
'parent_slug' => 'edit.php?post_type=carousels',
|
71 |
+
'option_name' => 'carousel_slider_settings',
|
72 |
+
]
|
73 |
+
);
|
74 |
+
|
75 |
+
// Add settings page tab.
|
76 |
+
$settings->set_panel(
|
77 |
+
[
|
78 |
+
'id' => 'general',
|
79 |
+
'title' => __( 'General', 'carousel-slider' ),
|
80 |
+
]
|
81 |
+
);
|
82 |
+
$settings->set_panel(
|
83 |
+
[
|
84 |
+
'id' => 'woocommerce',
|
85 |
+
'title' => __( 'WooCommerce', 'carousel-slider' ),
|
86 |
+
]
|
87 |
+
);
|
88 |
+
|
89 |
+
$settings->add_field(
|
90 |
+
[
|
91 |
+
'id' => 'load_scripts',
|
92 |
+
'type' => 'radio',
|
93 |
+
'std' => 'optimized',
|
94 |
+
'name' => __( 'Style & Scrips', 'carousel-slider' ),
|
95 |
+
'desc' => __(
|
96 |
+
'If you choose <strong>Optimized</strong>, then scrips and styles will be loaded only on page where
|
97 |
+
you are using shortcode. If <strong>Optimized</strong> is not working for you then choose
|
98 |
+
<strong>Optimized with style loader</strong>. Then it will add a small javascript at footer to load css
|
99 |
+
file in header. If none of these is not working for you then choose <strong>Always</strong>',
|
100 |
+
'carousel-slider'
|
101 |
+
),
|
102 |
+
'options' => [
|
103 |
+
'always' => __( 'Always', 'carousel-slider' ),
|
104 |
+
'optimized' => __( 'Optimized (recommended)', 'carousel-slider' ),
|
105 |
+
'optimized-loader' => __( 'Optimized with style loader', 'carousel-slider' ),
|
106 |
+
],
|
107 |
+
'panel' => 'general',
|
108 |
+
]
|
109 |
+
);
|
110 |
+
$settings->add_field(
|
111 |
+
[
|
112 |
+
'id' => 'show_structured_data',
|
113 |
+
'type' => 'checkbox',
|
114 |
+
'std' => '1',
|
115 |
+
'name' => __( 'Show Structured Data', 'carousel-slider' ),
|
116 |
+
'desc' => __(
|
117 |
+
'If you enable to show, then it will generate structured data for every slider for better SEO.
|
118 |
+
But if you are using some other SEO plugin to handle SEO, then you can disabled it.',
|
119 |
+
'carousel-slider'
|
120 |
+
),
|
121 |
+
'panel' => 'general',
|
122 |
+
]
|
123 |
+
);
|
124 |
+
$settings->add_field(
|
125 |
+
[
|
126 |
+
'id' => 'woocommerce_shop_loop_item_template',
|
127 |
+
'type' => 'radio',
|
128 |
+
'std' => 'v1-compatibility',
|
129 |
+
'name' => __( 'Slider item template', 'carousel-slider' ),
|
130 |
+
'desc' => [
|
131 |
+
__(
|
132 |
+
'<strong>WooCommerce Default</strong> use hook to load shop loop template and does not allow
|
133 |
+
hiding/showing title, rating, price, card button, sale tag using slider settings.',
|
134 |
+
'carousel-slider'
|
135 |
+
),
|
136 |
+
__(
|
137 |
+
'<strong>Compatibility mode</strong> use custom template and allow hiding/showing title,
|
138 |
+
rating, price, card button, sale tag.',
|
139 |
+
'carousel-slider'
|
140 |
+
),
|
141 |
+
],
|
142 |
+
'options' => [
|
143 |
+
'wc-default' => __( 'WooCommerce Default (recommended)', 'carousel-slider' ),
|
144 |
+
'v1-compatibility' => __( 'Compatibility mode (with version 1)', 'carousel-slider' ),
|
145 |
+
],
|
146 |
+
'panel' => 'woocommerce',
|
147 |
+
]
|
148 |
+
);
|
149 |
+
}
|
150 |
+
}
|
{classes → includes}/Ajax.php
RENAMED
@@ -1,9 +1,17 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
namespace CarouselSlider;
|
4 |
|
5 |
defined( 'ABSPATH' ) || exit;
|
6 |
|
|
|
|
|
|
|
7 |
class Ajax {
|
8 |
|
9 |
/**
|
@@ -36,7 +44,7 @@ class Ajax {
|
|
36 |
wp_die( 'Sorry. This link only for developer to do some testing.' );
|
37 |
}
|
38 |
|
39 |
-
var_dump( 'Testing some data on AJAX' );
|
40 |
die();
|
41 |
}
|
42 |
}
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* The ajax-specific functionality of the plugin.
|
4 |
+
*
|
5 |
+
* @package CarouselSlider
|
6 |
+
*/
|
7 |
|
8 |
namespace CarouselSlider;
|
9 |
|
10 |
defined( 'ABSPATH' ) || exit;
|
11 |
|
12 |
+
/**
|
13 |
+
* Ajax class
|
14 |
+
*/
|
15 |
class Ajax {
|
16 |
|
17 |
/**
|
44 |
wp_die( 'Sorry. This link only for developer to do some testing.' );
|
45 |
}
|
46 |
|
47 |
+
var_dump( 'Testing some data on AJAX' ); // phpcs:ignore
|
48 |
die();
|
49 |
}
|
50 |
}
|
{classes → includes}/Assets.php
RENAMED
@@ -4,6 +4,9 @@ namespace CarouselSlider;
|
|
4 |
|
5 |
defined( 'ABSPATH' ) || exit;
|
6 |
|
|
|
|
|
|
|
7 |
class Assets {
|
8 |
|
9 |
/**
|
@@ -21,7 +24,7 @@ class Assets {
|
|
21 |
private $plugin_name;
|
22 |
|
23 |
/**
|
24 |
-
* plugin version
|
25 |
*
|
26 |
* @var string
|
27 |
*/
|
@@ -61,7 +64,7 @@ class Assets {
|
|
61 |
return true;
|
62 |
} elseif ( 0 === stripos( get_option( 'siteurl' ), 'https://' ) ) {
|
63 |
return true;
|
64 |
-
} elseif ( isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) && 'https'
|
65 |
return true;
|
66 |
}
|
67 |
|
@@ -71,11 +74,11 @@ class Assets {
|
|
71 |
/**
|
72 |
* Get assets URL
|
73 |
*
|
74 |
-
* @param string $path
|
75 |
*
|
76 |
* @return string
|
77 |
*/
|
78 |
-
public static function get_assets_url( $path = '' ): string {
|
79 |
$url = CAROUSEL_SLIDER_ASSETS;
|
80 |
|
81 |
if ( static::is_ssl() && 0 === stripos( $url, 'http://' ) ) {
|
@@ -109,15 +112,15 @@ class Assets {
|
|
109 |
/**
|
110 |
* Register scripts
|
111 |
*
|
112 |
-
* @param array $scripts
|
113 |
*
|
114 |
* @return void
|
115 |
*/
|
116 |
private function register_scripts( array $scripts ) {
|
117 |
foreach ( $scripts as $handle => $script ) {
|
118 |
-
$deps =
|
119 |
-
$in_footer =
|
120 |
-
$version =
|
121 |
wp_register_script( $handle, $script['src'], $deps, $version, $in_footer );
|
122 |
}
|
123 |
}
|
@@ -125,13 +128,13 @@ class Assets {
|
|
125 |
/**
|
126 |
* Register styles
|
127 |
*
|
128 |
-
* @param array $styles
|
129 |
*
|
130 |
* @return void
|
131 |
*/
|
132 |
public function register_styles( array $styles ) {
|
133 |
foreach ( $styles as $handle => $style ) {
|
134 |
-
$deps =
|
135 |
wp_register_style( $handle, $style['src'], $deps, $this->version );
|
136 |
}
|
137 |
}
|
@@ -143,41 +146,13 @@ class Assets {
|
|
143 |
*/
|
144 |
public function get_scripts(): array {
|
145 |
return [
|
146 |
-
'
|
147 |
-
'src' => static::get_assets_url( 'lib/select2/select2.min.js' ),
|
148 |
-
'deps' => [ 'jquery' ],
|
149 |
-
'version' => '4.0.5',
|
150 |
-
],
|
151 |
-
'wp-color-picker-alpha' => [
|
152 |
-
'src' => static::get_assets_url( 'lib/wp-color-picker-alpha/wp-color-picker-alpha.min.js' ),
|
153 |
-
'deps' => [ 'jquery', 'wp-color-picker' ],
|
154 |
-
'version' => '2.1.3',
|
155 |
-
],
|
156 |
-
"carousel-slider-admin" => [
|
157 |
'src' => static::get_assets_url( 'js/admin.js' ),
|
158 |
-
'deps' => [
|
159 |
-
'jquery',
|
160 |
-
'select2',
|
161 |
-
'wp-color-picker-alpha',
|
162 |
-
'jquery-ui-accordion',
|
163 |
-
'jquery-ui-datepicker',
|
164 |
-
'jquery-ui-sortable',
|
165 |
-
'jquery-ui-tabs',
|
166 |
-
],
|
167 |
-
],
|
168 |
-
'owl-carousel' => [
|
169 |
-
'src' => static::get_assets_url( 'lib/owl-carousel/owl.carousel.min.js' ),
|
170 |
-
'deps' => [ 'jquery' ],
|
171 |
-
'version' => '2.3.4',
|
172 |
],
|
173 |
-
'
|
174 |
-
'src' => static::get_assets_url( 'lib/magnific-popup/jquery.magnific-popup.min.js' ),
|
175 |
-
'deps' => [ 'jquery' ],
|
176 |
-
'version' => '1.1.0',
|
177 |
-
],
|
178 |
-
"carousel-slider-frontend" => [
|
179 |
'src' => static::get_assets_url( 'js/frontend.js' ),
|
180 |
-
'deps' => [ 'jquery'
|
181 |
],
|
182 |
];
|
183 |
}
|
@@ -189,13 +164,30 @@ class Assets {
|
|
189 |
*/
|
190 |
public function get_styles(): array {
|
191 |
return [
|
192 |
-
|
193 |
-
'src' => static::get_assets_url( 'css/frontend.css' )
|
194 |
],
|
195 |
-
|
196 |
'src' => static::get_assets_url( 'css/admin.css' ),
|
197 |
'deps' => [ 'wp-color-picker' ],
|
198 |
],
|
199 |
];
|
200 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
201 |
}
|
4 |
|
5 |
defined( 'ABSPATH' ) || exit;
|
6 |
|
7 |
+
/**
|
8 |
+
* Assets class
|
9 |
+
*/
|
10 |
class Assets {
|
11 |
|
12 |
/**
|
24 |
private $plugin_name;
|
25 |
|
26 |
/**
|
27 |
+
* The plugin version
|
28 |
*
|
29 |
* @var string
|
30 |
*/
|
64 |
return true;
|
65 |
} elseif ( 0 === stripos( get_option( 'siteurl' ), 'https://' ) ) {
|
66 |
return true;
|
67 |
+
} elseif ( isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) && 'https' === $_SERVER['HTTP_X_FORWARDED_PROTO'] ) {
|
68 |
return true;
|
69 |
}
|
70 |
|
74 |
/**
|
75 |
* Get assets URL
|
76 |
*
|
77 |
+
* @param string $path Optional path.
|
78 |
*
|
79 |
* @return string
|
80 |
*/
|
81 |
+
public static function get_assets_url( string $path = '' ): string {
|
82 |
$url = CAROUSEL_SLIDER_ASSETS;
|
83 |
|
84 |
if ( static::is_ssl() && 0 === stripos( $url, 'http://' ) ) {
|
112 |
/**
|
113 |
* Register scripts
|
114 |
*
|
115 |
+
* @param array $scripts The scripts to register.
|
116 |
*
|
117 |
* @return void
|
118 |
*/
|
119 |
private function register_scripts( array $scripts ) {
|
120 |
foreach ( $scripts as $handle => $script ) {
|
121 |
+
$deps = $script['deps'] ?? false;
|
122 |
+
$in_footer = $script['in_footer'] ?? true;
|
123 |
+
$version = $script['version'] ?? $this->version;
|
124 |
wp_register_script( $handle, $script['src'], $deps, $version, $in_footer );
|
125 |
}
|
126 |
}
|
128 |
/**
|
129 |
* Register styles
|
130 |
*
|
131 |
+
* @param array $styles The styles to register.
|
132 |
*
|
133 |
* @return void
|
134 |
*/
|
135 |
public function register_styles( array $styles ) {
|
136 |
foreach ( $styles as $handle => $style ) {
|
137 |
+
$deps = $style['deps'] ?? false;
|
138 |
wp_register_style( $handle, $style['src'], $deps, $this->version );
|
139 |
}
|
140 |
}
|
146 |
*/
|
147 |
public function get_scripts(): array {
|
148 |
return [
|
149 |
+
'carousel-slider-admin' => [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
'src' => static::get_assets_url( 'js/admin.js' ),
|
151 |
+
'deps' => [ 'jquery', 'wp-color-picker', 'jquery-ui-accordion', 'jquery-ui-tabs', 'jquery-ui-sortable' ],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
152 |
],
|
153 |
+
'carousel-slider-frontend' => [
|
|
|
|
|
|
|
|
|
|
|
154 |
'src' => static::get_assets_url( 'js/frontend.js' ),
|
155 |
+
'deps' => [ 'jquery' ],
|
156 |
],
|
157 |
];
|
158 |
}
|
164 |
*/
|
165 |
public function get_styles(): array {
|
166 |
return [
|
167 |
+
'carousel-slider-frontend' => [
|
168 |
+
'src' => static::get_assets_url( 'css/frontend.css' ),
|
169 |
],
|
170 |
+
'carousel-slider-admin' => [
|
171 |
'src' => static::get_assets_url( 'css/admin.css' ),
|
172 |
'deps' => [ 'wp-color-picker' ],
|
173 |
],
|
174 |
];
|
175 |
}
|
176 |
+
|
177 |
+
/**
|
178 |
+
* Script to load css file via javaScript
|
179 |
+
*
|
180 |
+
* @return string
|
181 |
+
*/
|
182 |
+
public static function get_style_loader_script(): string {
|
183 |
+
$data = self::get_assets_url( 'css/frontend.css' );
|
184 |
+
// phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
|
185 |
+
$javascript = file_get_contents( self::get_assets_url( '/js/style-loader.js' ) );
|
186 |
+
$script = '<script id="carousel-slider-style-loader">' . PHP_EOL;
|
187 |
+
$script .= 'window.carouselSliderCssUrl = ' . wp_json_encode( $data ) . ';' . PHP_EOL;
|
188 |
+
$script .= $javascript . PHP_EOL;
|
189 |
+
$script .= '</script>' . PHP_EOL;
|
190 |
+
|
191 |
+
return $script;
|
192 |
+
}
|
193 |
}
|
{classes → includes}/Autoloader.php
RENAMED
@@ -4,6 +4,9 @@ namespace CarouselSlider;
|
|
4 |
|
5 |
defined( 'ABSPATH' ) || exit;
|
6 |
|
|
|
|
|
|
|
7 |
class Autoloader {
|
8 |
/**
|
9 |
* An associative array where the key is a namespace prefix and the value
|
@@ -35,18 +38,18 @@ class Autoloader {
|
|
35 |
* @return void
|
36 |
*/
|
37 |
public function add_namespace( $prefix, $base_dir, $prepend = false ) {
|
38 |
-
// normalize namespace prefix
|
39 |
$prefix = trim( $prefix, '\\' ) . '\\';
|
40 |
|
41 |
-
// normalize the base directory with a trailing separator
|
42 |
$base_dir = rtrim( $base_dir, DIRECTORY_SEPARATOR ) . '/';
|
43 |
|
44 |
-
// initialize the namespace prefix array
|
45 |
if ( isset( $this->prefixes[ $prefix ] ) === false ) {
|
46 |
$this->prefixes[ $prefix ] = array();
|
47 |
}
|
48 |
|
49 |
-
// retain the base directory for the namespace prefix
|
50 |
if ( $prepend ) {
|
51 |
array_unshift( $this->prefixes[ $prefix ], $base_dir );
|
52 |
} else {
|
@@ -63,31 +66,32 @@ class Autoloader {
|
|
63 |
* failure.
|
64 |
*/
|
65 |
public function load_class( $class ) {
|
66 |
-
// the current namespace prefix
|
67 |
$prefix = $class;
|
68 |
|
69 |
// work backwards through the namespace names of the fully-qualified
|
70 |
-
// class name to find a mapped file name
|
|
|
71 |
while ( false !== $pos = strrpos( $prefix, '\\' ) ) {
|
72 |
|
73 |
-
// retain the trailing namespace separator in the prefix
|
74 |
$prefix = substr( $class, 0, $pos + 1 );
|
75 |
|
76 |
-
// the rest is the relative class name
|
77 |
$relative_class = substr( $class, $pos + 1 );
|
78 |
|
79 |
-
// try to load a mapped file for the prefix and relative class
|
80 |
$mapped_file = $this->load_mapped_file( $prefix, $relative_class );
|
81 |
if ( $mapped_file ) {
|
82 |
return $mapped_file;
|
83 |
}
|
84 |
|
85 |
// remove the trailing namespace separator for the next iteration
|
86 |
-
// of strrpos()
|
87 |
$prefix = rtrim( $prefix, '\\' );
|
88 |
}
|
89 |
|
90 |
-
// never found a mapped file
|
91 |
return false;
|
92 |
}
|
93 |
|
@@ -106,24 +110,24 @@ class Autoloader {
|
|
106 |
return false;
|
107 |
}
|
108 |
|
109 |
-
// look through base directories for this namespace prefix
|
110 |
foreach ( $this->prefixes[ $prefix ] as $base_dir ) {
|
111 |
|
112 |
// replace the namespace prefix with the base directory,
|
113 |
// replace namespace separators with directory separators
|
114 |
-
// in the relative class name, append with .php
|
115 |
$file = $base_dir
|
116 |
-
|
117 |
-
|
118 |
|
119 |
-
// if the mapped file exists, require it
|
120 |
if ( $this->require_file( $file ) ) {
|
121 |
-
// yes, we're done
|
122 |
return $file;
|
123 |
}
|
124 |
}
|
125 |
|
126 |
-
// never found it
|
127 |
return false;
|
128 |
}
|
129 |
|
4 |
|
5 |
defined( 'ABSPATH' ) || exit;
|
6 |
|
7 |
+
/**
|
8 |
+
* Autoloader class
|
9 |
+
*/
|
10 |
class Autoloader {
|
11 |
/**
|
12 |
* An associative array where the key is a namespace prefix and the value
|
38 |
* @return void
|
39 |
*/
|
40 |
public function add_namespace( $prefix, $base_dir, $prepend = false ) {
|
41 |
+
// normalize namespace prefix.
|
42 |
$prefix = trim( $prefix, '\\' ) . '\\';
|
43 |
|
44 |
+
// normalize the base directory with a trailing separator.
|
45 |
$base_dir = rtrim( $base_dir, DIRECTORY_SEPARATOR ) . '/';
|
46 |
|
47 |
+
// initialize the namespace prefix array.
|
48 |
if ( isset( $this->prefixes[ $prefix ] ) === false ) {
|
49 |
$this->prefixes[ $prefix ] = array();
|
50 |
}
|
51 |
|
52 |
+
// retain the base directory for the namespace prefix.
|
53 |
if ( $prepend ) {
|
54 |
array_unshift( $this->prefixes[ $prefix ], $base_dir );
|
55 |
} else {
|
66 |
* failure.
|
67 |
*/
|
68 |
public function load_class( $class ) {
|
69 |
+
// the current namespace prefix.
|
70 |
$prefix = $class;
|
71 |
|
72 |
// work backwards through the namespace names of the fully-qualified
|
73 |
+
// class name to find a mapped file name.
|
74 |
+
// phpcs:ignore WordPress.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition
|
75 |
while ( false !== $pos = strrpos( $prefix, '\\' ) ) {
|
76 |
|
77 |
+
// retain the trailing namespace separator in the prefix.
|
78 |
$prefix = substr( $class, 0, $pos + 1 );
|
79 |
|
80 |
+
// the rest is the relative class name.
|
81 |
$relative_class = substr( $class, $pos + 1 );
|
82 |
|
83 |
+
// try to load a mapped file for the prefix and relative class.
|
84 |
$mapped_file = $this->load_mapped_file( $prefix, $relative_class );
|
85 |
if ( $mapped_file ) {
|
86 |
return $mapped_file;
|
87 |
}
|
88 |
|
89 |
// remove the trailing namespace separator for the next iteration
|
90 |
+
// of strrpos().
|
91 |
$prefix = rtrim( $prefix, '\\' );
|
92 |
}
|
93 |
|
94 |
+
// never found a mapped file.
|
95 |
return false;
|
96 |
}
|
97 |
|
110 |
return false;
|
111 |
}
|
112 |
|
113 |
+
// look through base directories for this namespace prefix.
|
114 |
foreach ( $this->prefixes[ $prefix ] as $base_dir ) {
|
115 |
|
116 |
// replace the namespace prefix with the base directory,
|
117 |
// replace namespace separators with directory separators
|
118 |
+
// in the relative class name, append with .php extension.
|
119 |
$file = $base_dir
|
120 |
+
. str_replace( '\\', '/', $relative_class )
|
121 |
+
. '.php';
|
122 |
|
123 |
+
// if the mapped file exists, require it.
|
124 |
if ( $this->require_file( $file ) ) {
|
125 |
+
// yes, we're done.
|
126 |
return $file;
|
127 |
}
|
128 |
}
|
129 |
|
130 |
+
// never found it.
|
131 |
return false;
|
132 |
}
|
133 |
|
includes/CLI/Command.php
ADDED
@@ -0,0 +1,364 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace CarouselSlider\CLI;
|
4 |
+
|
5 |
+
use CarouselSlider\Helper;
|
6 |
+
use CarouselSlider\Modules\HeroCarousel\Template as TemplateHeroCarousel;
|
7 |
+
use CarouselSlider\Modules\ImageCarousel\Template as TemplateImageCarousel;
|
8 |
+
use CarouselSlider\Modules\ImageCarousel\TemplateUrl as TemplateUrlImageCarousel;
|
9 |
+
use CarouselSlider\Modules\PostCarousel\Template as TemplatePostCarousel;
|
10 |
+
use CarouselSlider\Modules\ProductCarousel\Template as TemplateProductCarousel;
|
11 |
+
use CarouselSlider\Modules\VideoCarousel\Template as TemplateVideoCarousel;
|
12 |
+
use WP_CLI;
|
13 |
+
use WP_CLI_Command;
|
14 |
+
use WP_Post;
|
15 |
+
|
16 |
+
defined( 'ABSPATH' ) || exit;
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Command class
|
20 |
+
* The command line interface class handle plugin cli functionality
|
21 |
+
*
|
22 |
+
* @package CarouselSlider/CLI
|
23 |
+
*/
|
24 |
+
class Command extends WP_CLI_Command {
|
25 |
+
/**
|
26 |
+
* Create post carousel
|
27 |
+
*
|
28 |
+
* @param array $args The arguments.
|
29 |
+
* @param string $slider_title The slider title.
|
30 |
+
*
|
31 |
+
* @return int
|
32 |
+
*/
|
33 |
+
protected static function create_post_carousel( array $args, string $slider_title ): int {
|
34 |
+
$post_query = ! empty( $args['post-query'] ) ? $args['post-query'] : 'latest_posts';
|
35 |
+
$date_from = ! empty( $args['date-from'] ) ? $args['date-from'] : '';
|
36 |
+
$date_to = ! empty( $args['date-to'] ) ? $args['date-to'] : '';
|
37 |
+
$post_categories = ! empty( $args['post-categories'] ) ? $args['post-categories'] : '';
|
38 |
+
$post_tags = ! empty( $args['post-tags'] ) ? $args['post-tags'] : '';
|
39 |
+
$post_in = ! empty( $args['post-in'] ) ? $args['post-in'] : '';
|
40 |
+
$post_args = array(
|
41 |
+
'_created_via' => 'wp-cli',
|
42 |
+
'_post_query_type' => $post_query,
|
43 |
+
'_post_date_after' => $date_from,
|
44 |
+
'_post_date_before' => $date_to,
|
45 |
+
'_post_categories' => $post_categories,
|
46 |
+
'_post_tags' => $post_tags,
|
47 |
+
'_post_in' => $post_in,
|
48 |
+
);
|
49 |
+
|
50 |
+
return TemplatePostCarousel::create( $slider_title, $post_args );
|
51 |
+
}
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Display Carousel Slider Information
|
55 |
+
*
|
56 |
+
* @subcommand info
|
57 |
+
*/
|
58 |
+
public function info() {
|
59 |
+
WP_CLI::success( 'Welcome to the Carousel Slider WP-CLI Extension!' );
|
60 |
+
WP_CLI::line( '' );
|
61 |
+
WP_CLI::line( '- Carousel Slider Version: ' . CAROUSEL_SLIDER_VERSION );
|
62 |
+
WP_CLI::line( '- Carousel Slider Directory: ' . CAROUSEL_SLIDER_PATH );
|
63 |
+
WP_CLI::line( '- Carousel Slider Public URL: ' . CAROUSEL_SLIDER_URL );
|
64 |
+
WP_CLI::line( '' );
|
65 |
+
}
|
66 |
+
|
67 |
+
/**
|
68 |
+
* Create Slider
|
69 |
+
*
|
70 |
+
* ## OPTIONS
|
71 |
+
*
|
72 |
+
* <name>
|
73 |
+
* : The name of the slider to create.
|
74 |
+
*
|
75 |
+
* [--type=<type>]
|
76 |
+
* : Carousel slider slider type.
|
77 |
+
* ---
|
78 |
+
* default: image-carousel
|
79 |
+
* options:
|
80 |
+
* - image-carousel
|
81 |
+
* - image-carousel-url
|
82 |
+
* - post-carousel
|
83 |
+
* - product-carousel
|
84 |
+
* - video-carousel
|
85 |
+
* - hero-banner-slider
|
86 |
+
* ---
|
87 |
+
*
|
88 |
+
* [--post-query=<post-query>]
|
89 |
+
* : Post carousel query type.
|
90 |
+
* ---
|
91 |
+
* default: latest_posts
|
92 |
+
* options:
|
93 |
+
* - latest_posts
|
94 |
+
* - date_range
|
95 |
+
* - post_categories
|
96 |
+
* - post_tags
|
97 |
+
* - specific_posts
|
98 |
+
* ---
|
99 |
+
*
|
100 |
+
* [--date-from=<date-from>]
|
101 |
+
* : Post carousel query starting date.
|
102 |
+
*
|
103 |
+
* [--date-to=<date-to>]
|
104 |
+
* : Post carousel query starting date.
|
105 |
+
*
|
106 |
+
* [--post-categories=<post-categories>]
|
107 |
+
* : Comma separated post category id
|
108 |
+
*
|
109 |
+
* [--post-tags=<post-tags>]
|
110 |
+
* : Comma separated post tag id
|
111 |
+
*
|
112 |
+
* [--post-in=<post-in>]
|
113 |
+
* : Comma separated post id
|
114 |
+
*
|
115 |
+
* ## EXAMPLES
|
116 |
+
*
|
117 |
+
* wp carousel-slider create_slider 'Post Carousel - LP' --type='post-carousel'
|
118 |
+
* wp carousel-slider create_slider 'Post Carousel - LP' --type='post-carousel' --post-query='latest_posts'
|
119 |
+
* wp carousel-slider create_slider 'Post Carousel - SP' --type='post-carousel' --post-query='specific_posts'
|
120 |
+
* wp carousel-slider create_slider 'Post Carousel - DR' --type='post-carousel' --post-query='date_range'
|
121 |
+
* wp carousel-slider create_slider 'Post Carousel - PC' --type='post-carousel' --post-query='post_categories'
|
122 |
+
* wp carousel-slider create_slider 'Post Carousel - PT' --type='post-carousel' --post-query='post_tags'
|
123 |
+
*
|
124 |
+
* @param mixed $args The arguments.
|
125 |
+
* @param mixed $assoc_args The additional arguments.
|
126 |
+
*
|
127 |
+
* @throws WP_CLI\ExitException The Exception.
|
128 |
+
*/
|
129 |
+
public function create_slider( $args, $assoc_args ) {
|
130 |
+
list( $slider_title ) = $args;
|
131 |
+
$type = ! empty( $assoc_args['type'] ) ? $assoc_args['type'] : 'image-carousel';
|
132 |
+
$slider_id = 0;
|
133 |
+
|
134 |
+
if ( 'image-carousel' === $type ) {
|
135 |
+
$slider_id = TemplateImageCarousel::create(
|
136 |
+
$slider_title,
|
137 |
+
array(
|
138 |
+
'_created_via' => 'wp-cli',
|
139 |
+
)
|
140 |
+
);
|
141 |
+
}
|
142 |
+
|
143 |
+
if ( 'image-carousel-url' === $type ) {
|
144 |
+
$slider_id = TemplateUrlImageCarousel::create(
|
145 |
+
$slider_title,
|
146 |
+
array(
|
147 |
+
'_created_via' => 'wp-cli',
|
148 |
+
)
|
149 |
+
);
|
150 |
+
}
|
151 |
+
|
152 |
+
if ( 'video-carousel' === $type ) {
|
153 |
+
$slider_id = TemplateVideoCarousel::create(
|
154 |
+
$slider_title,
|
155 |
+
array(
|
156 |
+
'_created_via' => 'wp-cli',
|
157 |
+
)
|
158 |
+
);
|
159 |
+
}
|
160 |
+
|
161 |
+
if ( 'post-carousel' === $type ) {
|
162 |
+
$slider_id = self::create_post_carousel( $assoc_args, (string) $slider_title );
|
163 |
+
}
|
164 |
+
|
165 |
+
if ( ! $slider_id ) {
|
166 |
+
WP_CLI::error( __( 'Could not create slider.', 'carousel-slider' ) );
|
167 |
+
|
168 |
+
return;
|
169 |
+
}
|
170 |
+
|
171 |
+
/* translators: 1: the slider id, 2: the slider title */
|
172 |
+
$response = sprintf( __( '#%1$s - %2$s has been created successfully.', 'carousel-slider' ), $slider_id, $slider_title );
|
173 |
+
WP_CLI::success( $response );
|
174 |
+
}
|
175 |
+
|
176 |
+
/**
|
177 |
+
* Create sliders for testing
|
178 |
+
*/
|
179 |
+
public function create_sliders() {
|
180 |
+
$ids = [];
|
181 |
+
$sliders = [
|
182 |
+
[
|
183 |
+
'type' => 'hero-banner-slider',
|
184 |
+
'title' => 'Test: Hero Carousel',
|
185 |
+
'args' => [],
|
186 |
+
],
|
187 |
+
[
|
188 |
+
'type' => 'image-carousel',
|
189 |
+
'title' => 'Test: Image Carousel - Gallery',
|
190 |
+
'args' => [],
|
191 |
+
],
|
192 |
+
[
|
193 |
+
'type' => 'image-carousel-url',
|
194 |
+
'title' => 'Test: Image Carousel - URL',
|
195 |
+
'args' => [],
|
196 |
+
],
|
197 |
+
[
|
198 |
+
'type' => 'video-carousel',
|
199 |
+
'title' => 'Test: Video Carousel - Youtube',
|
200 |
+
'args' => [],
|
201 |
+
],
|
202 |
+
// Post Carousel.
|
203 |
+
[
|
204 |
+
'type' => 'post-carousel',
|
205 |
+
'title' => 'Test: Post Carousel - Latest Posts',
|
206 |
+
'args' => [ '_post_query_type' => 'latest_posts' ],
|
207 |
+
],
|
208 |
+
[
|
209 |
+
'type' => 'post-carousel',
|
210 |
+
'title' => 'Test: Post Carousel - Date Range',
|
211 |
+
'args' => [ '_post_query_type' => 'date_range' ],
|
212 |
+
],
|
213 |
+
[
|
214 |
+
'type' => 'post-carousel',
|
215 |
+
'title' => 'Test: Post Carousel - Categories',
|
216 |
+
'args' => [ '_post_query_type' => 'post_categories' ],
|
217 |
+
],
|
218 |
+
[
|
219 |
+
'type' => 'post-carousel',
|
220 |
+
'title' => 'Test: Post Carousel - Tags',
|
221 |
+
'args' => [ '_post_query_type' => 'post_tags' ],
|
222 |
+
],
|
223 |
+
[
|
224 |
+
'type' => 'post-carousel',
|
225 |
+
'title' => 'Test: Post Carousel - IDs',
|
226 |
+
'args' => [ '_post_query_type' => 'specific_posts' ],
|
227 |
+
],
|
228 |
+
// Product Carousel.
|
229 |
+
[
|
230 |
+
'type' => 'product-carousel',
|
231 |
+
'title' => 'Test: Product Carousel - IDs',
|
232 |
+
'args' => [ '_product_query_type' => 'specific_products' ],
|
233 |
+
],
|
234 |
+
[
|
235 |
+
'type' => 'product-carousel',
|
236 |
+
'title' => 'Test: Product Carousel - Categories',
|
237 |
+
'args' => [ '_product_query_type' => 'product_categories' ],
|
238 |
+
],
|
239 |
+
[
|
240 |
+
'type' => 'product-carousel',
|
241 |
+
'title' => 'Test: Product Carousel - Tags',
|
242 |
+
'args' => [ '_product_query_type' => 'product_tags' ],
|
243 |
+
],
|
244 |
+
[
|
245 |
+
'type' => 'product-carousel',
|
246 |
+
'title' => 'Test: Product Carousel - Recent Products',
|
247 |
+
'args' => [
|
248 |
+
'_product_query_type' => 'query_product',
|
249 |
+
'_product_query' => 'recent',
|
250 |
+
],
|
251 |
+
],
|
252 |
+
[
|
253 |
+
'type' => 'product-carousel',
|
254 |
+
'title' => 'Test: Product Carousel - Featured Products',
|
255 |
+
'args' => [
|
256 |
+
'_product_query_type' => 'query_product',
|
257 |
+
'_product_query' => 'featured',
|
258 |
+
],
|
259 |
+
],
|
260 |
+
[
|
261 |
+
'type' => 'product-carousel',
|
262 |
+
'title' => 'Test: Product Carousel - Sale Products',
|
263 |
+
'args' => [
|
264 |
+
'_product_query_type' => 'query_product',
|
265 |
+
'_product_query' => 'sale',
|
266 |
+
],
|
267 |
+
],
|
268 |
+
[
|
269 |
+
'type' => 'product-carousel',
|
270 |
+
'title' => 'Test: Product Carousel - Best Selling Products',
|
271 |
+
'args' => [
|
272 |
+
'_product_query_type' => 'query_product',
|
273 |
+
'_product_query' => 'best_selling',
|
274 |
+
],
|
275 |
+
],
|
276 |
+
[
|
277 |
+
'type' => 'product-carousel',
|
278 |
+
'title' => 'Test: Product Carousel - Top Rated Products',
|
279 |
+
'args' => [
|
280 |
+
'_product_query_type' => 'query_product',
|
281 |
+
'_product_query' => 'top_rated',
|
282 |
+
],
|
283 |
+
],
|
284 |
+
[
|
285 |
+
'type' => 'product-carousel',
|
286 |
+
'title' => 'Test: Product Carousel - Product Categories List',
|
287 |
+
'args' => [
|
288 |
+
'_product_query_type' => 'query_product',
|
289 |
+
'_product_query' => 'product_categories_list',
|
290 |
+
],
|
291 |
+
],
|
292 |
+
];
|
293 |
+
|
294 |
+
foreach ( $sliders as $slider ) {
|
295 |
+
switch ( $slider['type'] ) {
|
296 |
+
case 'image-carousel':
|
297 |
+
$ids[] = TemplateImageCarousel::create( $slider['title'], $slider['args'] );
|
298 |
+
WP_CLI::line( "{$slider['title']} has been created successfully." );
|
299 |
+
break;
|
300 |
+
case 'image-carousel-url':
|
301 |
+
$ids[] = TemplateUrlImageCarousel::create( $slider['title'], $slider['args'] );
|
302 |
+
WP_CLI::line( "{$slider['title']} has been created successfully." );
|
303 |
+
break;
|
304 |
+
case 'video-carousel':
|
305 |
+
$ids[] = TemplateVideoCarousel::create( $slider['title'], $slider['args'] );
|
306 |
+
WP_CLI::line( "{$slider['title']} has been created successfully." );
|
307 |
+
break;
|
308 |
+
case 'post-carousel':
|
309 |
+
$ids[] = TemplatePostCarousel::create( $slider['title'], $slider['args'] );
|
310 |
+
WP_CLI::line( "{$slider['title']} has been created successfully." );
|
311 |
+
break;
|
312 |
+
case 'hero-banner-slider':
|
313 |
+
$ids[] = TemplateHeroCarousel::create( $slider['title'], $slider['args'] );
|
314 |
+
WP_CLI::line( "{$slider['title']} has been created successfully." );
|
315 |
+
break;
|
316 |
+
case 'product-carousel':
|
317 |
+
$ids[] = TemplateProductCarousel::create( $slider['title'], $slider['args'] );
|
318 |
+
WP_CLI::line( "{$slider['title']} has been created successfully." );
|
319 |
+
break;
|
320 |
+
}
|
321 |
+
}
|
322 |
+
|
323 |
+
Helper::create_test_page( $ids );
|
324 |
+
|
325 |
+
WP_CLI::success( 'All test sliders has been created successfully.' );
|
326 |
+
}
|
327 |
+
|
328 |
+
/**
|
329 |
+
* Delete a slider by slider id
|
330 |
+
*
|
331 |
+
* ## OPTIONS
|
332 |
+
*
|
333 |
+
* <id>
|
334 |
+
* : The slider id.
|
335 |
+
*
|
336 |
+
* @param array|mixed $args The arguments.
|
337 |
+
*/
|
338 |
+
public function delete_slider( $args ) {
|
339 |
+
list( $id ) = $args;
|
340 |
+
|
341 |
+
if ( wp_delete_post( $id, true ) ) {
|
342 |
+
WP_CLI::success( "#{$id} has been deleted successfully." );
|
343 |
+
}
|
344 |
+
}
|
345 |
+
|
346 |
+
/**
|
347 |
+
* Delete all sliders
|
348 |
+
*/
|
349 |
+
public function delete_sliders() {
|
350 |
+
$sliders = get_posts(
|
351 |
+
[
|
352 |
+
'post_type' => 'carousels',
|
353 |
+
'post_status' => 'any',
|
354 |
+
'numberposts' => - 1,
|
355 |
+
]
|
356 |
+
);
|
357 |
+
foreach ( $sliders as $slider ) {
|
358 |
+
if ( wp_delete_post( $slider->ID, true ) ) {
|
359 |
+
WP_CLI::line( "Carousel Slider #{$slider->ID} has been deleted successfully." );
|
360 |
+
}
|
361 |
+
}
|
362 |
+
WP_CLI::success( 'Carousel Slider: all sliders has been deleted successfully.' );
|
363 |
+
}
|
364 |
+
}
|
includes/Frontend/Frontend.php
ADDED
@@ -0,0 +1,130 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace CarouselSlider\Frontend;
|
4 |
+
|
5 |
+
use CarouselSlider\Assets;
|
6 |
+
use CarouselSlider\Helper;
|
7 |
+
use CarouselSlider\Interfaces\SliderViewInterface;
|
8 |
+
use WP_Post;
|
9 |
+
|
10 |
+
defined( 'ABSPATH' ) || exit;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Frontend class
|
14 |
+
*
|
15 |
+
* The frontend functionality specific class of the plugin
|
16 |
+
*/
|
17 |
+
class Frontend {
|
18 |
+
|
19 |
+
/**
|
20 |
+
* The instance of the class
|
21 |
+
*
|
22 |
+
* @var self
|
23 |
+
*/
|
24 |
+
protected static $instance;
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Ensures only one instance of the class is loaded or can be loaded.
|
28 |
+
*
|
29 |
+
* @return self
|
30 |
+
*/
|
31 |
+
public static function init() {
|
32 |
+
if ( is_null( self::$instance ) ) {
|
33 |
+
self::$instance = new self();
|
34 |
+
|
35 |
+
add_shortcode( 'carousel_slide', [ self::$instance, 'carousel_slide' ] );
|
36 |
+
add_action( 'wp_enqueue_scripts', [ self::$instance, 'frontend_scripts' ], 15 );
|
37 |
+
}
|
38 |
+
|
39 |
+
return self::$instance;
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* A shortcode for rendering the carousel slide.
|
44 |
+
*
|
45 |
+
* @param array $attributes Shortcode attributes.
|
46 |
+
*
|
47 |
+
* @return string The shortcode output
|
48 |
+
*/
|
49 |
+
public function carousel_slide( array $attributes ): string {
|
50 |
+
if ( empty( $attributes['id'] ) ) {
|
51 |
+
return '';
|
52 |
+
}
|
53 |
+
|
54 |
+
$slider_id = intval( $attributes['id'] );
|
55 |
+
|
56 |
+
// Check if id is valid or not.
|
57 |
+
$post = get_post( $slider_id );
|
58 |
+
if ( ! ( $post instanceof WP_Post && CAROUSEL_SLIDER_POST_TYPE === $post->post_type ) ) {
|
59 |
+
return '';
|
60 |
+
}
|
61 |
+
|
62 |
+
$slide_type = get_post_meta( $slider_id, '_slide_type', true );
|
63 |
+
$slide_type = array_key_exists( $slide_type, Helper::get_slide_types() ) ? $slide_type : 'image-carousel';
|
64 |
+
|
65 |
+
// If script & style is not enqueued yet, then enqueued it now.
|
66 |
+
$this->load_scripts_if_not_loaded();
|
67 |
+
|
68 |
+
$view = Helper::get_slider_view( $slide_type );
|
69 |
+
if ( $view instanceof SliderViewInterface ) {
|
70 |
+
$view->set_slider_id( $slider_id );
|
71 |
+
$view->set_slider_type( $slide_type );
|
72 |
+
|
73 |
+
return $view->render();
|
74 |
+
}
|
75 |
+
|
76 |
+
return apply_filters( 'carousel_slider/view', '', $slider_id, $slide_type );
|
77 |
+
}
|
78 |
+
|
79 |
+
/**
|
80 |
+
* Load frontend scripts
|
81 |
+
*/
|
82 |
+
public function frontend_scripts() {
|
83 |
+
if ( ! $this->should_load_scripts() ) {
|
84 |
+
return;
|
85 |
+
}
|
86 |
+
|
87 |
+
wp_enqueue_style( 'carousel-slider-frontend' );
|
88 |
+
wp_enqueue_script( 'carousel-slider-frontend' );
|
89 |
+
}
|
90 |
+
|
91 |
+
/**
|
92 |
+
* Check if it should load frontend scripts
|
93 |
+
*
|
94 |
+
* @return bool
|
95 |
+
*/
|
96 |
+
private function should_load_scripts(): bool {
|
97 |
+
$load_scripts = Helper::get_setting( 'load_scripts', 'optimized' );
|
98 |
+
if ( 'always' === $load_scripts ) {
|
99 |
+
return true;
|
100 |
+
}
|
101 |
+
|
102 |
+
global $post;
|
103 |
+
$load_scripts = is_active_widget( false, false, 'widget_carousel_slider', true ) ||
|
104 |
+
( is_a( $post, 'WP_Post' ) && has_shortcode( $post->post_content, 'carousel_slide' ) );
|
105 |
+
|
106 |
+
return apply_filters( 'carousel_slider_load_scripts', $load_scripts );
|
107 |
+
}
|
108 |
+
|
109 |
+
/**
|
110 |
+
* Load scripts if not loaded yet
|
111 |
+
*
|
112 |
+
* @return void
|
113 |
+
*/
|
114 |
+
protected function load_scripts_if_not_loaded() {
|
115 |
+
if ( wp_script_is( 'carousel-slider-frontend', 'enqueued' ) ) {
|
116 |
+
return;
|
117 |
+
}
|
118 |
+
if ( 'optimized-loader' !== Helper::get_setting( 'load_scripts' ) ) {
|
119 |
+
return;
|
120 |
+
}
|
121 |
+
wp_enqueue_script( 'carousel-slider-frontend' );
|
122 |
+
add_action(
|
123 |
+
'wp_footer',
|
124 |
+
function () {
|
125 |
+
echo Assets::get_style_loader_script(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
126 |
+
},
|
127 |
+
0
|
128 |
+
);
|
129 |
+
}
|
130 |
+
}
|
includes/Frontend/Preview.php
ADDED
@@ -0,0 +1,102 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace CarouselSlider\Frontend;
|
4 |
+
|
5 |
+
defined( 'ABSPATH' ) || exit;
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Preview class
|
9 |
+
*/
|
10 |
+
class Preview {
|
11 |
+
/**
|
12 |
+
* The instance of the class
|
13 |
+
*
|
14 |
+
* @var self
|
15 |
+
*/
|
16 |
+
protected static $instance;
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Ensures only one instance of this class is loaded or can be loaded.
|
20 |
+
*
|
21 |
+
* @return self
|
22 |
+
*/
|
23 |
+
public static function init() {
|
24 |
+
if ( is_null( self::$instance ) ) {
|
25 |
+
self::$instance = new self();
|
26 |
+
|
27 |
+
add_action( 'template_redirect', [ self::$instance, 'show_preview' ] );
|
28 |
+
}
|
29 |
+
|
30 |
+
return self::$instance;
|
31 |
+
}
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Include custom template
|
35 |
+
*
|
36 |
+
* @return void
|
37 |
+
*/
|
38 |
+
public function show_preview() {
|
39 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
40 |
+
if ( ! isset( $_GET['carousel_slider_preview'], $_GET['carousel_slider_iframe'], $_GET['slider_id'] ) ) {
|
41 |
+
return;
|
42 |
+
}
|
43 |
+
if ( ! current_user_can( 'edit_pages' ) ) {
|
44 |
+
return;
|
45 |
+
}
|
46 |
+
add_filter( 'carousel_slider_load_scripts', '__return_true' );
|
47 |
+
echo $this->preview_html(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
48 |
+
exit();
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Preview html
|
53 |
+
*
|
54 |
+
* @return string
|
55 |
+
*/
|
56 |
+
public function preview_html(): string {
|
57 |
+
ob_start();
|
58 |
+
wp_head();
|
59 |
+
$wp_head = ob_get_clean();
|
60 |
+
|
61 |
+
ob_start();
|
62 |
+
wp_footer();
|
63 |
+
$wp_footer = ob_get_clean();
|
64 |
+
|
65 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
66 |
+
$slider_id = isset( $_GET['slider_id'] ) ? intval( $_GET['slider_id'] ) : 0;
|
67 |
+
|
68 |
+
$html = '<!DOCTYPE html>' . PHP_EOL;
|
69 |
+
$html .= '<html ' . get_language_attributes() . '>' . PHP_EOL;
|
70 |
+
$html .= '<head>' . PHP_EOL;
|
71 |
+
$html .= '<meta charset="' . get_bloginfo( 'charset' ) . '">' . PHP_EOL;
|
72 |
+
$html .= '<meta name="viewport" content="width=device-width, initial-scale=1">' . PHP_EOL;
|
73 |
+
$html .= $wp_head . PHP_EOL;
|
74 |
+
$html .= '<style type="text/css" media="screen">
|
75 |
+
html {margin-top: 0 !important;}
|
76 |
+
* html body {margin-top: 0 !important;}
|
77 |
+
#wpadminbar {display: none !important;}
|
78 |
+
.carousel-slider-preview-container {max-width: 1024px;margin-left: auto;margin-right: auto;}
|
79 |
+
@media screen and ( max-width: 782px ) {
|
80 |
+
html {margin-top: 0 !important;}
|
81 |
+
* html body {margin-top: 0 !important;}
|
82 |
+
}
|
83 |
+
</style>' . PHP_EOL;
|
84 |
+
$html .= '</head>' . PHP_EOL;
|
85 |
+
$html .= '</body>' . PHP_EOL;
|
86 |
+
$html .= '<div class="carousel-slider-preview-container">' . PHP_EOL;
|
87 |
+
$html .= do_shortcode( '[carousel_slide id="' . $slider_id . '"]' ) . PHP_EOL;
|
88 |
+
$html .= '</div>' . PHP_EOL;
|
89 |
+
$html .= $wp_footer . PHP_EOL;
|
90 |
+
$html .= '<script type="text/javascript">
|
91 |
+
(function () {
|
92 |
+
if (window.frameElement) {
|
93 |
+
window.frameElement.height = document.querySelector(".carousel-slider-preview-container").offsetHeight;
|
94 |
+
}
|
95 |
+
})();
|
96 |
+
</script>' . PHP_EOL;
|
97 |
+
$html .= '</body>' . PHP_EOL;
|
98 |
+
$html .= '</html>';
|
99 |
+
|
100 |
+
return $html;
|
101 |
+
}
|
102 |
+
}
|
{classes → includes}/Frontend/StructuredData.php
RENAMED
@@ -1,14 +1,52 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
namespace CarouselSlider\Frontend;
|
4 |
|
|
|
|
|
|
|
|
|
|
|
5 |
defined( 'ABSPATH' ) || exit;
|
6 |
|
|
|
|
|
|
|
|
|
|
|
7 |
class StructuredData {
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
|
13 |
/**
|
14 |
* Ensures only one instance of this class is loaded or can be loaded.
|
@@ -19,11 +57,15 @@ class StructuredData {
|
|
19 |
if ( is_null( self::$instance ) ) {
|
20 |
self::$instance = new self();
|
21 |
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
|
|
|
|
|
|
|
|
27 |
}
|
28 |
|
29 |
return self::$instance;
|
@@ -51,15 +93,16 @@ class StructuredData {
|
|
51 |
|
52 |
/**
|
53 |
* Structures and returns product data.
|
|
|
54 |
* @return array
|
55 |
*/
|
56 |
-
private function get_structured_product_data() {
|
57 |
-
$data =
|
58 |
-
'@context' => '
|
59 |
-
|
60 |
-
|
61 |
|
62 |
-
return $this->get_product_data() ? $data :
|
63 |
}
|
64 |
|
65 |
/**
|
@@ -67,22 +110,23 @@ class StructuredData {
|
|
67 |
*
|
68 |
* @return array
|
69 |
*/
|
70 |
-
private function get_product_data() {
|
71 |
-
return $this->
|
72 |
}
|
73 |
|
74 |
/**
|
75 |
* Structures and returns image data.
|
|
|
76 |
* @return array
|
77 |
*/
|
78 |
-
private function get_structured_image_data() {
|
79 |
-
$data =
|
80 |
-
'@context' => '
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
return $this->get_image_data() ? $data :
|
86 |
}
|
87 |
|
88 |
/**
|
@@ -90,21 +134,31 @@ class StructuredData {
|
|
90 |
*
|
91 |
* @return array
|
92 |
*/
|
93 |
-
private function get_image_data() {
|
94 |
-
return $this->
|
95 |
}
|
96 |
|
97 |
-
|
|
|
|
|
|
|
|
|
|
|
98 |
$data = array(
|
99 |
-
'@context' => '
|
100 |
-
|
101 |
);
|
102 |
|
103 |
return $this->get_post_data() ? $data : array();
|
104 |
}
|
105 |
|
106 |
-
|
107 |
-
|
|
|
|
|
|
|
|
|
|
|
108 |
}
|
109 |
|
110 |
/**
|
@@ -112,15 +166,15 @@ class StructuredData {
|
|
112 |
*
|
113 |
* Hooked into `carousel_slider_image_gallery_loop` action hook.
|
114 |
*
|
115 |
-
* @param WP_Post $
|
116 |
*/
|
117 |
-
public function generate_image_data( $
|
118 |
-
$image = wp_get_attachment_image_src( $
|
119 |
$markup['@type'] = 'ImageObject';
|
120 |
$markup['contentUrl'] = $image[0];
|
121 |
-
$markup['name'] = $
|
122 |
|
123 |
-
$this->set_data( apply_filters( 'carousel_slider_structured_data_image', $markup, $
|
124 |
}
|
125 |
|
126 |
/**
|
@@ -128,49 +182,50 @@ class StructuredData {
|
|
128 |
*
|
129 |
* @param array $data Structured data.
|
130 |
*
|
131 |
-
* @return
|
132 |
*/
|
133 |
-
private function set_data( $data ) {
|
134 |
if ( ! isset( $data['@type'] ) || ! preg_match( '|^[a-zA-Z]{1,20}$|', $data['@type'] ) ) {
|
135 |
-
return
|
136 |
}
|
137 |
|
138 |
-
if ( $data['@type']
|
139 |
if ( ! $this->maybe_image_added( $data['contentUrl'] ) ) {
|
140 |
-
$this->
|
141 |
}
|
142 |
}
|
143 |
|
144 |
-
if ( $data['@type']
|
145 |
if ( ! $this->maybe_product_added( $data['@id'] ) ) {
|
146 |
-
$this->
|
147 |
}
|
148 |
}
|
149 |
|
150 |
-
if ( $data['@type']
|
151 |
if ( ! $this->maybe_post_added( $data['mainEntityOfPage']['@id'] ) ) {
|
152 |
-
$this->
|
153 |
}
|
154 |
}
|
155 |
-
|
156 |
-
return true;
|
157 |
}
|
158 |
|
159 |
/**
|
160 |
* Check if image is already added to list
|
161 |
*
|
162 |
-
* @param string $image_id
|
163 |
*
|
164 |
* @return boolean
|
165 |
*/
|
166 |
-
private function maybe_image_added( $image_id
|
167 |
$image_data = $this->get_image_data();
|
168 |
if ( count( $image_data ) > 0 ) {
|
169 |
-
$image_data = array_map(
|
170 |
-
|
171 |
-
|
|
|
|
|
|
|
172 |
|
173 |
-
return in_array( $image_id, $image_data );
|
174 |
}
|
175 |
|
176 |
return false;
|
@@ -179,18 +234,21 @@ class StructuredData {
|
|
179 |
/**
|
180 |
* Check if product is already added to list
|
181 |
*
|
182 |
-
* @param string $product_id
|
183 |
*
|
184 |
* @return boolean
|
185 |
*/
|
186 |
-
private function maybe_product_added( $product_id
|
187 |
$product_data = $this->get_product_data();
|
188 |
if ( count( $product_data ) > 0 ) {
|
189 |
-
$product_data = array_map(
|
190 |
-
|
191 |
-
|
|
|
|
|
|
|
192 |
|
193 |
-
return in_array( $product_id, $product_data );
|
194 |
}
|
195 |
|
196 |
return false;
|
@@ -199,18 +257,21 @@ class StructuredData {
|
|
199 |
/**
|
200 |
* Check if post is already added to list
|
201 |
*
|
202 |
-
* @param string $post_id
|
203 |
*
|
204 |
* @return boolean
|
205 |
*/
|
206 |
-
private function maybe_post_added( $post_id ) {
|
207 |
$post_data = $this->get_post_data();
|
208 |
if ( count( $post_data ) > 0 ) {
|
209 |
-
$post_data = array_map(
|
210 |
-
|
211 |
-
|
|
|
|
|
|
|
212 |
|
213 |
-
return in_array( $post_id, $post_data );
|
214 |
}
|
215 |
|
216 |
return false;
|
@@ -221,10 +282,10 @@ class StructuredData {
|
|
221 |
*
|
222 |
* Hooked into `carousel_slider_post_loop` action hook.
|
223 |
*
|
224 |
-
* @param WP_Post $
|
225 |
*/
|
226 |
-
public function generate_post_data( $
|
227 |
-
if ( ! $
|
228 |
return;
|
229 |
}
|
230 |
|
@@ -237,7 +298,6 @@ class StructuredData {
|
|
237 |
'@id' => get_the_permalink(),
|
238 |
);
|
239 |
|
240 |
-
|
241 |
$json['publisher'] = array(
|
242 |
'@type' => 'organization',
|
243 |
'name' => get_bloginfo( 'name' ),
|
@@ -263,30 +323,21 @@ class StructuredData {
|
|
263 |
$json['headline'] = $json['name'];
|
264 |
$json['description'] = get_the_excerpt();
|
265 |
|
266 |
-
|
267 |
-
$this->set_data( apply_filters( 'carousel_slider_structured_data_post', $json, $_post ) );
|
268 |
}
|
269 |
|
270 |
/**
|
271 |
* Generates Product structured data.
|
272 |
*
|
273 |
-
*
|
274 |
-
*
|
275 |
-
* @param WC_Product $product Product data (default: null).
|
276 |
-
* @param WP_Post $post
|
277 |
*/
|
278 |
-
public function generate_product_data( $product
|
279 |
if ( ! $product instanceof WC_Product ) {
|
280 |
return;
|
281 |
}
|
282 |
|
283 |
-
|
284 |
-
|
285 |
-
$permalink = get_permalink( $product->get_id() );
|
286 |
-
} else {
|
287 |
-
$name = get_the_title( $post->ID );
|
288 |
-
$permalink = get_permalink( $post->ID );
|
289 |
-
}
|
290 |
|
291 |
$markup['@type'] = 'Product';
|
292 |
$markup['@id'] = $permalink;
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* The structure-data specific file of the plugin
|
4 |
+
*
|
5 |
+
* @package CarouselSlider/Frontend
|
6 |
+
*/
|
7 |
|
8 |
namespace CarouselSlider\Frontend;
|
9 |
|
10 |
+
use CarouselSlider\Helper;
|
11 |
+
use CarouselSlider\Supports\Validate;
|
12 |
+
use WC_Product;
|
13 |
+
use WP_Post;
|
14 |
+
|
15 |
defined( 'ABSPATH' ) || exit;
|
16 |
|
17 |
+
/**
|
18 |
+
* StructuredData class
|
19 |
+
*
|
20 |
+
* The structure-data specific class of the plugin
|
21 |
+
*/
|
22 |
class StructuredData {
|
23 |
+
/**
|
24 |
+
* The instance of the class
|
25 |
+
*
|
26 |
+
* @var null | self
|
27 |
+
*/
|
28 |
+
private static $instance = null;
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Product structured data
|
32 |
+
*
|
33 |
+
* @var array
|
34 |
+
*/
|
35 |
+
private $product_data = [];
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Image structured data
|
39 |
+
*
|
40 |
+
* @var array
|
41 |
+
*/
|
42 |
+
private $image_data = [];
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Post structured data
|
46 |
+
*
|
47 |
+
* @var array
|
48 |
+
*/
|
49 |
+
private $post_data = [];
|
50 |
|
51 |
/**
|
52 |
* Ensures only one instance of this class is loaded or can be loaded.
|
57 |
if ( is_null( self::$instance ) ) {
|
58 |
self::$instance = new self();
|
59 |
|
60 |
+
$show = Validate::checked( Helper::get_setting( 'show_structured_data', '1' ) );
|
61 |
+
|
62 |
+
if ( $show ) {
|
63 |
+
add_action( 'carousel_slider_image_gallery_loop', [ self::$instance, 'generate_image_data' ] );
|
64 |
+
add_action( 'carousel_slider_post_loop', [ self::$instance, 'generate_post_data' ] );
|
65 |
+
add_action( 'carousel_slider_after_shop_loop_item', [ self::$instance, 'generate_product_data' ] );
|
66 |
+
// Output structured data.
|
67 |
+
add_action( 'wp_footer', [ self::$instance, 'output_structured_data' ], 90 );
|
68 |
+
}
|
69 |
}
|
70 |
|
71 |
return self::$instance;
|
93 |
|
94 |
/**
|
95 |
* Structures and returns product data.
|
96 |
+
*
|
97 |
* @return array
|
98 |
*/
|
99 |
+
private function get_structured_product_data(): array {
|
100 |
+
$data = [
|
101 |
+
'@context' => 'https://schema.org/',
|
102 |
+
'@graph' => $this->get_product_data(),
|
103 |
+
];
|
104 |
|
105 |
+
return $this->get_product_data() ? $data : [];
|
106 |
}
|
107 |
|
108 |
/**
|
110 |
*
|
111 |
* @return array
|
112 |
*/
|
113 |
+
private function get_product_data(): array {
|
114 |
+
return $this->product_data;
|
115 |
}
|
116 |
|
117 |
/**
|
118 |
* Structures and returns image data.
|
119 |
+
*
|
120 |
* @return array
|
121 |
*/
|
122 |
+
private function get_structured_image_data(): array {
|
123 |
+
$data = [
|
124 |
+
'@context' => 'https://schema.org/',
|
125 |
+
'@type' => 'ImageGallery',
|
126 |
+
'associatedMedia' => $this->get_image_data(),
|
127 |
+
];
|
128 |
+
|
129 |
+
return $this->get_image_data() ? $data : [];
|
130 |
}
|
131 |
|
132 |
/**
|
134 |
*
|
135 |
* @return array
|
136 |
*/
|
137 |
+
private function get_image_data(): array {
|
138 |
+
return $this->image_data;
|
139 |
}
|
140 |
|
141 |
+
/**
|
142 |
+
* Get structured data for post
|
143 |
+
*
|
144 |
+
* @return array
|
145 |
+
*/
|
146 |
+
private function get_structured_post_data(): array {
|
147 |
$data = array(
|
148 |
+
'@context' => 'https://schema.org/',
|
149 |
+
'@graph' => $this->get_post_data(),
|
150 |
);
|
151 |
|
152 |
return $this->get_post_data() ? $data : array();
|
153 |
}
|
154 |
|
155 |
+
/**
|
156 |
+
* Get post data
|
157 |
+
*
|
158 |
+
* @return array
|
159 |
+
*/
|
160 |
+
private function get_post_data(): array {
|
161 |
+
return $this->post_data;
|
162 |
}
|
163 |
|
164 |
/**
|
166 |
*
|
167 |
* Hooked into `carousel_slider_image_gallery_loop` action hook.
|
168 |
*
|
169 |
+
* @param WP_Post $post Post data (default: null).
|
170 |
*/
|
171 |
+
public function generate_image_data( WP_Post $post ) {
|
172 |
+
$image = wp_get_attachment_image_src( $post->ID, 'full' );
|
173 |
$markup['@type'] = 'ImageObject';
|
174 |
$markup['contentUrl'] = $image[0];
|
175 |
+
$markup['name'] = $post->post_title;
|
176 |
|
177 |
+
$this->set_data( apply_filters( 'carousel_slider_structured_data_image', $markup, $post ) );
|
178 |
}
|
179 |
|
180 |
/**
|
182 |
*
|
183 |
* @param array $data Structured data.
|
184 |
*
|
185 |
+
* @return void
|
186 |
*/
|
187 |
+
private function set_data( array $data ) {
|
188 |
if ( ! isset( $data['@type'] ) || ! preg_match( '|^[a-zA-Z]{1,20}$|', $data['@type'] ) ) {
|
189 |
+
return;
|
190 |
}
|
191 |
|
192 |
+
if ( 'ImageObject' === $data['@type'] ) {
|
193 |
if ( ! $this->maybe_image_added( $data['contentUrl'] ) ) {
|
194 |
+
$this->image_data[] = $data;
|
195 |
}
|
196 |
}
|
197 |
|
198 |
+
if ( 'Product' === $data['@type'] ) {
|
199 |
if ( ! $this->maybe_product_added( $data['@id'] ) ) {
|
200 |
+
$this->product_data[] = $data;
|
201 |
}
|
202 |
}
|
203 |
|
204 |
+
if ( 'BlogPosting' === $data['@type'] ) {
|
205 |
if ( ! $this->maybe_post_added( $data['mainEntityOfPage']['@id'] ) ) {
|
206 |
+
$this->post_data[] = $data;
|
207 |
}
|
208 |
}
|
|
|
|
|
209 |
}
|
210 |
|
211 |
/**
|
212 |
* Check if image is already added to list
|
213 |
*
|
214 |
+
* @param string|null $image_id The image id.
|
215 |
*
|
216 |
* @return boolean
|
217 |
*/
|
218 |
+
private function maybe_image_added( string $image_id ): bool {
|
219 |
$image_data = $this->get_image_data();
|
220 |
if ( count( $image_data ) > 0 ) {
|
221 |
+
$image_data = array_map(
|
222 |
+
function ( $data ) {
|
223 |
+
return $data['contentUrl'];
|
224 |
+
},
|
225 |
+
$image_data
|
226 |
+
);
|
227 |
|
228 |
+
return in_array( $image_id, $image_data, true );
|
229 |
}
|
230 |
|
231 |
return false;
|
234 |
/**
|
235 |
* Check if product is already added to list
|
236 |
*
|
237 |
+
* @param string $product_id The product id.
|
238 |
*
|
239 |
* @return boolean
|
240 |
*/
|
241 |
+
private function maybe_product_added( string $product_id ): bool {
|
242 |
$product_data = $this->get_product_data();
|
243 |
if ( count( $product_data ) > 0 ) {
|
244 |
+
$product_data = array_map(
|
245 |
+
function ( $data ) {
|
246 |
+
return $data['@id'];
|
247 |
+
},
|
248 |
+
$product_data
|
249 |
+
);
|
250 |
|
251 |
+
return in_array( $product_id, $product_data, true );
|
252 |
}
|
253 |
|
254 |
return false;
|
257 |
/**
|
258 |
* Check if post is already added to list
|
259 |
*
|
260 |
+
* @param string $post_id The post id.
|
261 |
*
|
262 |
* @return boolean
|
263 |
*/
|
264 |
+
private function maybe_post_added( string $post_id ): bool {
|
265 |
$post_data = $this->get_post_data();
|
266 |
if ( count( $post_data ) > 0 ) {
|
267 |
+
$post_data = array_map(
|
268 |
+
function ( $data ) {
|
269 |
+
return $data['mainEntityOfPage']['@id'];
|
270 |
+
},
|
271 |
+
$post_data
|
272 |
+
);
|
273 |
|
274 |
+
return in_array( $post_id, $post_data, true );
|
275 |
}
|
276 |
|
277 |
return false;
|
282 |
*
|
283 |
* Hooked into `carousel_slider_post_loop` action hook.
|
284 |
*
|
285 |
+
* @param WP_Post|mixed $post The WP_Post object.
|
286 |
*/
|
287 |
+
public function generate_post_data( $post ) {
|
288 |
+
if ( ! $post instanceof WP_Post ) {
|
289 |
return;
|
290 |
}
|
291 |
|
298 |
'@id' => get_the_permalink(),
|
299 |
);
|
300 |
|
|
|
301 |
$json['publisher'] = array(
|
302 |
'@type' => 'organization',
|
303 |
'name' => get_bloginfo( 'name' ),
|
323 |
$json['headline'] = $json['name'];
|
324 |
$json['description'] = get_the_excerpt();
|
325 |
|
326 |
+
$this->set_data( apply_filters( 'carousel_slider_structured_data_post', $json, $post ) );
|
|
|
327 |
}
|
328 |
|
329 |
/**
|
330 |
* Generates Product structured data.
|
331 |
*
|
332 |
+
* @param WC_Product|mixed $product Product data (default: null).
|
|
|
|
|
|
|
333 |
*/
|
334 |
+
public function generate_product_data( $product ) {
|
335 |
if ( ! $product instanceof WC_Product ) {
|
336 |
return;
|
337 |
}
|
338 |
|
339 |
+
$name = $product->get_name();
|
340 |
+
$permalink = get_permalink( $product->get_id() );
|
|
|
|
|
|
|
|
|
|
|
341 |
|
342 |
$markup['@type'] = 'Product';
|
343 |
$markup['@id'] = $permalink;
|
includes/Helper.php
ADDED
@@ -0,0 +1,253 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace CarouselSlider;
|
4 |
+
|
5 |
+
use CarouselSlider\Interfaces\SliderViewInterface;
|
6 |
+
use WP_Error;
|
7 |
+
use WP_Post;
|
8 |
+
|
9 |
+
defined( 'ABSPATH' ) || exit;
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Helper class
|
13 |
+
*/
|
14 |
+
class Helper extends ViewHelper {
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Get sliders
|
18 |
+
*
|
19 |
+
* @param array $args Optional arguments.
|
20 |
+
*
|
21 |
+
* @return WP_Post[]|int[] Array of post objects or post IDs.
|
22 |
+
*/
|
23 |
+
public static function get_sliders( array $args = [] ): array {
|
24 |
+
$args = wp_parse_args(
|
25 |
+
$args,
|
26 |
+
[
|
27 |
+
'post_status' => 'publish',
|
28 |
+
'posts_per_page' => - 1,
|
29 |
+
'orderby' => 'date',
|
30 |
+
'order' => 'DESC',
|
31 |
+
]
|
32 |
+
);
|
33 |
+
|
34 |
+
$args['post_type'] = CAROUSEL_SLIDER_POST_TYPE;
|
35 |
+
|
36 |
+
return get_posts( $args );
|
37 |
+
}
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Get setting
|
41 |
+
*
|
42 |
+
* @param string $key The setting key.
|
43 |
+
* @param mixed $default Setting default value.
|
44 |
+
*
|
45 |
+
* @return mixed|null
|
46 |
+
*/
|
47 |
+
public static function get_setting( string $key, $default = null ) {
|
48 |
+
$default_options = [
|
49 |
+
'load_scripts' => 'optimized',
|
50 |
+
'show_structured_data' => '1',
|
51 |
+
'woocommerce_shop_loop_item_template' => 'v1-compatibility',
|
52 |
+
];
|
53 |
+
$settings = (array) get_option( 'carousel_slider_settings' );
|
54 |
+
$settings = wp_parse_args( $settings, $default_options );
|
55 |
+
|
56 |
+
return $settings[ $key ] ?? $default;
|
57 |
+
}
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Get carousel slider available slide type
|
61 |
+
*
|
62 |
+
* @return array
|
63 |
+
*/
|
64 |
+
public static function get_slide_types(): array {
|
65 |
+
return apply_filters(
|
66 |
+
'carousel_slider_slide_type',
|
67 |
+
[
|
68 |
+
'image-carousel' => __( 'Image Carousel', 'carousel-slider' ),
|
69 |
+
'image-carousel-url' => __( 'Image Carousel (URL)', 'carousel-slider' ),
|
70 |
+
'post-carousel' => __( 'Post Carousel', 'carousel-slider' ),
|
71 |
+
'product-carousel' => __( 'Product Carousel', 'carousel-slider' ),
|
72 |
+
'video-carousel' => __( 'Video Carousel', 'carousel-slider' ),
|
73 |
+
'hero-banner-slider' => __( 'Hero Carousel', 'carousel-slider' ),
|
74 |
+
]
|
75 |
+
);
|
76 |
+
}
|
77 |
+
|
78 |
+
/**
|
79 |
+
* Get slider view
|
80 |
+
*
|
81 |
+
* @param string $key The slider type slug.
|
82 |
+
*
|
83 |
+
* @return false|SliderViewInterface
|
84 |
+
*/
|
85 |
+
public static function get_slider_view( string $key ) {
|
86 |
+
$views = apply_filters( 'carousel_slider/register_view', [] );
|
87 |
+
|
88 |
+
return $views[ $key ] ?? false;
|
89 |
+
}
|
90 |
+
|
91 |
+
/**
|
92 |
+
* Get default settings
|
93 |
+
*
|
94 |
+
* @return array
|
95 |
+
*/
|
96 |
+
public static function get_default_settings(): array {
|
97 |
+
return apply_filters(
|
98 |
+
'carousel_slider_default_settings',
|
99 |
+
[
|
100 |
+
'product_title_color' => '#323232',
|
101 |
+
'product_button_bg_color' => '#00d1b2',
|
102 |
+
'product_button_text_color' => '#f1f1f1',
|
103 |
+
'nav_color' => '#f1f1f1',
|
104 |
+
'nav_active_color' => '#00d1b2',
|
105 |
+
'margin_right' => 10,
|
106 |
+
'lazy_load_image' => 'off',
|
107 |
+
]
|
108 |
+
);
|
109 |
+
}
|
110 |
+
|
111 |
+
/**
|
112 |
+
* Get default setting
|
113 |
+
*
|
114 |
+
* @param string $key The setting key.
|
115 |
+
* @param mixed $default Default value.
|
116 |
+
*
|
117 |
+
* @return mixed|null
|
118 |
+
*/
|
119 |
+
public static function get_default_setting( string $key, $default = null ) {
|
120 |
+
$settings = self::get_default_settings();
|
121 |
+
|
122 |
+
return $settings[ $key ] ?? $default;
|
123 |
+
}
|
124 |
+
|
125 |
+
/**
|
126 |
+
* Get available image sizes
|
127 |
+
*
|
128 |
+
* @return array
|
129 |
+
*/
|
130 |
+
public static function get_available_image_sizes(): array {
|
131 |
+
global $_wp_additional_image_sizes;
|
132 |
+
|
133 |
+
$sizes = [];
|
134 |
+
foreach ( get_intermediate_image_sizes() as $_size ) {
|
135 |
+
if ( in_array( $_size, [ 'thumbnail', 'medium', 'medium_large', 'large' ], true ) ) {
|
136 |
+
|
137 |
+
$width = get_option( "{$_size}_size_w" );
|
138 |
+
$height = get_option( "{$_size}_size_h" );
|
139 |
+
$crop = get_option( "{$_size}_crop" ) ? 'hard' : 'soft';
|
140 |
+
|
141 |
+
$sizes[ $_size ] = sprintf( '%s - %s:%sx%s', $_size, $crop, $width, $height );
|
142 |
+
|
143 |
+
} elseif ( isset( $_wp_additional_image_sizes[ $_size ] ) ) {
|
144 |
+
|
145 |
+
$width = $_wp_additional_image_sizes[ $_size ]['width'];
|
146 |
+
$height = $_wp_additional_image_sizes[ $_size ]['height'];
|
147 |
+
$crop = $_wp_additional_image_sizes[ $_size ]['crop'] ? 'hard' : 'soft';
|
148 |
+
|
149 |
+
$sizes[ $_size ] = sprintf( '%s - %s:%sx%s', $_size, $crop, $width, $height );
|
150 |
+
}
|
151 |
+
}
|
152 |
+
|
153 |
+
return array_merge( $sizes, [ 'full' => 'original uploaded image' ] );
|
154 |
+
}
|
155 |
+
|
156 |
+
/**
|
157 |
+
* Check if WooCommerce is active
|
158 |
+
*
|
159 |
+
* @return bool
|
160 |
+
*/
|
161 |
+
public static function is_woocommerce_active(): bool {
|
162 |
+
return in_array( 'woocommerce/woocommerce.php', get_option( 'active_plugins' ), true ) ||
|
163 |
+
defined( 'WC_VERSION' ) ||
|
164 |
+
defined( 'WOOCOMMERCE_VERSION' );
|
165 |
+
}
|
166 |
+
|
167 |
+
/**
|
168 |
+
* Creates Carousel Slider test page
|
169 |
+
*
|
170 |
+
* @param array $ids The sliders ids.
|
171 |
+
*
|
172 |
+
* @return int|WP_Error
|
173 |
+
*/
|
174 |
+
public static function create_test_page( array $ids = [] ) {
|
175 |
+
$page_path = 'carousel-slider-test';
|
176 |
+
$page_title = __( 'Carousel Slider Test', 'carousel-slider' );
|
177 |
+
$page_content = '';
|
178 |
+
|
179 |
+
if ( empty( $ids ) ) {
|
180 |
+
$ids = self::get_sliders();
|
181 |
+
}
|
182 |
+
|
183 |
+
foreach ( $ids as $id ) {
|
184 |
+
$_post = get_post( $id );
|
185 |
+
$page_content .= '<!-- wp:heading {"level":4} --><h4>' . $_post->post_title . '</h4><!-- /wp:heading -->';
|
186 |
+
$page_content .= '<!-- wp:carousel-slider/slider {"sliderID":' . $id . ',"sliderName":"' . $_post->post_title . ' ( ID: ' . $id . ' )"} -->';
|
187 |
+
$page_content .= '<div class="wp-block-carousel-slider-slider">[carousel_slide id=\'' . $id . '\']</div>';
|
188 |
+
$page_content .= '<!-- /wp:carousel-slider/slider -->';
|
189 |
+
$page_content .= '<!-- wp:spacer {"height":100} --><div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div><!-- /wp:spacer -->';
|
190 |
+
}
|
191 |
+
|
192 |
+
// Check that the page doesn't exist already.
|
193 |
+
$_page = get_page_by_path( $page_path );
|
194 |
+
$page_data = [
|
195 |
+
'post_content' => $page_content,
|
196 |
+
'post_name' => $page_path,
|
197 |
+
'post_title' => $page_title,
|
198 |
+
'post_status' => 'publish',
|
199 |
+
'post_type' => 'page',
|
200 |
+
'ping_status' => 'closed',
|
201 |
+
'comment_status' => 'closed',
|
202 |
+
];
|
203 |
+
|
204 |
+
if ( $_page instanceof WP_Post ) {
|
205 |
+
$page_data['ID'] = $_page->ID;
|
206 |
+
|
207 |
+
return wp_update_post( $page_data );
|
208 |
+
}
|
209 |
+
|
210 |
+
return wp_insert_post( $page_data );
|
211 |
+
}
|
212 |
+
|
213 |
+
/**
|
214 |
+
* What type of request is this?
|
215 |
+
*
|
216 |
+
* @param string $type admin, ajax, rest, cron or frontend.
|
217 |
+
*
|
218 |
+
* @return bool
|
219 |
+
*/
|
220 |
+
public static function is_request( string $type ): bool {
|
221 |
+
switch ( $type ) {
|
222 |
+
case 'admin':
|
223 |
+
return is_admin();
|
224 |
+
case 'ajax':
|
225 |
+
return defined( 'DOING_AJAX' );
|
226 |
+
case 'rest':
|
227 |
+
return defined( 'REST_REQUEST' );
|
228 |
+
case 'cron':
|
229 |
+
return defined( 'DOING_CRON' );
|
230 |
+
case 'frontend':
|
231 |
+
return ( ! is_admin() || defined( 'DOING_AJAX' ) ) && ! defined( 'DOING_CRON' );
|
232 |
+
}
|
233 |
+
|
234 |
+
return false;
|
235 |
+
}
|
236 |
+
|
237 |
+
/**
|
238 |
+
* Get preview link
|
239 |
+
*
|
240 |
+
* @param WP_Post $post The WP_Post object.
|
241 |
+
*
|
242 |
+
* @return string
|
243 |
+
*/
|
244 |
+
public static function get_preview_link( WP_Post $post ): string {
|
245 |
+
$args = [
|
246 |
+
'carousel_slider_preview' => true,
|
247 |
+
'carousel_slider_iframe' => true,
|
248 |
+
'slider_id' => $post->ID,
|
249 |
+
];
|
250 |
+
|
251 |
+
return add_query_arg( $args, site_url( '/' ) );
|
252 |
+
}
|
253 |
+
}
|
includes/Integration/DiviBuilder/DiviBuilderModule.php
ADDED
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace CarouselSlider\Integration\DiviBuilder;
|
4 |
+
|
5 |
+
use ET_Builder_Module;
|
6 |
+
|
7 |
+
defined( 'ABSPATH' ) || exit;
|
8 |
+
|
9 |
+
/**
|
10 |
+
* DiviBuilderModule class
|
11 |
+
*/
|
12 |
+
class DiviBuilderModule {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* The instance of the class
|
16 |
+
*
|
17 |
+
* @var self
|
18 |
+
*/
|
19 |
+
private static $instance = null;
|
20 |
+
|
21 |
+
/**
|
22 |
+
* The instance of the class
|
23 |
+
*
|
24 |
+
* @return self
|
25 |
+
*/
|
26 |
+
public static function init() {
|
27 |
+
if ( is_null( self::$instance ) ) {
|
28 |
+
self::$instance = new self();
|
29 |
+
|
30 |
+
add_action( 'carousel_slider/activation', [ self::$instance, 'activation' ] );
|
31 |
+
add_action( 'wp_enqueue_scripts', [ self::$instance, 'load_scripts' ] );
|
32 |
+
add_action( 'et_builder_ready', [ self::$instance, 'load_modules' ] );
|
33 |
+
}
|
34 |
+
|
35 |
+
return self::$instance;
|
36 |
+
}
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Force the legacy backend builder to reload its template cache.
|
40 |
+
* This ensures that custom modules are available for use right away.
|
41 |
+
*/
|
42 |
+
public function activation() {
|
43 |
+
if ( function_exists( 'et_pb_force_regenerate_templates' ) ) {
|
44 |
+
et_pb_force_regenerate_templates();
|
45 |
+
}
|
46 |
+
}
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Load module script
|
50 |
+
*/
|
51 |
+
public function load_scripts() {
|
52 |
+
if ( empty( $_GET['et_fb'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
53 |
+
return;
|
54 |
+
}
|
55 |
+
wp_enqueue_style( 'carousel-slider-divi-modules', CAROUSEL_SLIDER_ASSETS . '/css/divi-modules.css', [], CAROUSEL_SLIDER_VERSION );
|
56 |
+
wp_enqueue_script(
|
57 |
+
'carousel-slider-divi-modules',
|
58 |
+
CAROUSEL_SLIDER_ASSETS . '/js/divi-modules.js',
|
59 |
+
[ 'react', 'react-dom' ],
|
60 |
+
CAROUSEL_SLIDER_VERSION,
|
61 |
+
true
|
62 |
+
);
|
63 |
+
wp_localize_script( 'carousel-slider-divi-modules', 'csDivi', [ 'site_url' => site_url() ] );
|
64 |
+
}
|
65 |
+
|
66 |
+
/**
|
67 |
+
* Load modules
|
68 |
+
*/
|
69 |
+
public function load_modules() {
|
70 |
+
if ( ! self::should_load_modules() ) {
|
71 |
+
return;
|
72 |
+
}
|
73 |
+
new Module();
|
74 |
+
}
|
75 |
+
|
76 |
+
/**
|
77 |
+
* Check if we should load modules
|
78 |
+
*
|
79 |
+
* @return bool
|
80 |
+
*/
|
81 |
+
public static function should_load_modules(): bool {
|
82 |
+
return class_exists( ET_Builder_Module::class );
|
83 |
+
}
|
84 |
+
}
|
includes/Integration/DiviBuilder/Module.php
ADDED
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace CarouselSlider\Integration\DiviBuilder;
|
4 |
+
|
5 |
+
use CarouselSlider\Frontend\Frontend;
|
6 |
+
use CarouselSlider\Helper;
|
7 |
+
use ET_Builder_Module;
|
8 |
+
|
9 |
+
defined( 'ABSPATH' ) || exit;
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Module class
|
13 |
+
*/
|
14 |
+
class Module extends ET_Builder_Module {
|
15 |
+
/**
|
16 |
+
* Module slug
|
17 |
+
*
|
18 |
+
* @var string
|
19 |
+
*/
|
20 |
+
public $slug = 'carousel_slider_divi_module';
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Enable support visual builder
|
24 |
+
*
|
25 |
+
* @var string
|
26 |
+
*/
|
27 |
+
public $vb_support = 'on';
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Credits of our custom modules.
|
31 |
+
*
|
32 |
+
* @var string[]
|
33 |
+
*/
|
34 |
+
protected $module_credits = [
|
35 |
+
'module_uri' => 'https://wordpress.org/plugins/carousel-slider',
|
36 |
+
'author' => 'Sayful Islam',
|
37 |
+
'author_uri' => 'https://sayfulislam.com',
|
38 |
+
];
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Init module
|
42 |
+
*
|
43 |
+
* @return void
|
44 |
+
*/
|
45 |
+
public function init() {
|
46 |
+
$this->name = esc_html__( 'Carousel Slider', 'carousel-slider' );
|
47 |
+
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Get the settings fields data for this element.
|
51 |
+
*
|
52 |
+
* @inheritDoc
|
53 |
+
*/
|
54 |
+
public function get_fields(): array {
|
55 |
+
$posts = Helper::get_sliders();
|
56 |
+
$options = [];
|
57 |
+
foreach ( $posts as $post ) {
|
58 |
+
$options[ $post->ID ] = $post->post_title;
|
59 |
+
}
|
60 |
+
|
61 |
+
return [
|
62 |
+
'slider_id' => [
|
63 |
+
'label' => esc_html__( 'Slider', 'carousel-slider' ),
|
64 |
+
'description' => esc_html__( 'Select a slider.', 'carousel-slider' ),
|
65 |
+
'type' => 'select',
|
66 |
+
'option_category' => 'basic_option',
|
67 |
+
'options' => $options,
|
68 |
+
],
|
69 |
+
'site_url' => [
|
70 |
+
'type' => 'hidden',
|
71 |
+
'value' => site_url(),
|
72 |
+
],
|
73 |
+
];
|
74 |
+
}
|
75 |
+
|
76 |
+
/**
|
77 |
+
* Generates the module's HTML output based on {@see self::$props}. This method should be
|
78 |
+
* overridden in module classes.
|
79 |
+
*
|
80 |
+
* @param array $unprocessed_props List of unprocessed attributes.
|
81 |
+
* @param string $content Content being processed.
|
82 |
+
* @param string $render_slug Slug of module that is used for rendering output.
|
83 |
+
*
|
84 |
+
* @return string The module's HTML output.
|
85 |
+
*/
|
86 |
+
public function render( $unprocessed_props, $content = null, $render_slug ) {
|
87 |
+
$slider_id = intval( $this->props['slider_id'] );
|
88 |
+
|
89 |
+
return Frontend::init()->carousel_slide( [ 'id' => $slider_id ] );
|
90 |
+
}
|
91 |
+
}
|
includes/Integration/Elementor/ElementorExtension.php
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace CarouselSlider\Integration\Elementor;
|
4 |
+
|
5 |
+
use CarouselSlider\Assets;
|
6 |
+
use Elementor\Plugin;
|
7 |
+
|
8 |
+
defined( 'ABSPATH' ) || exit;
|
9 |
+
|
10 |
+
/**
|
11 |
+
* ElementorExtension class
|
12 |
+
*/
|
13 |
+
class ElementorExtension {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* The instance of the class.
|
17 |
+
*
|
18 |
+
* @var self
|
19 |
+
*/
|
20 |
+
private static $instance = null;
|
21 |
+
|
22 |
+
/**
|
23 |
+
* The instance of the class
|
24 |
+
*
|
25 |
+
* @return ElementorExtension|null
|
26 |
+
*/
|
27 |
+
public static function init() {
|
28 |
+
if ( is_null( self::$instance ) ) {
|
29 |
+
self::$instance = new self();
|
30 |
+
|
31 |
+
add_action( 'elementor/frontend/after_register_scripts', [ self::$instance, 'widget_scripts' ] );
|
32 |
+
add_action( 'elementor/widgets/widgets_registered', [ self::$instance, 'register_widgets' ] );
|
33 |
+
}
|
34 |
+
|
35 |
+
return self::$instance;
|
36 |
+
}
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Widget scrips
|
40 |
+
*/
|
41 |
+
public function widget_scripts() {
|
42 |
+
wp_register_script(
|
43 |
+
'carousel-slider-elementor',
|
44 |
+
Assets::get_assets_url( 'js/frontend.js' ),
|
45 |
+
[ 'elementor-frontend', 'jquery' ],
|
46 |
+
'1.0.0',
|
47 |
+
true
|
48 |
+
);
|
49 |
+
wp_register_style(
|
50 |
+
'carousel-slider-elementor',
|
51 |
+
Assets::get_assets_url( 'css/frontend.css' ),
|
52 |
+
[],
|
53 |
+
CAROUSEL_SLIDER_VERSION
|
54 |
+
);
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Register Elementor widgets
|
59 |
+
*/
|
60 |
+
public function register_widgets() {
|
61 |
+
Plugin::instance()->widgets_manager->register_widget_type( new ElementorWidget() );
|
62 |
+
}
|
63 |
+
}
|
includes/Integration/Elementor/ElementorWidget.php
ADDED
@@ -0,0 +1,163 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace CarouselSlider\Integration\Elementor;
|
4 |
+
|
5 |
+
use CarouselSlider\Frontend\Frontend;
|
6 |
+
use CarouselSlider\Helper;
|
7 |
+
use Elementor\Controls_Manager;
|
8 |
+
use Elementor\Widget_Base;
|
9 |
+
|
10 |
+
defined( 'ABSPATH' ) || exit;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* ElementorWidget class
|
14 |
+
*/
|
15 |
+
class ElementorWidget extends Widget_Base {
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Get element name.
|
19 |
+
*
|
20 |
+
* @inheritDoc
|
21 |
+
*/
|
22 |
+
public function get_name(): string {
|
23 |
+
return 'carousel-slider-elementor';
|
24 |
+
}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Get element title.
|
28 |
+
*
|
29 |
+
* @inheritDoc
|
30 |
+
*/
|
31 |
+
public function get_title(): string {
|
32 |
+
return esc_html__( 'Carousel Slider - Elementor', 'carousel-slider' );
|
33 |
+
}
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Get widget icon.
|
37 |
+
*
|
38 |
+
* @inheritDoc
|
39 |
+
*/
|
40 |
+
public function get_icon(): string {
|
41 |
+
return 'eicon-carousel';
|
42 |
+
}
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Get script dependencies.
|
46 |
+
*
|
47 |
+
* @inheritDoc
|
48 |
+
*/
|
49 |
+
public function get_script_depends(): array {
|
50 |
+
return [ 'carousel-slider-frontend' ];
|
51 |
+
}
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Get style dependencies.
|
55 |
+
*
|
56 |
+
* @inheritDoc
|
57 |
+
*/
|
58 |
+
public function get_style_depends(): array {
|
59 |
+
return [ 'carousel-slider-frontend' ];
|
60 |
+
}
|
61 |
+
|
62 |
+
/**
|
63 |
+
* Get widget keywords.
|
64 |
+
*
|
65 |
+
* @inheritDoc
|
66 |
+
*/
|
67 |
+
public function get_keywords(): array {
|
68 |
+
return [ 'image', 'photo', 'carousel', 'slider' ];
|
69 |
+
}
|
70 |
+
|
71 |
+
/**
|
72 |
+
* Register controls.
|
73 |
+
*
|
74 |
+
* @inheritDoc
|
75 |
+
*/
|
76 |
+
protected function register_controls() {
|
77 |
+
$posts = Helper::get_sliders();
|
78 |
+
$options = [];
|
79 |
+
foreach ( $posts as $post ) {
|
80 |
+
$options[ $post->ID ] = $post->post_title;
|
81 |
+
}
|
82 |
+
|
83 |
+
$this->start_controls_section(
|
84 |
+
'content_section',
|
85 |
+
[
|
86 |
+
'label' => __( 'Slider Settings', 'carousel-slider' ),
|
87 |
+
'tab' => Controls_Manager::TAB_CONTENT,
|
88 |
+
]
|
89 |
+
);
|
90 |
+
|
91 |
+
$this->add_control(
|
92 |
+
'slider_id',
|
93 |
+
[
|
94 |
+
'label' => __( 'Choose slider', 'carousel-slider' ),
|
95 |
+
'type' => Controls_Manager::SELECT,
|
96 |
+
'input_type' => 'url',
|
97 |
+
'options' => $options,
|
98 |
+
]
|
99 |
+
);
|
100 |
+
|
101 |
+
$this->add_control(
|
102 |
+
'site_url',
|
103 |
+
[
|
104 |
+
'type' => Controls_Manager::HIDDEN,
|
105 |
+
'input_type' => 'hidden',
|
106 |
+
'value' => site_url(),
|
107 |
+
]
|
108 |
+
);
|
109 |
+
|
110 |
+
$this->end_controls_section();
|
111 |
+
}
|
112 |
+
|
113 |
+
/**
|
114 |
+
* Render element output in the editor.
|
115 |
+
*
|
116 |
+
* @inheritDoc
|
117 |
+
*/
|
118 |
+
public function content_template() {
|
119 |
+
?>
|
120 |
+
<div class="carousel-slider-iframe-container">
|
121 |
+
<div class="carousel-slider-iframe-overlay"></div>
|
122 |
+
<iframe class="carousel-slider-iframe"
|
123 |
+
src="{{settings.site_url}}?carousel_slider_preview=1&carousel_slider_iframe=1&slider_id={{settings.slider_id}}"
|
124 |
+
height="0" width="500"></iframe>
|
125 |
+
</div>
|
126 |
+
<?php
|
127 |
+
}
|
128 |
+
|
129 |
+
/**
|
130 |
+
* Render element.
|
131 |
+
*
|
132 |
+
* @inheritDoc
|
133 |
+
*/
|
134 |
+
protected function render() {
|
135 |
+
$settings = $this->get_settings_for_display();
|
136 |
+
$slider_id = intval( $settings['slider_id'] );
|
137 |
+
|
138 |
+
if ( 'elementor' === ( $_GET['action'] ?? '' ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
139 |
+
$args = add_query_arg(
|
140 |
+
[
|
141 |
+
'carousel_slider_preview' => true,
|
142 |
+
'carousel_slider_iframe' => true,
|
143 |
+
'slider_id' => $slider_id,
|
144 |
+
],
|
145 |
+
site_url()
|
146 |
+
);
|
147 |
+
|
148 |
+
$html = '<div class="carousel-slider-iframe-container">';
|
149 |
+
$html .= '<div class="carousel-slider-iframe-overlay"></div>';
|
150 |
+
$html .= '<iframe class="carousel-slider-iframe" src="' . $args . '" height="0" width="500"></iframe>';
|
151 |
+
$html .= '</div>';
|
152 |
+
echo wp_kses_post( $html );
|
153 |
+
|
154 |
+
return;
|
155 |
+
}
|
156 |
+
|
157 |
+
$html = '<div class="carousel-slider-elementor-widget">';
|
158 |
+
$html .= Frontend::init()->carousel_slide( [ 'id' => $slider_id ] );
|
159 |
+
$html .= '</div>';
|
160 |
+
|
161 |
+
echo wp_kses_post( $html );
|
162 |
+
}
|
163 |
+
}
|
includes/Integration/VisualComposer/Element.php
ADDED
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace CarouselSlider\Integration\VisualComposer;
|
4 |
+
|
5 |
+
defined( 'ABSPATH' ) || exit;
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Element class
|
9 |
+
*/
|
10 |
+
class Element {
|
11 |
+
/**
|
12 |
+
* The instance of the class
|
13 |
+
*
|
14 |
+
* @var self
|
15 |
+
*/
|
16 |
+
private static $instance = null;
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Ensures only one instance of this class is loaded or can be loaded.
|
20 |
+
*
|
21 |
+
* @return self
|
22 |
+
*/
|
23 |
+
public static function init() {
|
24 |
+
if ( is_null( self::$instance ) ) {
|
25 |
+
self::$instance = new self();
|
26 |
+
|
27 |
+
add_action( 'init', array( self::$instance, 'integrate_with_vc' ) );
|
28 |
+
}
|
29 |
+
|
30 |
+
return self::$instance;
|
31 |
+
}
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Integrate with visual composer
|
35 |
+
*/
|
36 |
+
public function integrate_with_vc() {
|
37 |
+
// Check if Visual Composer is installed.
|
38 |
+
if ( ! function_exists( 'vc_map' ) ) {
|
39 |
+
return;
|
40 |
+
}
|
41 |
+
|
42 |
+
vc_map(
|
43 |
+
array(
|
44 |
+
'name' => __( 'Carousel Slider', 'carousel-slider' ),
|
45 |
+
'description' => __( 'Place Carousel Slider.', 'carousel-slider' ),
|
46 |
+
'base' => 'carousel_slide',
|
47 |
+
'controls' => 'full',
|
48 |
+
'icon' => CAROUSEL_SLIDER_ASSETS . '/static-images/logo.svg',
|
49 |
+
'category' => __( 'Content', 'carousel-slider' ),
|
50 |
+
'params' => array(
|
51 |
+
array(
|
52 |
+
'type' => 'dropdown',
|
53 |
+
'holder' => 'div',
|
54 |
+
'class' => 'carousel-slider-id',
|
55 |
+
'param_name' => 'id',
|
56 |
+
'value' => $this->carousels_list(),
|
57 |
+
'heading' => __( 'Choose Carousel Slide', 'carousel-slider' ),
|
58 |
+
),
|
59 |
+
),
|
60 |
+
)
|
61 |
+
);
|
62 |
+
}
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Generate array for carousel slider
|
66 |
+
*
|
67 |
+
* @return array
|
68 |
+
*/
|
69 |
+
private function carousels_list(): array {
|
70 |
+
$carousels = get_posts(
|
71 |
+
[
|
72 |
+
'post_type' => 'carousels',
|
73 |
+
'post_status' => 'publish',
|
74 |
+
'posts_per_page' => - 1,
|
75 |
+
]
|
76 |
+
);
|
77 |
+
|
78 |
+
$result = [];
|
79 |
+
|
80 |
+
if ( count( $carousels ) ) {
|
81 |
+
foreach ( $carousels as $carousel ) {
|
82 |
+
$result[ esc_html( $carousel->post_title ) ] = $carousel->ID;
|
83 |
+
}
|
84 |
+
}
|
85 |
+
|
86 |
+
return $result;
|
87 |
+
}
|
88 |
+
}
|
includes/Interfaces/FieldInterface.php
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace CarouselSlider\Interfaces;
|
4 |
+
|
5 |
+
interface FieldInterface {
|
6 |
+
/**
|
7 |
+
* Set settings
|
8 |
+
*
|
9 |
+
* @param array $settings The settings array.
|
10 |
+
*
|
11 |
+
* @return mixed
|
12 |
+
*/
|
13 |
+
public function set_settings( array $settings );
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Set field name
|
17 |
+
*
|
18 |
+
* @param string $name the field name.
|
19 |
+
*
|
20 |
+
* @return mixed
|
21 |
+
*/
|
22 |
+
public function set_name( string $name );
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Set field value
|
26 |
+
*
|
27 |
+
* @param mixed $value The field value.
|
28 |
+
*
|
29 |
+
* @return mixed
|
30 |
+
*/
|
31 |
+
public function set_value( $value );
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Render field html
|
35 |
+
*
|
36 |
+
* @return string
|
37 |
+
*/
|
38 |
+
public function render(): string;
|
39 |
+
}
|
includes/Interfaces/FormBuilderInterface.php
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace CarouselSlider\Interfaces;
|
4 |
+
|
5 |
+
interface FormBuilderInterface {
|
6 |
+
/**
|
7 |
+
* Set fields settings
|
8 |
+
*
|
9 |
+
* @param array $settings The setting array.
|
10 |
+
*/
|
11 |
+
public function set_fields_settings( array $settings );
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Set option name
|
15 |
+
*
|
16 |
+
* @param string $option_name The option name.
|
17 |
+
*/
|
18 |
+
public function set_option_name( string $option_name );
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Set values
|
22 |
+
*
|
23 |
+
* @param array $values The values.
|
24 |
+
*/
|
25 |
+
public function set_values( array $values );
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Render form
|
29 |
+
*
|
30 |
+
* @return string
|
31 |
+
*/
|
32 |
+
public function render(): string;
|
33 |
+
}
|
includes/Interfaces/SliderViewInterface.php
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace CarouselSlider\Interfaces;
|
4 |
+
|
5 |
+
defined( 'ABSPATH' ) || exit;
|
6 |
+
|
7 |
+
interface SliderViewInterface {
|
8 |
+
/**
|
9 |
+
* Set slider id
|
10 |
+
*
|
11 |
+
* @param int $slider_id The slider id.
|
12 |
+
*/
|
13 |
+
public function set_slider_id( int $slider_id );
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Set slider type
|
17 |
+
*
|
18 |
+
* @param string $slider_type The slider type.
|
19 |
+
*/
|
20 |
+
public function set_slider_type( string $slider_type );
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Render element.
|
24 |
+
* Generates the final HTML on the frontend.
|
25 |
+
*
|
26 |
+
* @return string
|
27 |
+
*/
|
28 |
+
public function render(): string;
|
29 |
+
}
|
{classes → includes}/Plugin.php
RENAMED
@@ -4,13 +4,23 @@ namespace CarouselSlider;
|
|
4 |
|
5 |
use CarouselSlider\Admin\Admin;
|
6 |
use CarouselSlider\Admin\GutenbergBlock;
|
|
|
7 |
use CarouselSlider\Admin\Setting;
|
|
|
8 |
use CarouselSlider\Frontend\Frontend;
|
9 |
use CarouselSlider\Frontend\Preview;
|
10 |
-
use CarouselSlider\Frontend\Shortcode;
|
11 |
use CarouselSlider\Frontend\StructuredData;
|
12 |
-
use CarouselSlider\Integration\
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
use CarouselSlider\Widget\CarouselSliderWidget;
|
|
|
|
|
14 |
|
15 |
defined( 'ABSPATH' ) || exit;
|
16 |
|
@@ -46,9 +56,6 @@ class Plugin {
|
|
46 |
add_action( 'plugins_loaded', [ self::$instance, 'includes' ] );
|
47 |
add_action( 'carousel_slider/activation', [ self::$instance, 'activation_includes' ] );
|
48 |
add_action( 'carousel_slider/deactivation', [ self::$instance, 'deactivation_includes' ] );
|
49 |
-
|
50 |
-
add_action( 'in_plugin_update_message-carousel-slider/carousel-slider.php',
|
51 |
-
[ self::$instance, 'in_plugin_update_message' ] );
|
52 |
}
|
53 |
|
54 |
return self::$instance;
|
@@ -60,27 +67,34 @@ class Plugin {
|
|
60 |
* @return void
|
61 |
*/
|
62 |
public function includes() {
|
63 |
-
$this->container['i18n']
|
64 |
-
$this->container['assets']
|
65 |
-
$this->container['widget']
|
66 |
-
$this->container['vc_element']
|
67 |
-
$this->container['
|
68 |
-
|
69 |
-
|
|
|
|
|
70 |
if ( $this->is_request( 'admin' ) ) {
|
71 |
$this->admin_includes();
|
72 |
}
|
73 |
|
74 |
-
// Load classes for frontend area
|
75 |
if ( $this->is_request( 'frontend' ) ) {
|
76 |
$this->frontend_includes();
|
77 |
}
|
78 |
|
79 |
-
// Load classes for ajax functionality
|
80 |
if ( $this->is_request( 'ajax' ) ) {
|
81 |
$this->ajax_includes();
|
82 |
}
|
83 |
|
|
|
|
|
|
|
|
|
|
|
84 |
$this->modules_includes();
|
85 |
}
|
86 |
|
@@ -90,7 +104,13 @@ class Plugin {
|
|
90 |
* @return void
|
91 |
*/
|
92 |
public function modules_includes() {
|
93 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
}
|
95 |
|
96 |
/**
|
@@ -100,6 +120,7 @@ class Plugin {
|
|
100 |
*/
|
101 |
public function admin_includes() {
|
102 |
$this->container['admin'] = Admin::init();
|
|
|
103 |
$this->container['setting'] = Setting::init();
|
104 |
$this->container['gutenberg_block'] = GutenbergBlock::init();
|
105 |
}
|
@@ -150,47 +171,6 @@ class Plugin {
|
|
150 |
* @return bool
|
151 |
*/
|
152 |
private function is_request( string $type ): bool {
|
153 |
-
|
154 |
-
case 'admin' :
|
155 |
-
return is_admin();
|
156 |
-
case 'ajax' :
|
157 |
-
return defined( 'DOING_AJAX' );
|
158 |
-
case 'rest' :
|
159 |
-
return defined( 'REST_REQUEST' );
|
160 |
-
case 'cron' :
|
161 |
-
return defined( 'DOING_CRON' );
|
162 |
-
case 'frontend' :
|
163 |
-
return ( ! is_admin() || defined( 'DOING_AJAX' ) ) && ! defined( 'DOING_CRON' );
|
164 |
-
}
|
165 |
-
|
166 |
-
return false;
|
167 |
-
}
|
168 |
-
|
169 |
-
/**
|
170 |
-
* Show in plugin update message
|
171 |
-
*
|
172 |
-
* @param array $plugin_data
|
173 |
-
*/
|
174 |
-
public function in_plugin_update_message( array $plugin_data ) {
|
175 |
-
$current_version = CAROUSEL_SLIDER_VERSION;
|
176 |
-
$current_version_array = explode( '.', $current_version );
|
177 |
-
$new_version = $plugin_data['new_version'];
|
178 |
-
$new_version_array = explode( '.', $new_version );
|
179 |
-
|
180 |
-
$html = '';
|
181 |
-
if ( version_compare( $current_version_array[0], $new_version_array[0], '<' ) ) {
|
182 |
-
$html .= '</p><div class="cs_plugin_upgrade_notice extensions_warning major_update">';
|
183 |
-
$html .= '<div class="cs_plugin_upgrade_notice__title">';
|
184 |
-
$html .= sprintf( __( "<strong>%s</strong> version <strong>%s</strong> is a major update.", 'carousel-slider' ), $plugin_data['Title'], $new_version );
|
185 |
-
$html .= '</div>';
|
186 |
-
$html .= '<div class="cs_plugin_upgrade_notice__description">';
|
187 |
-
$html .= __( 'We made a lot of major changes to this version.', 'carousel-slider' ) . ' ';
|
188 |
-
$html .= __( 'We believe that all functionality will remain same after update (remember to refresh you cache plugin).', 'carousel-slider' ) . ' ';
|
189 |
-
$html .= __( 'Still make sure that you took a backup so you can role back if anything happen wrong to you.', 'carousel-slider' );
|
190 |
-
$html .= '</div>';
|
191 |
-
$html .= '</div><p class="dummy" style="display: none">';
|
192 |
-
}
|
193 |
-
|
194 |
-
echo apply_filters( 'carousel_slider/in_plugin_update_message', $html, $plugin_data );
|
195 |
}
|
196 |
}
|
4 |
|
5 |
use CarouselSlider\Admin\Admin;
|
6 |
use CarouselSlider\Admin\GutenbergBlock;
|
7 |
+
use CarouselSlider\Admin\MetaBox;
|
8 |
use CarouselSlider\Admin\Setting;
|
9 |
+
use CarouselSlider\CLI\Command;
|
10 |
use CarouselSlider\Frontend\Frontend;
|
11 |
use CarouselSlider\Frontend\Preview;
|
|
|
12 |
use CarouselSlider\Frontend\StructuredData;
|
13 |
+
use CarouselSlider\Integration\DiviBuilder\DiviBuilderModule;
|
14 |
+
use CarouselSlider\Integration\Elementor\ElementorExtension;
|
15 |
+
use CarouselSlider\Integration\VisualComposer\Element;
|
16 |
+
use CarouselSlider\Modules\HeroCarousel\Module as HeroCarouselModule;
|
17 |
+
use CarouselSlider\Modules\ImageCarousel\Module as ImageCarouselModule;
|
18 |
+
use CarouselSlider\Modules\PostCarousel\Module as PostCarouselModule;
|
19 |
+
use CarouselSlider\Modules\ProductCarousel\Module as ProductCarouselModule;
|
20 |
+
use CarouselSlider\Modules\VideoCarousel\Module as VideoCarouselModule;
|
21 |
use CarouselSlider\Widget\CarouselSliderWidget;
|
22 |
+
use WP_CLI;
|
23 |
+
use WP_CLI_Command;
|
24 |
|
25 |
defined( 'ABSPATH' ) || exit;
|
26 |
|
56 |
add_action( 'plugins_loaded', [ self::$instance, 'includes' ] );
|
57 |
add_action( 'carousel_slider/activation', [ self::$instance, 'activation_includes' ] );
|
58 |
add_action( 'carousel_slider/deactivation', [ self::$instance, 'deactivation_includes' ] );
|
|
|
|
|
|
|
59 |
}
|
60 |
|
61 |
return self::$instance;
|
67 |
* @return void
|
68 |
*/
|
69 |
public function includes() {
|
70 |
+
$this->container['i18n'] = i18n::init();
|
71 |
+
$this->container['assets'] = Assets::init();
|
72 |
+
$this->container['widget'] = CarouselSliderWidget::init();
|
73 |
+
$this->container['vc_element'] = Element::init();
|
74 |
+
$this->container['elementor_extension'] = ElementorExtension::init();
|
75 |
+
$this->container['divi_module'] = DiviBuilderModule::init();
|
76 |
+
$this->container['upgrader'] = Upgrader::init();
|
77 |
+
|
78 |
+
// Load classes for admin area.
|
79 |
if ( $this->is_request( 'admin' ) ) {
|
80 |
$this->admin_includes();
|
81 |
}
|
82 |
|
83 |
+
// Load classes for frontend area.
|
84 |
if ( $this->is_request( 'frontend' ) ) {
|
85 |
$this->frontend_includes();
|
86 |
}
|
87 |
|
88 |
+
// Load classes for ajax functionality.
|
89 |
if ( $this->is_request( 'ajax' ) ) {
|
90 |
$this->ajax_includes();
|
91 |
}
|
92 |
|
93 |
+
// WP-CLI Commands.
|
94 |
+
if ( class_exists( WP_CLI::class ) && class_exists( WP_CLI_Command::class ) ) {
|
95 |
+
WP_CLI::add_command( 'carousel-slider', Command::class );
|
96 |
+
}
|
97 |
+
|
98 |
$this->modules_includes();
|
99 |
}
|
100 |
|
104 |
* @return void
|
105 |
*/
|
106 |
public function modules_includes() {
|
107 |
+
$this->container['module_image_carousel'] = ImageCarouselModule::init();
|
108 |
+
$this->container['module_video_carousel'] = VideoCarouselModule::init();
|
109 |
+
$this->container['module_post_carousel'] = PostCarouselModule::init();
|
110 |
+
$this->container['module_hero_carousel'] = HeroCarouselModule::init();
|
111 |
+
if ( Helper::is_woocommerce_active() ) {
|
112 |
+
$this->container['module_product_carousel'] = ProductCarouselModule::init();
|
113 |
+
}
|
114 |
}
|
115 |
|
116 |
/**
|
120 |
*/
|
121 |
public function admin_includes() {
|
122 |
$this->container['admin'] = Admin::init();
|
123 |
+
$this->container['meta_box'] = MetaBox::init();
|
124 |
$this->container['setting'] = Setting::init();
|
125 |
$this->container['gutenberg_block'] = GutenbergBlock::init();
|
126 |
}
|
171 |
* @return bool
|
172 |
*/
|
173 |
private function is_request( string $type ): bool {
|
174 |
+
return Helper::is_request( $type );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
175 |
}
|
176 |
}
|
includes/Supports/FormFields/BaseField.php
ADDED
@@ -0,0 +1,265 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace CarouselSlider\Supports\FormFields;
|
4 |
+
|
5 |
+
use CarouselSlider\Interfaces\FieldInterface;
|
6 |
+
|
7 |
+
/**
|
8 |
+
* BaseField class
|
9 |
+
*/
|
10 |
+
abstract class BaseField implements FieldInterface {
|
11 |
+
/**
|
12 |
+
* Field settings
|
13 |
+
*
|
14 |
+
* @var array
|
15 |
+
*/
|
16 |
+
protected $settings = [];
|
17 |
+
|
18 |
+
/**
|
19 |
+
* The name to be used for input field name
|
20 |
+
*
|
21 |
+
* @var string
|
22 |
+
*/
|
23 |
+
protected $name;
|
24 |
+
|
25 |
+
/**
|
26 |
+
* The value of the field
|
27 |
+
*
|
28 |
+
* @var mixed
|
29 |
+
*/
|
30 |
+
protected $value;
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Render field
|
34 |
+
*
|
35 |
+
* @return string
|
36 |
+
*/
|
37 |
+
abstract public function render(): string;
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Get setting
|
41 |
+
*
|
42 |
+
* @param string $key The setting key.
|
43 |
+
* @param mixed $default The default value for the setting.
|
44 |
+
*
|
45 |
+
* @return mixed
|
46 |
+
*/
|
47 |
+
public function get_setting( string $key, $default = null ) {
|
48 |
+
return $this->settings[ $key ] ?? $default;
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Set setting
|
53 |
+
*
|
54 |
+
* @param string $key The setting key.
|
55 |
+
* @param mixed $value The value for the setting.
|
56 |
+
*/
|
57 |
+
public function set_setting( string $key, $value ) {
|
58 |
+
$this->settings[ $key ] = $value;
|
59 |
+
}
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Get settings
|
63 |
+
*
|
64 |
+
* @return array
|
65 |
+
*/
|
66 |
+
public function get_settings(): array {
|
67 |
+
return $this->settings;
|
68 |
+
}
|
69 |
+
|
70 |
+
/**
|
71 |
+
* Set Settings
|
72 |
+
*
|
73 |
+
* @param array $settings The field settings.
|
74 |
+
*/
|
75 |
+
public function set_settings( array $settings ) {
|
76 |
+
$default = [
|
77 |
+
'type' => 'text',
|
78 |
+
'id' => '',
|
79 |
+
'section' => 'default',
|
80 |
+
'label' => '',
|
81 |
+
'description' => '',
|
82 |
+
'priority' => 10,
|
83 |
+
'default' => '',
|
84 |
+
'choices' => [],
|
85 |
+
'field_class' => 'sp-input-text',
|
86 |
+
'label_class' => '',
|
87 |
+
];
|
88 |
+
$this->settings = wp_parse_args( $settings, $default );
|
89 |
+
}
|
90 |
+
|
91 |
+
/**
|
92 |
+
* Get name
|
93 |
+
*
|
94 |
+
* @return string
|
95 |
+
*/
|
96 |
+
public function get_name(): string {
|
97 |
+
return $this->name;
|
98 |
+
}
|
99 |
+
|
100 |
+
/**
|
101 |
+
* Set name
|
102 |
+
*
|
103 |
+
* @param string $name The name of the field.
|
104 |
+
*/
|
105 |
+
public function set_name( string $name ) {
|
106 |
+
$this->name = $name;
|
107 |
+
}
|
108 |
+
|
109 |
+
/**
|
110 |
+
* Get value
|
111 |
+
*
|
112 |
+
* @return mixed
|
113 |
+
*/
|
114 |
+
public function get_value() {
|
115 |
+
return $this->value;
|
116 |
+
}
|
117 |
+
|
118 |
+
/**
|
119 |
+
* Set value
|
120 |
+
*
|
121 |
+
* @param mixed $value The value of the field.
|
122 |
+
*/
|
123 |
+
public function set_value( $value ) {
|
124 |
+
$this->value = $value;
|
125 |
+
}
|
126 |
+
|
127 |
+
/**
|
128 |
+
* Generate input attribute
|
129 |
+
*
|
130 |
+
* @param bool $to_string Convert attribute to string.
|
131 |
+
*
|
132 |
+
* @return array|string
|
133 |
+
*/
|
134 |
+
protected function build_attributes( bool $to_string = true ) {
|
135 |
+
$input_type = $this->get_setting( 'type' );
|
136 |
+
$attributes = [
|
137 |
+
'id' => $this->get_setting( 'id' ),
|
138 |
+
'class' => $this->get_setting( 'field_class' ),
|
139 |
+
'name' => $this->get_name(),
|
140 |
+
'placeholder' => $this->get_setting( 'placeholder' ),
|
141 |
+
];
|
142 |
+
|
143 |
+
if ( ! in_array( $input_type, [ 'textarea', 'select' ], true ) ) {
|
144 |
+
$attributes['type'] = $input_type;
|
145 |
+
}
|
146 |
+
|
147 |
+
$this->add_extra_attributes( $attributes );
|
148 |
+
|
149 |
+
$input_attributes = (array) $this->get_setting( 'input_attributes' );
|
150 |
+
foreach ( $input_attributes as $attr_name => $attr_val ) {
|
151 |
+
$attributes[ $attr_name ] = $attr_val;
|
152 |
+
}
|
153 |
+
|
154 |
+
if ( $to_string ) {
|
155 |
+
return $this->array_to_attributes( $attributes );
|
156 |
+
}
|
157 |
+
|
158 |
+
return array_filter( $attributes );
|
159 |
+
}
|
160 |
+
|
161 |
+
/**
|
162 |
+
* Convert array to input attributes
|
163 |
+
*
|
164 |
+
* @param array $attributes The attributes list.
|
165 |
+
*
|
166 |
+
* @return string
|
167 |
+
*/
|
168 |
+
protected function array_to_attributes( array $attributes ): string {
|
169 |
+
$string = array_map(
|
170 |
+
function ( $key, $value ) {
|
171 |
+
if ( empty( $value ) && 'value' !== $key ) {
|
172 |
+
return null;
|
173 |
+
}
|
174 |
+
if ( in_array( $key, array( 'required', 'checked', 'multiple' ), true ) && $value ) {
|
175 |
+
return $key;
|
176 |
+
}
|
177 |
+
|
178 |
+
// If boolean value.
|
179 |
+
if ( is_bool( $value ) ) {
|
180 |
+
return sprintf( '%s="%s"', $key, $value ? 'true' : 'false' );
|
181 |
+
}
|
182 |
+
|
183 |
+
// If array value.
|
184 |
+
if ( is_array( $value ) ) {
|
185 |
+
return sprintf( '%s="%s"', $key, implode( ',', $value ) );
|
186 |
+
}
|
187 |
+
|
188 |
+
// If string value.
|
189 |
+
return sprintf( '%s="%s"', $key, esc_attr( $value ) );
|
190 |
+
|
191 |
+
},
|
192 |
+
array_keys( $attributes ),
|
193 |
+
array_values( $attributes )
|
194 |
+
);
|
195 |
+
|
196 |
+
return implode( ' ', array_filter( $string ) );
|
197 |
+
}
|
198 |
+
|
199 |
+
/**
|
200 |
+
* Add extra attributes
|
201 |
+
*
|
202 |
+
* @param array $attributes The attributes list.
|
203 |
+
*/
|
204 |
+
protected function add_extra_attributes( array &$attributes ) {
|
205 |
+
$input_type = $this->get_setting( 'type' );
|
206 |
+
$extra_attributes = [
|
207 |
+
[
|
208 |
+
'include_types' => [ 'textarea' ],
|
209 |
+
'attrs' => [ 'rows' => $this->get_setting( 'rows' ) ],
|
210 |
+
],
|
211 |
+
[
|
212 |
+
'include_types' => [ 'file' ],
|
213 |
+
'attrs' => [ 'accept' => $this->get_setting( 'accept' ) ],
|
214 |
+
],
|
215 |
+
[
|
216 |
+
'include_types' => [ 'number', 'date' ],
|
217 |
+
'attrs' => [
|
218 |
+
'max' => $this->get_setting( 'max' ),
|
219 |
+
'min' => $this->get_setting( 'min' ),
|
220 |
+
],
|
221 |
+
],
|
222 |
+
[
|
223 |
+
'include_types' => [ 'number' ],
|
224 |
+
'attrs' => [ 'step' => $this->get_setting( 'step' ) ],
|
225 |
+
],
|
226 |
+
[
|
227 |
+
'include_types' => [ 'email', 'file' ],
|
228 |
+
'attrs' => [ 'multiple' => $this->get_setting( 'multiple' ) ],
|
229 |
+
],
|
230 |
+
[
|
231 |
+
'include_types' => [ 'hidden' ],
|
232 |
+
'attrs' => [
|
233 |
+
'spellcheck' => 'false',
|
234 |
+
'tabindex' => '-1',
|
235 |
+
'autocomplete' => 'off',
|
236 |
+
],
|
237 |
+
],
|
238 |
+
[
|
239 |
+
'exclude_types' => [ 'textarea', 'file' ],
|
240 |
+
'attrs' => [ 'autocomplete' => $this->get_setting( 'autocomplete' ) ],
|
241 |
+
],
|
242 |
+
[
|
243 |
+
'exclude_types' => [ 'textarea', 'file', 'password', 'select' ],
|
244 |
+
'attrs' => [ 'value' => $this->get_value() ],
|
245 |
+
],
|
246 |
+
[
|
247 |
+
'exclude_types' => [ 'hidden', 'image', 'submit', 'reset', 'button' ],
|
248 |
+
'attrs' => [ 'required' => $this->get_setting( 'required' ) ],
|
249 |
+
],
|
250 |
+
];
|
251 |
+
|
252 |
+
foreach ( $extra_attributes as $attribute ) {
|
253 |
+
if ( isset( $attribute['include_types'] ) && in_array( $input_type, $attribute['include_types'], true ) ) {
|
254 |
+
foreach ( $attribute['attrs'] as $attr_key => $attr_val ) {
|
255 |
+
$attributes[ $attr_key ] = $attr_val;
|
256 |
+
}
|
257 |
+
}
|
258 |
+
if ( isset( $attribute['exclude_types'] ) && ! in_array( $input_type, $attribute['exclude_types'], true ) ) {
|
259 |
+
foreach ( $attribute['attrs'] as $attr_key => $attr_val ) {
|
260 |
+
$attributes[ $attr_key ] = $attr_val;
|
261 |
+
}
|
262 |
+
}
|
263 |
+
}
|
264 |
+
}
|
265 |
+
}
|
includes/Supports/FormFields/ButtonGroup.php
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace CarouselSlider\Supports\FormFields;
|
4 |
+
|
5 |
+
/**
|
6 |
+
* ButtonGroup class
|
7 |
+
*/
|
8 |
+
class ButtonGroup extends BaseField {
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Render field html
|
12 |
+
*
|
13 |
+
* @inheritDoc
|
14 |
+
*/
|
15 |
+
public function render(): string {
|
16 |
+
$value = $this->get_value();
|
17 |
+
$name = $this->get_name();
|
18 |
+
|
19 |
+
$html = '<div id="' . esc_attr( $this->get_setting( 'id' ) ) . '" class="buttonset">';
|
20 |
+
foreach ( $this->get_setting( 'choices' ) as $key => $title ) {
|
21 |
+
$id = sprintf( '%s-%s', $this->get_setting( 'id' ), $key );
|
22 |
+
$label_class = sprintf( 'switch-label switch-label-%s', ( $key === $value ) ? 'on' : 'off' );
|
23 |
+
$radio_attr = [
|
24 |
+
'type' => 'radio',
|
25 |
+
'name' => $name,
|
26 |
+
'id' => $id,
|
27 |
+
'class' => 'switch-input screen-reader-text',
|
28 |
+
'value' => $key,
|
29 |
+
'checked' => $key === $value,
|
30 |
+
];
|
31 |
+
$html .= '<input ' . $this->array_to_attributes( $radio_attr ) . ' />';
|
32 |
+
$html .= '<label class="' . esc_attr( $label_class ) . '" for="' . esc_attr( $id ) . '">' . esc_html( $title ) . '</label>';
|
33 |
+
}
|
34 |
+
|
35 |
+
$html .= '</div>';
|
36 |
+
|
37 |
+
return $html;
|
38 |
+
}
|
39 |
+
}
|
includes/Supports/FormFields/Checkbox.php
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace CarouselSlider\Supports\FormFields;
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Checkbox class
|
7 |
+
*/
|
8 |
+
class Checkbox extends BaseField {
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Render field html
|
12 |
+
*
|
13 |
+
* @inheritDoc
|
14 |
+
*/
|
15 |
+
public function render(): string {
|
16 |
+
$name = $this->get_name();
|
17 |
+
|
18 |
+
$attributes = array(
|
19 |
+
'type' => 'checkbox',
|
20 |
+
'id' => $this->get_setting( 'id' ),
|
21 |
+
'name' => $name,
|
22 |
+
'value' => 'on',
|
23 |
+
'checked' => 'on' === $this->get_value(),
|
24 |
+
);
|
25 |
+
|
26 |
+
$html = '<input type="hidden" name="' . $name . '" value="off">';
|
27 |
+
$html .= '<label for="' . $this->get_setting( 'id' ) . '">';
|
28 |
+
$html .= '<input ' . $this->array_to_attributes( $attributes ) . '>';
|
29 |
+
$html .= '<span>' . $this->get_setting( 'label' ) . '</span></label>';
|
30 |
+
|
31 |
+
return $html;
|
32 |
+
}
|
33 |
+
}
|
includes/Supports/FormFields/Color.php
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace CarouselSlider\Supports\FormFields;
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Color class
|
7 |
+
*/
|
8 |
+
class Color extends BaseField {
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Render field html
|
12 |
+
*
|
13 |
+
* @inheritDoc
|
14 |
+
*/
|
15 |
+
public function render(): string {
|
16 |
+
$input_attributes = (array) $this->get_setting( 'input_attributes' );
|
17 |
+
$this->set_setting( 'type', 'text' );
|
18 |
+
$this->set_setting( 'field_class', 'color-picker' );
|
19 |
+
$this->set_setting(
|
20 |
+
'input_attributes',
|
21 |
+
array_merge(
|
22 |
+
$input_attributes,
|
23 |
+
[
|
24 |
+
'data-alpha-enabled' => 'true',
|
25 |
+
'data-default-color' => $this->get_setting( 'default' ),
|
26 |
+
]
|
27 |
+
)
|
28 |
+
);
|
29 |
+
|
30 |
+
return '<br><input ' . $this->build_attributes() . ' />';
|
31 |
+
}
|
32 |
+
}
|
includes/Supports/FormFields/ImagesGallery.php
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace CarouselSlider\Supports\FormFields;
|
4 |
+
|
5 |
+
/**
|
6 |
+
* ImageGallery class
|
7 |
+
*/
|
8 |
+
class ImagesGallery extends BaseField {
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Render field html
|
12 |
+
*
|
13 |
+
* @inheritDoc
|
14 |
+
*/
|
15 |
+
public function render(): string {
|
16 |
+
global $post;
|
17 |
+
$value = wp_strip_all_tags( rtrim( $this->get_value(), ',' ) );
|
18 |
+
$html = '';
|
19 |
+
|
20 |
+
$button_attr = [
|
21 |
+
'href' => '#',
|
22 |
+
'id' => 'carousel_slider_gallery_btn',
|
23 |
+
'class' => 'button',
|
24 |
+
'data-id' => $post->ID,
|
25 |
+
'data-ids' => $value,
|
26 |
+
'data-create' => esc_html__( 'Create Gallery', 'carousel-slider' ),
|
27 |
+
'data-edit' => esc_html__( 'Edit Gallery', 'carousel-slider' ),
|
28 |
+
'data-save' => esc_html__( 'Save Gallery', 'carousel-slider' ),
|
29 |
+
'data-progress' => esc_html__( 'Saving...', 'carousel-slider' ),
|
30 |
+
'data-insert' => esc_html__( 'Insert', 'carousel-slider' ),
|
31 |
+
];
|
32 |
+
|
33 |
+
$btn_text = $value ? 'Edit Gallery' : 'Add Gallery';
|
34 |
+
|
35 |
+
$html .= '<div class="carousel_slider_images">';
|
36 |
+
$html .= '<input type="hidden" value="' . esc_attr( $value ) . '" id="_carousel_slider_images_ids" name="' . $this->get_name() . '">';
|
37 |
+
$html .= '<a ' . $this->array_to_attributes( $button_attr ) . '>' . esc_html( $btn_text ) . '</a>';
|
38 |
+
$html .= '<ul class="carousel_slider_gallery_list">';
|
39 |
+
if ( $value ) {
|
40 |
+
$thumbs = array_map( 'intval', explode( ',', $value ) );
|
41 |
+
foreach ( $thumbs as $thumb ) {
|
42 |
+
$html .= '<li>' . wp_get_attachment_image( $thumb, [ 50, 50 ] ) . '</li>';
|
43 |
+
}
|
44 |
+
}
|
45 |
+
$html .= '</ul>';
|
46 |
+
$html .= '</div>';
|
47 |
+
|
48 |
+
return $html;
|
49 |
+
}
|
50 |
+
}
|
includes/Supports/FormFields/Select.php
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace CarouselSlider\Supports\FormFields;
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Select class
|
7 |
+
*/
|
8 |
+
class Select extends BaseField {
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Render field html
|
12 |
+
*
|
13 |
+
* @inerhitDoc
|
14 |
+
*/
|
15 |
+
public function render(): string {
|
16 |
+
$is_multiple = $this->get_setting( 'multiple' );
|
17 |
+
$value = $this->get_value();
|
18 |
+
if ( $is_multiple && is_string( $value ) ) {
|
19 |
+
$value = explode( ',', wp_strip_all_tags( rtrim( $value, ',' ) ) );
|
20 |
+
}
|
21 |
+
$html = '<select ' . $this->build_attributes() . '>';
|
22 |
+
foreach ( $this->get_setting( 'choices' ) as $key => $label ) {
|
23 |
+
if ( $is_multiple ) {
|
24 |
+
$selected = in_array( $key, $value, true ) ? 'selected' : '';
|
25 |
+
} else {
|
26 |
+
$selected = $this->get_value() === $key ? 'selected' : '';
|
27 |
+
}
|
28 |
+
$html .= '<option value="' . esc_attr( $key ) . '" ' . $selected . '>' . esc_html( $label ) . '</option>';
|
29 |
+
}
|
30 |
+
$html .= '</select>';
|
31 |
+
|
32 |
+
return $html;
|
33 |
+
}
|
34 |
+
}
|
includes/Supports/FormFields/Spacing.php
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace CarouselSlider\Supports\FormFields;
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Spacing class
|
7 |
+
*/
|
8 |
+
class Spacing extends BaseField {
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Render field html
|
12 |
+
*
|
13 |
+
* @inheritDoc
|
14 |
+
*/
|
15 |
+
public function render(): string {
|
16 |
+
$default = (array) $this->get_setting( 'default', [] );
|
17 |
+
$value = (array) $this->get_value();
|
18 |
+
$name = $this->get_name();
|
19 |
+
|
20 |
+
$html = '';
|
21 |
+
$dimensions = [ 'top', 'right', 'bottom', 'left' ];
|
22 |
+
foreach ( $dimensions as $dimension ) {
|
23 |
+
if ( ! array_key_exists( $dimension, $default ) ) {
|
24 |
+
continue;
|
25 |
+
}
|
26 |
+
|
27 |
+
$attr_name = $name . '[' . $dimension . ']';
|
28 |
+
$attr_value = $value[ $dimension ] ?? $default[ $dimension ];
|
29 |
+
if ( 'top' === $dimension ) {
|
30 |
+
$icon_class = 'dashicons dashicons-arrow-up-alt';
|
31 |
+
} elseif ( 'bottom' === $dimension ) {
|
32 |
+
$icon_class = 'dashicons dashicons-arrow-down-alt';
|
33 |
+
} else {
|
34 |
+
$icon_class = 'dashicons dashicons-arrow-' . $dimension . '-alt';
|
35 |
+
}
|
36 |
+
|
37 |
+
$html .= '<div class="shapla-dimension">';
|
38 |
+
$html .= '<span class="add-on"><i class="' . esc_attr( $icon_class ) . '"></i></span>';
|
39 |
+
$html .= '<input type="text" name="' . esc_attr( $attr_name ) . '" value="' . esc_attr( $attr_value ) . '">';
|
40 |
+
$html .= '</div>';
|
41 |
+
}
|
42 |
+
|
43 |
+
return $html;
|
44 |
+
}
|
45 |
+
}
|
includes/Supports/FormFields/Text.php
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace CarouselSlider\Supports\FormFields;
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Text class
|
7 |
+
*/
|
8 |
+
class Text extends BaseField {
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Render field html
|
12 |
+
*
|
13 |
+
* @inheritDoc
|
14 |
+
*/
|
15 |
+
public function render(): string {
|
16 |
+
return '<input ' . $this->build_attributes() . ' />';
|
17 |
+
}
|
18 |
+
}
|
includes/Supports/FormFields/Textarea.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace CarouselSlider\Supports\FormFields;
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Textarea class
|
7 |
+
*/
|
8 |
+
class Textarea extends BaseField {
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Render field html
|
12 |
+
*
|
13 |
+
* @inheritDoc
|
14 |
+
*/
|
15 |
+
public function render(): string {
|
16 |
+
$this->set_setting( 'type', 'textarea' );
|
17 |
+
|
18 |
+
return '<textarea ' . $this->build_attributes() . '>' . esc_textarea( $this->get_value() ) . '</textarea>';
|
19 |
+
}
|
20 |
+
}
|
includes/Supports/MetaBoxForm.php
ADDED
@@ -0,0 +1,328 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace CarouselSlider\Supports;
|
4 |
+
|
5 |
+
use CarouselSlider\Helper;
|
6 |
+
use CarouselSlider\Interfaces\FieldInterface;
|
7 |
+
use CarouselSlider\Supports\FormFields\BaseField;
|
8 |
+
use CarouselSlider\Supports\FormFields\ButtonGroup;
|
9 |
+
use CarouselSlider\Supports\FormFields\Checkbox;
|
10 |
+
use CarouselSlider\Supports\FormFields\Color;
|
11 |
+
use CarouselSlider\Supports\FormFields\ImagesGallery;
|
12 |
+
use CarouselSlider\Supports\FormFields\Select;
|
13 |
+
use CarouselSlider\Supports\FormFields\Spacing;
|
14 |
+
use CarouselSlider\Supports\FormFields\Text;
|
15 |
+
use CarouselSlider\Supports\FormFields\Textarea;
|
16 |
+
|
17 |
+
defined( 'ABSPATH' ) || exit;
|
18 |
+
|
19 |
+
/**
|
20 |
+
* MetaBoxForm class
|
21 |
+
*
|
22 |
+
* @method void text( array $args )
|
23 |
+
* @method void date( array $args )
|
24 |
+
* @method void textarea( array $args )
|
25 |
+
* @method void spacing( array $args )
|
26 |
+
* @method void button_group( array $args )
|
27 |
+
* @method void color( array $args )
|
28 |
+
* @method void images_gallery( array $args )
|
29 |
+
* @method void number( array $args )
|
30 |
+
* @method void checkbox( array $args )
|
31 |
+
*/
|
32 |
+
class MetaBoxForm {
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Map field settings
|
36 |
+
*
|
37 |
+
* @param array $settings The settings arguments.
|
38 |
+
*
|
39 |
+
* @return array
|
40 |
+
*/
|
41 |
+
public function map_field_settings( array $settings ): array {
|
42 |
+
$attrs = [
|
43 |
+
'name' => 'label',
|
44 |
+
'desc' => 'description',
|
45 |
+
'class' => 'field_class',
|
46 |
+
'options' => 'choices',
|
47 |
+
'std' => 'default',
|
48 |
+
];
|
49 |
+
foreach ( $settings as $key => $value ) {
|
50 |
+
if ( isset( $attrs[ $key ] ) ) {
|
51 |
+
$settings[ $attrs[ $key ] ] = $value;
|
52 |
+
unset( $settings[ $key ] );
|
53 |
+
}
|
54 |
+
}
|
55 |
+
|
56 |
+
return $settings;
|
57 |
+
}
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Get field class
|
61 |
+
*
|
62 |
+
* @param string $type The field type.
|
63 |
+
*
|
64 |
+
* @return BaseField|FieldInterface
|
65 |
+
*/
|
66 |
+
public function get_field_class( string $type = 'text' ) {
|
67 |
+
$types = [
|
68 |
+
'text' => Text::class,
|
69 |
+
'textarea' => Textarea::class,
|
70 |
+
'spacing' => Spacing::class,
|
71 |
+
'checkbox' => Checkbox::class,
|
72 |
+
'button_group' => ButtonGroup::class,
|
73 |
+
'select' => Select::class,
|
74 |
+
'color' => Color::class,
|
75 |
+
'images_gallery' => ImagesGallery::class,
|
76 |
+
];
|
77 |
+
|
78 |
+
$class = array_key_exists( $type, $types ) ? $types[ $type ] : $types['text'];
|
79 |
+
|
80 |
+
return new $class();
|
81 |
+
}
|
82 |
+
|
83 |
+
/**
|
84 |
+
* Generate text field
|
85 |
+
*
|
86 |
+
* @param array $args The settings arguments.
|
87 |
+
*
|
88 |
+
* @return string
|
89 |
+
*/
|
90 |
+
public function field( array $args ): string {
|
91 |
+
list( $name, $value ) = $this->get_name_and_value( $args );
|
92 |
+
|
93 |
+
$field = self::get_field_class( $args['type'] ?? 'text' );
|
94 |
+
$field->set_settings( $this->map_field_settings( $args ) );
|
95 |
+
$field->set_name( $name );
|
96 |
+
$field->set_value( $value );
|
97 |
+
|
98 |
+
$html = $this->field_before( $args );
|
99 |
+
$html .= $field->render();
|
100 |
+
$html .= $this->field_after( $args );
|
101 |
+
|
102 |
+
return $html;
|
103 |
+
}
|
104 |
+
|
105 |
+
/**
|
106 |
+
* Generate select field
|
107 |
+
*
|
108 |
+
* @param array $args The settings arguments.
|
109 |
+
*/
|
110 |
+
public function select( array $args ) {
|
111 |
+
$args['type'] = 'select';
|
112 |
+
$args['field_class'] = 'select2 sp-input-text';
|
113 |
+
|
114 |
+
echo $this->field( $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
115 |
+
}
|
116 |
+
|
117 |
+
/**
|
118 |
+
* Generate posts list dropdown
|
119 |
+
* Also support for any custom post type
|
120 |
+
*
|
121 |
+
* @param array $args The settings arguments.
|
122 |
+
*/
|
123 |
+
public function posts_list( array $args ) {
|
124 |
+
$posts = get_posts(
|
125 |
+
[
|
126 |
+
'post_type' => $args['post_type'] ?? 'post',
|
127 |
+
'post_status' => 'publish',
|
128 |
+
'posts_per_page' => - 1,
|
129 |
+
]
|
130 |
+
);
|
131 |
+
|
132 |
+
$args['type'] = 'select';
|
133 |
+
$args['field_class'] = 'select2 sp-input-text';
|
134 |
+
$args['choices'] = [];
|
135 |
+
foreach ( $posts as $post ) {
|
136 |
+
$args['choices'][ $post->ID ] = $post->post_title;
|
137 |
+
}
|
138 |
+
|
139 |
+
echo $this->field( $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
140 |
+
}
|
141 |
+
|
142 |
+
/**
|
143 |
+
* Upload iFrame field
|
144 |
+
*
|
145 |
+
* @param array $args The settings arguments.
|
146 |
+
*/
|
147 |
+
public function upload_iframe( array $args ) {
|
148 |
+
if ( ! isset( $args['id'], $args['name'] ) ) {
|
149 |
+
return;
|
150 |
+
}
|
151 |
+
list( $name, $value ) = $this->get_name_and_value( $args );
|
152 |
+
$class = isset( $args['class'] ) ? esc_attr( $args['class'] ) : 'sp-input-hidden';
|
153 |
+
$button_text = $value ? __( 'Update Image', 'carousel-slider' ) : __( 'Set Image', 'carousel-slider' );
|
154 |
+
|
155 |
+
global $post;
|
156 |
+
$attrs = [
|
157 |
+
'class' => 'button slide_image_add',
|
158 |
+
'href' => esc_url( get_upload_iframe_src( 'image', $post->ID ) ),
|
159 |
+
'data-title' => esc_attr__( 'Select or Upload Slide Background Image', 'carousel-slider' ),
|
160 |
+
'data-button-text' => esc_attr( $button_text ),
|
161 |
+
];
|
162 |
+
|
163 |
+
$html = $this->field_before( $args );
|
164 |
+
$html .= '<input type="hidden" class="' . $class . '" name="' . $name . '" value="' . $value . '" />';
|
165 |
+
$html .= '<a ' . implode( ' ', Helper::array_to_attribute( $attrs ) ) . '>' . esc_html( $button_text ) . '</a>';
|
166 |
+
$html .= $this->field_after( $args );
|
167 |
+
echo $html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
168 |
+
}
|
169 |
+
|
170 |
+
/**
|
171 |
+
* Generate image gallery list from images URL
|
172 |
+
*
|
173 |
+
* @param array $args The settings arguments.
|
174 |
+
*/
|
175 |
+
public function images_url( array $args ) {
|
176 |
+
if ( ! isset( $args['id'], $args['name'] ) ) {
|
177 |
+
return;
|
178 |
+
}
|
179 |
+
|
180 |
+
global $post;
|
181 |
+
|
182 |
+
$std_value = $args['std'] ?? '';
|
183 |
+
$meta = get_post_meta( $post->ID, $args['id'], true );
|
184 |
+
$value = ! empty( $meta ) ? $meta : $std_value;
|
185 |
+
|
186 |
+
$btn_text = $value ? __( 'Edit URLs', 'carousel-slider' ) : __( 'Add URLs', 'carousel-slider' );
|
187 |
+
|
188 |
+
$html = $this->field_before( $args );
|
189 |
+
$html .= sprintf( '<a id="_images_urls_btn" class="button" href="#">%s</a>', $btn_text );
|
190 |
+
$html .= '<ul class="carousel_slider_url_images_list">';
|
191 |
+
if ( is_array( $value ) && count( $value ) > 0 ) {
|
192 |
+
foreach ( $value as $image ) {
|
193 |
+
$html .= '<li><img src="' . $image['url'] . '" alt="' . $image['alt'] . '" width="75" height="75"></li>';
|
194 |
+
}
|
195 |
+
}
|
196 |
+
$html .= '</ul>';
|
197 |
+
$html .= $this->field_after( $args );
|
198 |
+
echo $html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
199 |
+
}
|
200 |
+
|
201 |
+
/**
|
202 |
+
* Generate image sizes dropdown from available image sizes
|
203 |
+
*
|
204 |
+
* @param array $args The settings arguments.
|
205 |
+
*/
|
206 |
+
public function image_sizes( array $args ) {
|
207 |
+
$args['type'] = 'select';
|
208 |
+
$args['choices'] = Helper::get_available_image_sizes();
|
209 |
+
|
210 |
+
echo $this->field( $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
211 |
+
}
|
212 |
+
|
213 |
+
/**
|
214 |
+
* Get post terms drowdown list
|
215 |
+
*
|
216 |
+
* @param array $args The settings arguments.
|
217 |
+
*/
|
218 |
+
public function post_terms( array $args ) {
|
219 |
+
$terms = get_terms( [ 'taxonomy' => $args['taxonomy'] ?? 'category' ] );
|
220 |
+
|
221 |
+
$args['type'] = 'select';
|
222 |
+
$args['choices'] = [];
|
223 |
+
if ( ! is_wp_error( $terms ) ) {
|
224 |
+
foreach ( $terms as $term ) {
|
225 |
+
$args['choices'][ $term->term_id ] = sprintf( '%s (%s)', $term->name, $term->count );
|
226 |
+
}
|
227 |
+
}
|
228 |
+
|
229 |
+
echo $this->field( $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
230 |
+
}
|
231 |
+
|
232 |
+
/**
|
233 |
+
* Generate field name and field value
|
234 |
+
*
|
235 |
+
* @param array $args The settings arguments.
|
236 |
+
*
|
237 |
+
* @return array
|
238 |
+
*/
|
239 |
+
private function get_name_and_value( array $args ): array {
|
240 |
+
global $post;
|
241 |
+
$input_attributes = $args['input_attributes'] ?? [];
|
242 |
+
// Meta Name.
|
243 |
+
if ( isset( $input_attributes['name'] ) ) {
|
244 |
+
$name = $input_attributes['name'];
|
245 |
+
} else {
|
246 |
+
$group = $args['group'] ?? 'carousel_slider';
|
247 |
+
$multiple = isset( $args['multiple'] ) ? '[]' : '';
|
248 |
+
$name = sprintf( '%s[%s]%s', $group, $args['id'], $multiple );
|
249 |
+
}
|
250 |
+
|
251 |
+
// Meta Value.
|
252 |
+
$default = $args['std'] ?? '';
|
253 |
+
if ( isset( $input_attributes['value'] ) ) {
|
254 |
+
$value = ! empty( $input_attributes['value'] ) ? $input_attributes['value'] : $default;
|
255 |
+
} else {
|
256 |
+
$meta = get_post_meta( $post->ID, $args['id'], true );
|
257 |
+
$value = ! empty( $meta ) ? $meta : $default;
|
258 |
+
}
|
259 |
+
|
260 |
+
if ( 'zero' === $value ) {
|
261 |
+
$value = 0;
|
262 |
+
}
|
263 |
+
|
264 |
+
return [ $name, $value ];
|
265 |
+
}
|
266 |
+
|
267 |
+
/**
|
268 |
+
* Generate field before template
|
269 |
+
*
|
270 |
+
* @param array $args The settings arguments.
|
271 |
+
*
|
272 |
+
* @return string
|
273 |
+
*/
|
274 |
+
private function field_before( array $args ): string {
|
275 |
+
$_normal = sprintf( '<div class="sp-input-group" id="field-%s">', $args['id'] );
|
276 |
+
$_normal .= '<div class="sp-input-label">';
|
277 |
+
$_normal .= sprintf( '<label for="%1$s">%2$s</label>', $args['id'], $args['name'] );
|
278 |
+
if ( ! empty( $args['desc'] ) ) {
|
279 |
+
$_normal .= sprintf( '<p class="sp-input-desc">%s</p>', $args['desc'] );
|
280 |
+
}
|
281 |
+
$_normal .= '</div>';
|
282 |
+
$_normal .= '<div class="sp-input-field">';
|
283 |
+
|
284 |
+
if ( isset( $args['context'] ) && 'side' === $args['context'] ) {
|
285 |
+
$_side = '<p id="field-' . $args['id'] . '">';
|
286 |
+
$_side .= '<label for="' . $args['id'] . '"><strong>' . $args['name'] . '</strong></label>';
|
287 |
+
|
288 |
+
return $_side;
|
289 |
+
}
|
290 |
+
|
291 |
+
return $_normal;
|
292 |
+
}
|
293 |
+
|
294 |
+
/**
|
295 |
+
* Generate field after template
|
296 |
+
*
|
297 |
+
* @param array $args The settings arguments.
|
298 |
+
*
|
299 |
+
* @return string
|
300 |
+
*/
|
301 |
+
private function field_after( array $args = [] ): string {
|
302 |
+
|
303 |
+
if ( isset( $args['context'] ) && 'side' === $args['context'] ) {
|
304 |
+
$_side = '';
|
305 |
+
if ( ! empty( $args['desc'] ) ) {
|
306 |
+
$_side .= '<span class="cs-tooltip" title="' . esc_attr( $args['desc'] ) . '"></span>';
|
307 |
+
}
|
308 |
+
$_side .= '</p>';
|
309 |
+
|
310 |
+
return $_side;
|
311 |
+
}
|
312 |
+
|
313 |
+
return '</div></div>';
|
314 |
+
}
|
315 |
+
|
316 |
+
/**
|
317 |
+
* Handle wildcard method call
|
318 |
+
*
|
319 |
+
* @param string $name The method name.
|
320 |
+
* @param array $arguments The arguments for the method.
|
321 |
+
*
|
322 |
+
* @return void
|
323 |
+
*/
|
324 |
+
public function __call( string $name, array $arguments = [] ) {
|
325 |
+
$args = array_merge( ( is_array( $arguments[0] ) ? $arguments[0] : [] ), [ 'type' => $name ] );
|
326 |
+
echo $this->field( $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
327 |
+
}
|
328 |
+
}
|
includes/Supports/Sanitize.php
ADDED
@@ -0,0 +1,220 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace CarouselSlider\Supports;
|
4 |
+
|
5 |
+
defined( 'ABSPATH' ) || exit;
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Sanitize class
|
9 |
+
*/
|
10 |
+
class Sanitize {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Sanitize number options.
|
14 |
+
*
|
15 |
+
* @param mixed $value The value to be sanitized.
|
16 |
+
*
|
17 |
+
* @return int|float
|
18 |
+
*/
|
19 |
+
public static function number( $value ) {
|
20 |
+
if ( ! is_numeric( $value ) ) {
|
21 |
+
return 0;
|
22 |
+
}
|
23 |
+
|
24 |
+
if ( preg_match( '/^\\d+\\.\\d+$/', $value ) === 1 ) {
|
25 |
+
return floatval( $value );
|
26 |
+
}
|
27 |
+
|
28 |
+
return intval( $value );
|
29 |
+
}
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Sanitize float number
|
33 |
+
*
|
34 |
+
* @param mixed $value The value to be sanitized.
|
35 |
+
*
|
36 |
+
* @return float
|
37 |
+
*/
|
38 |
+
public static function float( $value ): float {
|
39 |
+
if ( ! is_numeric( $value ) ) {
|
40 |
+
return 0;
|
41 |
+
}
|
42 |
+
|
43 |
+
return floatval( $value );
|
44 |
+
}
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Sanitize integer number
|
48 |
+
*
|
49 |
+
* @param mixed $value The value to be sanitized.
|
50 |
+
*
|
51 |
+
* @return int
|
52 |
+
*/
|
53 |
+
public static function int( $value ): int {
|
54 |
+
if ( ! is_numeric( $value ) ) {
|
55 |
+
return 0;
|
56 |
+
}
|
57 |
+
|
58 |
+
return intval( $value );
|
59 |
+
}
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Sanitize email
|
63 |
+
*
|
64 |
+
* @param mixed $value The value to be sanitized.
|
65 |
+
*
|
66 |
+
* @return string
|
67 |
+
*/
|
68 |
+
public static function email( $value ): string {
|
69 |
+
return sanitize_email( $value );
|
70 |
+
}
|
71 |
+
|
72 |
+
/**
|
73 |
+
* Sanitize url
|
74 |
+
*
|
75 |
+
* @param mixed $value The value to be sanitized.
|
76 |
+
*
|
77 |
+
* @return string
|
78 |
+
*/
|
79 |
+
public static function url( $value ): string {
|
80 |
+
return esc_url_raw( trim( $value ) );
|
81 |
+
}
|
82 |
+
|
83 |
+
/**
|
84 |
+
* Sanitizes a string
|
85 |
+
*
|
86 |
+
* - Checks for invalid UTF-8,
|
87 |
+
* - Converts single `<` characters to entities
|
88 |
+
* - Strips all tags
|
89 |
+
* - Removes line breaks, tabs, and extra whitespace
|
90 |
+
* - Strips octets
|
91 |
+
*
|
92 |
+
* @param mixed $value The value to be sanitized.
|
93 |
+
*
|
94 |
+
* @return string
|
95 |
+
*/
|
96 |
+
public static function text( $value ): string {
|
97 |
+
return sanitize_text_field( $value );
|
98 |
+
}
|
99 |
+
|
100 |
+
/**
|
101 |
+
* Sanitizes a multiline string
|
102 |
+
*
|
103 |
+
* The function is like sanitize_text_field(), but preserves
|
104 |
+
* new lines (\n) and other whitespace, which are legitimate
|
105 |
+
* input in textarea elements.
|
106 |
+
*
|
107 |
+
* @param mixed $value The value to be sanitized.
|
108 |
+
*
|
109 |
+
* @return string
|
110 |
+
*/
|
111 |
+
public static function textarea( $value ): string {
|
112 |
+
return sanitize_textarea_field( $value );
|
113 |
+
}
|
114 |
+
|
115 |
+
/**
|
116 |
+
* If a field has been 'checked' or not, meaning it contains
|
117 |
+
* one of the following values: 'yes', 'on', '1', 1, true, or 'true'.
|
118 |
+
* This can be used for determining if an HTML checkbox has been checked.
|
119 |
+
*
|
120 |
+
* @param mixed $value The value to be sanitized.
|
121 |
+
*
|
122 |
+
* @return mixed|boolean|string
|
123 |
+
*/
|
124 |
+
public static function checked( $value ) {
|
125 |
+
$true_values = [ 'yes', 'on', '1', 1, true, 'true' ];
|
126 |
+
$false_values = [ 'no', 'off', '0', 0, false, 'false' ];
|
127 |
+
|
128 |
+
return in_array( $value, array_merge( $true_values, $false_values ), true ) ? $value : '';
|
129 |
+
}
|
130 |
+
|
131 |
+
/**
|
132 |
+
* Check if the given input is a valid date.
|
133 |
+
*
|
134 |
+
* @param mixed $value The value to be sanitized.
|
135 |
+
*
|
136 |
+
* @return boolean
|
137 |
+
*/
|
138 |
+
public static function date( $value ) {
|
139 |
+
$time = strtotime( $value );
|
140 |
+
|
141 |
+
if ( $time ) {
|
142 |
+
return gmdate( 'Y-m-d', $time );
|
143 |
+
}
|
144 |
+
|
145 |
+
return '';
|
146 |
+
}
|
147 |
+
|
148 |
+
/**
|
149 |
+
* Sanitize short block html input
|
150 |
+
*
|
151 |
+
* @param mixed $value The value to be sanitized.
|
152 |
+
*
|
153 |
+
* @return string
|
154 |
+
*/
|
155 |
+
public static function html( $value ): string {
|
156 |
+
return wp_kses_post( $value );
|
157 |
+
}
|
158 |
+
|
159 |
+
/**
|
160 |
+
* Sanitize colors.
|
161 |
+
*
|
162 |
+
* @param mixed $value The color.
|
163 |
+
*
|
164 |
+
* @return string
|
165 |
+
*/
|
166 |
+
public static function color( $value ): string {
|
167 |
+
// If the value is empty, then return empty.
|
168 |
+
if ( '' === $value || ! is_string( $value ) ) {
|
169 |
+
return '';
|
170 |
+
}
|
171 |
+
|
172 |
+
// Trim unneeded whitespace.
|
173 |
+
$value = str_replace( ' ', '', $value );
|
174 |
+
|
175 |
+
// This pattern will check and match 3/6/8-character hex, rgb, rgba, hsl, & hsla colors.
|
176 |
+
$pattern = '/^(\#[\da-f]{3}|\#[\da-f]{6}|\#[\da-f]{8}|';
|
177 |
+
$pattern .= 'rgba\(((\d{1,2}|1\d\d|2([0-4]\d|5[0-5]))\s*,\s*){2}((\d{1,2}|1\d\d|2([0-4]\d|5[0-5]))\s*)(,\s*(0\.\d+|1))\)|';
|
178 |
+
$pattern .= 'hsla\(\s*((\d{1,2}|[1-2]\d{2}|3([0-5]\d|60)))\s*,\s*((\d{1,2}|100)\s*%)\s*,\s*((\d{1,2}|100)\s*%)(,\s*(0\.\d+|1))\)|';
|
179 |
+
$pattern .= 'rgb\(((\d{1,2}|1\d\d|2([0-4]\d|5[0-5]))\s*,\s*){2}((\d{1,2}|1\d\d|2([0-4]\d|5[0-5]))\s*)\)|';
|
180 |
+
$pattern .= 'hsl\(\s*((\d{1,2}|[1-2]\d{2}|3([0-5]\d|60)))\s*,\s*((\d{1,2}|100)\s*%)\s*,\s*((\d{1,2}|100)\s*%)\))$/';
|
181 |
+
|
182 |
+
// Return the 1st match found.
|
183 |
+
if ( 1 === preg_match( $pattern, $value ) ) {
|
184 |
+
return $value;
|
185 |
+
}
|
186 |
+
|
187 |
+
// If no match was found, return an empty string.
|
188 |
+
return '';
|
189 |
+
}
|
190 |
+
|
191 |
+
|
192 |
+
/**
|
193 |
+
* Sanitize meta value
|
194 |
+
*
|
195 |
+
* @param mixed $value The value to be sanitized.
|
196 |
+
*
|
197 |
+
* @return mixed
|
198 |
+
*/
|
199 |
+
public static function deep( $value ) {
|
200 |
+
if ( empty( $value ) ) {
|
201 |
+
return $value;
|
202 |
+
}
|
203 |
+
if ( is_scalar( $value ) ) {
|
204 |
+
if ( is_numeric( $value ) ) {
|
205 |
+
return self::number( $value );
|
206 |
+
}
|
207 |
+
|
208 |
+
return sanitize_text_field( $value );
|
209 |
+
}
|
210 |
+
|
211 |
+
$sanitized_value = [];
|
212 |
+
if ( is_array( $value ) ) {
|
213 |
+
foreach ( $value as $index => $item ) {
|
214 |
+
$sanitized_value[ $index ] = self::deep( $item );
|
215 |
+
}
|
216 |
+
}
|
217 |
+
|
218 |
+
return $sanitized_value;
|
219 |
+
}
|
220 |
+
}
|
{classes → includes}/Supports/SettingAPI.php
RENAMED
@@ -2,6 +2,7 @@
|
|
2 |
|
3 |
namespace CarouselSlider\Supports;
|
4 |
|
|
|
5 |
use Exception;
|
6 |
|
7 |
defined( 'ABSPATH' ) || exit;
|
@@ -122,8 +123,8 @@ class SettingAPI {
|
|
122 |
$page_title = $this->menu_fields['page_title'];
|
123 |
$menu_title = $this->menu_fields['menu_title'];
|
124 |
$menu_slug = $this->menu_fields['menu_slug'];
|
125 |
-
$capability =
|
126 |
-
$parent_slug =
|
127 |
|
128 |
if ( $parent_slug ) {
|
129 |
add_submenu_page(
|
@@ -132,7 +133,7 @@ class SettingAPI {
|
|
132 |
$menu_title,
|
133 |
$capability,
|
134 |
$menu_slug,
|
135 |
-
|
136 |
);
|
137 |
} else {
|
138 |
add_menu_page(
|
@@ -140,7 +141,7 @@ class SettingAPI {
|
|
140 |
$menu_title,
|
141 |
$capability,
|
142 |
$menu_slug,
|
143 |
-
|
144 |
);
|
145 |
}
|
146 |
}
|
@@ -176,7 +177,7 @@ class SettingAPI {
|
|
176 |
return;
|
177 |
}
|
178 |
|
179 |
-
$current_tab =
|
180 |
$page = $this->menu_fields['menu_slug'];
|
181 |
|
182 |
echo '<h2 class="nav-tab-wrapper wp-clearfix">';
|
@@ -194,18 +195,18 @@ class SettingAPI {
|
|
194 |
/**
|
195 |
* Filter settings fields by page tab
|
196 |
*
|
197 |
-
* @param string $current_tab
|
198 |
*
|
199 |
* @return array
|
200 |
*/
|
201 |
-
public function filter_fields_by_tab( $current_tab = null ) {
|
202 |
|
203 |
if ( count( $this->tabs ) < 1 ) {
|
204 |
return $this->fields;
|
205 |
}
|
206 |
|
207 |
if ( ! $current_tab ) {
|
208 |
-
$current_tab =
|
209 |
}
|
210 |
|
211 |
$new_array = array();
|
@@ -234,24 +235,24 @@ class SettingAPI {
|
|
234 |
*
|
235 |
* @return array
|
236 |
*/
|
237 |
-
public function sanitize_callback( array $input ) {
|
238 |
-
$output_array =
|
239 |
$fields = $this->fields;
|
240 |
$options = (array) get_option( $this->menu_fields['option_name'] );
|
241 |
$options = array_filter( $options );
|
242 |
|
243 |
if ( empty( $options ) ) {
|
244 |
-
$options =
|
245 |
}
|
246 |
|
247 |
if ( count( $this->tabs ) > 0 ) {
|
248 |
parse_str( $_POST['_wp_http_referer'], $referrer );
|
249 |
-
$tab =
|
250 |
$fields = $this->filter_fields_by_tab( $tab );
|
251 |
}
|
252 |
|
253 |
// Loop through each setting being saved and
|
254 |
-
// pass it through a sanitize
|
255 |
foreach ( $input as $key => $value ) {
|
256 |
foreach ( $fields as $field ) {
|
257 |
if ( $field['id'] == $key ) {
|
@@ -268,20 +269,23 @@ class SettingAPI {
|
|
268 |
* Get options parsed with default value
|
269 |
* @return array
|
270 |
*/
|
271 |
-
public function get_options() {
|
272 |
-
|
|
|
273 |
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
}
|
278 |
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
|
284 |
-
|
|
|
|
|
|
|
285 |
}
|
286 |
|
287 |
/**
|
@@ -292,63 +296,41 @@ class SettingAPI {
|
|
292 |
*
|
293 |
* @return mixed
|
294 |
*/
|
295 |
-
private function validate( $input, $validation_rule = 'text' ) {
|
296 |
switch ( $validation_rule ) {
|
297 |
-
case 'text':
|
298 |
-
return sanitize_text_field( $input );
|
299 |
-
break;
|
300 |
|
301 |
case 'number':
|
302 |
return is_int( $input ) ? trim( $input ) : intval( $input );
|
303 |
-
break;
|
304 |
|
305 |
case 'url':
|
306 |
return esc_url_raw( trim( $input ) );
|
307 |
-
break;
|
308 |
|
309 |
case 'email':
|
310 |
return sanitize_email( $input );
|
311 |
-
break;
|
312 |
|
313 |
case 'checkbox':
|
314 |
return ( $input == 1 ) ? 1 : 0;
|
315 |
-
break;
|
316 |
|
317 |
case 'multi_checkbox':
|
318 |
return $input;
|
319 |
-
break;
|
320 |
-
|
321 |
-
case 'radio':
|
322 |
-
return sanitize_text_field( $input );
|
323 |
-
break;
|
324 |
-
|
325 |
-
case 'select':
|
326 |
-
return sanitize_text_field( $input );
|
327 |
-
break;
|
328 |
|
329 |
case 'date':
|
330 |
return date( 'F d, Y', strtotime( $input ) );
|
331 |
-
break;
|
332 |
|
333 |
case 'textarea':
|
334 |
return wp_filter_nohtml_kses( $input );
|
335 |
-
break;
|
336 |
|
337 |
case 'inlinehtml':
|
338 |
return wp_filter_kses( force_balance_tags( $input ) );
|
339 |
-
break;
|
340 |
|
341 |
case 'linebreaks':
|
342 |
return wp_strip_all_tags( $input );
|
343 |
-
break;
|
344 |
|
345 |
case 'wp_editor':
|
346 |
return wp_kses_post( $input );
|
347 |
-
break;
|
348 |
|
349 |
default:
|
350 |
return sanitize_text_field( $input );
|
351 |
-
break;
|
352 |
}
|
353 |
}
|
354 |
|
@@ -359,16 +341,15 @@ class SettingAPI {
|
|
359 |
*
|
360 |
* @return void
|
361 |
*/
|
362 |
-
private function setting_fields( $fields =
|
363 |
$fields = is_array( $fields ) ? $fields : $this->fields;
|
364 |
|
365 |
-
$table = "";
|
366 |
-
$table .= "<table class='form-table'>";
|
367 |
|
368 |
foreach ( $fields as $field ) {
|
369 |
$name = sprintf( '%s[%s]', $this->menu_fields['option_name'], $field['id'] );
|
370 |
-
$type =
|
371 |
-
$value =
|
372 |
|
373 |
$table .= "<tr>";
|
374 |
$table .= sprintf( '<th scope="row"><label for="%1$s">%2$s</label></th>', $field['id'],
|
@@ -382,7 +363,8 @@ class SettingAPI {
|
|
382 |
}
|
383 |
|
384 |
if ( ! empty( $field['desc'] ) ) {
|
385 |
-
$
|
|
|
386 |
}
|
387 |
$table .= "</td>";
|
388 |
$table .= "</tr>";
|
@@ -397,11 +379,11 @@ class SettingAPI {
|
|
397 |
*
|
398 |
* @param array $field
|
399 |
* @param string $name
|
400 |
-
* @param string $value
|
401 |
*
|
402 |
* @return string
|
403 |
*/
|
404 |
-
public function text( $field, $name, $value ) {
|
405 |
return sprintf( '<input type="text" class="regular-text" value="%1$s" id="%2$s" name="%3$s">', $value,
|
406 |
$field['id'], $name );
|
407 |
}
|
@@ -411,11 +393,11 @@ class SettingAPI {
|
|
411 |
*
|
412 |
* @param array $field
|
413 |
* @param string $name
|
414 |
-
* @param string $value
|
415 |
*
|
416 |
* @return string
|
417 |
*/
|
418 |
-
public function email( $field, $name, $value ) {
|
419 |
return sprintf( '<input type="email" class="regular-text" value="%1$s" id="%2$s" name="%3$s">', $value,
|
420 |
$field['id'], $name );
|
421 |
}
|
@@ -425,12 +407,12 @@ class SettingAPI {
|
|
425 |
*
|
426 |
* @param array $field
|
427 |
* @param string $name
|
428 |
-
* @param string $value
|
429 |
*
|
430 |
* @return string
|
431 |
*/
|
432 |
-
public function password( $field, $name, $value ) {
|
433 |
-
return sprintf( '<input type="password" class="regular-text" value="" id="%
|
434 |
$field['id'], $name );
|
435 |
}
|
436 |
|
@@ -439,11 +421,11 @@ class SettingAPI {
|
|
439 |
*
|
440 |
* @param array $field
|
441 |
* @param string $name
|
442 |
-
* @param string $value
|
443 |
*
|
444 |
* @return string
|
445 |
*/
|
446 |
-
public function number( $field, $name, $value ) {
|
447 |
return sprintf( '<input type="number" class="regular-text" value="%1$s" id="%2$s" name="%3$s">', $value,
|
448 |
$field['id'], $name );
|
449 |
}
|
@@ -453,11 +435,11 @@ class SettingAPI {
|
|
453 |
*
|
454 |
* @param array $field
|
455 |
* @param string $name
|
456 |
-
* @param string $value
|
457 |
*
|
458 |
* @return string
|
459 |
*/
|
460 |
-
public function url( $field, $name, $value ) {
|
461 |
return sprintf( '<input type="url" class="regular-text" value="%1$s" id="%2$s" name="%3$s">', $value,
|
462 |
$field['id'], $name );
|
463 |
}
|
@@ -467,11 +449,11 @@ class SettingAPI {
|
|
467 |
*
|
468 |
* @param array $field
|
469 |
* @param string $name
|
470 |
-
* @param string $value
|
471 |
*
|
472 |
* @return string
|
473 |
*/
|
474 |
-
public function color( $field, $name, $value ) {
|
475 |
$default_color = ( isset( $field['std'] ) ) ? $field['std'] : "";
|
476 |
|
477 |
return sprintf( '<input type="text" class="color-picker" value="%1$s" id="%2$s" name="%3$s" data-alpha="true" data-default-color="%4$s">',
|
@@ -483,14 +465,14 @@ class SettingAPI {
|
|
483 |
*
|
484 |
* @param array $field
|
485 |
* @param string $name
|
486 |
-
* @param string $value
|
487 |
*
|
488 |
* @return string
|
489 |
*/
|
490 |
-
public function date( $field, $name, $value ) {
|
491 |
-
$value = date( "
|
492 |
|
493 |
-
return sprintf( '<input type="
|
494 |
$value, $field['id'], $name );
|
495 |
}
|
496 |
|
@@ -499,13 +481,13 @@ class SettingAPI {
|
|
499 |
*
|
500 |
* @param array $field
|
501 |
* @param string $name
|
502 |
-
* @param string $value
|
503 |
*
|
504 |
* @return string
|
505 |
*/
|
506 |
-
public function textarea( $field, $name, $value ) {
|
507 |
-
$rows =
|
508 |
-
$cols =
|
509 |
$placeholder = ( isset( $field['placeholder'] ) ) ? sprintf( 'placeholder="%s"',
|
510 |
esc_attr( $field['placeholder'] ) ) : '';
|
511 |
|
@@ -517,11 +499,11 @@ class SettingAPI {
|
|
517 |
*
|
518 |
* @param array $field
|
519 |
* @param string $name
|
520 |
-
* @param string $value
|
521 |
*
|
522 |
* @return string
|
523 |
*/
|
524 |
-
public function checkbox( $field, $name, $value ) {
|
525 |
$checked = ( 1 == $value ) ? 'checked' : '';
|
526 |
$table = '<input type="hidden" name="' . $name . '" value="0">';
|
527 |
$table .= '<fieldset><legend class="screen-reader-text"><span>' . $field['name'] . '</span></legend>';
|
@@ -537,14 +519,14 @@ class SettingAPI {
|
|
537 |
*
|
538 |
* @param array $field
|
539 |
* @param string $name
|
540 |
-
* @param array $value
|
541 |
*
|
542 |
* @return string
|
543 |
*/
|
544 |
-
public function multi_checkbox( $field, $name, $value ) {
|
545 |
-
$
|
546 |
-
$name = $name . "[]";
|
547 |
|
|
|
548 |
$table .= sprintf( '<input type="hidden" name="%1$s" value="0">', $name );
|
549 |
foreach ( $field['options'] as $key => $label ) {
|
550 |
$checked = ( in_array( $key, $value ) ) ? 'checked="checked"' : '';
|
@@ -560,11 +542,11 @@ class SettingAPI {
|
|
560 |
*
|
561 |
* @param array $field
|
562 |
* @param string $name
|
563 |
-
* @param string $value
|
564 |
*
|
565 |
* @return string
|
566 |
*/
|
567 |
-
public function radio( $field, $name, $value ) {
|
568 |
$table = '<fieldset><legend class="screen-reader-text"><span>' . $field['name'] . '</span></legend><p>';
|
569 |
|
570 |
foreach ( $field['options'] as $key => $label ) {
|
@@ -582,11 +564,11 @@ class SettingAPI {
|
|
582 |
*
|
583 |
* @param array $field
|
584 |
* @param string $name
|
585 |
-
* @param string $value
|
586 |
*
|
587 |
* @return string
|
588 |
*/
|
589 |
-
public function select( $field, $name, $value ) {
|
590 |
$table = sprintf( '<select id="%1$s" name="%2$s" class="regular-text">', $field['id'], $name );
|
591 |
foreach ( $field['options'] as $key => $label ) {
|
592 |
$selected = ( $value == $key ) ? 'selected="selected"' : '';
|
@@ -600,38 +582,14 @@ class SettingAPI {
|
|
600 |
/**
|
601 |
* Get available image sizes
|
602 |
*
|
603 |
-
* @param $field
|
604 |
-
* @param $name
|
605 |
-
* @param $value
|
606 |
*
|
607 |
* @return string
|
608 |
*/
|
609 |
-
public function image_sizes( $field, $name, $value ) {
|
610 |
-
|
611 |
-
global $_wp_additional_image_sizes;
|
612 |
-
|
613 |
-
$sizes = array();
|
614 |
-
|
615 |
-
foreach ( get_intermediate_image_sizes() as $_size ) {
|
616 |
-
if ( in_array( $_size, array( 'thumbnail', 'medium', 'medium_large', 'large' ) ) ) {
|
617 |
-
|
618 |
-
$width = get_option( "{$_size}_size_w" );
|
619 |
-
$height = get_option( "{$_size}_size_h" );
|
620 |
-
$crop = (bool) get_option( "{$_size}_crop" ) ? 'hard' : 'soft';
|
621 |
-
|
622 |
-
$sizes[ $_size ] = "{$_size} - {$width}x{$height} ($crop crop)";
|
623 |
-
|
624 |
-
} elseif ( isset( $_wp_additional_image_sizes[ $_size ] ) ) {
|
625 |
-
|
626 |
-
$width = $_wp_additional_image_sizes[ $_size ]['width'];
|
627 |
-
$height = $_wp_additional_image_sizes[ $_size ]['height'];
|
628 |
-
$crop = $_wp_additional_image_sizes[ $_size ]['crop'] ? 'hard' : 'soft';
|
629 |
-
|
630 |
-
$sizes[ $_size ] = "{$_size} - {$width}x{$height} ($crop crop)";
|
631 |
-
}
|
632 |
-
}
|
633 |
-
|
634 |
-
$sizes = array_merge( $sizes, array( 'full' => 'original uploaded image' ) );
|
635 |
|
636 |
$table = '<select name="' . $name . '" id="' . $field['id'] . '" class="regular-text select2">';
|
637 |
foreach ( $sizes as $key => $option ) {
|
@@ -648,18 +606,18 @@ class SettingAPI {
|
|
648 |
*
|
649 |
* @param array $field
|
650 |
* @param string $name
|
651 |
-
* @param string $value
|
652 |
*
|
653 |
* @return string
|
654 |
*/
|
655 |
-
public function wp_editor( $field, $name, $value ) {
|
656 |
ob_start();
|
657 |
echo "<div class='sp-wp-editor-container'>";
|
658 |
wp_editor( $value, $field['id'], array(
|
659 |
'textarea_name' => $name,
|
660 |
'tinymce' => false,
|
661 |
'media_buttons' => false,
|
662 |
-
'textarea_rows' =>
|
663 |
'quicktags' => array( "buttons" => "strong,em,link,img,ul,li,ol" ),
|
664 |
) );
|
665 |
echo "</div>";
|
2 |
|
3 |
namespace CarouselSlider\Supports;
|
4 |
|
5 |
+
use CarouselSlider\Helper;
|
6 |
use Exception;
|
7 |
|
8 |
defined( 'ABSPATH' ) || exit;
|
123 |
$page_title = $this->menu_fields['page_title'];
|
124 |
$menu_title = $this->menu_fields['menu_title'];
|
125 |
$menu_slug = $this->menu_fields['menu_slug'];
|
126 |
+
$capability = $this->menu_fields['capability'] ?? 'manage_options';
|
127 |
+
$parent_slug = $this->menu_fields['parent_slug'] ?? null;
|
128 |
|
129 |
if ( $parent_slug ) {
|
130 |
add_submenu_page(
|
133 |
$menu_title,
|
134 |
$capability,
|
135 |
$menu_slug,
|
136 |
+
[ $this, 'page_content' ]
|
137 |
);
|
138 |
} else {
|
139 |
add_menu_page(
|
141 |
$menu_title,
|
142 |
$capability,
|
143 |
$menu_slug,
|
144 |
+
[ $this, 'page_content' ]
|
145 |
);
|
146 |
}
|
147 |
}
|
177 |
return;
|
178 |
}
|
179 |
|
180 |
+
$current_tab = $_GET['tab'] ?? $this->tabs[0]['id'];
|
181 |
$page = $this->menu_fields['menu_slug'];
|
182 |
|
183 |
echo '<h2 class="nav-tab-wrapper wp-clearfix">';
|
195 |
/**
|
196 |
* Filter settings fields by page tab
|
197 |
*
|
198 |
+
* @param string|null|mixed $current_tab
|
199 |
*
|
200 |
* @return array
|
201 |
*/
|
202 |
+
public function filter_fields_by_tab( $current_tab = null ): array {
|
203 |
|
204 |
if ( count( $this->tabs ) < 1 ) {
|
205 |
return $this->fields;
|
206 |
}
|
207 |
|
208 |
if ( ! $current_tab ) {
|
209 |
+
$current_tab = $_GET['tab'] ?? $this->tabs[0]['id'];
|
210 |
}
|
211 |
|
212 |
$new_array = array();
|
235 |
*
|
236 |
* @return array
|
237 |
*/
|
238 |
+
public function sanitize_callback( array $input ): array {
|
239 |
+
$output_array = [];
|
240 |
$fields = $this->fields;
|
241 |
$options = (array) get_option( $this->menu_fields['option_name'] );
|
242 |
$options = array_filter( $options );
|
243 |
|
244 |
if ( empty( $options ) ) {
|
245 |
+
$options = $this->get_options();
|
246 |
}
|
247 |
|
248 |
if ( count( $this->tabs ) > 0 ) {
|
249 |
parse_str( $_POST['_wp_http_referer'], $referrer );
|
250 |
+
$tab = $referrer['tab'] ?? $this->tabs[0]['id'];
|
251 |
$fields = $this->filter_fields_by_tab( $tab );
|
252 |
}
|
253 |
|
254 |
// Loop through each setting being saved and
|
255 |
+
// pass it through a filter to sanitize
|
256 |
foreach ( $input as $key => $value ) {
|
257 |
foreach ( $fields as $field ) {
|
258 |
if ( $field['id'] == $key ) {
|
269 |
* Get options parsed with default value
|
270 |
* @return array
|
271 |
*/
|
272 |
+
public function get_options(): array {
|
273 |
+
if ( empty( $this->options ) ) {
|
274 |
+
$options_array = [];
|
275 |
|
276 |
+
foreach ( $this->fields as $value ) {
|
277 |
+
$options_array[ $value['id'] ] = $value['std'] ?? '';
|
278 |
+
}
|
|
|
279 |
|
280 |
+
$options = wp_parse_args(
|
281 |
+
get_option( $this->menu_fields['option_name'] ),
|
282 |
+
$options_array
|
283 |
+
);
|
284 |
|
285 |
+
$this->options = $options;
|
286 |
+
}
|
287 |
+
|
288 |
+
return $this->options;
|
289 |
}
|
290 |
|
291 |
/**
|
296 |
*
|
297 |
* @return mixed
|
298 |
*/
|
299 |
+
private function validate( $input, string $validation_rule = 'text' ) {
|
300 |
switch ( $validation_rule ) {
|
|
|
|
|
|
|
301 |
|
302 |
case 'number':
|
303 |
return is_int( $input ) ? trim( $input ) : intval( $input );
|
|
|
304 |
|
305 |
case 'url':
|
306 |
return esc_url_raw( trim( $input ) );
|
|
|
307 |
|
308 |
case 'email':
|
309 |
return sanitize_email( $input );
|
|
|
310 |
|
311 |
case 'checkbox':
|
312 |
return ( $input == 1 ) ? 1 : 0;
|
|
|
313 |
|
314 |
case 'multi_checkbox':
|
315 |
return $input;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
316 |
|
317 |
case 'date':
|
318 |
return date( 'F d, Y', strtotime( $input ) );
|
|
|
319 |
|
320 |
case 'textarea':
|
321 |
return wp_filter_nohtml_kses( $input );
|
|
|
322 |
|
323 |
case 'inlinehtml':
|
324 |
return wp_filter_kses( force_balance_tags( $input ) );
|
|
|
325 |
|
326 |
case 'linebreaks':
|
327 |
return wp_strip_all_tags( $input );
|
|
|
328 |
|
329 |
case 'wp_editor':
|
330 |
return wp_kses_post( $input );
|
|
|
331 |
|
332 |
default:
|
333 |
return sanitize_text_field( $input );
|
|
|
334 |
}
|
335 |
}
|
336 |
|
341 |
*
|
342 |
* @return void
|
343 |
*/
|
344 |
+
private function setting_fields( array $fields = [] ) {
|
345 |
$fields = is_array( $fields ) ? $fields : $this->fields;
|
346 |
|
347 |
+
$table = "<table class='form-table'>";
|
|
|
348 |
|
349 |
foreach ( $fields as $field ) {
|
350 |
$name = sprintf( '%s[%s]', $this->menu_fields['option_name'], $field['id'] );
|
351 |
+
$type = $field['type'] ?? 'text';
|
352 |
+
$value = $this->options[ $field['id'] ] ?? '';
|
353 |
|
354 |
$table .= "<tr>";
|
355 |
$table .= sprintf( '<th scope="row"><label for="%1$s">%2$s</label></th>', $field['id'],
|
363 |
}
|
364 |
|
365 |
if ( ! empty( $field['desc'] ) ) {
|
366 |
+
$desc = is_array( $field['desc'] ) ? implode( "<br>", $field['desc'] ) : $field['desc'];
|
367 |
+
$table .= sprintf( '<p class="description">%s</p>', $desc );
|
368 |
}
|
369 |
$table .= "</td>";
|
370 |
$table .= "</tr>";
|
379 |
*
|
380 |
* @param array $field
|
381 |
* @param string $name
|
382 |
+
* @param string|mixed $value
|
383 |
*
|
384 |
* @return string
|
385 |
*/
|
386 |
+
public function text( array $field, string $name, $value ): string {
|
387 |
return sprintf( '<input type="text" class="regular-text" value="%1$s" id="%2$s" name="%3$s">', $value,
|
388 |
$field['id'], $name );
|
389 |
}
|
393 |
*
|
394 |
* @param array $field
|
395 |
* @param string $name
|
396 |
+
* @param string|mixed $value
|
397 |
*
|
398 |
* @return string
|
399 |
*/
|
400 |
+
public function email( array $field, string $name, $value ): string {
|
401 |
return sprintf( '<input type="email" class="regular-text" value="%1$s" id="%2$s" name="%3$s">', $value,
|
402 |
$field['id'], $name );
|
403 |
}
|
407 |
*
|
408 |
* @param array $field
|
409 |
* @param string $name
|
410 |
+
* @param string|mixed $value
|
411 |
*
|
412 |
* @return string
|
413 |
*/
|
414 |
+
public function password( array $field, string $name, $value = null ): string {
|
415 |
+
return sprintf( '<input type="password" class="regular-text" value="" id="%1$s" name="%2$s">',
|
416 |
$field['id'], $name );
|
417 |
}
|
418 |
|
421 |
*
|
422 |
* @param array $field
|
423 |
* @param string $name
|
424 |
+
* @param string|mixed $value
|
425 |
*
|
426 |
* @return string
|
427 |
*/
|
428 |
+
public function number( array $field, string $name, $value ): string {
|
429 |
return sprintf( '<input type="number" class="regular-text" value="%1$s" id="%2$s" name="%3$s">', $value,
|
430 |
$field['id'], $name );
|
431 |
}
|
435 |
*
|
436 |
* @param array $field
|
437 |
* @param string $name
|
438 |
+
* @param string|mixed $value
|
439 |
*
|
440 |
* @return string
|
441 |
*/
|
442 |
+
public function url( array $field, string $name, $value ): string {
|
443 |
return sprintf( '<input type="url" class="regular-text" value="%1$s" id="%2$s" name="%3$s">', $value,
|
444 |
$field['id'], $name );
|
445 |
}
|
449 |
*
|
450 |
* @param array $field
|
451 |
* @param string $name
|
452 |
+
* @param string|mixed $value
|
453 |
*
|
454 |
* @return string
|
455 |
*/
|
456 |
+
public function color( array $field, string $name, $value ): string {
|
457 |
$default_color = ( isset( $field['std'] ) ) ? $field['std'] : "";
|
458 |
|
459 |
return sprintf( '<input type="text" class="color-picker" value="%1$s" id="%2$s" name="%3$s" data-alpha="true" data-default-color="%4$s">',
|
465 |
*
|
466 |
* @param array $field
|
467 |
* @param string $name
|
468 |
+
* @param string|mixed $value
|
469 |
*
|
470 |
* @return string
|
471 |
*/
|
472 |
+
public function date( array $field, string $name, $value ): string {
|
473 |
+
$value = date( "Y-m-d", strtotime( $value ) );
|
474 |
|
475 |
+
return sprintf( '<input type="date" class="regular-text" value="%1$s" id="%2$s" name="%3$s">',
|
476 |
$value, $field['id'], $name );
|
477 |
}
|
478 |
|
481 |
*
|
482 |
* @param array $field
|
483 |
* @param string $name
|
484 |
+
* @param string|mixed $value
|
485 |
*
|
486 |
* @return string
|
487 |
*/
|
488 |
+
public function textarea( array $field, string $name, $value ): string {
|
489 |
+
$rows = $field['rows'] ?? 5;
|
490 |
+
$cols = $field['cols'] ?? 40;
|
491 |
$placeholder = ( isset( $field['placeholder'] ) ) ? sprintf( 'placeholder="%s"',
|
492 |
esc_attr( $field['placeholder'] ) ) : '';
|
493 |
|
499 |
*
|
500 |
* @param array $field
|
501 |
* @param string $name
|
502 |
+
* @param string|mixed $value
|
503 |
*
|
504 |
* @return string
|
505 |
*/
|
506 |
+
public function checkbox( array $field, string $name, $value ): string {
|
507 |
$checked = ( 1 == $value ) ? 'checked' : '';
|
508 |
$table = '<input type="hidden" name="' . $name . '" value="0">';
|
509 |
$table .= '<fieldset><legend class="screen-reader-text"><span>' . $field['name'] . '</span></legend>';
|
519 |
*
|
520 |
* @param array $field
|
521 |
* @param string $name
|
522 |
+
* @param array|mixed $value
|
523 |
*
|
524 |
* @return string
|
525 |
*/
|
526 |
+
public function multi_checkbox( array $field, string $name, $value ): string {
|
527 |
+
$name = $name . "[]";
|
|
|
528 |
|
529 |
+
$table = "<fieldset>";
|
530 |
$table .= sprintf( '<input type="hidden" name="%1$s" value="0">', $name );
|
531 |
foreach ( $field['options'] as $key => $label ) {
|
532 |
$checked = ( in_array( $key, $value ) ) ? 'checked="checked"' : '';
|
542 |
*
|
543 |
* @param array $field
|
544 |
* @param string $name
|
545 |
+
* @param string|mixed $value
|
546 |
*
|
547 |
* @return string
|
548 |
*/
|
549 |
+
public function radio( array $field, string $name, $value ): string {
|
550 |
$table = '<fieldset><legend class="screen-reader-text"><span>' . $field['name'] . '</span></legend><p>';
|
551 |
|
552 |
foreach ( $field['options'] as $key => $label ) {
|
564 |
*
|
565 |
* @param array $field
|
566 |
* @param string $name
|
567 |
+
* @param string|mixed $value
|
568 |
*
|
569 |
* @return string
|
570 |
*/
|
571 |
+
public function select( array $field, string $name, $value ): string {
|
572 |
$table = sprintf( '<select id="%1$s" name="%2$s" class="regular-text">', $field['id'], $name );
|
573 |
foreach ( $field['options'] as $key => $label ) {
|
574 |
$selected = ( $value == $key ) ? 'selected="selected"' : '';
|
582 |
/**
|
583 |
* Get available image sizes
|
584 |
*
|
585 |
+
* @param array $field
|
586 |
+
* @param string $name
|
587 |
+
* @param string|mixed $value
|
588 |
*
|
589 |
* @return string
|
590 |
*/
|
591 |
+
public function image_sizes( array $field, string $name, $value ): string {
|
592 |
+
$sizes = Helper::get_available_image_sizes();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
593 |
|
594 |
$table = '<select name="' . $name . '" id="' . $field['id'] . '" class="regular-text select2">';
|
595 |
foreach ( $sizes as $key => $option ) {
|
606 |
*
|
607 |
* @param array $field
|
608 |
* @param string $name
|
609 |
+
* @param string|mixed $value
|
610 |
*
|
611 |
* @return string
|
612 |
*/
|
613 |
+
public function wp_editor( array $field, string $name, $value ): string {
|
614 |
ob_start();
|
615 |
echo "<div class='sp-wp-editor-container'>";
|
616 |
wp_editor( $value, $field['id'], array(
|
617 |
'textarea_name' => $name,
|
618 |
'tinymce' => false,
|
619 |
'media_buttons' => false,
|
620 |
+
'textarea_rows' => $field['rows'] ?? 6,
|
621 |
'quicktags' => array( "buttons" => "strong,em,link,img,ul,li,ol" ),
|
622 |
) );
|
623 |
echo "</div>";
|
includes/Supports/SettingApi/DefaultSettingApi.php
ADDED
@@ -0,0 +1,339 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace CarouselSlider\Supports\SettingApi;
|
4 |
+
|
5 |
+
use CarouselSlider\Interfaces\FormBuilderInterface;
|
6 |
+
|
7 |
+
defined( 'ABSPATH' ) || exit;
|
8 |
+
|
9 |
+
/**
|
10 |
+
* DefaultSettingApi class
|
11 |
+
*/
|
12 |
+
class DefaultSettingApi extends SettingApi {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Setting page form action attribute value
|
16 |
+
*
|
17 |
+
* @var string
|
18 |
+
*/
|
19 |
+
protected $action = 'options.php';
|
20 |
+
|
21 |
+
/**
|
22 |
+
* The FormBuilder class
|
23 |
+
*
|
24 |
+
* @var FormBuilder
|
25 |
+
*/
|
26 |
+
protected $form_builder;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Class constructor
|
30 |
+
*/
|
31 |
+
public function __construct() {
|
32 |
+
if ( is_admin() ) {
|
33 |
+
add_action( 'admin_init', array( $this, 'register_setting' ) );
|
34 |
+
add_action( 'admin_menu', array( $this, 'add_menu_page' ) );
|
35 |
+
}
|
36 |
+
}
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Register setting and its sanitize callback.
|
40 |
+
*/
|
41 |
+
public function register_setting() {
|
42 |
+
register_setting( $this->get_option_name(), $this->get_option_name(), [ $this, 'sanitize_callback' ] );
|
43 |
+
}
|
44 |
+
|
45 |
+
/**
|
46 |
+
* Sanitize each setting field as needed
|
47 |
+
*
|
48 |
+
* @param array|mixed $input Contains all settings fields as array keys.
|
49 |
+
*
|
50 |
+
* @return array
|
51 |
+
*/
|
52 |
+
public function sanitize_callback( $input ): array {
|
53 |
+
return $this->sanitize_options( is_array( $input ) ? $input : [] );
|
54 |
+
}
|
55 |
+
|
56 |
+
/**
|
57 |
+
* Create admin menu
|
58 |
+
*/
|
59 |
+
public function add_menu_page() {
|
60 |
+
$page_title = $this->menu_fields['page_title'];
|
61 |
+
$menu_title = $this->menu_fields['menu_title'];
|
62 |
+
$menu_slug = $this->menu_fields['menu_slug'];
|
63 |
+
$capability = $this->menu_fields['capability'] ?? 'manage_options';
|
64 |
+
$parent_slug = $this->menu_fields['parent_slug'] ?? null;
|
65 |
+
|
66 |
+
if ( $parent_slug ) {
|
67 |
+
add_submenu_page(
|
68 |
+
$parent_slug,
|
69 |
+
$page_title,
|
70 |
+
$menu_title,
|
71 |
+
$capability,
|
72 |
+
$menu_slug,
|
73 |
+
[ $this, 'page_content' ]
|
74 |
+
);
|
75 |
+
} else {
|
76 |
+
add_menu_page( $page_title, $menu_title, $capability, $menu_slug, [ $this, 'page_content' ] );
|
77 |
+
}
|
78 |
+
}
|
79 |
+
|
80 |
+
/**
|
81 |
+
* Load page content
|
82 |
+
*/
|
83 |
+
public function page_content() {
|
84 |
+
$options = $this->get_options();
|
85 |
+
$option_name = $this->get_option_name();
|
86 |
+
|
87 |
+
$has_sections = false;
|
88 |
+
$panel = '';
|
89 |
+
$sections = [];
|
90 |
+
if ( $this->has_panels() ) {
|
91 |
+
$panels_ids = wp_list_pluck( $this->get_panels(), 'id' );
|
92 |
+
$current_tab = isset( $_GET['tab'] ) ?? null; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
93 |
+
$panel = in_array( $current_tab, $panels_ids, true ) ? $current_tab : $panels_ids[0];
|
94 |
+
$sections = $this->get_sections_by_panel( $panel );
|
95 |
+
$has_sections = count( $sections ) > 0;
|
96 |
+
}
|
97 |
+
ob_start(); ?>
|
98 |
+
<div class="wrap">
|
99 |
+
<h1><?php echo esc_html( $this->menu_fields['page_title'] ); ?></h1>
|
100 |
+
<hr class="wp-header-end">
|
101 |
+
<?php if ( ! empty( $this->menu_fields['about_text'] ) ) { ?>
|
102 |
+
<div class="about-text"><?php echo esc_html( $this->menu_fields['about_text'] ); ?></div>
|
103 |
+
<?php } ?>
|
104 |
+
<?php
|
105 |
+
if ( $this->has_panels() ) {
|
106 |
+
echo $this->option_page_tabs(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
107 |
+
}
|
108 |
+
?>
|
109 |
+
<form autocomplete="off" method="POST" action="<?php echo esc_attr( $this->action ); ?>">
|
110 |
+
<?php
|
111 |
+
settings_fields( $option_name );
|
112 |
+
if ( $has_sections ) {
|
113 |
+
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
114 |
+
echo $this->get_fields_html_by_section( $sections, $panel );
|
115 |
+
} else {
|
116 |
+
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
117 |
+
echo $this->get_form_builder()->get_fields_html( $this->filter_fields_by_tab(), $option_name, $options );
|
118 |
+
}
|
119 |
+
submit_button();
|
120 |
+
?>
|
121 |
+
</form>
|
122 |
+
</div>
|
123 |
+
<?php
|
124 |
+
echo ob_get_clean(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
125 |
+
}
|
126 |
+
|
127 |
+
/**
|
128 |
+
* Get fields HTML by section
|
129 |
+
*
|
130 |
+
* @param array $sections Array of section.
|
131 |
+
* @param string|null $panel Panel id.
|
132 |
+
*
|
133 |
+
* @return string
|
134 |
+
*/
|
135 |
+
public function get_fields_html_by_section( array $sections = [], string $panel = '' ): string {
|
136 |
+
$options = $this->get_options();
|
137 |
+
$option_name = $this->get_option_name();
|
138 |
+
|
139 |
+
$table = '';
|
140 |
+
foreach ( $sections as $section ) {
|
141 |
+
if ( ! empty( $section['title'] ) ) {
|
142 |
+
$table .= '<h2 class="title">' . esc_html( $section['title'] ) . '</h2>';
|
143 |
+
}
|
144 |
+
if ( ! empty( $section['description'] ) ) {
|
145 |
+
$table .= '<p class="description">' . esc_js( $section['description'] ) . '</p>';
|
146 |
+
}
|
147 |
+
|
148 |
+
$fields = $this->get_fields_by( $section['id'], $panel );
|
149 |
+
$table .= $this->get_form_builder()->get_fields_html( $fields, $option_name, $options );
|
150 |
+
}
|
151 |
+
|
152 |
+
return $table;
|
153 |
+
}
|
154 |
+
|
155 |
+
/**
|
156 |
+
* Generate Option Page Tabs
|
157 |
+
*
|
158 |
+
* @return string
|
159 |
+
*/
|
160 |
+
private function option_page_tabs(): string {
|
161 |
+
$panels = $this->get_panels();
|
162 |
+
if ( count( $panels ) < 1 ) {
|
163 |
+
return '';
|
164 |
+
}
|
165 |
+
|
166 |
+
$current_tab = $_GET['tab'] ?? $panels[0]['id']; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
167 |
+
$page = $this->menu_fields['menu_slug'];
|
168 |
+
|
169 |
+
$html = '<h2 class="nav-tab-wrapper wp-clearfix">';
|
170 |
+
foreach ( $panels as $tab ) {
|
171 |
+
$class = ( $tab['id'] === $current_tab ) ? ' nav-tab-active' : '';
|
172 |
+
$page_url = esc_url(
|
173 |
+
add_query_arg(
|
174 |
+
[
|
175 |
+
'page' => $page,
|
176 |
+
'tab' => $tab['id'],
|
177 |
+
],
|
178 |
+
admin_url( $this->menu_fields['parent_slug'] )
|
179 |
+
)
|
180 |
+
);
|
181 |
+
$html .= '<a class="nav-tab' . $class . '" href="' . $page_url . '">' . $tab['title'] . '</a>';
|
182 |
+
}
|
183 |
+
$html .= '</h2>';
|
184 |
+
|
185 |
+
return $html;
|
186 |
+
}
|
187 |
+
|
188 |
+
/**
|
189 |
+
* Filter settings fields by page tab
|
190 |
+
*
|
191 |
+
* @param string|null $current_tab The current tab slug.
|
192 |
+
*
|
193 |
+
* @return array
|
194 |
+
*/
|
195 |
+
public function filter_fields_by_tab( string $current_tab = '' ): array {
|
196 |
+
if ( ! $this->has_panels() ) {
|
197 |
+
return $this->get_fields();
|
198 |
+
}
|
199 |
+
|
200 |
+
if ( empty( $current_tab ) ) {
|
201 |
+
$panels = $this->get_panels();
|
202 |
+
$current_tab = $_GET['tab'] ?? $panels[0]['id']; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
203 |
+
}
|
204 |
+
|
205 |
+
return $this->get_fields_by_panel( $current_tab );
|
206 |
+
}
|
207 |
+
|
208 |
+
/**
|
209 |
+
* Add new field
|
210 |
+
*
|
211 |
+
* @param array $field The field settings.
|
212 |
+
*/
|
213 |
+
public function add_field( array $field ) {
|
214 |
+
if ( empty( $field['title'] ) && ! empty( $field['name'] ) ) {
|
215 |
+
$field['title'] = $field['name'];
|
216 |
+
unset( $field['name'] );
|
217 |
+
}
|
218 |
+
if ( empty( $field['description'] ) && ! empty( $field['desc'] ) ) {
|
219 |
+
$field['description'] = $field['desc'];
|
220 |
+
unset( $field['desc'] );
|
221 |
+
}
|
222 |
+
if ( empty( $field['default'] ) && ! empty( $field['std'] ) ) {
|
223 |
+
$field['default'] = $field['std'];
|
224 |
+
unset( $field['std'] );
|
225 |
+
}
|
226 |
+
$this->set_field( $field );
|
227 |
+
}
|
228 |
+
|
229 |
+
/**
|
230 |
+
* Check if it has panels
|
231 |
+
*
|
232 |
+
* @return bool
|
233 |
+
*/
|
234 |
+
public function has_panels(): bool {
|
235 |
+
return count( $this->panels ) > 0;
|
236 |
+
}
|
237 |
+
|
238 |
+
/**
|
239 |
+
* Check if it has sections
|
240 |
+
*
|
241 |
+
* @return bool
|
242 |
+
*/
|
243 |
+
public function has_sections(): bool {
|
244 |
+
return count( $this->sections ) > 0;
|
245 |
+
}
|
246 |
+
|
247 |
+
/**
|
248 |
+
* Get sections for current panel
|
249 |
+
*
|
250 |
+
* @param string $panel The panel slug.
|
251 |
+
*
|
252 |
+
* @return array
|
253 |
+
*/
|
254 |
+
public function get_sections_by_panel( string $panel = '' ): array {
|
255 |
+
if ( empty( $panel ) || ! $this->has_panels() ) {
|
256 |
+
return $this->get_sections();
|
257 |
+
}
|
258 |
+
|
259 |
+
$panels = [];
|
260 |
+
foreach ( $this->get_sections() as $section ) {
|
261 |
+
if ( $section['panel'] === $panel ) {
|
262 |
+
$panels[] = $section;
|
263 |
+
}
|
264 |
+
}
|
265 |
+
|
266 |
+
return $panels;
|
267 |
+
}
|
268 |
+
|
269 |
+
/**
|
270 |
+
* Get field for current section
|
271 |
+
*
|
272 |
+
* @param string|null $section The section slug.
|
273 |
+
* @param string|null $panel The panel slug.
|
274 |
+
*
|
275 |
+
* @return array
|
276 |
+
*/
|
277 |
+
public function get_fields_by( $section = '', $panel = '' ): array {
|
278 |
+
if ( ( empty( $section ) || ! $this->has_sections() ) && empty( $panel ) ) {
|
279 |
+
return $this->get_fields();
|
280 |
+
}
|
281 |
+
|
282 |
+
$fields = [];
|
283 |
+
foreach ( $this->get_fields() as $field ) {
|
284 |
+
if (
|
285 |
+
( isset( $field['section'] ) && $field['section'] === $section ) ||
|
286 |
+
( ! empty( $panel ) && isset( $field['panel'] ) && $panel === $field['panel'] )
|
287 |
+
) {
|
288 |
+
$fields[ $field['id'] ] = $field;
|
289 |
+
}
|
290 |
+
}
|
291 |
+
|
292 |
+
return $fields;
|
293 |
+
}
|
294 |
+
|
295 |
+
/**
|
296 |
+
* Filter settings fields by page tab
|
297 |
+
*
|
298 |
+
* @param string|null $panel The panel slug.
|
299 |
+
*
|
300 |
+
* @return array
|
301 |
+
*/
|
302 |
+
public function get_fields_by_panel( string $panel = '' ): array {
|
303 |
+
$sections = $this->get_sections_by_panel( $panel );
|
304 |
+
|
305 |
+
if ( count( $sections ) < 1 ) {
|
306 |
+
return $this->get_fields_by( null, $panel );
|
307 |
+
}
|
308 |
+
|
309 |
+
$fields = [];
|
310 |
+
foreach ( $sections as $section ) {
|
311 |
+
$_section = $this->get_fields_by( $section['id'], $panel );
|
312 |
+
$fields = array_merge( $fields, $_section );
|
313 |
+
}
|
314 |
+
|
315 |
+
return $fields;
|
316 |
+
}
|
317 |
+
|
318 |
+
/**
|
319 |
+
* Get for builder class
|
320 |
+
*
|
321 |
+
* @return FormBuilderInterface
|
322 |
+
*/
|
323 |
+
public function get_form_builder(): FormBuilderInterface {
|
324 |
+
if ( ! $this->form_builder instanceof FormBuilderInterface ) {
|
325 |
+
$this->set_form_builder( new FormBuilder() );
|
326 |
+
}
|
327 |
+
|
328 |
+
return $this->form_builder;
|
329 |
+
}
|
330 |
+
|
331 |
+
/**
|
332 |
+
* Set form builder class
|
333 |
+
*
|
334 |
+
* @param FormBuilderInterface $form_builder The form builder class.
|
335 |
+
*/
|
336 |
+
public function set_form_builder( FormBuilderInterface $form_builder ) {
|
337 |
+
$this->form_builder = $form_builder;
|
338 |
+
}
|
339 |
+
}
|
includes/Supports/SettingApi/FormBuilder.php
ADDED
@@ -0,0 +1,391 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace CarouselSlider\Supports\SettingApi;
|
4 |
+
|
5 |
+
use CarouselSlider\Interfaces\FormBuilderInterface;
|
6 |
+
use CarouselSlider\Supports\Validate;
|
7 |
+
|
8 |
+
// If this file is called directly, abort.
|
9 |
+
defined( 'ABSPATH' ) || die;
|
10 |
+
|
11 |
+
/**
|
12 |
+
* FormBuilder class
|
13 |
+
*/
|
14 |
+
class FormBuilder implements FormBuilderInterface {
|
15 |
+
|
16 |
+
/**
|
17 |
+
* The option name
|
18 |
+
*
|
19 |
+
* @var string|null
|
20 |
+
*/
|
21 |
+
protected $option_name = null;
|
22 |
+
|
23 |
+
/**
|
24 |
+
* The fields settings
|
25 |
+
*
|
26 |
+
* @var array
|
27 |
+
*/
|
28 |
+
protected $fields_settings = [];
|
29 |
+
|
30 |
+
/**
|
31 |
+
* The values of the fields
|
32 |
+
*
|
33 |
+
* @var array
|
34 |
+
*/
|
35 |
+
protected $values = [];
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Set field settings
|
39 |
+
*
|
40 |
+
* @param array $settings The settings arguments.
|
41 |
+
*
|
42 |
+
* @return void
|
43 |
+
*/
|
44 |
+
public function set_fields_settings( array $settings ) {
|
45 |
+
$this->fields_settings = $settings;
|
46 |
+
}
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Set option name
|
50 |
+
*
|
51 |
+
* @param string $option_name The option name.
|
52 |
+
*
|
53 |
+
* @return void
|
54 |
+
*/
|
55 |
+
public function set_option_name( string $option_name ) {
|
56 |
+
$this->option_name = $option_name;
|
57 |
+
}
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Set fields values
|
61 |
+
*
|
62 |
+
* @param array $values The values.
|
63 |
+
*
|
64 |
+
* @return void
|
65 |
+
*/
|
66 |
+
public function set_values( array $values ) {
|
67 |
+
$this->values = $values;
|
68 |
+
}
|
69 |
+
|
70 |
+
/**
|
71 |
+
* Render settings html
|
72 |
+
*
|
73 |
+
* @return string
|
74 |
+
*/
|
75 |
+
public function render(): string {
|
76 |
+
$table = "<table class='form-table'>";
|
77 |
+
|
78 |
+
foreach ( $this->fields_settings as $field ) {
|
79 |
+
$type = $field['type'] ?? 'text';
|
80 |
+
$name = sprintf( '%s[%s]', $this->option_name, $field['id'] );
|
81 |
+
$value = $this->values[ $field['id'] ] ?? '';
|
82 |
+
|
83 |
+
$table .= '<tr>';
|
84 |
+
if ( ! empty( $field['title'] ) ) {
|
85 |
+
$table .= sprintf( '<th scope="row"><label for="%1$s">%2$s</label></th>', $field['id'], $field['title'] );
|
86 |
+
}
|
87 |
+
$table .= '<td>';
|
88 |
+
|
89 |
+
if ( method_exists( $this, $type ) ) {
|
90 |
+
$table .= $this->$type( $field, $name, $value );
|
91 |
+
} else {
|
92 |
+
$table .= $this->text( $field, $name, $value );
|
93 |
+
}
|
94 |
+
|
95 |
+
if ( ! empty( $field['description'] ) ) {
|
96 |
+
$desc = is_array( $field['description'] ) ?
|
97 |
+
implode( '<br>', $field['description'] ) :
|
98 |
+
$field['description'];
|
99 |
+
$table .= sprintf( '<p class="description">%s</p>', $desc );
|
100 |
+
}
|
101 |
+
$table .= '</td>';
|
102 |
+
$table .= '</tr>';
|
103 |
+
}
|
104 |
+
|
105 |
+
$table .= '</table>';
|
106 |
+
|
107 |
+
return $table;
|
108 |
+
}
|
109 |
+
|
110 |
+
/**
|
111 |
+
* Settings fields
|
112 |
+
*
|
113 |
+
* @param array $fields The fields settings.
|
114 |
+
* @param string $option_name The option name.
|
115 |
+
* @param array $values The values.
|
116 |
+
*
|
117 |
+
* @return string
|
118 |
+
*/
|
119 |
+
public function get_fields_html( array $fields, string $option_name, array $values = [] ): string {
|
120 |
+
$this->set_fields_settings( $fields );
|
121 |
+
$this->set_option_name( $option_name );
|
122 |
+
$this->set_values( $values );
|
123 |
+
|
124 |
+
return $this->render();
|
125 |
+
}
|
126 |
+
|
127 |
+
/**
|
128 |
+
* Text input field
|
129 |
+
*
|
130 |
+
* @param array $field The field settings.
|
131 |
+
* @param string $name The field name.
|
132 |
+
* @param mixed $value The field value.
|
133 |
+
*
|
134 |
+
* @return string
|
135 |
+
*/
|
136 |
+
public function text( array $field, string $name, $value ): string {
|
137 |
+
$types = [ 'email', 'number', 'url', 'date', 'time' ];
|
138 |
+
$type = in_array( $field['type'], $types, true ) ? $field['type'] : 'text';
|
139 |
+
|
140 |
+
return sprintf(
|
141 |
+
'<input class="regular-text" value="%1$s" id="%2$s" name="%3$s" type="%4$s">',
|
142 |
+
esc_attr( $value ),
|
143 |
+
esc_attr( $field['id'] ),
|
144 |
+
esc_attr( $name ),
|
145 |
+
esc_attr( $type )
|
146 |
+
);
|
147 |
+
}
|
148 |
+
|
149 |
+
/**
|
150 |
+
* Password input field
|
151 |
+
*
|
152 |
+
* @param array $field The field settings.
|
153 |
+
* @param string $name The field name.
|
154 |
+
* @param mixed $value The field value.
|
155 |
+
*
|
156 |
+
* @return string
|
157 |
+
*/
|
158 |
+
public function password( array $field, string $name, $value ): string {
|
159 |
+
return sprintf(
|
160 |
+
'<input type="password" class="regular-text" value="" id="%1$s" name="%2$s">',
|
161 |
+
$field['id'],
|
162 |
+
$name
|
163 |
+
);
|
164 |
+
}
|
165 |
+
|
166 |
+
/**
|
167 |
+
* Color input field
|
168 |
+
*
|
169 |
+
* @param array $field The field settings.
|
170 |
+
* @param string $name The field name.
|
171 |
+
* @param mixed $value The field value.
|
172 |
+
*
|
173 |
+
* @return string
|
174 |
+
*/
|
175 |
+
public function color( array $field, string $name, $value ): string {
|
176 |
+
$default_color = $field['default'] ?? '';
|
177 |
+
|
178 |
+
return sprintf(
|
179 |
+
'<input type="text" class="color-picker" value="%1$s" id="%2$s" name="%3$s" data-alpha="true" data-default-color="%4$s">',
|
180 |
+
$value,
|
181 |
+
$field['id'],
|
182 |
+
$name,
|
183 |
+
$default_color
|
184 |
+
);
|
185 |
+
}
|
186 |
+
|
187 |
+
/**
|
188 |
+
* Textarea input field
|
189 |
+
*
|
190 |
+
* @param array $field The field settings.
|
191 |
+
* @param string $name The field name.
|
192 |
+
* @param mixed $value The field value.
|
193 |
+
*
|
194 |
+
* @return string
|
195 |
+
*/
|
196 |
+
public function textarea( array $field, string $name, $value ): string {
|
197 |
+
$rows = ( isset( $field['rows'] ) ) ? $field['rows'] : 5;
|
198 |
+
$cols = ( isset( $field['cols'] ) ) ? $field['cols'] : 40;
|
199 |
+
$placeholder = ( isset( $field['placeholder'] ) ) ? sprintf(
|
200 |
+
'placeholder="%s"',
|
201 |
+
esc_attr( $field['placeholder'] )
|
202 |
+
) : '';
|
203 |
+
|
204 |
+
return sprintf(
|
205 |
+
"<textarea id='%s' name='%s' rows='%s' cols='%s' " . $placeholder . '>' . esc_textarea( $value ) . '</textarea>',
|
206 |
+
esc_attr( $field['id'] ),
|
207 |
+
esc_attr( $name ),
|
208 |
+
esc_attr( $rows ),
|
209 |
+
esc_attr( $cols )
|
210 |
+
);
|
211 |
+
}
|
212 |
+
|
213 |
+
/**
|
214 |
+
* Checkbox input field
|
215 |
+
*
|
216 |
+
* @param array $field The field settings.
|
217 |
+
* @param string $name The field name.
|
218 |
+
* @param mixed $value The field value.
|
219 |
+
*
|
220 |
+
* @return string
|
221 |
+
*/
|
222 |
+
public function checkbox( array $field, string $name, $value ): string {
|
223 |
+
$true_value = isset( $field['true-value'] ) ? esc_attr( $field['true-value'] ) : '1';
|
224 |
+
$false_value = isset( $field['false-value'] ) ? esc_attr( $field['false-value'] ) : '0';
|
225 |
+
|
226 |
+
$checked = Validate::checked( $value ) ? 'checked' : '';
|
227 |
+
$table = '<input type="hidden" name="' . $name . '" value="' . $false_value . '">';
|
228 |
+
$table .= '<fieldset><legend class="screen-reader-text"><span>' . $field['title'] . '</span></legend>';
|
229 |
+
$table .= '<label for="' . $field['id'] . '">';
|
230 |
+
$table .= '<input type="checkbox" value="' . $true_value . '" id="' . $field['id'] . '" name="' . $name . '" ' . $checked . '>';
|
231 |
+
$table .= $field['title'] . '</label></fieldset>';
|
232 |
+
|
233 |
+
return $table;
|
234 |
+
}
|
235 |
+
|
236 |
+
/**
|
237 |
+
* Multi checkbox input field
|
238 |
+
*
|
239 |
+
* @param array $field The field settings.
|
240 |
+
* @param string $name The field name.
|
241 |
+
* @param mixed $value The field value.
|
242 |
+
*
|
243 |
+
* @return string
|
244 |
+
*/
|
245 |
+
public function multi_checkbox( array $field, string $name, $value ): string {
|
246 |
+
$table = '<fieldset>';
|
247 |
+
$name = $name . '[]';
|
248 |
+
|
249 |
+
$table .= sprintf( '<input type="hidden" name="%1$s" value="0">', $name );
|
250 |
+
foreach ( $field['options'] as $key => $label ) {
|
251 |
+
$checked = ( in_array( $key, $value, true ) ) ? 'checked="checked"' : '';
|
252 |
+
$table .= '<label for="' . $key . '"><input type="checkbox" value="' . $key . '" id="' . $key . '" name="' . $name . '" ' . $checked . '>' . $label . '</label><br>';
|
253 |
+
}
|
254 |
+
$table .= '</fieldset>';
|
255 |
+
|
256 |
+
return $table;
|
257 |
+
}
|
258 |
+
|
259 |
+
/**
|
260 |
+
* Radio input field
|
261 |
+
*
|
262 |
+
* @param array $field The field settings.
|
263 |
+
* @param string $name The field name.
|
264 |
+
* @param mixed $value The field value.
|
265 |
+
*
|
266 |
+
* @return string
|
267 |
+
*/
|
268 |
+
public function radio( array $field, string $name, $value ): string {
|
269 |
+
$table = '<fieldset><legend class="screen-reader-text"><span>' . $field['title'] . '</span></legend><p>';
|
270 |
+
|
271 |
+
foreach ( $field['options'] as $key => $label ) {
|
272 |
+
|
273 |
+
$checked = ( $value === $key ) ? 'checked="checked"' : '';
|
274 |
+
$table .= '<label><input type="radio" ' . $checked . ' value="' . $key . '" name="' . $name . '">' . $label . '</label><br>';
|
275 |
+
}
|
276 |
+
$table .= '</p></fieldset>';
|
277 |
+
|
278 |
+
return $table;
|
279 |
+
}
|
280 |
+
|
281 |
+
/**
|
282 |
+
* Select input field
|
283 |
+
*
|
284 |
+
* @param array $field The field settings.
|
285 |
+
* @param string $name The field name.
|
286 |
+
* @param mixed $value The field value.
|
287 |
+
*
|
288 |
+
* @return string
|
289 |
+
*/
|
290 |
+
public function select( array $field, string $name, $value ): string {
|
291 |
+
$table = sprintf( '<select id="%1$s" name="%2$s" class="regular-text">', $field['id'], $name );
|
292 |
+
foreach ( $field['options'] as $key => $label ) {
|
293 |
+
$selected = ( $value === $key ) ? 'selected="selected"' : '';
|
294 |
+
$table .= '<option value="' . $key . '" ' . $selected . '>' . $label . '</option>';
|
295 |
+
}
|
296 |
+
$table .= '</select>';
|
297 |
+
|
298 |
+
return $table;
|
299 |
+
}
|
300 |
+
|
301 |
+
/**
|
302 |
+
* Get available image sizes
|
303 |
+
*
|
304 |
+
* @param array $field The field settings.
|
305 |
+
* @param string $name The field name.
|
306 |
+
* @param mixed $value The field value.
|
307 |
+
*
|
308 |
+
* @return string
|
309 |
+
*/
|
310 |
+
public function image_sizes( array $field, string $name, $value ): string {
|
311 |
+
|
312 |
+
global $_wp_additional_image_sizes;
|
313 |
+
|
314 |
+
$sizes = [];
|
315 |
+
|
316 |
+
foreach ( get_intermediate_image_sizes() as $_size ) {
|
317 |
+
if ( in_array( $_size, [ 'thumbnail', 'medium', 'medium_large', 'large' ], true ) ) {
|
318 |
+
|
319 |
+
$width = get_option( "{$_size}_size_w" );
|
320 |
+
$height = get_option( "{$_size}_size_h" );
|
321 |
+
$crop = get_option( "{$_size}_crop" ) ? 'hard' : 'soft';
|
322 |
+
|
323 |
+
$sizes[ $_size ] = "{$_size} - {$width}x{$height} ($crop crop)";
|
324 |
+
|
325 |
+
} elseif ( isset( $_wp_additional_image_sizes[ $_size ] ) ) {
|
326 |
+
|
327 |
+
$width = $_wp_additional_image_sizes[ $_size ]['width'];
|
328 |
+
$height = $_wp_additional_image_sizes[ $_size ]['height'];
|
329 |
+
$crop = $_wp_additional_image_sizes[ $_size ]['crop'] ? 'hard' : 'soft';
|
330 |
+
|
331 |
+
$sizes[ $_size ] = "{$_size} - {$width}x{$height} ($crop crop)";
|
332 |
+
}
|
333 |
+
}
|
334 |
+
|
335 |
+
$sizes = array_merge( $sizes, array( 'full' => 'original uploaded image' ) );
|
336 |
+
|
337 |
+
$table = '<select name="' . $name . '" id="' . $field['id'] . '" class="regular-text select2">';
|
338 |
+
foreach ( $sizes as $key => $option ) {
|
339 |
+
$selected = ( $value === $key ) ? ' selected="selected"' : '';
|
340 |
+
$table .= '<option value="' . $key . '" ' . $selected . '>' . $option . '</option>';
|
341 |
+
}
|
342 |
+
$table .= '</select>';
|
343 |
+
|
344 |
+
return $table;
|
345 |
+
}
|
346 |
+
|
347 |
+
/**
|
348 |
+
* The wp_editor input field
|
349 |
+
*
|
350 |
+
* @param array $field The field settings.
|
351 |
+
* @param string $name The field name.
|
352 |
+
* @param mixed $value The field value.
|
353 |
+
*
|
354 |
+
* @return string
|
355 |
+
*/
|
356 |
+
public function wp_editor( array $field, string $name, $value ): string {
|
357 |
+
ob_start();
|
358 |
+
echo "<div class='sp-wp-editor-container'>";
|
359 |
+
wp_editor(
|
360 |
+
$value,
|
361 |
+
$field['id'],
|
362 |
+
array(
|
363 |
+
'textarea_name' => $name,
|
364 |
+
'tinymce' => false,
|
365 |
+
'media_buttons' => false,
|
366 |
+
'textarea_rows' => $field['rows'] ?? 6,
|
367 |
+
'quicktags' => array( 'buttons' => 'strong,em,link,img,ul,li,ol' ),
|
368 |
+
)
|
369 |
+
);
|
370 |
+
echo '</div>';
|
371 |
+
|
372 |
+
return ob_get_clean();
|
373 |
+
}
|
374 |
+
|
375 |
+
/**
|
376 |
+
* Get html field
|
377 |
+
*
|
378 |
+
* @param array $field The field settings.
|
379 |
+
* @param string $name The field name.
|
380 |
+
* @param mixed $value The field value.
|
381 |
+
*
|
382 |
+
* @return mixed
|
383 |
+
*/
|
384 |
+
public function html( array $field, string $name, $value ): string {
|
385 |
+
if ( isset( $field['html'] ) && is_string( $field['html'] ) ) {
|
386 |
+
return $field['html'];
|
387 |
+
}
|
388 |
+
|
389 |
+
return '';
|
390 |
+
}
|
391 |
+
}
|
includes/Supports/SettingApi/SettingApi.php
ADDED
@@ -0,0 +1,418 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace CarouselSlider\Supports\SettingApi;
|
4 |
+
|
5 |
+
use CarouselSlider\Supports\Sanitize;
|
6 |
+
use CarouselSlider\Supports\Validate;
|
7 |
+
use WP_Error;
|
8 |
+
|
9 |
+
defined( 'ABSPATH' ) || exit;
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Very simple WordPress Settings API wrapper class
|
13 |
+
*
|
14 |
+
* WordPress Option Page Wrapper class that implements WordPress Settings API and
|
15 |
+
* give you easy way to create multi tabs admin menu and
|
16 |
+
* add setting fields with build in validation.
|
17 |
+
*
|
18 |
+
* @author Sayful Islam <sayful.islam001@gmail.com>
|
19 |
+
* @link https://sayfulislam.com
|
20 |
+
*/
|
21 |
+
class SettingApi {
|
22 |
+
/**
|
23 |
+
* The instance of the class
|
24 |
+
*
|
25 |
+
* @var self
|
26 |
+
*/
|
27 |
+
private static $instance = null;
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Settings options array
|
31 |
+
*
|
32 |
+
* @var array
|
33 |
+
*/
|
34 |
+
protected $options = [];
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Settings menu fields array
|
38 |
+
*
|
39 |
+
* @var array
|
40 |
+
*/
|
41 |
+
protected $menu_fields = [];
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Settings fields array
|
45 |
+
*
|
46 |
+
* @var array
|
47 |
+
*/
|
48 |
+
protected $fields = [];
|
49 |
+
|
50 |
+
/**
|
51 |
+
* Settings tabs array
|
52 |
+
*
|
53 |
+
* @var array
|
54 |
+
*/
|
55 |
+
protected $panels = [];
|
56 |
+
|
57 |
+
/**
|
58 |
+
* The setting sections
|
59 |
+
*
|
60 |
+
* @var array
|
61 |
+
*/
|
62 |
+
protected $sections = [];
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Option name
|
66 |
+
*
|
67 |
+
* @var string
|
68 |
+
*/
|
69 |
+
protected $option_name = '';
|
70 |
+
|
71 |
+
/**
|
72 |
+
* The only one instance of the class can be loaded
|
73 |
+
*
|
74 |
+
* @return self
|
75 |
+
*/
|
76 |
+
public static function init() {
|
77 |
+
if ( is_null( self::$instance ) ) {
|
78 |
+
self::$instance = new self();
|
79 |
+
}
|
80 |
+
|
81 |
+
return self::$instance;
|
82 |
+
}
|
83 |
+
|
84 |
+
/**
|
85 |
+
* Add new admin menu
|
86 |
+
*
|
87 |
+
* This method is accessible outside the class for creating menu
|
88 |
+
*
|
89 |
+
* @param array $menu_fields The setting arguments.
|
90 |
+
*
|
91 |
+
* @return WP_Error|SettingApi
|
92 |
+
*/
|
93 |
+
public function add_menu( array $menu_fields ) {
|
94 |
+
if ( ! isset( $menu_fields['page_title'], $menu_fields['menu_title'], $menu_fields['menu_slug'] ) ) {
|
95 |
+
return new WP_Error( 'field_not_set', 'Required key is not set properly for creating menu.' );
|
96 |
+
}
|
97 |
+
|
98 |
+
$this->menu_fields = $menu_fields;
|
99 |
+
|
100 |
+
if ( ! empty( $menu_fields['option_name'] ) ) {
|
101 |
+
$this->set_option_name( $menu_fields['option_name'] );
|
102 |
+
}
|
103 |
+
|
104 |
+
return $this;
|
105 |
+
}
|
106 |
+
|
107 |
+
/**
|
108 |
+
* Sanitize options values
|
109 |
+
*
|
110 |
+
* @param array $input The setting arguments.
|
111 |
+
*
|
112 |
+
* @return array
|
113 |
+
*/
|
114 |
+
public function sanitize_options( array $input ): array {
|
115 |
+
$output_array = array();
|
116 |
+
$fields = $this->get_fields();
|
117 |
+
$options = $this->get_options();
|
118 |
+
foreach ( $fields as $field ) {
|
119 |
+
$key = $field['id'] ?? null;
|
120 |
+
$default = $field['default'] ?? null;
|
121 |
+
$type = $field['type'] ?? 'text';
|
122 |
+
$value = $input[ $field['id'] ] ?? $options[ $field['id'] ];
|
123 |
+
|
124 |
+
if ( isset( $field['options'] ) && is_array( $field['options'] ) ) {
|
125 |
+
$output_array[ $key ] = in_array( $value, array_keys( $field['options'] ), true ) ? $value : $default;
|
126 |
+
continue;
|
127 |
+
}
|
128 |
+
|
129 |
+
if ( 'checkbox' === $type ) {
|
130 |
+
$output_array[ $key ] = Validate::checked( $value ) ? 1 : 0;
|
131 |
+
continue;
|
132 |
+
}
|
133 |
+
|
134 |
+
if ( isset( $field['sanitize_callback'] ) && is_callable( $field['sanitize_callback'] ) ) {
|
135 |
+
$output_array[ $key ] = call_user_func( $field['sanitize_callback'], $value );
|
136 |
+
continue;
|
137 |
+
}
|
138 |
+
|
139 |
+
$output_array[ $key ] = $this->sanitize_by_input_type( $value, $field['type'] );
|
140 |
+
}
|
141 |
+
|
142 |
+
return $output_array;
|
143 |
+
}
|
144 |
+
|
145 |
+
/**
|
146 |
+
* Validate the option's value
|
147 |
+
*
|
148 |
+
* @param mixed $value The value.
|
149 |
+
* @param string $type The input field type.
|
150 |
+
*
|
151 |
+
* @return string|numeric
|
152 |
+
*/
|
153 |
+
private function sanitize_by_input_type( $value, string $type = 'text' ) {
|
154 |
+
switch ( $type ) {
|
155 |
+
case 'number':
|
156 |
+
return Sanitize::number( $value );
|
157 |
+
|
158 |
+
case 'url':
|
159 |
+
return Sanitize::url( $value );
|
160 |
+
|
161 |
+
case 'email':
|
162 |
+
return Sanitize::email( $value );
|
163 |
+
|
164 |
+
case 'date':
|
165 |
+
return Sanitize::date( $value );
|
166 |
+
|
167 |
+
case 'textarea':
|
168 |
+
return Sanitize::textarea( $value );
|
169 |
+
|
170 |
+
case 'text':
|
171 |
+
default:
|
172 |
+
return Sanitize::text( $value );
|
173 |
+
}
|
174 |
+
}
|
175 |
+
|
176 |
+
/**
|
177 |
+
* Get fields default values
|
178 |
+
*
|
179 |
+
* @return array
|
180 |
+
*/
|
181 |
+
public function get_default_options(): array {
|
182 |
+
$defaults = array();
|
183 |
+
|
184 |
+
foreach ( $this->get_fields() as $field ) {
|
185 |
+
$defaults[ $field['id'] ] = $field['default'] ?? '';
|
186 |
+
}
|
187 |
+
|
188 |
+
return $defaults;
|
189 |
+
}
|
190 |
+
|
191 |
+
/**
|
192 |
+
* Get options parsed with default value
|
193 |
+
*
|
194 |
+
* @return array
|
195 |
+
*/
|
196 |
+
public function get_options(): array {
|
197 |
+
if ( empty( $this->options ) ) {
|
198 |
+
$defaults = $this->get_default_options();
|
199 |
+
$options = get_option( $this->get_option_name() );
|
200 |
+
$this->options = wp_parse_args( $options, $defaults );
|
201 |
+
}
|
202 |
+
|
203 |
+
return $this->options;
|
204 |
+
}
|
205 |
+
|
206 |
+
/**
|
207 |
+
* Update options
|
208 |
+
*
|
209 |
+
* @param array $options The options.
|
210 |
+
* @param bool $sanitize If it should sanitize options.
|
211 |
+
*/
|
212 |
+
public function update_options( array $options, bool $sanitize = true ) {
|
213 |
+
if ( $sanitize ) {
|
214 |
+
$options = $this->sanitize_options( $options );
|
215 |
+
}
|
216 |
+
update_option( $this->get_option_name(), $options );
|
217 |
+
}
|
218 |
+
|
219 |
+
/**
|
220 |
+
* Get settings panels
|
221 |
+
*
|
222 |
+
* @return array
|
223 |
+
*/
|
224 |
+
public function get_panels(): array {
|
225 |
+
$panels = apply_filters( 'carousel_slider/settings/panels', $this->panels );
|
226 |
+
|
227 |
+
// Sort by priority.
|
228 |
+
usort( $panels, [ $this, 'sort_by_priority' ] );
|
229 |
+
|
230 |
+
return $panels;
|
231 |
+
}
|
232 |
+
|
233 |
+
/**
|
234 |
+
* Set panels
|
235 |
+
*
|
236 |
+
* @param array $panels The setting arguments.
|
237 |
+
*
|
238 |
+
* @return self
|
239 |
+
*/
|
240 |
+
public function set_panels( array $panels ): SettingApi {
|
241 |
+
foreach ( $panels as $panel ) {
|
242 |
+
$this->set_panel( $panel );
|
243 |
+
}
|
244 |
+
|
245 |
+
return $this;
|
246 |
+
}
|
247 |
+
|
248 |
+
/**
|
249 |
+
* Get settings sections
|
250 |
+
*
|
251 |
+
* @return array
|
252 |
+
*/
|
253 |
+
public function get_sections(): array {
|
254 |
+
$sections = apply_filters( 'carousel_slider/settings/sections', $this->sections );
|
255 |
+
|
256 |
+
// Sort by priority.
|
257 |
+
usort( $sections, [ $this, 'sort_by_priority' ] );
|
258 |
+
|
259 |
+
return $sections;
|
260 |
+
}
|
261 |
+
|
262 |
+
/**
|
263 |
+
* Set sections
|
264 |
+
*
|
265 |
+
* @param array $sections The setting arguments.
|
266 |
+
*
|
267 |
+
* @return self
|
268 |
+
*/
|
269 |
+
public function set_sections( array $sections ): SettingApi {
|
270 |
+
foreach ( $sections as $section ) {
|
271 |
+
$this->set_section( $section );
|
272 |
+
}
|
273 |
+
|
274 |
+
return $this;
|
275 |
+
}
|
276 |
+
|
277 |
+
/**
|
278 |
+
* Get settings fields
|
279 |
+
*
|
280 |
+
* @return array
|
281 |
+
*/
|
282 |
+
public function get_fields(): array {
|
283 |
+
$fields = apply_filters( 'carousel_slider/settings/fields', $this->fields );
|
284 |
+
|
285 |
+
// Sort by priority.
|
286 |
+
usort( $fields, [ $this, 'sort_by_priority' ] );
|
287 |
+
|
288 |
+
return $fields;
|
289 |
+
}
|
290 |
+
|
291 |
+
/**
|
292 |
+
* Set fields
|
293 |
+
*
|
294 |
+
* @param array $fields The setting arguments.
|
295 |
+
*
|
296 |
+
* @return self
|
297 |
+
*/
|
298 |
+
public function set_fields( array $fields ): SettingApi {
|
299 |
+
foreach ( $fields as $field ) {
|
300 |
+
$this->set_field( $field );
|
301 |
+
}
|
302 |
+
|
303 |
+
return $this;
|
304 |
+
}
|
305 |
+
|
306 |
+
/**
|
307 |
+
* Add setting page tab
|
308 |
+
*
|
309 |
+
* This method is accessible outside the class for creating page tab
|
310 |
+
*
|
311 |
+
* @param array $panel The setting arguments.
|
312 |
+
*
|
313 |
+
* @return self
|
314 |
+
*/
|
315 |
+
public function set_panel( array $panel ): SettingApi {
|
316 |
+
$panel = wp_parse_args(
|
317 |
+
$panel,
|
318 |
+
array(
|
319 |
+
'id' => '',
|
320 |
+
'title' => '',
|
321 |
+
'description' => '',
|
322 |
+
'priority' => 200,
|
323 |
+
)
|
324 |
+
);
|
325 |
+
|
326 |
+
$this->panels[] = $panel;
|
327 |
+
|
328 |
+
return $this;
|
329 |
+
}
|
330 |
+
|
331 |
+
/**
|
332 |
+
* Add Setting page section
|
333 |
+
*
|
334 |
+
* @param array $section The setting arguments.
|
335 |
+
*
|
336 |
+
* @return self
|
337 |
+
*/
|
338 |
+
public function set_section( array $section ): SettingApi {
|
339 |
+
$section = wp_parse_args(
|
340 |
+
$section,
|
341 |
+
array(
|
342 |
+
'id' => 'general',
|
343 |
+
'panel' => '',
|
344 |
+
'title' => '',
|
345 |
+
'description' => '',
|
346 |
+
'priority' => 200,
|
347 |
+
)
|
348 |
+
);
|
349 |
+
|
350 |
+
$this->sections[] = $section;
|
351 |
+
|
352 |
+
return $this;
|
353 |
+
}
|
354 |
+
|
355 |
+
/**
|
356 |
+
* Add new settings field
|
357 |
+
* This method is accessible outside the class for creating settings field
|
358 |
+
*
|
359 |
+
* @param array $field The setting arguments.
|
360 |
+
*
|
361 |
+
* @return self
|
362 |
+
*/
|
363 |
+
public function set_field( array $field ): SettingApi {
|
364 |
+
$field = wp_parse_args(
|
365 |
+
$field,
|
366 |
+
array(
|
367 |
+
'type' => 'text',
|
368 |
+
'section' => 'general',
|
369 |
+
'id' => '',
|
370 |
+
'title' => '',
|
371 |
+
'description' => '',
|
372 |
+
'priority' => 200,
|
373 |
+
)
|
374 |
+
);
|
375 |
+
|
376 |
+
$this->fields[ $field['id'] ] = $field;
|
377 |
+
|
378 |
+
return $this;
|
379 |
+
}
|
380 |
+
|
381 |
+
/**
|
382 |
+
* Sort array by its priority field
|
383 |
+
*
|
384 |
+
* @param array $array1 First array.
|
385 |
+
* @param array $array2 Second array.
|
386 |
+
*
|
387 |
+
* @return mixed
|
388 |
+
*/
|
389 |
+
public function sort_by_priority( array $array1, array $array2 ) {
|
390 |
+
return $array1['priority'] - $array2['priority'];
|
391 |
+
}
|
392 |
+
|
393 |
+
/**
|
394 |
+
* Get option name
|
395 |
+
*
|
396 |
+
* @return string
|
397 |
+
*/
|
398 |
+
public function get_option_name(): string {
|
399 |
+
if ( ! empty( $this->menu_fields['option_name'] ) ) {
|
400 |
+
return $this->menu_fields['option_name'];
|
401 |
+
}
|
402 |
+
|
403 |
+
return $this->option_name;
|
404 |
+
}
|
405 |
+
|
406 |
+
/**
|
407 |
+
* Set option name
|
408 |
+
*
|
409 |
+
* @param string $option_name The option name.
|
410 |
+
*
|
411 |
+
* @return SettingApi
|
412 |
+
*/
|
413 |
+
public function set_option_name( string $option_name ): SettingApi {
|
414 |
+
$this->option_name = $option_name;
|
415 |
+
|
416 |
+
return $this;
|
417 |
+
}
|
418 |
+
}
|
includes/Supports/Validate.php
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace CarouselSlider\Supports;
|
4 |
+
|
5 |
+
defined( 'ABSPATH' ) || exit;
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Validate class
|
9 |
+
*/
|
10 |
+
class Validate {
|
11 |
+
/**
|
12 |
+
* Check if url is valid as per RFC 2396 Generic Syntax
|
13 |
+
*
|
14 |
+
* @param mixed $url The URL string.
|
15 |
+
*
|
16 |
+
* @return bool
|
17 |
+
*/
|
18 |
+
public static function url( $url ): bool {
|
19 |
+
return (bool) filter_var( $url, FILTER_VALIDATE_URL );
|
20 |
+
}
|
21 |
+
|
22 |
+
/**
|
23 |
+
* If a field has been 'checked' or not, meaning it contains
|
24 |
+
* one of the following values: 'yes', 'on', '1', 1, true, or 'true'.
|
25 |
+
* This can be used for determining if an HTML checkbox has been checked.
|
26 |
+
*
|
27 |
+
* @param mixed $value The value to be checked.
|
28 |
+
*
|
29 |
+
* @return boolean
|
30 |
+
*/
|
31 |
+
public static function checked( $value ): bool {
|
32 |
+
return in_array( $value, [ 'yes', 'on', '1', 1, true, 'true' ], true );
|
33 |
+
}
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Check if value is json
|
37 |
+
*
|
38 |
+
* @param mixed $string The value to be checked.
|
39 |
+
*
|
40 |
+
* @return bool
|
41 |
+
*/
|
42 |
+
public static function json( $string ): bool {
|
43 |
+
if ( ! is_string( $string ) ) {
|
44 |
+
return false;
|
45 |
+
}
|
46 |
+
json_decode( $string );
|
47 |
+
|
48 |
+
return ( json_last_error() === JSON_ERROR_NONE );
|
49 |
+
}
|
50 |
+
}
|
includes/Upgrader.php
ADDED
@@ -0,0 +1,185 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* The upgrade-specific functionality of the plugin.
|
4 |
+
*
|
5 |
+
* @package CarouselSlider
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace CarouselSlider;
|
9 |
+
|
10 |
+
defined( 'ABSPATH' ) || exit;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Upgrader class
|
14 |
+
*/
|
15 |
+
class Upgrader {
|
16 |
+
|
17 |
+
/**
|
18 |
+
* The instance of the class
|
19 |
+
*
|
20 |
+
* @var self
|
21 |
+
*/
|
22 |
+
protected static $instance;
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Ensures only one instance of the class is loaded or can be loaded.
|
26 |
+
*
|
27 |
+
* @return self
|
28 |
+
*/
|
29 |
+
public static function init() {
|
30 |
+
if ( is_null( self::$instance ) ) {
|
31 |
+
self::$instance = new self();
|
32 |
+
|
33 |
+
add_action( 'admin_notices', [ self::$instance, 'show_upgrade_notice' ] );
|
34 |
+
add_action( 'wp_ajax_carousel_slider_upgrade', [ self::$instance, 'upgrade' ] );
|
35 |
+
|
36 |
+
add_action(
|
37 |
+
'in_plugin_update_message-carousel-slider/carousel-slider.php',
|
38 |
+
[ self::$instance, 'in_plugin_update_message' ]
|
39 |
+
);
|
40 |
+
}
|
41 |
+
|
42 |
+
return self::$instance;
|
43 |
+
}
|
44 |
+
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Show in plugin update message
|
48 |
+
*
|
49 |
+
* @param array $plugin_data plugin info data.
|
50 |
+
*/
|
51 |
+
public function in_plugin_update_message( array $plugin_data ) {
|
52 |
+
$current_version = CAROUSEL_SLIDER_VERSION;
|
53 |
+
$current_version_array = explode( '.', $current_version );
|
54 |
+
$new_version = $plugin_data['new_version'];
|
55 |
+
$new_version_array = explode( '.', $new_version );
|
56 |
+
|
57 |
+
$html = '';
|
58 |
+
if ( version_compare( $current_version_array[0], $new_version_array[0], '<' ) ) {
|
59 |
+
$html .= '</p><div class="cs_plugin_upgrade_notice extensions_warning major_update">';
|
60 |
+
$html .= '<div class="cs_plugin_upgrade_notice__title">';
|
61 |
+
$html .= sprintf(
|
62 |
+
/* translators: 1: plugin title, 2: plugin new version number */
|
63 |
+
__( '%1$s version %2$s is a major update.', 'carousel-slider' ),
|
64 |
+
'<strong>' . $plugin_data['Title'] . '</strong>',
|
65 |
+
'<strong>' . $new_version . '</strong>'
|
66 |
+
);
|
67 |
+
$html .= '</div>';
|
68 |
+
$html .= '<div class="cs_plugin_upgrade_notice__description">';
|
69 |
+
$html .= __( 'We made a lot of major changes to this version.', 'carousel-slider' ) . ' ';
|
70 |
+
$html .= __( 'We believe that all functionality will remain same after update (remember to refresh you cache plugin).', 'carousel-slider' ) . ' ';
|
71 |
+
$html .= __( 'Still make sure that you took a backup so you can role back if anything happen wrong to you.', 'carousel-slider' );
|
72 |
+
$html .= '</div>';
|
73 |
+
$html .= '</div><p class="dummy" style="display: none">';
|
74 |
+
}
|
75 |
+
|
76 |
+
$message = apply_filters( 'carousel_slider/in_plugin_update_message', $html, $plugin_data );
|
77 |
+
echo wp_kses_post( $message );
|
78 |
+
}
|
79 |
+
|
80 |
+
/**
|
81 |
+
* Show upgrade notice
|
82 |
+
*/
|
83 |
+
public function show_upgrade_notice() {
|
84 |
+
$version = get_option( 'carousel_slider_version' );
|
85 |
+
if ( ! ( false !== $version && version_compare( $version, '2.0', '<' ) ) ) {
|
86 |
+
return;
|
87 |
+
}
|
88 |
+
$message = __( 'Carousel Slider need to update database.', 'carousel-slider' );
|
89 |
+
$message2 = __( 'We strongly recommend creating a backup of your site before updating.', 'carousel-slider' );
|
90 |
+
$button_text = __( 'Update database', 'carousel-slider' );
|
91 |
+
$update_url = wp_nonce_url(
|
92 |
+
add_query_arg( [ 'action' => 'carousel_slider_upgrade' ], admin_url( 'admin-ajax.php' ) ),
|
93 |
+
'carousel_slider_upgrade'
|
94 |
+
);
|
95 |
+
$html = '<div class="notice notice-info is-dismissible">';
|
96 |
+
$html .= '<p><strong>' . $message . '</strong> ' . $message2 . '</p>';
|
97 |
+
$html .= '<p><a href="' . $update_url . '" class="button">' . $button_text . '</a></p>';
|
98 |
+
$html .= '</div>';
|
99 |
+
|
100 |
+
echo wp_kses_post( $html );
|
101 |
+
}
|
102 |
+
|
103 |
+
/**
|
104 |
+
* Run upgrade function
|
105 |
+
*/
|
106 |
+
public function upgrade() {
|
107 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
108 |
+
$nonce = $_REQUEST['_wpnonce'] ? sanitize_text_field( $_REQUEST['_wpnonce'] ) : null;
|
109 |
+
$is_verified = wp_verify_nonce( $nonce, 'carousel_slider_upgrade' );
|
110 |
+
|
111 |
+
$message = '<h1>' . __( 'Carousel Slider', 'carousel-slider' ) . '</h1>';
|
112 |
+
if ( ! ( current_user_can( 'manage_options' ) && $is_verified ) ) {
|
113 |
+
$message .= '<p>' . __( 'Sorry. This link only for admin to perform upgrade tasks.', 'carousel-slider' ) . '</p>';
|
114 |
+
_default_wp_die_handler( $message, '', [ 'back_link' => true ] );
|
115 |
+
}
|
116 |
+
|
117 |
+
$version = get_option( 'carousel_slider_version', '1.0.0' );
|
118 |
+
if ( version_compare( $version, '1.10.0', '<=' ) ) {
|
119 |
+
static::fix_meta_key_typo_error();
|
120 |
+
static::fix_product_query_type_typo_error();
|
121 |
+
}
|
122 |
+
|
123 |
+
// Add plugin version to database.
|
124 |
+
update_option( 'carousel_slider_version', CAROUSEL_SLIDER_VERSION );
|
125 |
+
|
126 |
+
$message .= '<p>' . __( 'Database upgrade process has been started.', 'carousel-slider' ) . '</p>';
|
127 |
+
_default_wp_die_handler( $message, '', [ 'back_link' => true ] );
|
128 |
+
}
|
129 |
+
|
130 |
+
/**
|
131 |
+
* Fix meta key typo error
|
132 |
+
*
|
133 |
+
* @return bool|int
|
134 |
+
*/
|
135 |
+
public function fix_meta_key_typo_error() {
|
136 |
+
$ids = static::get_sliders_ids();
|
137 |
+
if ( count( $ids ) ) {
|
138 |
+
global $wpdb;
|
139 |
+
$sql = "UPDATE {$wpdb->postmeta} SET `meta_key`= '_infinity_loop' WHERE `meta_key` = '_inifnity_loop'";
|
140 |
+
$sql .= ' AND post_id IN(' . implode( ',', $ids ) . ')';
|
141 |
+
|
142 |
+
// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
|
143 |
+
return $wpdb->query( $sql );
|
144 |
+
}
|
145 |
+
|
146 |
+
return false;
|
147 |
+
}
|
148 |
+
|
149 |
+
/**
|
150 |
+
* Fix meta key typo error
|
151 |
+
*
|
152 |
+
* @return bool|int
|
153 |
+
*/
|
154 |
+
public function fix_product_query_type_typo_error() {
|
155 |
+
$ids = static::get_sliders_ids();
|
156 |
+
if ( count( $ids ) ) {
|
157 |
+
global $wpdb;
|
158 |
+
$sql = "UPDATE {$wpdb->postmeta} SET `meta_value`= 'query_product' WHERE `meta_value` = 'query_porduct'";
|
159 |
+
$sql .= " AND `meta_key` = '_product_query_type' AND post_id IN(" . implode( ',', $ids ) . ')';
|
160 |
+
|
161 |
+
// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
|
162 |
+
return $wpdb->query( $sql );
|
163 |
+
}
|
164 |
+
|
165 |
+
return false;
|
166 |
+
}
|
167 |
+
|
168 |
+
/**
|
169 |
+
* Get sliders ids
|
170 |
+
*
|
171 |
+
* @return array
|
172 |
+
*/
|
173 |
+
public static function get_sliders_ids(): array {
|
174 |
+
global $wpdb;
|
175 |
+
$sql = $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_type = %s", CAROUSEL_SLIDER_POST_TYPE );
|
176 |
+
// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
|
177 |
+
$results = $wpdb->get_results( $sql, ARRAY_A );
|
178 |
+
$ids = [];
|
179 |
+
foreach ( $results as $result ) {
|
180 |
+
$ids[] = intval( $result['ID'] );
|
181 |
+
}
|
182 |
+
|
183 |
+
return $ids;
|
184 |
+
}
|
185 |
+
}
|
includes/ViewHelper.php
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace CarouselSlider;
|
4 |
+
|
5 |
+
use CarouselSlider\Supports\Validate;
|
6 |
+
|
7 |
+
defined( 'ABSPATH' ) || exit;
|
8 |
+
|
9 |
+
/**
|
10 |
+
* ViewHelper class
|
11 |
+
*/
|
12 |
+
class ViewHelper {
|
13 |
+
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Array to style
|
17 |
+
*
|
18 |
+
* @param array $styles The styles array.
|
19 |
+
*
|
20 |
+
* @return string
|
21 |
+
*/
|
22 |
+
public static function array_to_style( array $styles ): string {
|
23 |
+
$_styles = [];
|
24 |
+
foreach ( $styles as $key => $value ) {
|
25 |
+
if ( ! is_string( $key ) || empty( $value ) ) {
|
26 |
+
continue;
|
27 |
+
}
|
28 |
+
$_styles[] = sprintf( '%s:%s', $key, $value );
|
29 |
+
}
|
30 |
+
|
31 |
+
return implode( ';', $_styles );
|
32 |
+
}
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Convert array to html data attribute
|
36 |
+
*
|
37 |
+
* @param array $array The attributes list.
|
38 |
+
*
|
39 |
+
* @return array
|
40 |
+
*/
|
41 |
+
public static function array_to_attribute( array $array ): array {
|
42 |
+
return array_map(
|
43 |
+
function ( $key, $value ) {
|
44 |
+
// If boolean value.
|
45 |
+
if ( is_bool( $value ) ) {
|
46 |
+
return sprintf( '%s="%s"', $key, ( $value ? 'true' : 'false' ) );
|
47 |
+
}
|
48 |
+
// If array value.
|
49 |
+
if ( is_array( $value ) ) {
|
50 |
+
return sprintf( '%s="%s"', $key, implode( ' ', $value ) );
|
51 |
+
}
|
52 |
+
|
53 |
+
if ( is_string( $value ) && Validate::json( $value ) ) {
|
54 |
+
return sprintf( "%s='%s'", $key, $value );
|
55 |
+
}
|
56 |
+
|
57 |
+
// If string value.
|
58 |
+
return sprintf( '%s="%s"', $key, esc_attr( $value ) );
|
59 |
+
|
60 |
+
},
|
61 |
+
array_keys( $array ),
|
62 |
+
array_values( $array )
|
63 |
+
);
|
64 |
+
}
|
65 |
+
}
|
{classes → includes}/Widget/CarouselSliderWidget.php
RENAMED
@@ -2,10 +2,15 @@
|
|
2 |
|
3 |
namespace CarouselSlider\Widget;
|
4 |
|
|
|
|
|
5 |
use WP_Widget;
|
6 |
|
7 |
defined( 'ABSPATH' ) || exit;
|
8 |
|
|
|
|
|
|
|
9 |
class CarouselSliderWidget extends WP_Widget {
|
10 |
|
11 |
/**
|
@@ -43,20 +48,14 @@ class CarouselSliderWidget extends WP_Widget {
|
|
43 |
* @return array
|
44 |
*/
|
45 |
private static function carousels_list(): array {
|
46 |
-
$posts =
|
47 |
-
'post_type' => 'carousels',
|
48 |
-
'post_status' => 'publish',
|
49 |
-
'posts_per_page' => 100,
|
50 |
-
'orderby' => 'date',
|
51 |
-
'order' => 'DESC',
|
52 |
-
] );
|
53 |
|
54 |
$items = [];
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
}
|
61 |
|
62 |
return $items;
|
@@ -88,14 +87,14 @@ class CarouselSliderWidget extends WP_Widget {
|
|
88 |
return;
|
89 |
}
|
90 |
|
91 |
-
echo $args['before_widget'];
|
92 |
|
93 |
if ( ! empty( $title ) ) {
|
94 |
-
echo $args['before_title'] . $title . $args['after_title'];
|
95 |
}
|
96 |
|
97 |
-
echo
|
98 |
-
echo $args['after_widget'];
|
99 |
}
|
100 |
|
101 |
/**
|
@@ -109,39 +108,41 @@ class CarouselSliderWidget extends WP_Widget {
|
|
109 |
$carousels = static::carousels_list();
|
110 |
$carousel_id = ! empty( $instance['carousel_id'] ) ? absint( $instance['carousel_id'] ) : null;
|
111 |
$title = ! empty( $instance['title'] ) ? esc_attr( $instance['title'] ) : '';
|
112 |
-
|
113 |
if ( count( $carousels ) > 0 ) {
|
|
|
|
|
114 |
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
printf( '<p><label>%s</label>', __( 'Choose Slide', 'carousel-slider' ) );
|
119 |
-
printf( '<select class="widefat" name="%s">', $this->get_field_name( 'carousel_id' ) );
|
120 |
foreach ( $carousels as $carousel ) {
|
121 |
-
$selected = $carousel['id']
|
122 |
-
|
123 |
'<option value="%1$d" %3$s>%2$s</option>',
|
124 |
absint( $carousel['id'] ),
|
125 |
esc_html( $carousel['title'] ),
|
126 |
$selected
|
127 |
);
|
128 |
}
|
129 |
-
|
130 |
|
131 |
} else {
|
132 |
-
|
|
|
133 |
__( 'You did not add any carousel slider yet.', 'carousel-slider' ),
|
134 |
__( 'to create a new carousel slider now.', 'carousel-slider' ),
|
135 |
__( 'click here', 'carousel-slider' )
|
136 |
);
|
137 |
}
|
|
|
|
|
138 |
}
|
139 |
|
140 |
/**
|
141 |
* Processing widget options on save
|
142 |
*
|
143 |
-
* @param array $new_instance The new options
|
144 |
-
* @param array $old_instance The previous options
|
145 |
*
|
146 |
* @return array
|
147 |
*/
|
2 |
|
3 |
namespace CarouselSlider\Widget;
|
4 |
|
5 |
+
use CarouselSlider\Frontend\Frontend;
|
6 |
+
use CarouselSlider\Helper;
|
7 |
use WP_Widget;
|
8 |
|
9 |
defined( 'ABSPATH' ) || exit;
|
10 |
|
11 |
+
/**
|
12 |
+
* CarouselSliderWidget class
|
13 |
+
*/
|
14 |
class CarouselSliderWidget extends WP_Widget {
|
15 |
|
16 |
/**
|
48 |
* @return array
|
49 |
*/
|
50 |
private static function carousels_list(): array {
|
51 |
+
$posts = Helper::get_sliders();
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
|
53 |
$items = [];
|
54 |
+
foreach ( $posts as $post ) {
|
55 |
+
$items[] = [
|
56 |
+
'id' => $post->ID,
|
57 |
+
'title' => $post->post_title,
|
58 |
+
];
|
59 |
}
|
60 |
|
61 |
return $items;
|
87 |
return;
|
88 |
}
|
89 |
|
90 |
+
echo $args['before_widget']; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
|
91 |
|
92 |
if ( ! empty( $title ) ) {
|
93 |
+
echo $args['before_title'] . $title . $args['after_title']; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
|
94 |
}
|
95 |
|
96 |
+
echo Frontend::init()->carousel_slide( [ 'id' => $carousel_id ] ); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
|
97 |
+
echo $args['after_widget']; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
|
98 |
}
|
99 |
|
100 |
/**
|
108 |
$carousels = static::carousels_list();
|
109 |
$carousel_id = ! empty( $instance['carousel_id'] ) ? absint( $instance['carousel_id'] ) : null;
|
110 |
$title = ! empty( $instance['title'] ) ? esc_attr( $instance['title'] ) : '';
|
111 |
+
$html = '';
|
112 |
if ( count( $carousels ) > 0 ) {
|
113 |
+
$html .= sprintf( '<p><label for="%1$s">%2$s</label>', $this->get_field_id( 'title' ), __( 'Title (optional):', 'carousel-slider' ) );
|
114 |
+
$html .= sprintf( '<input type="text" class="widefat" id="%1$s" name="%2$s" value="%3$s" /></p>', $this->get_field_id( 'title' ), $this->get_field_name( 'title' ), $title );
|
115 |
|
116 |
+
$html .= sprintf( '<p><label>%s</label>', __( 'Choose Slide', 'carousel-slider' ) );
|
117 |
+
$html .= sprintf( '<select class="widefat" name="%s">', $this->get_field_name( 'carousel_id' ) );
|
|
|
|
|
|
|
118 |
foreach ( $carousels as $carousel ) {
|
119 |
+
$selected = $carousel['id'] === $carousel_id ? 'selected="selected"' : '';
|
120 |
+
$html .= sprintf(
|
121 |
'<option value="%1$d" %3$s>%2$s</option>',
|
122 |
absint( $carousel['id'] ),
|
123 |
esc_html( $carousel['title'] ),
|
124 |
$selected
|
125 |
);
|
126 |
}
|
127 |
+
$html .= '</select></p>';
|
128 |
|
129 |
} else {
|
130 |
+
$html .= sprintf(
|
131 |
+
'<p>%1$s <a href="' . admin_url( 'post-new.php?post_type=carousels' ) . '">%3$s</a> %2$s</p>',
|
132 |
__( 'You did not add any carousel slider yet.', 'carousel-slider' ),
|
133 |
__( 'to create a new carousel slider now.', 'carousel-slider' ),
|
134 |
__( 'click here', 'carousel-slider' )
|
135 |
);
|
136 |
}
|
137 |
+
|
138 |
+
echo $html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
139 |
}
|
140 |
|
141 |
/**
|
142 |
* Processing widget options on save
|
143 |
*
|
144 |
+
* @param array $new_instance The new options.
|
145 |
+
* @param array $old_instance The previous options.
|
146 |
*
|
147 |
* @return array
|
148 |
*/
|
includes/class-carousel-slider-activator.php
DELETED
@@ -1,80 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
4 |
-
die; // If this file is called directly, abort.
|
5 |
-
}
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Fired during plugin activation.
|
9 |
-
* This class defines all code necessary to run during the plugin's activation.
|
10 |
-
*
|
11 |
-
* @since 1.6.0
|
12 |
-
* @author Sayful Islam <sayful.islam001@gmail.com>
|
13 |
-
*/
|
14 |
-
if ( ! class_exists( 'Carousel_Slider_Activator' ) ) {
|
15 |
-
|
16 |
-
class Carousel_Slider_Activator {
|
17 |
-
|
18 |
-
/**
|
19 |
-
* The instance of the class
|
20 |
-
*
|
21 |
-
* @var self
|
22 |
-
*/
|
23 |
-
private static $instance = null;
|
24 |
-
|
25 |
-
/**
|
26 |
-
* Ensures only one instance of this class is loaded or can be loaded.
|
27 |
-
*
|
28 |
-
* @return self
|
29 |
-
*/
|
30 |
-
public static function init() {
|
31 |
-
if ( is_null( self::$instance ) ) {
|
32 |
-
self::$instance = new self();
|
33 |
-
|
34 |
-
add_action( 'carousel_slider/activation', array( self::$instance, 'activate' ) );
|
35 |
-
}
|
36 |
-
|
37 |
-
return self::$instance;
|
38 |
-
}
|
39 |
-
|
40 |
-
/**
|
41 |
-
* Script that should load upon plugin activation
|
42 |
-
*/
|
43 |
-
public function activate() {
|
44 |
-
$version = get_option( 'carousel_slider_version' );
|
45 |
-
|
46 |
-
if ( $version == false ) {
|
47 |
-
$this->update_meta_160();
|
48 |
-
}
|
49 |
-
|
50 |
-
// Add plugin version to database
|
51 |
-
update_option( 'carousel_slider_version', CAROUSEL_SLIDER_VERSION );
|
52 |
-
}
|
53 |
-
|
54 |
-
/**
|
55 |
-
* Update meta for prior to version 1.6.0
|
56 |
-
*/
|
57 |
-
public function update_meta_160() {
|
58 |
-
$carousels = get_posts( array(
|
59 |
-
'post_type' => 'carousels',
|
60 |
-
'post_status' => 'any',
|
61 |
-
) );
|
62 |
-
|
63 |
-
if ( count( $carousels ) > 0 ) {
|
64 |
-
foreach ( $carousels as $carousel ) {
|
65 |
-
|
66 |
-
$id = $carousel->ID;
|
67 |
-
$_items_desktop = get_post_meta( $id, '_items', true );
|
68 |
-
$_lazy_load = get_post_meta( $id, '_lazy_load_image', true );
|
69 |
-
$_lazy_load = $_lazy_load == 'on' ? 'on' : 'off';
|
70 |
-
|
71 |
-
update_post_meta( $id, '_lazy_load_image', $_lazy_load );
|
72 |
-
update_post_meta( $id, '_items_desktop', $_items_desktop );
|
73 |
-
update_post_meta( $id, '_slide_type', 'image-carousel' );
|
74 |
-
}
|
75 |
-
}
|
76 |
-
}
|
77 |
-
}
|
78 |
-
}
|
79 |
-
|
80 |
-
Carousel_Slider_Activator::init();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/class-carousel-slider-admin.php
DELETED
@@ -1,504 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
4 |
-
die; // If this file is called directly, abort.
|
5 |
-
}
|
6 |
-
|
7 |
-
if ( ! class_exists( 'Carousel_Slider_Admin' ) ) {
|
8 |
-
|
9 |
-
class Carousel_Slider_Admin {
|
10 |
-
|
11 |
-
/**
|
12 |
-
* @var Carousel_Slider_Form
|
13 |
-
*/
|
14 |
-
private $form;
|
15 |
-
|
16 |
-
/**
|
17 |
-
* The instance of the class
|
18 |
-
*
|
19 |
-
* @var self
|
20 |
-
*/
|
21 |
-
protected static $instance = null;
|
22 |
-
|
23 |
-
/**
|
24 |
-
* Ensures only one instance of this class is loaded or can be loaded.
|
25 |
-
*
|
26 |
-
* @return Carousel_Slider_Admin
|
27 |
-
*/
|
28 |
-
public static function init() {
|
29 |
-
if ( is_null( self::$instance ) ) {
|
30 |
-
self::$instance = new self();
|
31 |
-
}
|
32 |
-
|
33 |
-
return self::$instance;
|
34 |
-
}
|
35 |
-
|
36 |
-
/**
|
37 |
-
* Carousel_Slider_Admin constructor.
|
38 |
-
*/
|
39 |
-
public function __construct() {
|
40 |
-
$this->form = new Carousel_Slider_Form();
|
41 |
-
|
42 |
-
add_action( 'init', array( $this, 'carousel_post_type' ) );
|
43 |
-
add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) );
|
44 |
-
add_filter( 'manage_edit-carousels_columns', array( $this, 'columns_head' ) );
|
45 |
-
add_filter( 'manage_carousels_posts_custom_column', array( $this, 'columns_content' ), 10, 2 );
|
46 |
-
add_action( 'save_post', array( $this, 'save_meta_box' ) );
|
47 |
-
add_action( 'wp_ajax_carousel_slider_save_images', array( $this, 'save_images' ) );
|
48 |
-
|
49 |
-
// Remove view and Quick Edit from Carousels
|
50 |
-
add_filter( 'post_row_actions', array( $this, 'post_row_actions' ), 10, 2 );
|
51 |
-
|
52 |
-
// Add custom link to media gallery
|
53 |
-
add_filter( "attachment_fields_to_edit", array( $this, "attachment_fields_to_edit" ), null, 2 );
|
54 |
-
add_filter( "attachment_fields_to_save", array( $this, "attachment_fields_to_save" ), null, 2 );
|
55 |
-
|
56 |
-
add_action( 'admin_footer', array( $this, 'gallery_url_template' ), 5 );
|
57 |
-
}
|
58 |
-
|
59 |
-
/**
|
60 |
-
* Carousel slider gallery url template
|
61 |
-
*
|
62 |
-
* @return void
|
63 |
-
*/
|
64 |
-
public function gallery_url_template() {
|
65 |
-
global $post_type;
|
66 |
-
if ( $post_type != 'carousels' ) {
|
67 |
-
return;
|
68 |
-
}
|
69 |
-
?>
|
70 |
-
<template id="carouselSliderGalleryUrlTemplate" style="display: none;">
|
71 |
-
<div class="carousel_slider-fields">
|
72 |
-
<label class="setting">
|
73 |
-
<span class="name"><?php esc_html_e( 'URL', 'carousel-slider' ); ?></span>
|
74 |
-
<input type="url" name="_images_urls[url][]" value="" autocomplete="off">
|
75 |
-
</label>
|
76 |
-
<label class="setting">
|
77 |
-
<span class="name"><?php esc_html_e( 'Title', 'carousel-slider' ); ?></span>
|
78 |
-
<input type="text" name="_images_urls[title][]" value="" autocomplete="off">
|
79 |
-
</label>
|
80 |
-
<label class="setting">
|
81 |
-
<span class="name"><?php esc_html_e( 'Caption', 'carousel-slider' ); ?></span>
|
82 |
-
<textarea name="_images_urls[caption][]"></textarea>
|
83 |
-
</label>
|
84 |
-
<label class="setting">
|
85 |
-
<span class="name"><?php esc_html_e( 'Alt Text', 'carousel-slider' ); ?></span>
|
86 |
-
<input type="text" name="_images_urls[alt][]" value="" autocomplete="off">
|
87 |
-
</label>
|
88 |
-
<label class="setting">
|
89 |
-
<span class="name"><?php esc_html_e( 'Link To URL', 'carousel-slider' ); ?></span>
|
90 |
-
<input type="text" name="_images_urls[link_url][]" value="" autocomplete="off">
|
91 |
-
</label>
|
92 |
-
<div class="actions">
|
93 |
-
<span><span class="dashicons dashicons-move"></span></span>
|
94 |
-
<span class="add_row"><span class="dashicons dashicons-plus-alt"></span></span>
|
95 |
-
<span class="delete_row"><span class="dashicons dashicons-trash"></span></span>
|
96 |
-
</div>
|
97 |
-
</div>
|
98 |
-
</template>
|
99 |
-
<?php
|
100 |
-
}
|
101 |
-
|
102 |
-
/**
|
103 |
-
* Carousel slider post type
|
104 |
-
*/
|
105 |
-
public function carousel_post_type() {
|
106 |
-
$labels = array(
|
107 |
-
'name' => _x( 'Slides', 'Post Type General Name', 'carousel-slider' ),
|
108 |
-
'singular_name' => _x( 'Slide', 'Post Type Singular Name', 'carousel-slider' ),
|
109 |
-
'menu_name' => __( 'Carousel Slider', 'carousel-slider' ),
|
110 |
-
'parent_item_colon' => __( 'Parent Slide:', 'carousel-slider' ),
|
111 |
-
'all_items' => __( 'All Slides', 'carousel-slider' ),
|
112 |
-
'view_item' => __( 'View Slide', 'carousel-slider' ),
|
113 |
-
'add_new_item' => __( 'Add New Slide', 'carousel-slider' ),
|
114 |
-
'add_new' => __( 'Add New', 'carousel-slider' ),
|
115 |
-
'edit_item' => __( 'Edit Slide', 'carousel-slider' ),
|
116 |
-
'update_item' => __( 'Update Slide', 'carousel-slider' ),
|
117 |
-
'search_items' => __( 'Search Slide', 'carousel-slider' ),
|
118 |
-
'not_found' => __( 'Not found', 'carousel-slider' ),
|
119 |
-
'not_found_in_trash' => __( 'Not found in Trash', 'carousel-slider' ),
|
120 |
-
);
|
121 |
-
$args = array(
|
122 |
-
'label' => __( 'Slide', 'carousel-slider' ),
|
123 |
-
'description' => __( 'The easiest way to create carousel slide', 'carousel-slider' ),
|
124 |
-
'labels' => $labels,
|
125 |
-
'supports' => array( 'title' ),
|
126 |
-
'hierarchical' => false,
|
127 |
-
'public' => false,
|
128 |
-
'show_ui' => true,
|
129 |
-
'show_in_menu' => true,
|
130 |
-
'show_in_nav_menus' => true,
|
131 |
-
'show_in_admin_bar' => true,
|
132 |
-
'menu_position' => 5.55525,
|
133 |
-
'menu_icon' => 'dashicons-slides',
|
134 |
-
'can_export' => true,
|
135 |
-
'has_archive' => false,
|
136 |
-
'exclude_from_search' => true,
|
137 |
-
'publicly_queryable' => true,
|
138 |
-
'rewrite' => false,
|
139 |
-
'capability_type' => 'post',
|
140 |
-
);
|
141 |
-
|
142 |
-
register_post_type( 'carousels', $args );
|
143 |
-
}
|
144 |
-
|
145 |
-
/**
|
146 |
-
* Hide view and quick edit from carousel slider admin
|
147 |
-
*
|
148 |
-
* @param array $actions
|
149 |
-
* @param WP_Post $post
|
150 |
-
*
|
151 |
-
* @return mixed
|
152 |
-
*/
|
153 |
-
public function post_row_actions( $actions, $post ) {
|
154 |
-
if ( $post->post_type != 'carousels' ) {
|
155 |
-
return $actions;
|
156 |
-
}
|
157 |
-
|
158 |
-
$view_url = add_query_arg( array(
|
159 |
-
'carousel_slider_preview' => true,
|
160 |
-
'carousel_slider_iframe' => true,
|
161 |
-
'slider_id' => $post->ID,
|
162 |
-
), site_url( '/' ) );
|
163 |
-
$actions['view'] = '<a href="' . $view_url . '" target="_blank">' . esc_html__( 'Preview', 'carousel-slider' ) . '</a>';
|
164 |
-
|
165 |
-
unset( $actions['inline hide-if-no-js'] );
|
166 |
-
|
167 |
-
return $actions;
|
168 |
-
}
|
169 |
-
|
170 |
-
/**
|
171 |
-
* Customize Carousel slider list table head
|
172 |
-
*
|
173 |
-
* @return array A list of column headers.
|
174 |
-
*/
|
175 |
-
public function columns_head() {
|
176 |
-
|
177 |
-
$columns = array(
|
178 |
-
'cb' => '<input type="checkbox">',
|
179 |
-
'title' => __( 'Carousel Slide Title', 'carousel-slider' ),
|
180 |
-
'usage' => __( 'Shortcode', 'carousel-slider' ),
|
181 |
-
'slide_type' => __( 'Slide Type', 'carousel-slider' )
|
182 |
-
);
|
183 |
-
|
184 |
-
return $columns;
|
185 |
-
|
186 |
-
}
|
187 |
-
|
188 |
-
/**
|
189 |
-
* Generate carousel slider list table content for each custom column
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|