Version Description
Visit the Github release page.
Download this release
Release Info
Developer | nikeo |
Plugin | Nimble Page Builder |
Version | 3.2.9 |
Comparing to | |
See all releases |
Code changes from version 3.2.8 to 3.2.9
- assets/_deprecated_preset_sections.json +30 -0
- assets/czr/fmk/css/img/czr-spinner.gif +0 -0
- assets/czr/fmk/css/img/fs-sprite.png +0 -0
- assets/czr/fmk/css/img/green.png +0 -0
- assets/czr/fmk/css/img/green@2x.png +0 -0
- assets/czr/fmk/css/img/grey.png +0 -0
- assets/czr/fmk/css/img/grey@2x.png +0 -0
- assets/czr/fmk/css/img/jquery.fs.selecter-arrow.png +0 -0
- assets/czr/fmk/css/img/jquery.fs.stepper-arrows.png +0 -0
- assets/czr/fmk/css/index.php +2 -0
- assets/czr/fmk/css/lib/czrSelect2.css +482 -0
- assets/czr/fmk/css/lib/czrSelect2.min.css +1 -0
- assets/czr/fmk/css/parts/__DEPREC__czr-control-skope.css +696 -0
- assets/czr/fmk/css/parts/czr-control-common.css +984 -0
- assets/czr/fmk/css/parts/czr-control-input-types.css +900 -0
- assets/czr/fmk/css/parts/czr-control-modules.css +863 -0
- assets/czr/fmk/js/____modules/5_0_1_pro_modules_map.js +49 -0
- assets/czr/fmk/js/____modules/___MOVED_TO_HUEMAN_THEME_JUNE_2018_5_0_0_free_modules_map.js +26 -0
- assets/czr/fmk/js/____modules/free/___MOVED_TO_HUEMAN_THEME_JUNE_2018__2_6_widget_areas_module.js +1009 -0
- assets/czr/fmk/js/____modules/free/___MOVED_TO_HUEMAN_THEME_JUNE_2018__3_2_body_background_module.js +117 -0
- assets/czr/fmk/js/____modules/pro/_2_9_fps_module.js +272 -0
- assets/czr/fmk/js/____modules/pro/_3_0_text_module.js +23 -0
- assets/czr/fmk/js/____modules/pro/_3_15_text_editor_module.js +54 -0
- assets/czr/fmk/js/base-fmk/0_2_api_override/_0_0_0_pre_900_Value_prototype.js +128 -0
- assets/czr/fmk/js/base-fmk/0_2_api_override/_0_0_0_pre_908_Setting_prototype.js +109 -0
- assets/czr/fmk/js/base-fmk/0_2_api_override/_0_0_0_pre_990_various_overrides.js +29 -0
- assets/czr/fmk/js/base-fmk/0_3_api_helpers/_0_0_0_pre_97_api_helpers_setup_input_from_dom.js +117 -0
- assets/czr/fmk/js/base-fmk/0_3_api_helpers/_0_0_1_pre_97_api_helpers_get_module_template.js +84 -0
- assets/czr/fmk/js/base-fmk/0_3_api_helpers/_0_0_2_pre_97_api_helpers_register_utils.js +196 -0
- assets/czr/fmk/js/base-fmk/0_3_api_helpers/_0_0_9_pre_97_api_helpers_various.js +320 -0
- assets/czr/fmk/js/base-fmk/0_3_api_helpers/_0_1_0_pre_98_api_helpers_setup_dom_listeners.js +223 -0
- assets/czr/fmk/js/base-fmk/0_4_preview_listeners/_0_0_0_pre_99_preview_listeners.js +47 -0
- assets/czr/fmk/js/base-fmk/1_0_input_item_module_control/1_0_input/_0_0_1_input_0_init.js +413 -0
- assets/czr/fmk/js/base-fmk/1_0_input_item_module_control/1_0_input/_0_0_1_input_1_img_upload.js +259 -0
- assets/czr/fmk/js/base-fmk/1_0_input_item_module_control/1_0_input/_0_0_1_input_4_content_picker.js +270 -0
- assets/czr/fmk/js/base-fmk/1_0_input_item_module_control/1_1_item_and_modopt/1_1_0_item/_0_0_2_item_0_init.js +247 -0
- assets/czr/fmk/js/base-fmk/1_0_input_item_module_control/1_1_item_and_modopt/1_1_0_item/_0_0_2_item_2_model.js +98 -0
- assets/czr/fmk/js/base-fmk/1_0_input_item_module_control/1_1_item_and_modopt/1_1_0_item/_0_0_2_item_3_view.js +500 -0
- assets/czr/fmk/js/base-fmk/1_0_input_item_module_control/1_1_item_and_modopt/1_1_1_module_options/_0_0_2_mod_opt_0_init.js +97 -0
- assets/czr/fmk/js/base-fmk/1_0_input_item_module_control/1_1_item_and_modopt/1_1_1_module_options/_0_0_2_mod_opt_2_view.js +160 -0
- assets/czr/fmk/js/base-fmk/1_0_input_item_module_control/1_3_module/_0_0_3_module_0_init.js +575 -0
- assets/czr/fmk/js/base-fmk/1_0_input_item_module_control/1_3_module/_0_0_3_module_1_collection.js +416 -0
- assets/czr/fmk/js/base-fmk/1_0_input_item_module_control/1_3_module/_0_0_3_module_2_model.js +61 -0
- assets/czr/fmk/js/base-fmk/1_0_input_item_module_control/1_3_module/_0_0_3_module_3_view.js +292 -0
- assets/czr/fmk/js/base-fmk/1_0_input_item_module_control/1_3_module/_0_0_4_dyn_module_0_init.js +278 -0
- assets/czr/fmk/js/base-fmk/1_0_input_item_module_control/1_3_module/_0_0_4_dyn_module_1_pre_item_views.js +125 -0
- assets/czr/fmk/js/base-fmk/1_0_input_item_module_control/1_4_control/_0_1_0_base_control.js +35 -0
- assets/czr/fmk/js/base-fmk/1_0_input_item_module_control/1_4_control/base_module_control/_0_1_0_base_module_control_init.js +269 -0
- assets/czr/fmk/js/base-fmk/1_0_input_item_module_control/1_4_control/base_module_control/_0_1_1_base_module_control_instantiate.js +269 -0
- assets/czr/fmk/js/base-fmk/1_0_input_item_module_control/1_4_control/base_module_control/_0_1_2_base_module_control_collection.js +204 -0
- assets/czr/fmk/js/base-fmk/_0_0_pre_previewed_device_event.js +13 -0
- assets/czr/fmk/js/base-fmk/_0_1_pre_helpers.js +85 -0
- assets/czr/fmk/js/base-fmk/_0_2_api_ready_themes_section_visibility.js +24 -0
- assets/czr/fmk/js/base-fmk/_0_3_api_ready_watch_section_panel_expansion.js +55 -0
- assets/czr/fmk/js/base-fmk/_0_4_api_ready_dynamic_registration.js +129 -0
- assets/czr/fmk/js/base-fmk/_0_9_extend_api_base.js +67 -0
- assets/czr/fmk/js/base-fmk/_7_various_fmk_dom_ready.js +112 -0
- assets/czr/fmk/js/base-fmk/lib/czr-alpha-colorpicker.js +570 -0
- assets/czr/fmk/js/base-fmk/lib/czr-alpha-colorpicker.min.js +12 -0
- assets/czr/fmk/js/base-fmk/lib/czrSelect2.js +5725 -0
- assets/czr/fmk/js/base-fmk/lib/czrSelect2.min.js +8 -0
- assets/czr/fmk/js/base-fmk/lib/icheck.min.js +4 -0
- assets/czr/fmk/js/base-fmk/lib/rangeslider.min.js +2 -0
- assets/czr/fmk/js/base-fmk/lib/selecter.min.js +10 -0
- assets/czr/fmk/js/base-fmk/lib/stepper.min.js +10 -0
- assets/czr/fmk/js/themes/_0_4_pre_section_panel_ubiquity.js +79 -0
- assets/czr/fmk/js/themes/_0_5_pre_pro_section.js +77 -0
- assets/czr/fmk/js/themes/_2_1_multiplepicker_control.js +34 -0
- assets/czr/fmk/js/themes/_2_2_cropped_image_control.js +111 -0
- assets/czr/fmk/js/themes/_2_3_upload_control.js +63 -0
- assets/czr/fmk/js/themes/_2_4_layout_control.js +39 -0
- assets/czr/fmk/js/themes/_2_extend_api_theme_controls.js +37 -0
- assets/czr/fmk/js/themes/_6_control_dependencies.js +467 -0
- assets/czr/fmk/js/themes/_8_various_theme_dom_ready.js +115 -0
- assets/czr/sek/css/_dev_control/DEPRECATED__0_5_control_feedback_ui.css +128 -0
- assets/czr/sek/css/_dev_control/_0_0_control_font_and_core_overrides.css +115 -0
- assets/czr/sek/css/_dev_control/_0_1_control_module_and_section_input.css +321 -0
- assets/czr/sek/css/_dev_control/_0_2_control_inputs.css +723 -0
- assets/czr/sek/css/_dev_control/_0_3_control_buttons.css +274 -0
- assets/czr/sek/css/_dev_control/_0_4_control_top_bar.css +205 -0
- assets/czr/sek/css/_dev_control/_0_6_control_top_save_sections_and_templates.css +260 -0
- assets/czr/sek/css/_dev_control/_0_7_control_tmpl_gallery.css +434 -0
- assets/czr/sek/css/_dev_control/_0_8_control_level_tree.css +124 -0
- assets/czr/sek/js/_dev_control/_0_0_sektions_fmk_overrides.js +228 -0
- assets/czr/sek/js/_dev_control/_1_0_sektions_initialize.js +721 -0
- assets/czr/sek/js/_dev_control/_1_1_1_sektions_topbar.js +283 -0
assets/_deprecated_preset_sections.json
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"intro_one" : {"collection":[{"id":"","level":"column","collection":[{"id":"","level":"module","module_type":"czr_heading_module","value":{"main_settings":{"heading_text":"Our creative Lab","h_alignment_css":{"desktop":"center"}},"font_settings":{"font_family_css":"[gfont]Montserrat:regular","font_size_css":{"desktop":"46px","tablet":"30px","mobile":"20px"},"color_css":"#000000","text_transform_css":"uppercase"},"spacing":{"spacing_css":{"desktop":{"margin-bottom":"10","unit":"px"}}}},"options":{"spacing":[]},"ver_ini":"1.1.0"},{"id":"","level":"module","module_type":"czr_tiny_mce_editor_module","value":{"main_settings":{"content":"Helps you bring your ideas to life.","h_alignment_css":{"desktop":"center"},"autop":false},"font_settings":{"font_family_css":"[gfont]Roboto:italic","font_size_css":{"desktop":"20px","tablet":"18px","mobile":"16px"},"color_css":"#6d6d6d"}},"options":{"spacing":[]},"ver_ini":"1.1.0"}],"options":{"bg":{"bg-color":"rgba(255,255,255,0.75)","bg-color-overlay":"#000000","bg-opacity-overlay":"40"},"spacing":{"pad_marg":{"desktop":{"padding-right":"20","padding-left":"20","padding-top":"70","padding-bottom":"70"},"tablet":{"padding-top":"40","padding-bottom":"40","padding-right":"10","padding-left":"10"},"mobile":{"padding-top":"30","padding-bottom":"30"}}}},"ver_ini":"1.1.0"}],"options":{"bg":{"bg-image":"__img_url__https://api.nimblebuilder.com/wp-content/uploads/2021/03/intro_one.jpg","bg-color-overlay":"#000000","bg-opacity-overlay":"40"},"width":{"use-custom-inner-width":true,"inner-section-width":{"desktop":"525px","tablet":"50%","mobile":"85%"}},"spacing":{"pad_marg":{"desktop":{"padding-top":"250","padding-bottom":"250"},"tablet":{"padding-bottom":"200","padding-top":"200"},"mobile":{"padding-top":"150","padding-bottom":"150"}}}},"ver_ini":"1.1.0"},
|
3 |
+
"intro_two" : {"collection":[{"id":"","level":"column","collection":[],"ver_ini":"1.1.0"},{"id":"","level":"column","collection":[{"id":"","level":"module","module_type":"czr_tiny_mce_editor_module","ver_ini":"1.1.0","value":{"main_settings":{"content":"Design your <strong>own space</strong>","h_alignment_css":{"desktop":"right","mobile":"center"},"autop":false},"font_settings":{"font_family_css":"[gfont]Montserrat:regular","font_size_css":{"desktop":"50px","tablet":"33px"},"color_css":"#ffffff"}}},{"id":"","level":"module","module_type":"czr_tiny_mce_editor_module","ver_ini":"1.1.0","value":{"main_settings":{"content":"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor.","h_alignment_css":{"desktop":"right","mobile":"justify"}},"font_settings":{"font_family_css":"[gfont]Roboto:regular","color_css":"#ffffff"}}},{"id":"","level":"module","module_type":"czr_button_module","ver_ini":"1.1.0","value":{"content":{"button_text":"Start now"},"design":{"bg_color_css":"#c5a872","bg_color_hover":"#151515","border_radius_css":"2","h_alignment_css":{"desktop":"right","mobile":"center"}},"font":{"font_family_css":"[gfont]Roboto:regular","color_css":"#ffffff","font_style_css":"italic"}}}],"ver_ini":"1.1.0","options":{"spacing":{"pad_marg":{"desktop":{"padding-left":"63"},"mobile":{"padding-left":"0"}}}}}],"options":{"bg":{"bg-image":"__img_url__https://api.nimblebuilder.com/wp-content/uploads/2021/03/intro_two.jpg","bg-position":{"desktop":"top","tablet":"top_left","mobile":"center"},"bg-apply-overlay":true},"width":{"use-custom-inner-width":true,"inner-section-width":{"desktop":"960px"}},"breakpoint":{"use-custom-breakpoint":true,"custom-breakpoint":"575"},"spacing":{"pad_marg":{"desktop":{"padding-top":"180","padding-bottom":"180"},"tablet":{"padding-right":"20","padding-left":"20"},"mobile":{"padding-right":"10","padding-left":"10","padding-top":"150","padding-bottom":"150"}}}},"ver_ini":"1.1.0"},
|
4 |
+
"intro_three" : {"collection":[{"id":"","level":"column","collection":[{"id":"","level":"module","module_type":"czr_heading_module","ver_ini":"1.1.0","value":{"main_settings":{"heading_text":"We can help you<br/><strong><i>grow</i></strong> your business !","heading_tag":"h2","h_alignment_css":{"desktop":"center"}},"font_settings":{"font_family_css":"[gfont]Poppins:regular","font_size_css":{"desktop":"50px","tablet":"40px","mobile":"30px"},"color_css":"#000000"},"spacing":{"spacing_css":{"desktop":{"margin-bottom":"14"}}}}},{"id":"","level":"module","module_type":"czr_tiny_mce_editor_module","ver_ini":"1.1.0","value":{"main_settings":{"content":"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec.","h_alignment_css":{"desktop":"center"}},"font_settings":{"font_family_css":"[gfont]Roboto:regular","font_size_css":{"desktop":"18px","tablet":"17px","mobile":"16px"},"color_css":"#514f4f"}}},{"id":"","level":"module","module_type":"czr_button_module","ver_ini":"1.1.0","value":{"content":{"button_text":"Learn more","link-to":"url","link-pick-url":{"id":"_custom_","type_label":"","title":"<span style=\"font-weight:bold\">Set a custom url</span>","url":""},"link-custom-url":"mailto:contact@youremail.com","icon":"far fa-envelope-open"},"design":{"bg_color_css":"#ff595e","bg_color_hover":"#151515","border_radius_css":{"_all_":"10px"},"h_alignment_css":"center"},"font":{"font_family_css":"[gfont]Roboto:regular","font_size_css":{"desktop":"20px","mobile":"16px","tablet":"18px"},"color_css":"#ffffff"}}}],"ver_ini":"1.1.0","options":{"spacing":{"pad_marg":{"desktop":{"padding-left":"20","padding-right":"20"},"mobile":{"padding-left":"0","padding-right":"0"}}}}}],"ver_ini":"1.1.0","options":{"bg":{"bg-image":"__img_url__https://api.nimblebuilder.com/wp-content/uploads/2021/03/intro_three.jpg","bg-position":{"desktop":"top","mobile":"center"},"bg-parallax":true,"bg-opacity-overlay":"22"},"spacing":{"pad_marg":{"desktop":{"padding-top":"200","padding-bottom":"200"},"mobile":{"padding-top":"150","padding-bottom":"150"}}},"width":{"use-custom-inner-width":true,"inner-section-width":{"desktop":"600px"}}}},
|
5 |
+
|
6 |
+
"features_one" : {"collection":[{"id":"","level":"column","collection":[{"id":"","level":"module","module_type":"czr_heading_module","ver_ini":"1.1.0","value":{"main_settings":{"heading_text":"Our services","heading_tag":"h2","h_alignment_css":{"desktop":"center"}},"font_settings":{"font_family_css":"[gfont]Poppins:regular","font_size_css":{"desktop":"45px","tablet":"40px","mobile":"30px"},"color_css":"#000000"},"spacing":{"spacing_css":{"desktop":{"margin-bottom":"3","margin-top":"3"}}}}},{"id":"","is_nested":true,"level":"section","collection":[{"id":"","level":"column","collection":[{"id":"","level":"module","module_type":"czr_icon_module","ver_ini":"1.1.0","value":{"icon_settings":{"icon":"fas fa-award","font_size_css":{"desktop":"34px"},"color_css":"#19b934"}}},{"id":"","level":"module","module_type":"czr_heading_module","ver_ini":"1.1.0","value":{"main_settings":{"heading_text":"Award winning ","heading_tag":"h3","h_alignment_css":{"desktop":"center"}},"font_settings":{"font_family_css":"[gfont]Poppins:500","font_size_css":{"desktop":"25px","tablet":"18px"}},"spacing":{"spacing_css":{"desktop":{"margin-top":"10","margin-bottom":"10"}}}}},{"id":"","level":"module","module_type":"czr_tiny_mce_editor_module","ver_ini":"1.1.0","value":{"main_settings":{"content":"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet.","h_alignment_css":{"desktop":"center"}},"font_settings":{"font_family_css":"[gfont]Montserrat:500","font_size_css":{"desktop":"16px","tablet":"15px","mobile":"15px"},"color_css":"#727272"}}},{"id":"","level":"module","module_type":"czr_button_module","ver_ini":"1.1.0","value":{"content":{"button_text":"Learn more"},"design":{"bg_color_css":"#19b934","bg_color_hover":"#151515","border_radius_css":"2","h_alignment_css":"center"},"font":{"font_size_css":{"desktop":"17px","mobile":"15px"},"color_css":"#ffffff"}},"options":{"spacing":{"pad_marg":{"desktop":{"margin-top":"1","unit":"em"}}}}}],"ver_ini":"1.1.0","options":{"border":{"shadow":true},"spacing":{"pad_marg":{"desktop":{"margin-right":"10","margin-left":"10","padding-top":"50","padding-bottom":"50","padding-left":"15","padding-right":"15","margin-bottom":"20"},"tablet":{"padding-top":"30","padding-bottom":"30"}}}},"width":""},{"id":"","level":"column","collection":[{"id":"","level":"module","module_type":"czr_icon_module","ver_ini":"1.1.0","value":{"icon_settings":{"icon":"fas fa-rocket","font_size_css":{"desktop":"34px"},"color_css":"#19b934"}}},{"id":"","level":"module","module_type":"czr_heading_module","ver_ini":"1.1.0","value":{"main_settings":{"heading_text":"Performances ","heading_tag":"h3","h_alignment_css":{"desktop":"center"}},"font_settings":{"font_family_css":"[gfont]Poppins:500","font_size_css":{"desktop":"25px","tablet":"18px"}},"spacing":{"spacing_css":{"desktop":{"margin-top":"10","margin-bottom":"10"}}}}},{"id":"","level":"module","module_type":"czr_tiny_mce_editor_module","ver_ini":"1.1.0","value":{"main_settings":{"content":"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet.","h_alignment_css":{"desktop":"center"}},"font_settings":{"font_family_css":"[gfont]Montserrat:500","font_size_css":{"desktop":"16px","tablet":"15px","mobile":"15px"},"color_css":"#727272"}}},{"id":"","level":"module","module_type":"czr_button_module","ver_ini":"1.1.0","value":{"content":{"button_text":"Learn more"},"design":{"bg_color_css":"#19b934","bg_color_hover":"#151515","border_radius_css":"2","h_alignment_css":"center"},"font":{"font_size_css":{"desktop":"17px","mobile":"15px"},"color_css":"#ffffff"}},"options":{"spacing":{"pad_marg":{"desktop":{"margin-top":"1","unit":"em"}}}}}],"ver_ini":"1.1.0","options":{"border":{"shadow":true},"spacing":{"pad_marg":{"desktop":{"margin-right":"10","margin-left":"10","padding-top":"50","padding-bottom":"50","padding-left":"15","padding-right":"15","margin-bottom":"20"},"tablet":{"padding-top":"30","padding-bottom":"30"}}}},"width":""},{"id":"","level":"column","collection":[{"id":"","level":"module","module_type":"czr_icon_module","ver_ini":"1.1.0","value":{"icon_settings":{"icon":"fas fa-hands-helping","font_size_css":{"desktop":"34px"},"color_css":"#19b934"}}},{"id":"","level":"module","module_type":"czr_heading_module","ver_ini":"1.1.0","value":{"main_settings":{"heading_text":"Top support","heading_tag":"h3","h_alignment_css":{"desktop":"center"}},"font_settings":{"font_family_css":"[gfont]Poppins:500","font_size_css":{"desktop":"25px","tablet":"18px"}},"spacing":{"spacing_css":{"desktop":{"margin-top":"10","margin-bottom":"10"}}}}},{"id":"","level":"module","module_type":"czr_tiny_mce_editor_module","ver_ini":"1.1.0","value":{"main_settings":{"content":"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet.","h_alignment_css":{"desktop":"center"}},"font_settings":{"font_family_css":"[gfont]Montserrat:500","font_size_css":{"desktop":"16px","tablet":"15px","mobile":"15px"},"color_css":"#727272"}}},{"id":"","level":"module","module_type":"czr_button_module","ver_ini":"1.1.0","value":{"content":{"button_text":"Learn more"},"design":{"bg_color_css":"#19b934","bg_color_hover":"#151515","border_radius_css":"2","h_alignment_css":"center"},"font":{"font_size_css":{"desktop":"17px","mobile":"15px"},"color_css":"#ffffff"}},"options":{"spacing":{"pad_marg":{"desktop":{"margin-top":"1","unit":"em"}}}}}],"ver_ini":"1.1.0","options":{"border":{"shadow":true},"spacing":{"pad_marg":{"desktop":{"margin-right":"10","margin-left":"10","padding-top":"50","padding-bottom":"50","padding-left":"15","padding-right":"15","margin-bottom":"20"},"tablet":{"padding-top":"30","padding-bottom":"30"}}}},"width":""}],"options":{"spacing":{"pad_marg":{"desktop":{"padding-bottom":"180","padding-top":"80"},"tablet":{"padding-top":"70","padding-bottom":"130"},"mobile":{"padding-top":"30","padding-bottom":"50"}}},"width":{"use-custom-inner-width":true,"inner-section-width":{"desktop":"960px"}},"breakpoint":{"use-custom-breakpoint":true,"custom-breakpoint":"720"}},"ver_ini":"1.1.0"}],"ver_ini":"1.1.0"}],"ver_ini":"1.1.0","options":{"spacing":{"pad_marg":{"desktop":{"padding-top":"100"},"tablet":{"padding-top":"80"},"mobile":{"padding-top":"30"}}}}},
|
7 |
+
|
8 |
+
"features_two" : {"collection":[{"id":"","level":"column","collection":[{"id":"","level":"module","module_type":"czr_icon_module","ver_ini":"1.1.0","value":{"icon_settings":{"icon":"fas fa-chart-line","font_size_css":"40px","color_css":"#ffffff"},"spacing_border":{"spacing_css":{"desktop":{"padding-top":"30","padding-bottom":"30","padding-right":"30","padding-left":"30"}},"border-type":"solid","borders":{"_all_":{"wght":"3px","col":"#ffffff"}},"border_radius_css":{"_all_":"119px"},"use_box_shadow":true}}},{"id":"","level":"module","module_type":"czr_heading_module","ver_ini":"1.1.0","value":{"main_settings":{"heading_text":"High performances","heading_tag":"h3","h_alignment_css":{"desktop":"center"}},"font_settings":{"font_family_css":"[gfont]Lato:regular","font_size_css":{"desktop":"27px","mobile":"22px","tablet":"24px"},"color_css":"#ffffff"},"spacing":{"spacing_css":{"desktop":{"margin-top":"15","margin-bottom":"15"}}}}},{"id":"","level":"module","module_type":"czr_tiny_mce_editor_module","ver_ini":"1.1.0","value":{"main_settings":{"content":"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus.","h_alignment_css":{"desktop":"center"}},"font_settings":{"font_family_css":"[gfont]Montserrat:italic","font_size_css":{"desktop":"17px","mobile":"15px"},"color_css":"#ffffff"}}}],"ver_ini":"1.1.0","width":"","options":{"spacing":{"pad_marg":{"desktop":[],"mobile":{},"tablet":{"margin-bottom":"20"}}}}},{"id":"","level":"column","collection":[{"id":"","level":"module","module_type":"czr_icon_module","ver_ini":"1.1.0","value":{"icon_settings":{"icon":"fas fa-award","font_size_css":"40px","color_css":"#ffffff"},"spacing_border":{"spacing_css":{"desktop":{"padding-top":"30","padding-bottom":"30","padding-right":"30","padding-left":"30"}},"border-type":"solid","borders":{"_all_":{"wght":"3px","col":"#ffffff"}},"border_radius_css":{"_all_":"231px"},"use_box_shadow":true}}},{"id":"","level":"module","module_type":"czr_heading_module","ver_ini":"1.1.0","value":{"main_settings":{"heading_text":"Industry leader","heading_tag":"h3","h_alignment_css":{"desktop":"center"}},"font_settings":{"font_family_css":"[gfont]Lato:regular","font_size_css":{"desktop":"27px","mobile":"22px","tablet":"24px"},"color_css":"#ffffff"},"spacing":{"spacing_css":{"desktop":{"margin-top":"15","margin-bottom":"15"}}}}},{"id":"","level":"module","module_type":"czr_tiny_mce_editor_module","ver_ini":"1.1.0","value":{"main_settings":{"content":"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus.","h_alignment_css":{"desktop":"center"}},"font_settings":{"font_family_css":"[gfont]Montserrat:italic","font_size_css":{"desktop":"17px","mobile":"15px"},"color_css":"#ffffff"}}}],"ver_ini":"1.1.0","width":"","options":{"spacing":{"pad_marg":{"desktop":[],"mobile":{},"tablet":{"margin-bottom":"20"}}}}},{"id":"","level":"column","collection":[{"id":"","level":"module","module_type":"czr_icon_module","ver_ini":"1.1.0","value":{"icon_settings":{"icon":"far fa-clock","font_size_css":"40px","color_css":"#ffffff"},"spacing_border":{"spacing_css":{"desktop":{"padding-top":"30","padding-bottom":"30","padding-right":"30","padding-left":"30"}},"border-type":"solid","borders":{"_all_":{"wght":"3px","col":"#ffffff"}},"border_radius_css":{"_all_":"119px"},"use_box_shadow":true}}},{"id":"","level":"module","module_type":"czr_heading_module","ver_ini":"1.1.0","value":{"main_settings":{"heading_text":"Delivers on time","heading_tag":"h3","h_alignment_css":{"desktop":"center"}},"font_settings":{"font_family_css":"[gfont]Lato:regular","font_size_css":{"desktop":"27px","mobile":"22px","tablet":"24px"},"color_css":"#ffffff"},"spacing":{"spacing_css":{"desktop":{"margin-top":"15","margin-bottom":"15"}}}}},{"id":"","level":"module","module_type":"czr_tiny_mce_editor_module","ver_ini":"1.1.0","value":{"main_settings":{"content":"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus.","h_alignment_css":{"desktop":"center"}},"font_settings":{"font_family_css":"[gfont]Montserrat:italic","font_size_css":{"desktop":"17px","mobile":"15px"},"color_css":"#ffffff"}}}],"ver_ini":"1.1.0","width":"","options":{"spacing":{"pad_marg":{"desktop":[],"mobile":{},"tablet":{"margin-bottom":"20"}}}}}],"options":{"bg":{"bg-image":"__img_url__https://api.nimblebuilder.com/wp-content/uploads/2021/03/features_two.jpg","bg-attachment":true,"bg-apply-overlay":true,"bg-opacity-overlay":"62"},"spacing":{"pad_marg":{"desktop":{"padding-top":"200","padding-bottom":"200"},"mobile":{"padding-top":"100","padding-bottom":"100","padding-left":"5","padding-right":"5"},"tablet":{"padding-top":"150","padding-bottom":"150","padding-left":"40","padding-right":"40"}}},"width":{"use-custom-inner-width":true,"inner-section-width":{"desktop":"960px"}},"breakpoint":{"use-custom-breakpoint":true,"custom-breakpoint":"660"}},"ver_ini":"1.1.0"},
|
9 |
+
|
10 |
+
"about_one":{"collection":[{"id":"","level":"column","collection":[],"ver_ini":"1.8.1","options":{"bg":{"bg-image":"__img_url__https://api.nimblebuilder.com/wp-content/uploads/2021/03/about_one.jpg","bg-position":{"desktop":"right"}},"spacing":{"pad_marg":{"desktop":[],"mobile":{"padding-top":"100","padding-bottom":"100"}}}}},{"id":"","level":"column","collection":[{"id":"","level":"module","module_type":"czr_heading_module","ver_ini":"1.8.1","value":{"main_settings":{"heading_text":"About us","heading_tag":"h2","h_alignment_css":{"desktop":"left"}},"font_settings":{"font_family_css":"[gfont]Raleway:800","font_size_css":{"desktop":"40px"},"color_css":"#646464","font_weight_css":"bold"}}},{"id":"","level":"module","module_type":"czr_heading_module","ver_ini":"1.8.1","value":{"main_settings":{"heading_text":"WHAT DO WE DO ?","heading_tag":"h3","h_alignment_css":{"desktop":"left"}},"font_settings":{"font_family_css":"[gfont]Montserrat:regular","font_size_css":{"desktop":"20px"},"color_css":"#000000","font_weight_css":"bold"}}},{"id":"","level":"module","module_type":"czr_tiny_mce_editor_module","ver_ini":"1.8.1","value":{"main_settings":{"content":"<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor.</p>","h_alignment_css":{"desktop":"left","mobile":"justify"}},"font_settings":{"font_family_css":"[gfont]Roboto:regular","color_css":"#898888"}}},{"id":"","level":"module","module_type":"czr_button_module","ver_ini":"1.8.1","value":{"content":{"button_text":"LEARN MORE"},"design":{"bg_color_css":"rgba(255,255,255,0)","bg_color_hover":"#151515","border_radius_css":"2","h_alignment_css":{"desktop":"left"},"spacing_css":{"padding-top":"0.5","padding-bottom":0.5,"padding-right":1,"padding-left":"0","unit":"em","margin-bottom":"1"},"use_box_shadow":false},"font":{"font_family_css":"[gfont]Roboto:regular","color_css":"#000000","color_hover_css":"#000000","text_decoration_css":"underline"}}},{"id":"","level":"module","module_type":"czr_heading_module","ver_ini":"1.8.1","value":{"main_settings":{"heading_text":"WHO ARE WE ?","heading_tag":"h3","h_alignment_css":{"desktop":"left"}},"font_settings":{"font_family_css":"[gfont]Montserrat:regular","font_size_css":{"desktop":"20px"},"color_css":"#000000","font_weight_css":"bold"}}},{"id":"","level":"module","module_type":"czr_tiny_mce_editor_module","ver_ini":"1.8.1","value":{"main_settings":{"content":"<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor.</p>","h_alignment_css":{"desktop":"left","mobile":"justify"}},"font_settings":{"font_family_css":"[gfont]Roboto:regular","color_css":"#898888"}}},{"id":"","level":"module","module_type":"czr_button_module","ver_ini":"1.8.1","value":{"content":{"button_text":"LEARN MORE"},"design":{"bg_color_css":"rgba(255,255,255,0)","bg_color_hover":"#151515","border_radius_css":"2","h_alignment_css":{"desktop":"left"},"spacing_css":{"padding-top":0.5,"padding-bottom":0.5,"padding-right":1,"padding-left":"0","unit":"em"},"use_box_shadow":false},"font":{"font_family_css":"[gfont]Roboto:regular","color_css":"#000000","color_hover_css":"#000000","text_decoration_css":"underline"}}}],"ver_ini":"1.8.1","options":{"spacing":{"pad_marg":{"desktop":{"padding-left":"15","padding-bottom":"90","padding-top":"90","padding-right":"150"},"mobile":{"padding-left":"10","padding-right":"10","padding-bottom":"30","padding-top":"30"},"tablet":{"padding-right":"20"}}}}}],"options":{"bg":{"bg-color":"#ffffff","bg-position":{"desktop":"top","tablet":"top_left","mobile":"center"},"bg-apply-overlay":true},"width":{"inner-section-width":{"desktop":"960px","tablet":"960%"}},"breakpoint":{"use-custom-breakpoint":true,"custom-breakpoint":"575"},"spacing":{"pad_marg":{"desktop":{"padding-top":"50","padding-bottom":"40"},"tablet":[],"mobile":[]}}},"ver_ini":"1.8.1"},
|
11 |
+
|
12 |
+
"contact_one":{"collection":[{"id":"","level":"column","collection":[{"id":"","level":"module","module_type":"czr_map_module","ver_ini":"1.1.6","value":{"address":"405 East 42nd Street, New York, NY, 10017, USA","zoom":"16","height_css":{"desktop":"588px","mobile":"336px"}}}],"ver_ini":"1.1.6","width":"","options":{"spacing":{"pad_marg":{"desktop":{"margin-right":"10","margin-left":"10"}}}}},{"id":"","level":"column","collection":[{"id":"","level":"module","module_type":"czr_heading_module","ver_ini":"1.1.6","value":{"main_settings":{"heading_text":"Drop us a line","heading_tag":"h2","h_alignment_css":{"desktop":"center"}},"font_settings":{"font_family_css":"[gfont]Roboto:regular","font_size_css":{"desktop":"32px","mobile":"23px"},"color_css":"#141414"}}},{"id":"","level":"module","module_type":"czr_tiny_mce_editor_module","ver_ini":"1.1.6","value":{"main_settings":{"content":"Contact us for anything you want to know! We are happy to answer any question you have as quickly as possible.","h_alignment_css":{"desktop":"justify"}},"font_settings":{"font_family_css":"[gfont]Montserrat:regular","color_css":"#333333"}}},{"id":"","level":"module","module_type":"czr_simple_form_module","ver_ini":"1.1.6","value":{"fields_design":{"borders":{"_all_":{"wght":"0px","col":"#cccccc"},"bottom":{"wght":"1px","col":"#cccccc"}},"use_inset_shadow":false,"border":{"_all_":{"wght":"1px","col":"#cccccc"}}},"form_button":{"bg_color_css":"#020202","bg_color_hover":"#151515","h_alignment_css":{"desktop":"center"},"spacing_css":{"margin-top":0.5,"padding-top":0.5,"padding-bottom":0.5,"padding-right":"2","padding-left":"2","unit":"em"}},"form_fonts":{"fl_font_family_css":"[gfont]Montserrat:regular","fl_font_weight_css":"700","btn_font_family_css":"[gfont]Montserrat:regular","btn_color_css":"#ffffff"},"form_submission":{"email_footer":""}},"options":{"spacing":{"pad_marg":{"desktop":[],"tablet":{"padding-left":"10","padding-right":"15"},"mobile":{"padding-right":"25"}}}}}],"width":"","ver_ini":"1.1.6","options":{"spacing":{"pad_marg":{"desktop":{"margin-right":"10","margin-left":"10"},"tablet":{"margin-left":"10","margin-right":"10","padding-right":"20","padding-left":"20"}}},"bg":[]}}],"options":{"width":{"use-custom-inner-width":true,"inner-section-width":{"desktop":"1000px"}},"spacing":{"pad_marg":{"desktop":{"padding-top":"75","padding-bottom":"75"},"tablet":{"padding-top":"40","padding-bottom":"40"}}},"breakpoint":{"reverse-col-at-breakpoint":true}},"ver_ini":"1.1.6"},
|
13 |
+
|
14 |
+
"contact_two":{"collection":[{"id":"","level":"column","collection":[{"id":"","level":"module","module_type":"czr_heading_module","ver_ini":"1.1.6","value":{"main_settings":{"heading_text":"CONTACT US","heading_tag":"h2","h_alignment_css":{"desktop":"center"}},"font_settings":{"font_family_css":"[gfont]Roboto:regular","font_size_css":{"desktop":"40px","tablet":"35px","mobile":"25px"},"color_css":"#ffffff"},"spacing":{"spacing_css":{"desktop":{"margin-bottom":"5"}}}}},{"id":"","level":"module","module_type":"czr_simple_form_module","ver_ini":"1.1.6","value":{"fields_design":{"border-type":"none","use_outset_shadow":true,"border":{"_all_":{"wght":"1px","col":"#cccccc"}}},"form_button":{"bg_color_hover":"#151515","border-type":"solid","borders":{"_all_":{"wght":"0px","col":""}},"border_radius_css":"2","h_alignment_css":{"desktop":"center"},"spacing_css":{"margin-top":0.5,"padding-top":0.5,"padding-bottom":0.5,"padding-right":"3","padding-left":"3","unit":"em"}},"form_fonts":{"fl_font_family_css":"[cfont]Lucida Console,Monaco,monospace","fl_color_css":"#ffffff","btn_color_css":"#ffffff"},"form_submission":{"email_footer":""}}}],"ver_ini":"1.1.6"}],"ver_ini":"1.1.6","options":{"bg":{"bg-image":"__img_url__https://api.nimblebuilder.com/wp-content/uploads/2021/03/contact_two.jpg","bg-apply-overlay":true,"bg-color-overlay":"#752a2a"},"spacing":{"pad_marg":{"desktop":{"padding-top":"120","padding-bottom":"120"},"tablet":{"padding-top":"85","padding-bottom":"85"},"mobile":{"padding-top":"40","padding-bottom":"40"}}},"width":{"use-custom-inner-width":true,"inner-section-width":{"desktop":"600px"}}}},
|
15 |
+
|
16 |
+
"two_columns":{"collection":[{"id":"","level":"column","collection":[]},{"id":"","level":"column","collection":[]}]},
|
17 |
+
|
18 |
+
"three_columns":{"collection":[{"id":"","level":"column","collection":[]},{"id":"","level":"column","collection":[]},{"id":"","level":"column","collection":[]}]},
|
19 |
+
"four_columns":{"collection":[{"id":"","level":"column","collection":[]},{"id":"","level":"column","collection":[]},{"id":"","level":"column","collection":[]},{"id":"","level":"column","collection":[]}]},
|
20 |
+
|
21 |
+
"header_one":{"collection":[{"id":"","level":"column","collection":[{"id":"","level":"module","module_type":"czr_image_module","ver_ini":"2.0.21-beta","value":{"main_settings":{"img":"__img_url__https://api.nimblebuilder.com/wp-content/uploads/2021/03/logo_placeholder_190x80.jpg","img-size":"original","link-to":"url","link-pick-url":{"id":"_custom_","type_label":"","title":"<span style=\"font-weight:bold\">Set a custom url</span>","url":""},"link-custom-url":"{{home_url}}"},"borders_corners":{"border_radius_css":{"_all_":"8px"}}},"options":{"spacing":{"pad_marg":{"desktop":{"padding-top":"8","padding-bottom":"8"}}}}}],"ver_ini":"2.0.21-beta","options":{"width":{"custom-width":25}}},{"id":"","level":"column","collection":[{"id":"","level":"module","module_type":"czr_menu_module","ver_ini":"2.0.21-beta","value":{"content":{"h_alignment_css":{"desktop":"right"},"hamb_h_alignment_css":{"desktop":"center","mobile":"right","tablet":"right"}},"font":{"text_transform_css":"uppercase"}}}],"ver_ini":"2.0.21-beta","options":{"width":{"custom-width":75}}}],"options":{"breakpoint":{"use-custom-breakpoint":true,"custom-breakpoint":"1"}}},
|
22 |
+
|
23 |
+
"header_two":{"collection":[{"id":"","level":"column","collection":[{"id":"","level":"module","module_type":"czr_menu_module","ver_ini":"2.0.21-beta","value":{"content":{"h_alignment_css":{"desktop":"left"},"hamb_h_alignment_css":{"desktop":"center","tablet":"left"}},"font":{"text_transform_css":"uppercase"}}}],"ver_ini":"2.0.21-beta","options":{"width":{"custom-width":75}}},{"id":"","level":"column","collection":[{"id":"","level":"module","module_type":"czr_image_module","ver_ini":"2.0.21-beta","value":{"main_settings":{"img":"__img_url__https://api.nimblebuilder.com/wp-content/uploads/2021/03/logo_placeholder_190x80.jpg","img-size":"original","link-to":"url","link-pick-url":{"id":"_custom_","type_label":"","title":"<span style=\"font-weight:bold\">Set a custom url</span>","url":""},"link-custom-url":"{{home_url}}"},"borders_corners":{"border_radius_css":{"_all_":"8px"}}},"options":{"spacing":{"pad_marg":{"desktop":{"padding-top":"8","padding-bottom":"8"}}}}}],"ver_ini":"2.0.21-beta","options":{"width":{"custom-width":25}}}],"options":{"breakpoint":{"use-custom-breakpoint":true,"custom-breakpoint":"1","reverse-col-at-breakpoint":true}}},
|
24 |
+
|
25 |
+
"footer_one":{"collection":[{"id":"","level":"column","collection":[]},{"id":"","level":"column","collection":[]},{"id":"","level":"column","collection":[]}]},
|
26 |
+
|
27 |
+
"team_one":{"collection":[{"id":"","level":"column","collection":[{"id":"","level":"module","module_type":"czr_heading_module","ver_ini":"2.1.10","value":{"main_settings":{"heading_text":"· Meet Our Team ·","heading_tag":"h2"},"font_settings":{"font_size_css":{"desktop":"45px","tablet":"40px","mobile":"30px"},"color_css":"#000000"},"spacing":{"spacing_css":{"desktop":{"margin-bottom":"3","margin-top":"3"}}}}},{"id":"","is_nested":true,"level":"section","collection":[{"id":"","level":"column","collection":[{"id":"","level":"module","module_type":"czr_image_module","ver_ini":"2.1.10","value":{"main_settings":{"img":"__img_url__https://api.nimblebuilder.com/wp-content/uploads/2021/03/portrait_1.jpg","img-size":"original","use_custom_width":true,"use_custom_height":true,"custom_height":{"desktop":"210px","tablet":"100%","mobile":"100%"},"img_hover_effect":"reverse-grayscale"}},"options":{"height":{"height-type":"auto","custom-height":{"desktop":"50px"}}}},{"id":"","level":"module","module_type":"czr_heading_module","ver_ini":"2.1.10","value":{"main_settings":{"heading_text":"Lisa Weintriks","heading_tag":"h3","h_alignment_css":{"desktop":"left"}},"font_settings":{"font_size_css":{"desktop":"25px","tablet":"20px"},"color_css":"#000000"},"spacing":{"spacing_css":{"desktop":{"margin-top":"10","margin-bottom":"10"}}}}},{"id":"","level":"module","module_type":"czr_tiny_mce_editor_module","ver_ini":"2.1.10","value":{"main_settings":{"content":"<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet.</p>"},"font_settings":{"font_size_css":{"desktop":"17px","tablet":"15px","mobile":"15px"},"color_css":"#727272"}}}],"ver_ini":"2.1.10","options":{"border":{"shadow":true},"spacing":{"pad_marg":{"desktop":{"margin-right":"5","margin-left":"5","unit":"px","margin-bottom":"5","margin-top":"5","padding-top":"8"},"tablet":{"unit":"px"}}},"height":{"v_alignment":{"desktop":"top"}}},"width":""},{"id":"","level":"column","collection":[{"id":"","level":"module","module_type":"czr_image_module","ver_ini":"2.1.10","value":{"main_settings":{"img":"__img_url__https://api.nimblebuilder.com/wp-content/uploads/2021/03/portrait_4.jpg","img-size":"original","use_custom_width":true,"use_custom_height":true,"custom_height":{"desktop":"210px","tablet":"100%","mobile":"100%"},"img_hover_effect":"reverse-grayscale"}},"options":{"height":{"height-type":"auto","custom-height":{"desktop":"50px"}}}},{"id":"","level":"module","module_type":"czr_heading_module","ver_ini":"2.1.10","value":{"main_settings":{"heading_text":"John Doe","heading_tag":"h3","h_alignment_css":{"desktop":"left"}},"font_settings":{"font_size_css":{"desktop":"25px","tablet":"20px"},"color_css":"#000000"},"spacing":{"spacing_css":{"desktop":{"margin-top":"10","margin-bottom":"10"}}}}},{"id":"","level":"module","module_type":"czr_tiny_mce_editor_module","ver_ini":"2.1.10","value":{"main_settings":{"content":"<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet.</p>"},"font_settings":{"font_size_css":{"desktop":"17px","tablet":"15px","mobile":"15px"},"color_css":"#727272"}}}],"ver_ini":"2.1.10","options":{"border":{"shadow":true},"spacing":{"pad_marg":{"desktop":{"margin-right":"5","margin-left":"5","unit":"px","margin-bottom":"5","margin-top":"5","padding-top":"8"},"tablet":{"unit":"px"}}},"height":{"v_alignment":{"desktop":"top"}}},"width":""},{"id":"","level":"column","collection":[{"id":"","level":"module","module_type":"czr_image_module","ver_ini":"2.1.10","value":{"main_settings":{"img":"__img_url__https://api.nimblebuilder.com/wp-content/uploads/2021/03/portrait_2.jpg","img-size":"original","use_custom_width":true,"use_custom_height":true,"custom_height":{"desktop":"210px","tablet":"100%","mobile":"100%"},"img_hover_effect":"reverse-grayscale"}},"options":{"height":{"height-type":"auto","custom-height":{"desktop":"50px"}}}},{"id":"","level":"module","module_type":"czr_heading_module","ver_ini":"2.1.10","value":{"main_settings":{"heading_text":"Helen Stimuks","heading_tag":"h3","h_alignment_css":{"desktop":"left"}},"font_settings":{"font_size_css":{"desktop":"25px","tablet":"20px"},"color_css":"#000000"},"spacing":{"spacing_css":{"desktop":{"margin-top":"10","margin-bottom":"10"}}}}},{"id":"","level":"module","module_type":"czr_tiny_mce_editor_module","ver_ini":"2.1.10","value":{"main_settings":{"content":"<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet.</p>"},"font_settings":{"font_size_css":{"desktop":"17px","tablet":"15px","mobile":"15px"},"color_css":"#727272"}}}],"ver_ini":"2.1.10","options":{"border":{"shadow":true},"spacing":{"pad_marg":{"desktop":{"margin-right":"5","margin-left":"5","unit":"px","margin-bottom":"5","margin-top":"5","padding-top":"8"},"tablet":{"unit":"px"}}},"height":{"v_alignment":{"desktop":"top"}}},"width":""},{"id":"","level":"column","collection":[{"id":"","level":"module","module_type":"czr_image_module","ver_ini":"2.1.10","value":{"main_settings":{"img":"__img_url__https://api.nimblebuilder.com/wp-content/uploads/2021/03/portrait_3.jpg","img-size":"original","use_custom_width":true,"use_custom_height":true,"custom_height":{"desktop":"210px","tablet":"100%","mobile":"100%"},"img_hover_effect":"reverse-grayscale"}},"options":{"height":{"height-type":"auto","custom-height":{"desktop":"50px"}}}},{"id":"","level":"module","module_type":"czr_heading_module","ver_ini":"2.1.10","value":{"main_settings":{"heading_text":"Robert Dawnip","heading_tag":"h3","h_alignment_css":{"desktop":"left"}},"font_settings":{"font_size_css":{"desktop":"25px","tablet":"20px"},"color_css":"#000000"},"spacing":{"spacing_css":{"desktop":{"margin-top":"10","margin-bottom":"10"}}}}},{"id":"","level":"module","module_type":"czr_tiny_mce_editor_module","ver_ini":"2.1.10","value":{"main_settings":{"content":"<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet.</p>"},"font_settings":{"font_size_css":{"desktop":"17px","tablet":"15px","mobile":"15px"},"color_css":"#727272"}}}],"ver_ini":"2.1.10","options":{"border":{"shadow":true},"spacing":{"pad_marg":{"desktop":{"margin-right":"5","margin-left":"5","unit":"px","margin-bottom":"5","margin-top":"5","padding-top":"8"},"tablet":{"unit":"px"}}}},"width":""}],"options":{"spacing":{"pad_marg":{"desktop":{"padding-bottom":"50","padding-top":"50","unit":"px"},"tablet":{"padding-top":"40","padding-bottom":"40","unit":"px"},"mobile":{"padding-top":"30","padding-bottom":"30","unit":"px"}}},"width":{"use-custom-inner-width":true,"inner-section-width":{"desktop":"1100px"}},"breakpoint":{"use-custom-breakpoint":true,"custom-breakpoint":"720","apply-to-all":true},"border":[]},"ver_ini":"2.1.10"}],"ver_ini":"2.1.10"}],"options":{"spacing":{"pad_marg":{"desktop":{"padding-top":"60","padding-bottom":"60","unit":"px"},"tablet":{"padding-top":"50","padding-bottom":"50","unit":"px"},"mobile":{"padding-top":"30","padding-bottom":"30","unit":"px"}}},"bg":{"bg-color":"#ffffff"},"level_text":{"font_family_css":"[gfont]Rubik:regular"}},"ver_ini":"2.1.10"},
|
28 |
+
|
29 |
+
"team_two":{"collection":[{"id":"","level":"column","collection":[{"id":"","level":"module","module_type":"czr_heading_module","ver_ini":"2.1.10","value":{"main_settings":{"heading_text":"· Meet Our Team ·","heading_tag":"h2"},"font_settings":{"font_size_css":{"desktop":"45px","tablet":"40px","mobile":"30px"},"color_css":"#000000"},"spacing":{"spacing_css":{"desktop":{"margin-bottom":"3","margin-top":"3"}}}}},{"id":"","is_nested":true,"level":"section","collection":[{"id":"","level":"column","collection":[{"id":"","level":"module","module_type":"czr_image_module","ver_ini":"2.1.10","value":{"main_settings":{"img":"__img_url__https://api.nimblebuilder.com/wp-content/uploads/2021/03/portrait_5.jpg","img-size":"original","use_custom_width":true,"use_custom_height":true,"custom_height":{"desktop":"280px","tablet":"100%","mobile":"100%"},"img_hover_effect":"reverse-grayscale"}},"options":{"height":{"height-type":"auto","custom-height":{"desktop":"50px"}}}},{"id":"","level":"module","module_type":"czr_heading_module","ver_ini":"2.1.10","value":{"main_settings":{"heading_text":"Lisa Weintriks","heading_tag":"h3","h_alignment_css":{"desktop":"left"}},"font_settings":{"font_size_css":{"desktop":"25px","tablet":"20px"},"color_css":"#000000"},"spacing":{"spacing_css":{"desktop":{"margin-top":"10","margin-bottom":"10"}}}}},{"id":"","level":"module","module_type":"czr_tiny_mce_editor_module","ver_ini":"2.1.10","value":{"main_settings":{"content":"<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet.</p>"},"font_settings":{"font_size_css":{"desktop":"17px","tablet":"15px","mobile":"15px"},"color_css":"#727272"}}}],"ver_ini":"2.1.10","options":{"border":{"shadow":true},"spacing":{"pad_marg":{"desktop":{"margin-right":"5","margin-left":"5","unit":"px","margin-bottom":"5","margin-top":"5","padding-top":"8"},"tablet":{"unit":"px"}}},"height":{"v_alignment":{"desktop":"top"}}},"width":""},{"id":"","level":"column","collection":[{"id":"","level":"module","module_type":"czr_image_module","ver_ini":"2.1.10","value":{"main_settings":{"img":"__img_url__https://api.nimblebuilder.com/wp-content/uploads/2021/03/portrait_3.jpg","img-size":"original","use_custom_width":true,"use_custom_height":true,"custom_height":{"desktop":"280px","tablet":"100%","mobile":"100%"},"img_hover_effect":"reverse-grayscale"}},"options":{"height":{"height-type":"auto","custom-height":{"desktop":"50px"}}}},{"id":"","level":"module","module_type":"czr_heading_module","ver_ini":"2.1.10","value":{"main_settings":{"heading_text":"John Doe","heading_tag":"h3","h_alignment_css":{"desktop":"left"}},"font_settings":{"font_size_css":{"desktop":"25px","tablet":"20px"},"color_css":"#000000"},"spacing":{"spacing_css":{"desktop":{"margin-top":"10","margin-bottom":"10"}}}}},{"id":"","level":"module","module_type":"czr_tiny_mce_editor_module","ver_ini":"2.1.10","value":{"main_settings":{"content":"<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet.</p>"},"font_settings":{"font_size_css":{"desktop":"17px","tablet":"15px","mobile":"15px"},"color_css":"#727272"}}}],"ver_ini":"2.1.10","options":{"border":{"shadow":true},"spacing":{"pad_marg":{"desktop":{"margin-right":"5","margin-left":"5","unit":"px","margin-bottom":"5","margin-top":"5","padding-top":"8"},"tablet":{"unit":"px"}}},"height":{"v_alignment":{"desktop":"top"}}},"width":""},{"id":"","level":"column","collection":[{"id":"","level":"module","module_type":"czr_image_module","ver_ini":"2.1.10","value":{"main_settings":{"img":"__img_url__https://api.nimblebuilder.com/wp-content/uploads/2021/03/portrait_2.jpg","img-size":"original","use_custom_width":true,"use_custom_height":true,"custom_height":{"desktop":"280px","tablet":"100%","mobile":"100%"},"img_hover_effect":"reverse-grayscale"}},"options":{"height":{"height-type":"auto","custom-height":{"desktop":"50px"}}}},{"id":"","level":"module","module_type":"czr_heading_module","ver_ini":"2.1.10","value":{"main_settings":{"heading_text":"Helen Stimuks","heading_tag":"h3","h_alignment_css":{"desktop":"left"}},"font_settings":{"font_size_css":{"desktop":"25px","tablet":"20px"},"color_css":"#000000"},"spacing":{"spacing_css":{"desktop":{"margin-top":"10","margin-bottom":"10"}}}}},{"id":"","level":"module","module_type":"czr_tiny_mce_editor_module","ver_ini":"2.1.10","value":{"main_settings":{"content":"<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet.</p>"},"font_settings":{"font_size_css":{"desktop":"17px","tablet":"15px","mobile":"15px"},"color_css":"#727272"}}}],"ver_ini":"2.1.10","options":{"border":{"shadow":true},"spacing":{"pad_marg":{"desktop":{"margin-right":"5","margin-left":"5","unit":"px","margin-bottom":"5","margin-top":"5","padding-top":"8"},"tablet":{"unit":"px"}}},"height":{"v_alignment":{"desktop":"top"}}},"width":""}],"options":{"spacing":{"pad_marg":{"desktop":{"padding-bottom":"50","padding-top":"50","unit":"px"},"tablet":{"padding-top":"40","padding-bottom":"40","unit":"px"},"mobile":{"padding-top":"30","padding-bottom":"30","unit":"px"}}},"width":{"use-custom-inner-width":true,"inner-section-width":{"desktop":"1100px"}},"breakpoint":{"use-custom-breakpoint":true,"custom-breakpoint":"720","apply-to-all":true},"border":[]},"ver_ini":"2.1.10"}],"ver_ini":"2.1.10"}],"options":{"spacing":{"pad_marg":{"desktop":{"padding-top":"60","padding-bottom":"60","unit":"px"},"tablet":{"padding-top":"50","padding-bottom":"50","unit":"px"},"mobile":{"padding-top":"30","padding-bottom":"30","unit":"px"}}},"bg":{"bg-color":"#ffffff"},"level_text":{"font_family_css":"[gfont]Rubik:regular"}},"ver_ini":"2.1.10"}
|
30 |
+
}
|
assets/czr/fmk/css/img/czr-spinner.gif
ADDED
Binary file
|
assets/czr/fmk/css/img/fs-sprite.png
ADDED
Binary file
|
assets/czr/fmk/css/img/green.png
ADDED
Binary file
|
assets/czr/fmk/css/img/green@2x.png
ADDED
Binary file
|
assets/czr/fmk/css/img/grey.png
ADDED
Binary file
|
assets/czr/fmk/css/img/grey@2x.png
ADDED
Binary file
|
assets/czr/fmk/css/img/jquery.fs.selecter-arrow.png
ADDED
Binary file
|
assets/czr/fmk/css/img/jquery.fs.stepper-arrows.png
ADDED
Binary file
|
assets/czr/fmk/css/index.php
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Silence is golden.
|
assets/czr/fmk/css/lib/czrSelect2.css
ADDED
@@ -0,0 +1,482 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.czrSelect2-container {
|
2 |
+
box-sizing: border-box;
|
3 |
+
display: inline-block;
|
4 |
+
margin: 0;
|
5 |
+
position: relative;
|
6 |
+
vertical-align: middle; }
|
7 |
+
.czrSelect2-container .czrSelect2-selection--single {
|
8 |
+
box-sizing: border-box;
|
9 |
+
cursor: pointer;
|
10 |
+
display: block;
|
11 |
+
height: 28px;
|
12 |
+
user-select: none;
|
13 |
+
-webkit-user-select: none; }
|
14 |
+
.czrSelect2-container .czrSelect2-selection--single .czrSelect2-selection__rendered {
|
15 |
+
display: block;
|
16 |
+
padding-left: 8px;
|
17 |
+
padding-right: 20px;
|
18 |
+
overflow: hidden;
|
19 |
+
text-overflow: ellipsis;
|
20 |
+
white-space: nowrap; }
|
21 |
+
.czrSelect2-container .czrSelect2-selection--single .czrSelect2-selection__clear {
|
22 |
+
position: relative; }
|
23 |
+
.czrSelect2-container[dir="rtl"] .czrSelect2-selection--single .czrSelect2-selection__rendered {
|
24 |
+
padding-right: 8px;
|
25 |
+
padding-left: 20px; }
|
26 |
+
.czrSelect2-container .czrSelect2-selection--multiple {
|
27 |
+
box-sizing: border-box;
|
28 |
+
cursor: pointer;
|
29 |
+
display: block;
|
30 |
+
min-height: 32px;
|
31 |
+
user-select: none;
|
32 |
+
-webkit-user-select: none; }
|
33 |
+
.czrSelect2-container .czrSelect2-selection--multiple .czrSelect2-selection__rendered {
|
34 |
+
display: inline-block;
|
35 |
+
overflow: hidden;
|
36 |
+
padding-left: 8px;
|
37 |
+
text-overflow: ellipsis;
|
38 |
+
white-space: nowrap; }
|
39 |
+
.czrSelect2-container .czrSelect2-search--inline {
|
40 |
+
float: left; }
|
41 |
+
.czrSelect2-container .czrSelect2-search--inline .czrSelect2-search__field {
|
42 |
+
box-sizing: border-box;
|
43 |
+
border: none;
|
44 |
+
font-size: 100%;
|
45 |
+
margin-top: 5px;
|
46 |
+
padding: 0; }
|
47 |
+
.czrSelect2-container .czrSelect2-search--inline .czrSelect2-search__field::-webkit-search-cancel-button {
|
48 |
+
-webkit-appearance: none; }
|
49 |
+
|
50 |
+
.czrSelect2-dropdown {
|
51 |
+
background-color: white;
|
52 |
+
border: 1px solid #aaa;
|
53 |
+
border-radius: 4px;
|
54 |
+
box-sizing: border-box;
|
55 |
+
display: block;
|
56 |
+
position: absolute;
|
57 |
+
left: -100000px;
|
58 |
+
width: 100%;
|
59 |
+
z-index: 1051; }
|
60 |
+
|
61 |
+
.czrSelect2-results {
|
62 |
+
display: block; }
|
63 |
+
|
64 |
+
.czrSelect2-results__options {
|
65 |
+
list-style: none;
|
66 |
+
margin: 0;
|
67 |
+
padding: 0; }
|
68 |
+
|
69 |
+
.czrSelect2-results__option {
|
70 |
+
padding: 6px;
|
71 |
+
user-select: none;
|
72 |
+
-webkit-user-select: none; }
|
73 |
+
.czrSelect2-results__option[aria-selected] {
|
74 |
+
cursor: pointer; }
|
75 |
+
|
76 |
+
.czrSelect2-container--open .czrSelect2-dropdown {
|
77 |
+
left: 0; }
|
78 |
+
|
79 |
+
.czrSelect2-container--open .czrSelect2-dropdown--above {
|
80 |
+
border-bottom: none;
|
81 |
+
border-bottom-left-radius: 0;
|
82 |
+
border-bottom-right-radius: 0; }
|
83 |
+
|
84 |
+
.czrSelect2-container--open .czrSelect2-dropdown--below {
|
85 |
+
border-top: none;
|
86 |
+
border-top-left-radius: 0;
|
87 |
+
border-top-right-radius: 0; }
|
88 |
+
|
89 |
+
.czrSelect2-search--dropdown {
|
90 |
+
display: block;
|
91 |
+
padding: 4px; }
|
92 |
+
.czrSelect2-search--dropdown .czrSelect2-search__field {
|
93 |
+
padding: 4px;
|
94 |
+
width: 100%;
|
95 |
+
box-sizing: border-box; }
|
96 |
+
.czrSelect2-search--dropdown .czrSelect2-search__field::-webkit-search-cancel-button {
|
97 |
+
-webkit-appearance: none; }
|
98 |
+
.czrSelect2-search--dropdown.czrSelect2-search--hide {
|
99 |
+
display: none; }
|
100 |
+
|
101 |
+
.czrSelect2-close-mask {
|
102 |
+
border: 0;
|
103 |
+
margin: 0;
|
104 |
+
padding: 0;
|
105 |
+
display: block;
|
106 |
+
position: fixed;
|
107 |
+
left: 0;
|
108 |
+
top: 0;
|
109 |
+
min-height: 100%;
|
110 |
+
min-width: 100%;
|
111 |
+
height: auto;
|
112 |
+
width: auto;
|
113 |
+
opacity: 0;
|
114 |
+
z-index: 99;
|
115 |
+
background-color: #fff;
|
116 |
+
filter: alpha(opacity=0); }
|
117 |
+
|
118 |
+
.czrSelect2-hidden-accessible {
|
119 |
+
border: 0 !important;
|
120 |
+
clip: rect(0 0 0 0) !important;
|
121 |
+
height: 1px !important;
|
122 |
+
margin: -1px !important;
|
123 |
+
overflow: hidden !important;
|
124 |
+
padding: 0 !important;
|
125 |
+
position: absolute !important;
|
126 |
+
width: 1px !important; }
|
127 |
+
|
128 |
+
.czrSelect2-container--default .czrSelect2-selection--single {
|
129 |
+
background-color: #fff;
|
130 |
+
border: 1px solid #aaa;
|
131 |
+
border-radius: 4px; }
|
132 |
+
.czrSelect2-container--default .czrSelect2-selection--single .czrSelect2-selection__rendered {
|
133 |
+
color: #444;
|
134 |
+
line-height: 28px; }
|
135 |
+
.czrSelect2-container--default .czrSelect2-selection--single .czrSelect2-selection__clear {
|
136 |
+
cursor: pointer;
|
137 |
+
float: right;
|
138 |
+
font-weight: bold; }
|
139 |
+
.czrSelect2-container--default .czrSelect2-selection--single .czrSelect2-selection__placeholder {
|
140 |
+
color: #999; }
|
141 |
+
.czrSelect2-container--default .czrSelect2-selection--single .czrSelect2-selection__arrow {
|
142 |
+
height: 26px;
|
143 |
+
position: absolute;
|
144 |
+
top: 1px;
|
145 |
+
right: 1px;
|
146 |
+
width: 20px; }
|
147 |
+
.czrSelect2-container--default .czrSelect2-selection--single .czrSelect2-selection__arrow b {
|
148 |
+
border-color: #888 transparent transparent transparent;
|
149 |
+
border-style: solid;
|
150 |
+
border-width: 5px 4px 0 4px;
|
151 |
+
height: 0;
|
152 |
+
left: 50%;
|
153 |
+
margin-left: -4px;
|
154 |
+
margin-top: -2px;
|
155 |
+
position: absolute;
|
156 |
+
top: 50%;
|
157 |
+
width: 0; }
|
158 |
+
|
159 |
+
.czrSelect2-container--default[dir="rtl"] .czrSelect2-selection--single .czrSelect2-selection__clear {
|
160 |
+
float: left; }
|
161 |
+
|
162 |
+
.czrSelect2-container--default[dir="rtl"] .czrSelect2-selection--single .czrSelect2-selection__arrow {
|
163 |
+
left: 1px;
|
164 |
+
right: auto; }
|
165 |
+
|
166 |
+
.czrSelect2-container--default.czrSelect2-container--disabled .czrSelect2-selection--single {
|
167 |
+
background-color: #eee;
|
168 |
+
cursor: default; }
|
169 |
+
.czrSelect2-container--default.czrSelect2-container--disabled .czrSelect2-selection--single .czrSelect2-selection__clear {
|
170 |
+
display: none; }
|
171 |
+
|
172 |
+
.czrSelect2-container--default.czrSelect2-container--open .czrSelect2-selection--single .czrSelect2-selection__arrow b {
|
173 |
+
border-color: transparent transparent #888 transparent;
|
174 |
+
border-width: 0 4px 5px 4px; }
|
175 |
+
|
176 |
+
.czrSelect2-container--default .czrSelect2-selection--multiple {
|
177 |
+
background-color: white;
|
178 |
+
border: 1px solid #aaa;
|
179 |
+
border-radius: 4px;
|
180 |
+
cursor: text; }
|
181 |
+
.czrSelect2-container--default .czrSelect2-selection--multiple .czrSelect2-selection__rendered {
|
182 |
+
box-sizing: border-box;
|
183 |
+
list-style: none;
|
184 |
+
margin: 0;
|
185 |
+
padding: 0 5px;
|
186 |
+
width: 100%; }
|
187 |
+
.czrSelect2-container--default .czrSelect2-selection--multiple .czrSelect2-selection__placeholder {
|
188 |
+
color: #999;
|
189 |
+
margin-top: 5px;
|
190 |
+
float: left; }
|
191 |
+
.czrSelect2-container--default .czrSelect2-selection--multiple .czrSelect2-selection__clear {
|
192 |
+
cursor: pointer;
|
193 |
+
float: right;
|
194 |
+
font-weight: bold;
|
195 |
+
margin-top: 5px;
|
196 |
+
margin-right: 10px; }
|
197 |
+
.czrSelect2-container--default .czrSelect2-selection--multiple .czrSelect2-selection__choice {
|
198 |
+
background-color: #e4e4e4;
|
199 |
+
border: 1px solid #aaa;
|
200 |
+
border-radius: 4px;
|
201 |
+
cursor: default;
|
202 |
+
float: left;
|
203 |
+
margin-right: 5px;
|
204 |
+
margin-top: 5px;
|
205 |
+
padding: 0 5px; }
|
206 |
+
.czrSelect2-container--default .czrSelect2-selection--multiple .czrSelect2-selection__choice__remove {
|
207 |
+
color: #999;
|
208 |
+
cursor: pointer;
|
209 |
+
display: inline-block;
|
210 |
+
font-weight: bold;
|
211 |
+
margin-right: 2px; }
|
212 |
+
.czrSelect2-container--default .czrSelect2-selection--multiple .czrSelect2-selection__choice__remove:hover {
|
213 |
+
color: #333; }
|
214 |
+
|
215 |
+
.czrSelect2-container--default[dir="rtl"] .czrSelect2-selection--multiple .czrSelect2-selection__choice, .czrSelect2-container--default[dir="rtl"] .czrSelect2-selection--multiple .czrSelect2-selection__placeholder, .czrSelect2-container--default[dir="rtl"] .czrSelect2-selection--multiple .czrSelect2-search--inline {
|
216 |
+
float: right; }
|
217 |
+
|
218 |
+
.czrSelect2-container--default[dir="rtl"] .czrSelect2-selection--multiple .czrSelect2-selection__choice {
|
219 |
+
margin-left: 5px;
|
220 |
+
margin-right: auto; }
|
221 |
+
|
222 |
+
.czrSelect2-container--default[dir="rtl"] .czrSelect2-selection--multiple .czrSelect2-selection__choice__remove {
|
223 |
+
margin-left: 2px;
|
224 |
+
margin-right: auto; }
|
225 |
+
|
226 |
+
.czrSelect2-container--default.czrSelect2-container--focus .czrSelect2-selection--multiple {
|
227 |
+
border: solid black 1px;
|
228 |
+
outline: 0; }
|
229 |
+
|
230 |
+
.czrSelect2-container--default.czrSelect2-container--disabled .czrSelect2-selection--multiple {
|
231 |
+
background-color: #eee;
|
232 |
+
cursor: default; }
|
233 |
+
|
234 |
+
.czrSelect2-container--default.czrSelect2-container--disabled .czrSelect2-selection__choice__remove {
|
235 |
+
display: none; }
|
236 |
+
|
237 |
+
.czrSelect2-container--default.czrSelect2-container--open.czrSelect2-container--above .czrSelect2-selection--single, .czrSelect2-container--default.czrSelect2-container--open.czrSelect2-container--above .czrSelect2-selection--multiple {
|
238 |
+
border-top-left-radius: 0;
|
239 |
+
border-top-right-radius: 0; }
|
240 |
+
|
241 |
+
.czrSelect2-container--default.czrSelect2-container--open.czrSelect2-container--below .czrSelect2-selection--single, .czrSelect2-container--default.czrSelect2-container--open.czrSelect2-container--below .czrSelect2-selection--multiple {
|
242 |
+
border-bottom-left-radius: 0;
|
243 |
+
border-bottom-right-radius: 0; }
|
244 |
+
|
245 |
+
.czrSelect2-container--default .czrSelect2-search--dropdown .czrSelect2-search__field {
|
246 |
+
border: 1px solid #aaa; }
|
247 |
+
|
248 |
+
.czrSelect2-container--default .czrSelect2-search--inline .czrSelect2-search__field {
|
249 |
+
background: transparent;
|
250 |
+
border: none;
|
251 |
+
outline: 0;
|
252 |
+
box-shadow: none;
|
253 |
+
-webkit-appearance: textfield; }
|
254 |
+
|
255 |
+
.czrSelect2-container--default .czrSelect2-results > .czrSelect2-results__options {
|
256 |
+
max-height: 200px;
|
257 |
+
overflow-y: auto; }
|
258 |
+
|
259 |
+
.czrSelect2-container--default .czrSelect2-results__option[role=group] {
|
260 |
+
padding: 0; }
|
261 |
+
|
262 |
+
.czrSelect2-container--default .czrSelect2-results__option[aria-disabled=true] {
|
263 |
+
color: #999; }
|
264 |
+
|
265 |
+
.czrSelect2-container--default .czrSelect2-results__option[aria-selected=true] {
|
266 |
+
background-color: #ddd; }
|
267 |
+
|
268 |
+
.czrSelect2-container--default .czrSelect2-results__option .czrSelect2-results__option {
|
269 |
+
padding-left: 1em; }
|
270 |
+
.czrSelect2-container--default .czrSelect2-results__option .czrSelect2-results__option .czrSelect2-results__group {
|
271 |
+
padding-left: 0; }
|
272 |
+
.czrSelect2-container--default .czrSelect2-results__option .czrSelect2-results__option .czrSelect2-results__option {
|
273 |
+
margin-left: -1em;
|
274 |
+
padding-left: 2em; }
|
275 |
+
.czrSelect2-container--default .czrSelect2-results__option .czrSelect2-results__option .czrSelect2-results__option .czrSelect2-results__option {
|
276 |
+
margin-left: -2em;
|
277 |
+
padding-left: 3em; }
|
278 |
+
.czrSelect2-container--default .czrSelect2-results__option .czrSelect2-results__option .czrSelect2-results__option .czrSelect2-results__option .czrSelect2-results__option {
|
279 |
+
margin-left: -3em;
|
280 |
+
padding-left: 4em; }
|
281 |
+
.czrSelect2-container--default .czrSelect2-results__option .czrSelect2-results__option .czrSelect2-results__option .czrSelect2-results__option .czrSelect2-results__option .czrSelect2-results__option {
|
282 |
+
margin-left: -4em;
|
283 |
+
padding-left: 5em; }
|
284 |
+
.czrSelect2-container--default .czrSelect2-results__option .czrSelect2-results__option .czrSelect2-results__option .czrSelect2-results__option .czrSelect2-results__option .czrSelect2-results__option .czrSelect2-results__option {
|
285 |
+
margin-left: -5em;
|
286 |
+
padding-left: 6em; }
|
287 |
+
|
288 |
+
.czrSelect2-container--default .czrSelect2-results__option--highlighted[aria-selected] {
|
289 |
+
background-color: #5897fb;
|
290 |
+
color: white; }
|
291 |
+
|
292 |
+
.czrSelect2-container--default .czrSelect2-results__group {
|
293 |
+
cursor: default;
|
294 |
+
display: block;
|
295 |
+
padding: 6px; }
|
296 |
+
|
297 |
+
.czrSelect2-container--classic .czrSelect2-selection--single {
|
298 |
+
background-color: #f7f7f7;
|
299 |
+
border: 1px solid #aaa;
|
300 |
+
border-radius: 4px;
|
301 |
+
outline: 0;
|
302 |
+
background-image: -webkit-linear-gradient(top, white 50%, #eeeeee 100%);
|
303 |
+
background-image: -o-linear-gradient(top, white 50%, #eeeeee 100%);
|
304 |
+
background-image: linear-gradient(to bottom, white 50%, #eeeeee 100%);
|
305 |
+
background-repeat: repeat-x;
|
306 |
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0); }
|
307 |
+
.czrSelect2-container--classic .czrSelect2-selection--single:focus {
|
308 |
+
border: 1px solid #5897fb; }
|
309 |
+
.czrSelect2-container--classic .czrSelect2-selection--single .czrSelect2-selection__rendered {
|
310 |
+
color: #444;
|
311 |
+
line-height: 28px; }
|
312 |
+
.czrSelect2-container--classic .czrSelect2-selection--single .czrSelect2-selection__clear {
|
313 |
+
cursor: pointer;
|
314 |
+
float: right;
|
315 |
+
font-weight: bold;
|
316 |
+
margin-right: 10px; }
|
317 |
+
.czrSelect2-container--classic .czrSelect2-selection--single .czrSelect2-selection__placeholder {
|
318 |
+
color: #999; }
|
319 |
+
.czrSelect2-container--classic .czrSelect2-selection--single .czrSelect2-selection__arrow {
|
320 |
+
background-color: #ddd;
|
321 |
+
border: none;
|
322 |
+
border-left: 1px solid #aaa;
|
323 |
+
border-top-right-radius: 4px;
|
324 |
+
border-bottom-right-radius: 4px;
|
325 |
+
height: 26px;
|
326 |
+
position: absolute;
|
327 |
+
top: 1px;
|
328 |
+
right: 1px;
|
329 |
+
width: 20px;
|
330 |
+
background-image: -webkit-linear-gradient(top, #eeeeee 50%, #cccccc 100%);
|
331 |
+
background-image: -o-linear-gradient(top, #eeeeee 50%, #cccccc 100%);
|
332 |
+
background-image: linear-gradient(to bottom, #eeeeee 50%, #cccccc 100%);
|
333 |
+
background-repeat: repeat-x;
|
334 |
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0); }
|
335 |
+
.czrSelect2-container--classic .czrSelect2-selection--single .czrSelect2-selection__arrow b {
|
336 |
+
border-color: #888 transparent transparent transparent;
|
337 |
+
border-style: solid;
|
338 |
+
border-width: 5px 4px 0 4px;
|
339 |
+
height: 0;
|
340 |
+
left: 50%;
|
341 |
+
margin-left: -4px;
|
342 |
+
margin-top: -2px;
|
343 |
+
position: absolute;
|
344 |
+
top: 50%;
|
345 |
+
width: 0; }
|
346 |
+
|
347 |
+
.czrSelect2-container--classic[dir="rtl"] .czrSelect2-selection--single .czrSelect2-selection__clear {
|
348 |
+
float: left; }
|
349 |
+
|
350 |
+
.czrSelect2-container--classic[dir="rtl"] .czrSelect2-selection--single .czrSelect2-selection__arrow {
|
351 |
+
border: none;
|
352 |
+
border-right: 1px solid #aaa;
|
353 |
+
border-radius: 0;
|
354 |
+
border-top-left-radius: 4px;
|
355 |
+
border-bottom-left-radius: 4px;
|
356 |
+
left: 1px;
|
357 |
+
right: auto; }
|
358 |
+
|
359 |
+
.czrSelect2-container--classic.czrSelect2-container--open .czrSelect2-selection--single {
|
360 |
+
border: 1px solid #5897fb; }
|
361 |
+
.czrSelect2-container--classic.czrSelect2-container--open .czrSelect2-selection--single .czrSelect2-selection__arrow {
|
362 |
+
background: transparent;
|
363 |
+
border: none; }
|
364 |
+
.czrSelect2-container--classic.czrSelect2-container--open .czrSelect2-selection--single .czrSelect2-selection__arrow b {
|
365 |
+
border-color: transparent transparent #888 transparent;
|
366 |
+
border-width: 0 4px 5px 4px; }
|
367 |
+
|
368 |
+
.czrSelect2-container--classic.czrSelect2-container--open.czrSelect2-container--above .czrSelect2-selection--single {
|
369 |
+
border-top: none;
|
370 |
+
border-top-left-radius: 0;
|
371 |
+
border-top-right-radius: 0;
|
372 |
+
background-image: -webkit-linear-gradient(top, white 0%, #eeeeee 50%);
|
373 |
+
background-image: -o-linear-gradient(top, white 0%, #eeeeee 50%);
|
374 |
+
background-image: linear-gradient(to bottom, white 0%, #eeeeee 50%);
|
375 |
+
background-repeat: repeat-x;
|
376 |
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0); }
|
377 |
+
|
378 |
+
.czrSelect2-container--classic.czrSelect2-container--open.czrSelect2-container--below .czrSelect2-selection--single {
|
379 |
+
border-bottom: none;
|
380 |
+
border-bottom-left-radius: 0;
|
381 |
+
border-bottom-right-radius: 0;
|
382 |
+
background-image: -webkit-linear-gradient(top, #eeeeee 50%, white 100%);
|
383 |
+
background-image: -o-linear-gradient(top, #eeeeee 50%, white 100%);
|
384 |
+
background-image: linear-gradient(to bottom, #eeeeee 50%, white 100%);
|
385 |
+
background-repeat: repeat-x;
|
386 |
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0); }
|
387 |
+
|
388 |
+
.czrSelect2-container--classic .czrSelect2-selection--multiple {
|
389 |
+
background-color: white;
|
390 |
+
border: 1px solid #aaa;
|
391 |
+
border-radius: 4px;
|
392 |
+
cursor: text;
|
393 |
+
outline: 0; }
|
394 |
+
.czrSelect2-container--classic .czrSelect2-selection--multiple:focus {
|
395 |
+
border: 1px solid #5897fb; }
|
396 |
+
.czrSelect2-container--classic .czrSelect2-selection--multiple .czrSelect2-selection__rendered {
|
397 |
+
list-style: none;
|
398 |
+
margin: 0;
|
399 |
+
padding: 0 5px; }
|
400 |
+
.czrSelect2-container--classic .czrSelect2-selection--multiple .czrSelect2-selection__clear {
|
401 |
+
display: none; }
|
402 |
+
.czrSelect2-container--classic .czrSelect2-selection--multiple .czrSelect2-selection__choice {
|
403 |
+
background-color: #e4e4e4;
|
404 |
+
border: 1px solid #aaa;
|
405 |
+
border-radius: 4px;
|
406 |
+
cursor: default;
|
407 |
+
float: left;
|
408 |
+
margin-right: 5px;
|
409 |
+
margin-top: 5px;
|
410 |
+
padding: 0 5px; }
|
411 |
+
.czrSelect2-container--classic .czrSelect2-selection--multiple .czrSelect2-selection__choice__remove {
|
412 |
+
color: #888;
|
413 |
+
cursor: pointer;
|
414 |
+
display: inline-block;
|
415 |
+
font-weight: bold;
|
416 |
+
margin-right: 2px; }
|
417 |
+
.czrSelect2-container--classic .czrSelect2-selection--multiple .czrSelect2-selection__choice__remove:hover {
|
418 |
+
color: #555; }
|
419 |
+
|
420 |
+
.czrSelect2-container--classic[dir="rtl"] .czrSelect2-selection--multiple .czrSelect2-selection__choice {
|
421 |
+
float: right; }
|
422 |
+
|
423 |
+
.czrSelect2-container--classic[dir="rtl"] .czrSelect2-selection--multiple .czrSelect2-selection__choice {
|
424 |
+
margin-left: 5px;
|
425 |
+
margin-right: auto; }
|
426 |
+
|
427 |
+
.czrSelect2-container--classic[dir="rtl"] .czrSelect2-selection--multiple .czrSelect2-selection__choice__remove {
|
428 |
+
margin-left: 2px;
|
429 |
+
margin-right: auto; }
|
430 |
+
|
431 |
+
.czrSelect2-container--classic.czrSelect2-container--open .czrSelect2-selection--multiple {
|
432 |
+
border: 1px solid #5897fb; }
|
433 |
+
|
434 |
+
.czrSelect2-container--classic.czrSelect2-container--open.czrSelect2-container--above .czrSelect2-selection--multiple {
|
435 |
+
border-top: none;
|
436 |
+
border-top-left-radius: 0;
|
437 |
+
border-top-right-radius: 0; }
|
438 |
+
|
439 |
+
.czrSelect2-container--classic.czrSelect2-container--open.czrSelect2-container--below .czrSelect2-selection--multiple {
|
440 |
+
border-bottom: none;
|
441 |
+
border-bottom-left-radius: 0;
|
442 |
+
border-bottom-right-radius: 0; }
|
443 |
+
|
444 |
+
.czrSelect2-container--classic .czrSelect2-search--dropdown .czrSelect2-search__field {
|
445 |
+
border: 1px solid #aaa;
|
446 |
+
outline: 0; }
|
447 |
+
|
448 |
+
.czrSelect2-container--classic .czrSelect2-search--inline .czrSelect2-search__field {
|
449 |
+
outline: 0;
|
450 |
+
box-shadow: none; }
|
451 |
+
|
452 |
+
.czrSelect2-container--classic .czrSelect2-dropdown {
|
453 |
+
background-color: white;
|
454 |
+
border: 1px solid transparent; }
|
455 |
+
|
456 |
+
.czrSelect2-container--classic .czrSelect2-dropdown--above {
|
457 |
+
border-bottom: none; }
|
458 |
+
|
459 |
+
.czrSelect2-container--classic .czrSelect2-dropdown--below {
|
460 |
+
border-top: none; }
|
461 |
+
|
462 |
+
.czrSelect2-container--classic .czrSelect2-results > .czrSelect2-results__options {
|
463 |
+
max-height: 200px;
|
464 |
+
overflow-y: auto; }
|
465 |
+
|
466 |
+
.czrSelect2-container--classic .czrSelect2-results__option[role=group] {
|
467 |
+
padding: 0; }
|
468 |
+
|
469 |
+
.czrSelect2-container--classic .czrSelect2-results__option[aria-disabled=true] {
|
470 |
+
color: grey; }
|
471 |
+
|
472 |
+
.czrSelect2-container--classic .czrSelect2-results__option--highlighted[aria-selected] {
|
473 |
+
background-color: #3875d7;
|
474 |
+
color: white; }
|
475 |
+
|
476 |
+
.czrSelect2-container--classic .czrSelect2-results__group {
|
477 |
+
cursor: default;
|
478 |
+
display: block;
|
479 |
+
padding: 6px; }
|
480 |
+
|
481 |
+
.czrSelect2-container--classic.czrSelect2-container--open .czrSelect2-dropdown {
|
482 |
+
border-color: #5897fb; }
|
assets/czr/fmk/css/lib/czrSelect2.min.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.czrSelect2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}.czrSelect2-container .czrSelect2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none}.czrSelect2-container .czrSelect2-selection--single .czrSelect2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.czrSelect2-container .czrSelect2-selection--single .czrSelect2-selection__clear{position:relative}.czrSelect2-container[dir="rtl"] .czrSelect2-selection--single .czrSelect2-selection__rendered{padding-right:8px;padding-left:20px}.czrSelect2-container .czrSelect2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none}.czrSelect2-container .czrSelect2-selection--multiple .czrSelect2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}.czrSelect2-container .czrSelect2-search--inline{float:left}.czrSelect2-container .czrSelect2-search--inline .czrSelect2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.czrSelect2-container .czrSelect2-search--inline .czrSelect2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.czrSelect2-dropdown{background-color:white;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}.czrSelect2-results{display:block}.czrSelect2-results__options{list-style:none;margin:0;padding:0}.czrSelect2-results__option{padding:6px;user-select:none;-webkit-user-select:none}.czrSelect2-results__option[aria-selected]{cursor:pointer}.czrSelect2-container--open .czrSelect2-dropdown{left:0}.czrSelect2-container--open .czrSelect2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.czrSelect2-container--open .czrSelect2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.czrSelect2-search--dropdown{display:block;padding:4px}.czrSelect2-search--dropdown .czrSelect2-search__field{padding:4px;width:100%;box-sizing:border-box}.czrSelect2-search--dropdown .czrSelect2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.czrSelect2-search--dropdown.czrSelect2-search--hide{display:none}.czrSelect2-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)}.czrSelect2-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}.czrSelect2-container--default .czrSelect2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:4px}.czrSelect2-container--default .czrSelect2-selection--single .czrSelect2-selection__rendered{color:#444;line-height:28px}.czrSelect2-container--default .czrSelect2-selection--single .czrSelect2-selection__clear{cursor:pointer;float:right;font-weight:bold}.czrSelect2-container--default .czrSelect2-selection--single .czrSelect2-selection__placeholder{color:#999}.czrSelect2-container--default .czrSelect2-selection--single .czrSelect2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px}.czrSelect2-container--default .czrSelect2-selection--single .czrSelect2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.czrSelect2-container--default[dir="rtl"] .czrSelect2-selection--single .czrSelect2-selection__clear{float:left}.czrSelect2-container--default[dir="rtl"] .czrSelect2-selection--single .czrSelect2-selection__arrow{left:1px;right:auto}.czrSelect2-container--default.czrSelect2-container--disabled .czrSelect2-selection--single{background-color:#eee;cursor:default}.czrSelect2-container--default.czrSelect2-container--disabled .czrSelect2-selection--single .czrSelect2-selection__clear{display:none}.czrSelect2-container--default.czrSelect2-container--open .czrSelect2-selection--single .czrSelect2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.czrSelect2-container--default .czrSelect2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text}.czrSelect2-container--default .czrSelect2-selection--multiple .czrSelect2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.czrSelect2-container--default .czrSelect2-selection--multiple .czrSelect2-selection__placeholder{color:#999;margin-top:5px;float:left}.czrSelect2-container--default .czrSelect2-selection--multiple .czrSelect2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-top:5px;margin-right:10px}.czrSelect2-container--default .czrSelect2-selection--multiple .czrSelect2-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}.czrSelect2-container--default .czrSelect2-selection--multiple .czrSelect2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.czrSelect2-container--default .czrSelect2-selection--multiple .czrSelect2-selection__choice__remove:hover{color:#333}.czrSelect2-container--default[dir="rtl"] .czrSelect2-selection--multiple .czrSelect2-selection__choice,.czrSelect2-container--default[dir="rtl"] .czrSelect2-selection--multiple .czrSelect2-selection__placeholder,.czrSelect2-container--default[dir="rtl"] .czrSelect2-selection--multiple .czrSelect2-search--inline{float:right}.czrSelect2-container--default[dir="rtl"] .czrSelect2-selection--multiple .czrSelect2-selection__choice{margin-left:5px;margin-right:auto}.czrSelect2-container--default[dir="rtl"] .czrSelect2-selection--multiple .czrSelect2-selection__choice__remove{margin-left:2px;margin-right:auto}.czrSelect2-container--default.czrSelect2-container--focus .czrSelect2-selection--multiple{border:solid #000 1px;outline:0}.czrSelect2-container--default.czrSelect2-container--disabled .czrSelect2-selection--multiple{background-color:#eee;cursor:default}.czrSelect2-container--default.czrSelect2-container--disabled .czrSelect2-selection__choice__remove{display:none}.czrSelect2-container--default.czrSelect2-container--open.czrSelect2-container--above .czrSelect2-selection--single,.czrSelect2-container--default.czrSelect2-container--open.czrSelect2-container--above .czrSelect2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0}.czrSelect2-container--default.czrSelect2-container--open.czrSelect2-container--below .czrSelect2-selection--single,.czrSelect2-container--default.czrSelect2-container--open.czrSelect2-container--below .czrSelect2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0}.czrSelect2-container--default .czrSelect2-search--dropdown .czrSelect2-search__field{border:1px solid #aaa}.czrSelect2-container--default .czrSelect2-search--inline .czrSelect2-search__field{background:transparent;border:none;outline:0;box-shadow:none;-webkit-appearance:textfield}.czrSelect2-container--default .czrSelect2-results>.czrSelect2-results__options{max-height:200px;overflow-y:auto}.czrSelect2-container--default .czrSelect2-results__option[role=group]{padding:0}.czrSelect2-container--default .czrSelect2-results__option[aria-disabled=true]{color:#999}.czrSelect2-container--default .czrSelect2-results__option[aria-selected=true]{background-color:#ddd}.czrSelect2-container--default .czrSelect2-results__option .czrSelect2-results__option{padding-left:1em}.czrSelect2-container--default .czrSelect2-results__option .czrSelect2-results__option .czrSelect2-results__group{padding-left:0}.czrSelect2-container--default .czrSelect2-results__option .czrSelect2-results__option .czrSelect2-results__option{margin-left:-1em;padding-left:2em}.czrSelect2-container--default .czrSelect2-results__option .czrSelect2-results__option .czrSelect2-results__option .czrSelect2-results__option{margin-left:-2em;padding-left:3em}.czrSelect2-container--default .czrSelect2-results__option .czrSelect2-results__option .czrSelect2-results__option .czrSelect2-results__option .czrSelect2-results__option{margin-left:-3em;padding-left:4em}.czrSelect2-container--default .czrSelect2-results__option .czrSelect2-results__option .czrSelect2-results__option .czrSelect2-results__option .czrSelect2-results__option .czrSelect2-results__option{margin-left:-4em;padding-left:5em}.czrSelect2-container--default .czrSelect2-results__option .czrSelect2-results__option .czrSelect2-results__option .czrSelect2-results__option .czrSelect2-results__option .czrSelect2-results__option .czrSelect2-results__option{margin-left:-5em;padding-left:6em}.czrSelect2-container--default .czrSelect2-results__option--highlighted[aria-selected]{background-color:#5897fb;color:white}.czrSelect2-container--default .czrSelect2-results__group{cursor:default;display:block;padding:6px}.czrSelect2-container--classic .czrSelect2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top, #fff 50%, #eee 100%);background-image:-o-linear-gradient(top, #fff 50%, #eee 100%);background-image:linear-gradient(to bottom, #fff 50%, #eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.czrSelect2-container--classic .czrSelect2-selection--single:focus{border:1px solid #5897fb}.czrSelect2-container--classic .czrSelect2-selection--single .czrSelect2-selection__rendered{color:#444;line-height:28px}.czrSelect2-container--classic .czrSelect2-selection--single .czrSelect2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-right:10px}.czrSelect2-container--classic .czrSelect2-selection--single .czrSelect2-selection__placeholder{color:#999}.czrSelect2-container--classic .czrSelect2-selection--single .czrSelect2-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:-webkit-linear-gradient(top, #eee 50%, #ccc 100%);background-image:-o-linear-gradient(top, #eee 50%, #ccc 100%);background-image:linear-gradient(to bottom, #eee 50%, #ccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0)}.czrSelect2-container--classic .czrSelect2-selection--single .czrSelect2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.czrSelect2-container--classic[dir="rtl"] .czrSelect2-selection--single .czrSelect2-selection__clear{float:left}.czrSelect2-container--classic[dir="rtl"] .czrSelect2-selection--single .czrSelect2-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}.czrSelect2-container--classic.czrSelect2-container--open .czrSelect2-selection--single{border:1px solid #5897fb}.czrSelect2-container--classic.czrSelect2-container--open .czrSelect2-selection--single .czrSelect2-selection__arrow{background:transparent;border:none}.czrSelect2-container--classic.czrSelect2-container--open .czrSelect2-selection--single .czrSelect2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.czrSelect2-container--classic.czrSelect2-container--open.czrSelect2-container--above .czrSelect2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top, #fff 0%, #eee 50%);background-image:-o-linear-gradient(top, #fff 0%, #eee 50%);background-image:linear-gradient(to bottom, #fff 0%, #eee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.czrSelect2-container--classic.czrSelect2-container--open.czrSelect2-container--below .czrSelect2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top, #eee 50%, #fff 100%);background-image:-o-linear-gradient(top, #eee 50%, #fff 100%);background-image:linear-gradient(to bottom, #eee 50%, #fff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0)}.czrSelect2-container--classic .czrSelect2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0}.czrSelect2-container--classic .czrSelect2-selection--multiple:focus{border:1px solid #5897fb}.czrSelect2-container--classic .czrSelect2-selection--multiple .czrSelect2-selection__rendered{list-style:none;margin:0;padding:0 5px}.czrSelect2-container--classic .czrSelect2-selection--multiple .czrSelect2-selection__clear{display:none}.czrSelect2-container--classic .czrSelect2-selection--multiple .czrSelect2-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}.czrSelect2-container--classic .czrSelect2-selection--multiple .czrSelect2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.czrSelect2-container--classic .czrSelect2-selection--multiple .czrSelect2-selection__choice__remove:hover{color:#555}.czrSelect2-container--classic[dir="rtl"] .czrSelect2-selection--multiple .czrSelect2-selection__choice{float:right}.czrSelect2-container--classic[dir="rtl"] .czrSelect2-selection--multiple .czrSelect2-selection__choice{margin-left:5px;margin-right:auto}.czrSelect2-container--classic[dir="rtl"] .czrSelect2-selection--multiple .czrSelect2-selection__choice__remove{margin-left:2px;margin-right:auto}.czrSelect2-container--classic.czrSelect2-container--open .czrSelect2-selection--multiple{border:1px solid #5897fb}.czrSelect2-container--classic.czrSelect2-container--open.czrSelect2-container--above .czrSelect2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.czrSelect2-container--classic.czrSelect2-container--open.czrSelect2-container--below .czrSelect2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.czrSelect2-container--classic .czrSelect2-search--dropdown .czrSelect2-search__field{border:1px solid #aaa;outline:0}.czrSelect2-container--classic .czrSelect2-search--inline .czrSelect2-search__field{outline:0;box-shadow:none}.czrSelect2-container--classic .czrSelect2-dropdown{background-color:#fff;border:1px solid transparent}.czrSelect2-container--classic .czrSelect2-dropdown--above{border-bottom:none}.czrSelect2-container--classic .czrSelect2-dropdown--below{border-top:none}.czrSelect2-container--classic .czrSelect2-results>.czrSelect2-results__options{max-height:200px;overflow-y:auto}.czrSelect2-container--classic .czrSelect2-results__option[role=group]{padding:0}.czrSelect2-container--classic .czrSelect2-results__option[aria-disabled=true]{color:grey}.czrSelect2-container--classic .czrSelect2-results__option--highlighted[aria-selected]{background-color:#3875d7;color:#fff}.czrSelect2-container--classic .czrSelect2-results__group{cursor:default;display:block;padding:6px}.czrSelect2-container--classic.czrSelect2-container--open .czrSelect2-dropdown{border-color:#5897fb}
|
assets/czr/fmk/css/parts/__DEPREC__czr-control-skope.css
ADDED
@@ -0,0 +1,696 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* WP SAVE BUTTON */
|
2 |
+
/*.czr-api-dirty input#save {
|
3 |
+
background-color: #FFBD2E;
|
4 |
+
border-color: #d99400;
|
5 |
+
color: black;
|
6 |
+
text-shadow: none;
|
7 |
+
-webkit-box-shadow: none;
|
8 |
+
box-shadow: none;
|
9 |
+
-webkit-transition: background-color .2s ease-in-out;
|
10 |
+
-moz-transition: background-color .2s ease-in-out;
|
11 |
+
-ms-transition: background-color .2s ease-in-out;
|
12 |
+
-o-transition: background-color .2s ease-in-out;
|
13 |
+
transition: background-color .2s ease-in-out;
|
14 |
+
}
|
15 |
+
.czr-api-dirty input#save:hover {
|
16 |
+
background-color: #fcad06;
|
17 |
+
}*/
|
18 |
+
|
19 |
+
/* FIX CUSTOMIZE INFO OVERLAPPING SKOPE SWITCHER */
|
20 |
+
.czr-skop-on #customize-controls .customize-info.is-in-view, #customize-controls .customize-section-title.is-in-view {
|
21 |
+
opacity: 0;
|
22 |
+
}
|
23 |
+
|
24 |
+
|
25 |
+
/* HEADER AND SCOPE SWITCHER */
|
26 |
+
.czr-skop-on .wp-full-overlay-sidebar .wp-full-overlay-header {
|
27 |
+
height: 185px;
|
28 |
+
}
|
29 |
+
.czr-skop-on .wp-full-overlay-sidebar .wp-full-overlay-sidebar-content {
|
30 |
+
top: 185px!important;
|
31 |
+
}
|
32 |
+
.wp-customizer .in-sub-panel .wp-full-overlay-sidebar .wp-full-overlay-header {
|
33 |
+
padding: 0 15px;
|
34 |
+
}
|
35 |
+
.customize-controls-close {
|
36 |
+
border-bottom: 1px solid #ddd;
|
37 |
+
}
|
38 |
+
/*
|
39 |
+
* when skope is on, the z-index of the #customize-notifications-area has to be increased
|
40 |
+
* this #customize-notifications-area block has been introduced in WP 4.9
|
41 |
+
*/
|
42 |
+
.czr-skop-on #customize-controls #customize-notifications-area {
|
43 |
+
z-index: 1000;
|
44 |
+
}
|
45 |
+
|
46 |
+
.wp-customizer #customize-header-actions {
|
47 |
+
border-bottom: 0px;
|
48 |
+
}
|
49 |
+
.czr-scope-switcher {
|
50 |
+
width: 100%;
|
51 |
+
float: right;
|
52 |
+
position: absolute;
|
53 |
+
left: 0;
|
54 |
+
bottom: 0;
|
55 |
+
overflow: hidden;
|
56 |
+
}
|
57 |
+
.czr-scope-switcher .czr-skp-permanent-title {
|
58 |
+
position: relative;
|
59 |
+
color: #5f5f5f;
|
60 |
+
}
|
61 |
+
#customize-header-actions .czr-scope-switcher .spinner {
|
62 |
+
float: none;
|
63 |
+
display: none;
|
64 |
+
margin: 0px;
|
65 |
+
left: -26px;
|
66 |
+
top: 0px;
|
67 |
+
position: absolute;
|
68 |
+
visibility: visible;
|
69 |
+
}
|
70 |
+
h2.czr-current-skope-title {
|
71 |
+
font-size: 13px;
|
72 |
+
line-height: 21px;
|
73 |
+
margin: 6px 0 4px;
|
74 |
+
text-align: center;
|
75 |
+
height: 63px;
|
76 |
+
font-weight:normal;
|
77 |
+
overflow: hidden;
|
78 |
+
}
|
79 |
+
.czr-main-title {
|
80 |
+
max-height: 24px;
|
81 |
+
overflow: hidden;
|
82 |
+
display: inline-block;
|
83 |
+
text-overflow: ellipsis;
|
84 |
+
white-space: nowrap;
|
85 |
+
width: 95%;
|
86 |
+
}
|
87 |
+
.czr-skope-title {
|
88 |
+
display: block;
|
89 |
+
font-size: 17px;
|
90 |
+
font-style: italic;
|
91 |
+
line-height: 25px;
|
92 |
+
}
|
93 |
+
.czr-toggle-title-notice {
|
94 |
+
cursor: pointer;
|
95 |
+
font-size: 14px;
|
96 |
+
color: #777;
|
97 |
+
}
|
98 |
+
.czr-skope-inherits-from {
|
99 |
+
display: inline-block;
|
100 |
+
opacity: 0;
|
101 |
+
width: 90%;
|
102 |
+
font-size: 12px;
|
103 |
+
line-height: 18px;
|
104 |
+
color: #0029ff;
|
105 |
+
top: -6px;
|
106 |
+
position: relative;
|
107 |
+
}
|
108 |
+
.notice-visible .czr-toggle-title-notice {
|
109 |
+
color: #0029ff;
|
110 |
+
}
|
111 |
+
.notice-visible .czr-skope-inherits-from {
|
112 |
+
opacity: 1;
|
113 |
+
-webkit-transition: opacity .3s ease-in-out;
|
114 |
+
-moz-transition: opacity .3s ease-in-out;
|
115 |
+
-ms-transition: opacity .3s ease-in-out;
|
116 |
+
-o-transition: opacity .3s ease-in-out;
|
117 |
+
transition: opacity .3s ease-in-out;
|
118 |
+
}
|
119 |
+
.czr-scope-switcher .button {
|
120 |
+
float: left;
|
121 |
+
width: 40%;
|
122 |
+
text-align: center;
|
123 |
+
margin: 0 2%;
|
124 |
+
opacity: 0.7;
|
125 |
+
-webkit-transition: opacity .3s ease-in-out;
|
126 |
+
-moz-transition: opacity .3s ease-in-out;
|
127 |
+
-ms-transition: opacity .3s ease-in-out;
|
128 |
+
-o-transition: opacity .3s ease-in-out;
|
129 |
+
transition: opacity .3s ease-in-out;
|
130 |
+
}
|
131 |
+
.czr-scope-switcher .button.active {
|
132 |
+
font-weight: bold;
|
133 |
+
opacity: 1;
|
134 |
+
}
|
135 |
+
.czr-scope-switcher .active, .czr-scope-switcher .czr-scope:hover {
|
136 |
+
opacity: 1;
|
137 |
+
/*border-bottom: 2px solid #59b15c;*/
|
138 |
+
}
|
139 |
+
.czr-skopes-wrapper {
|
140 |
+
overflow: hidden;
|
141 |
+
position: relative;
|
142 |
+
}
|
143 |
+
.czr-scope.active:before {
|
144 |
+
height: 101%;
|
145 |
+
float: left;
|
146 |
+
position: absolute;
|
147 |
+
z-index: 1;
|
148 |
+
content: '';
|
149 |
+
-webkit-box-shadow : -4px 0px 15px 0px rgba(119, 119, 119, 0.58);
|
150 |
+
box-shadow: -4px 0px 15px 0px rgba(119, 119, 119, 0.58);
|
151 |
+
top: 0;
|
152 |
+
}
|
153 |
+
.czr-scope-switcher .active:after {
|
154 |
+
content: '';
|
155 |
+
height: 100%;
|
156 |
+
position: absolute;
|
157 |
+
-webkit-box-shadow : 4px 0px 15px 0px rgba(119, 119, 119, 0.58);
|
158 |
+
box-shadow: 4px 0px 15px 0px rgba(119, 119, 119, 0.58);
|
159 |
+
top: 0;
|
160 |
+
z-index: 3;
|
161 |
+
}
|
162 |
+
|
163 |
+
.czr-skopes-wrapper .active-collection.local:after {
|
164 |
+
right:0;
|
165 |
+
}
|
166 |
+
.czr-scope-switcher .czr-scope:last-child:after {
|
167 |
+
-webkit-box-shadow :none;
|
168 |
+
box-shadow: none;
|
169 |
+
right: 0;
|
170 |
+
}
|
171 |
+
.czr-scope-switcher .czr-scope:first-child:after {
|
172 |
+
left: 0;
|
173 |
+
}
|
174 |
+
.czr-scope {
|
175 |
+
float: left;
|
176 |
+
width: 30.5%;
|
177 |
+
/*margin-left: 1.5%;*/
|
178 |
+
background: #fff;
|
179 |
+
/*border-bottom: 2px solid #cccccc;*/
|
180 |
+
border-top: 1px solid #cccccc;
|
181 |
+
/*-webkit-border-radius: 3px;
|
182 |
+
border-radius: 3px;*/
|
183 |
+
overflow: hidden;
|
184 |
+
opacity: 0.65;
|
185 |
+
-webkit-transition: opacity .3s ease-in-out;
|
186 |
+
-moz-transition: opacity .3s ease-in-out;
|
187 |
+
-ms-transition: opacity .3s ease-in-out;
|
188 |
+
-o-transition: opacity .3s ease-in-out;
|
189 |
+
transition: opacity .3s ease-in-out;
|
190 |
+
}
|
191 |
+
|
192 |
+
/* LAYOUTS */
|
193 |
+
.czr-scope-switcher .width-100, .czr-scope.width-100.active:before, .czr-scope.width-100.active:after { width: 100%; }
|
194 |
+
.czr-scope-switcher .width-50, .czr-scope.width-50.active:before, .czr-scope.width-50.active:after { width: 50%; }
|
195 |
+
.czr-scope-switcher .width-33, .czr-scope.width-33.active:before, .czr-scope.width-33.active:after { width: 33.33%; }
|
196 |
+
.czr-scope-switcher .width-25, .czr-scope.width-25.active:before, .czr-scope.width-25.active:after { width: 25%; }
|
197 |
+
|
198 |
+
.czr-scope-header, .czr-scope-footer {
|
199 |
+
width: 100%;
|
200 |
+
min-height: 16px;
|
201 |
+
position: relative;
|
202 |
+
z-index: 5;
|
203 |
+
}
|
204 |
+
.inactive .czr-scope-footer:after {
|
205 |
+
content: '';
|
206 |
+
width: 100%;
|
207 |
+
position: absolute;
|
208 |
+
height: 5px;
|
209 |
+
bottom: -7px;
|
210 |
+
left: 0;
|
211 |
+
-webkit-box-shadow : 0px 0px 13px 4px rgba(119, 119, 119, 0.85);
|
212 |
+
box-shadow: 0px 0px 13px 4px rgba(119, 119, 119, 0.85);
|
213 |
+
}
|
214 |
+
.czr-scope-content {
|
215 |
+
height: 35px;
|
216 |
+
padding: 0 3%;
|
217 |
+
width: 94%;
|
218 |
+
line-height: 35px;
|
219 |
+
text-align: center;
|
220 |
+
clear: both;
|
221 |
+
color: #000;
|
222 |
+
overflow: hidden;
|
223 |
+
}
|
224 |
+
.czr-scope-content h4 {
|
225 |
+
margin: 0;
|
226 |
+
display: inline-block;
|
227 |
+
text-align: center;
|
228 |
+
font-size: 14px;
|
229 |
+
line-height: 18px;
|
230 |
+
font-weight: normal;
|
231 |
+
text-shadow: 1px 1px 0px #dedede;
|
232 |
+
}
|
233 |
+
.czr-scope .fab,
|
234 |
+
.czr-scope .far,
|
235 |
+
.czr-scope .fas {
|
236 |
+
font-size: 10px;
|
237 |
+
padding: 2%;
|
238 |
+
color: #585858;
|
239 |
+
cursor: pointer;
|
240 |
+
-webkit-transition: opacity .3s ease-in-out;
|
241 |
+
-moz-transition: opacity .3s ease-in-out;
|
242 |
+
-ms-transition: opacity .3s ease-in-out;
|
243 |
+
-o-transition: opacity .3s ease-in-out;
|
244 |
+
transition: opacity .3s ease-in-out;
|
245 |
+
}
|
246 |
+
.czr-scope .czr-scope-footer .info {
|
247 |
+
cursor: inherit;
|
248 |
+
}
|
249 |
+
.czr-scope-header .czr-scope-switch {
|
250 |
+
font-size: 22px;
|
251 |
+
padding: 0 2px 0 0;
|
252 |
+
text-shadow: 1px 1px 2px white;
|
253 |
+
}
|
254 |
+
.czr-skp-switch-link {
|
255 |
+
cursor: pointer;
|
256 |
+
}
|
257 |
+
.czr-skp-switch-link:hover {
|
258 |
+
text-decoration: underline;
|
259 |
+
}
|
260 |
+
.czr-pull-left {
|
261 |
+
float: left;
|
262 |
+
}
|
263 |
+
.czr-pull-right {
|
264 |
+
float: right;
|
265 |
+
}
|
266 |
+
|
267 |
+
|
268 |
+
/* DIALOG BOX REACTIONS */
|
269 |
+
.active .czr-scope-switch {
|
270 |
+
color: #59b15c;
|
271 |
+
cursor:inherit;
|
272 |
+
}
|
273 |
+
|
274 |
+
.czr-scope .czr-scope-reset {
|
275 |
+
/*opacity: 0;*/
|
276 |
+
display: none;
|
277 |
+
font-size: 13px;
|
278 |
+
text-shadow: 1px 1px 0px #dedede;
|
279 |
+
|
280 |
+
}
|
281 |
+
.has-db-val .czr-scope-reset {
|
282 |
+
color: #00a0d2;
|
283 |
+
}
|
284 |
+
.dirty .czr-scope-reset {
|
285 |
+
color: #FFBD2E!important;
|
286 |
+
}
|
287 |
+
|
288 |
+
.is_winner .czr-scope-winner {
|
289 |
+
color: #59b15c;
|
290 |
+
font-size: 14px;
|
291 |
+
position: absolute;
|
292 |
+
bottom: 2px;
|
293 |
+
left: 2px;
|
294 |
+
}
|
295 |
+
|
296 |
+
.czr-scope-force {
|
297 |
+
display: none;
|
298 |
+
}
|
299 |
+
|
300 |
+
/* Underline skope switch text in control notices and in the main skope switcher title */
|
301 |
+
.czr-skope-switch {
|
302 |
+
cursor: pointer;
|
303 |
+
text-decoration: underline;
|
304 |
+
}
|
305 |
+
|
306 |
+
/**************************************
|
307 |
+
******* RESET */
|
308 |
+
/* RESET COMMONS */
|
309 |
+
.czr-spinner-wrapper {
|
310 |
+
visibility: hidden;
|
311 |
+
}
|
312 |
+
.czr-reset-success, .czr-reset-fail {
|
313 |
+
display: none;
|
314 |
+
}
|
315 |
+
.czr-spinner {
|
316 |
+
background: url(img/czr-spinner.gif) no-repeat;
|
317 |
+
-webkit-background-size: 32px 32px;
|
318 |
+
background-size: 32px 32px;
|
319 |
+
display: inline-block;
|
320 |
+
float: right;
|
321 |
+
vertical-align: middle;
|
322 |
+
opacity: 0.7;
|
323 |
+
filter: alpha(opacity=70);
|
324 |
+
width: 32px;
|
325 |
+
height: 32px;
|
326 |
+
margin: 4px 10px 0;
|
327 |
+
}
|
328 |
+
|
329 |
+
|
330 |
+
/* SINGLE CONTROL RESET */
|
331 |
+
.customize-control span.customize-control-title:first-child {
|
332 |
+
padding-left: 16px;
|
333 |
+
-webkit-transition: left, right, 0.15s ease-in-out;
|
334 |
+
-moz-transition: left, right, 0.15s ease-in-out;
|
335 |
+
-ms-transition: left, right, 0.15s ease-in-out;
|
336 |
+
-o-transition: left, right, 0.15s ease-in-out;
|
337 |
+
transition: left, right, 0.15s ease-in-out;
|
338 |
+
position: relative;
|
339 |
+
}
|
340 |
+
|
341 |
+
.wp-customizer .customize-control.czr-not-skoped .customize-control-title {
|
342 |
+
padding-left: 0px;
|
343 |
+
}
|
344 |
+
.czr-setting-reset {
|
345 |
+
color: #eee;
|
346 |
+
-webkit-transition: color 0.4s;
|
347 |
+
transition: color 0.4s;
|
348 |
+
position: absolute;
|
349 |
+
left: 0px;
|
350 |
+
line-height: 21px;
|
351 |
+
display: none;
|
352 |
+
text-shadow: 1px 1px 0px #a0a0a0;
|
353 |
+
}
|
354 |
+
.czr-global-skope-level .is-wp-authorized-setting.has-db-val .czr-setting-reset {
|
355 |
+
color: #eee;
|
356 |
+
}
|
357 |
+
.has-db-val .czr-setting-reset {
|
358 |
+
color: #00a0d2;
|
359 |
+
}
|
360 |
+
.is-dirty .czr-setting-reset {
|
361 |
+
color: #FFBD2E!important;
|
362 |
+
}
|
363 |
+
.czr-ctrl-reset-warning .czr-spinner {
|
364 |
+
display: none;
|
365 |
+
}
|
366 |
+
.czr-resetting-control .czr-ctrl-reset-warning .czr-spinner {
|
367 |
+
display: block;
|
368 |
+
}
|
369 |
+
|
370 |
+
/* RESET ALERTS */
|
371 |
+
.is-dirty .czr-remove-alert-wrapper {
|
372 |
+
background-color: rgba(255, 189, 46, 0.54)!important;
|
373 |
+
border: 1px solid #FFBD2E!important;
|
374 |
+
text-shadow:none;
|
375 |
+
color: #000;
|
376 |
+
}
|
377 |
+
|
378 |
+
.has-db-val .czr-remove-alert-wrapper {
|
379 |
+
background-color: rgba(0, 160, 210, 0.45);
|
380 |
+
border: 1px solid #00a0d2;
|
381 |
+
text-shadow:none;
|
382 |
+
color: #000;
|
383 |
+
}
|
384 |
+
|
385 |
+
.czr-resetting-control .czr-remove-alert-wrapper {
|
386 |
+
-webkit-transition: all, 0.3s ease-in-out;
|
387 |
+
-moz-transition: all, 0.3s ease-in-out;
|
388 |
+
-ms-transition: all, 0.3s ease-in-out;
|
389 |
+
-o-transition: all, 0.3s ease-in-out;
|
390 |
+
transition: all, 0.3s ease-in-out;
|
391 |
+
}
|
392 |
+
|
393 |
+
/* SKOPE LOADING */
|
394 |
+
body.czr-skop-loading #czr-skope-pane {
|
395 |
+
top : 0;
|
396 |
+
}
|
397 |
+
body.czr-skop-loading #customize-preview {
|
398 |
+
/*opacity: 0!important;*/
|
399 |
+
filter: blur(3px);
|
400 |
+
-webkit-filter: blur(3px);
|
401 |
+
}
|
402 |
+
|
403 |
+
/* Pure CSS loader */
|
404 |
+
@-webkit-keyframes czr-mr-loader {
|
405 |
+
0% {
|
406 |
+
-webkit-transform: scale(0.1);
|
407 |
+
transform: scale(0.1);
|
408 |
+
opacity: 1; }
|
409 |
+
|
410 |
+
70% {
|
411 |
+
-webkit-transform: scale(1);
|
412 |
+
transform: scale(1);
|
413 |
+
opacity: 0.7; }
|
414 |
+
|
415 |
+
100% {
|
416 |
+
opacity: 0.0; }
|
417 |
+
}
|
418 |
+
|
419 |
+
@keyframes czr-mr-loader {
|
420 |
+
0% {
|
421 |
+
-webkit-transform: scale(0.1);
|
422 |
+
transform: scale(0.1);
|
423 |
+
opacity: 1; }
|
424 |
+
|
425 |
+
70% {
|
426 |
+
-webkit-transform: scale(1);
|
427 |
+
transform: scale(1);
|
428 |
+
opacity: 0.7; }
|
429 |
+
|
430 |
+
100% {
|
431 |
+
opacity: 0.0; }
|
432 |
+
}
|
433 |
+
/*.czr-css-loader {
|
434 |
+
display: none;
|
435 |
+
}*/
|
436 |
+
.czr-css-loader {
|
437 |
+
width: 50px;
|
438 |
+
height: 50px;
|
439 |
+
position: absolute;
|
440 |
+
-webkit-transform: translate3d(-50%, -50%, 0);
|
441 |
+
-ms-transform: translate3d(-50%, -50%, 0);
|
442 |
+
transform: translate3d(-50%, -50%, 0);
|
443 |
+
top: 50%;
|
444 |
+
left: 50%;
|
445 |
+
display: block;
|
446 |
+
}
|
447 |
+
.czr-mr-loader > div:nth-child(0) {
|
448 |
+
-webkit-animation-delay: -0.8s;
|
449 |
+
animation-delay: -0.8s;
|
450 |
+
}
|
451 |
+
.czr-mr-loader > div:nth-child(1) {
|
452 |
+
-webkit-animation-delay: -0.6s;
|
453 |
+
animation-delay: -0.6s;
|
454 |
+
}
|
455 |
+
.czr-mr-loader > div:nth-child(2) {
|
456 |
+
-webkit-animation-delay: -0.4s;
|
457 |
+
animation-delay: -0.4s;
|
458 |
+
}
|
459 |
+
.czr-mr-loader > div:nth-child(3) {
|
460 |
+
-webkit-animation-delay: -0.2s;
|
461 |
+
animation-delay: -0.2s;
|
462 |
+
}
|
463 |
+
.czr-mr-loader > div {
|
464 |
+
-webkit-animation-fill-mode: both;
|
465 |
+
animation-fill-mode: both;
|
466 |
+
position: absolute;
|
467 |
+
top: -4%;
|
468 |
+
left: -4%;
|
469 |
+
width: 100%;
|
470 |
+
height: 100%;
|
471 |
+
border-radius: 100%;
|
472 |
+
border: 2px solid #fff;
|
473 |
+
-webkit-animation: czr-mr-loader 1.25s 0s infinite cubic-bezier(.21, .53, .56, .8);
|
474 |
+
animation: czr-mr-loader 1.25s 0s infinite cubic-bezier(.21, .53, .56, .8);
|
475 |
+
}
|
476 |
+
|
477 |
+
|
478 |
+
|
479 |
+
/* PREVIEW NOTIFICATIONS BLOCKS ( for Welcome, etc ) */
|
480 |
+
/* COMMONS */
|
481 |
+
#czr-top-note, #czr-bottom-infos {
|
482 |
+
position: absolute;
|
483 |
+
text-align: center;
|
484 |
+
right: 0;
|
485 |
+
left: 0;
|
486 |
+
z-index: 20;
|
487 |
+
color: #fff;
|
488 |
+
display: block;
|
489 |
+
-webkit-transition: all 0.3s ease-in-out;
|
490 |
+
-moz-transition: all, 0.3s ease-in-out;
|
491 |
+
-ms-transition: all, 0.3s ease-in-out;
|
492 |
+
-o-transition: all, 0.3s ease-in-out;
|
493 |
+
transition: all 0.3s ease-in-out;
|
494 |
+
visibility: hidden;
|
495 |
+
}
|
496 |
+
.czr-preview-notification a, .czr-preview-notification h2 {color: #fff; margin: 1em 0;}
|
497 |
+
|
498 |
+
.czr-preview-notification .czr-preview-note-close {
|
499 |
+
position: absolute;
|
500 |
+
top: 10px;
|
501 |
+
right: 25px;
|
502 |
+
font-size: 31px;
|
503 |
+
cursor: pointer;
|
504 |
+
}
|
505 |
+
|
506 |
+
.czr-preview-notification .fa-arrow-left {
|
507 |
+
position: absolute;
|
508 |
+
bottom: 10px;
|
509 |
+
left: 25px;
|
510 |
+
font-size: 40px;
|
511 |
+
}
|
512 |
+
.czr-preview-notification .czr-note-content {
|
513 |
+
display: inline-block;
|
514 |
+
line-height: 20px;
|
515 |
+
width: 80%;
|
516 |
+
}
|
517 |
+
.czr-preview-notification .czr-note-message {
|
518 |
+
font-size: 16px;
|
519 |
+
line-height: 1.5em;
|
520 |
+
margin: 0.5em 0;
|
521 |
+
}
|
522 |
+
|
523 |
+
/* TOP NOTE */
|
524 |
+
#czr-top-note { top : -100%; background: rgba(0, 0, 0, 0.80); padding: 2%;}
|
525 |
+
#czr-top-note h2 {font-size: 25px; }
|
526 |
+
|
527 |
+
body.czr-top-note-open #czr-top-note {
|
528 |
+
top: 0;
|
529 |
+
visibility: inherit;
|
530 |
+
}
|
531 |
+
|
532 |
+
/* BOTTOM SKOPE INFOS */
|
533 |
+
#czr-bottom-infos { bottom : -100%; background-color: rgba(0, 0, 0, 0.85);padding: 1px;}
|
534 |
+
body.czr-bottom-infos-open #czr-bottom-infos {
|
535 |
+
bottom: 0;
|
536 |
+
visibility: inherit;
|
537 |
+
}
|
538 |
+
#czr-bottom-infos .czr-note-content .czr-note-message {
|
539 |
+
font-size: 13px;
|
540 |
+
}
|
541 |
+
#czr-bottom-infos .action-links-wrap {
|
542 |
+
width: 100%;
|
543 |
+
}
|
544 |
+
#czr-bottom-infos .action-link {
|
545 |
+
font-style: italic;
|
546 |
+
display: inline-block;
|
547 |
+
width: 40%;
|
548 |
+
}
|
549 |
+
#czr-bottom-infos .action-link a:hover {
|
550 |
+
color: #fff;
|
551 |
+
}
|
552 |
+
.czr-disable-bottom-infos {
|
553 |
+
text-decoration: underline;
|
554 |
+
cursor: pointer;
|
555 |
+
}
|
556 |
+
|
557 |
+
|
558 |
+
|
559 |
+
/* SKOPE PANE */
|
560 |
+
/* WP TEXT EDITOR */
|
561 |
+
#czr-skope-pane {
|
562 |
+
position: absolute;
|
563 |
+
min-height: 100%;
|
564 |
+
text-align: center;
|
565 |
+
padding: 2%;
|
566 |
+
top : -100%;
|
567 |
+
right: 0;
|
568 |
+
left: 0;
|
569 |
+
z-index: 20;
|
570 |
+
color: #fff;
|
571 |
+
display: block;
|
572 |
+
-webkit-transition: all 0.3s ease-in-out;
|
573 |
+
-moz-transition: all, 0.3s ease-in-out;
|
574 |
+
-ms-transition: all, 0.3s ease-in-out;
|
575 |
+
-o-transition: all, 0.3s ease-in-out;
|
576 |
+
transition: all 0.3s ease-in-out;
|
577 |
+
visibility: hidden;
|
578 |
+
}
|
579 |
+
|
580 |
+
/* RESET */
|
581 |
+
#czr-skope-pane.dirty-reset {
|
582 |
+
background: rgba(252, 173, 6, 0.23);
|
583 |
+
}
|
584 |
+
#czr-skope-pane.db-reset {
|
585 |
+
background: rgba(0, 160, 210, 0.3);
|
586 |
+
}
|
587 |
+
.czr-reset-content {
|
588 |
+
display: inline-block;
|
589 |
+
line-height: 20px;
|
590 |
+
width: 80%;
|
591 |
+
padding: 5%;
|
592 |
+
background: rgba(0, 0, 0, 0.63);
|
593 |
+
}
|
594 |
+
|
595 |
+
#czr-skope-pane h2 {
|
596 |
+
color: #fff;
|
597 |
+
line-height: 1.5em;
|
598 |
+
}
|
599 |
+
body.czr-skope-pane-open #czr-skope-pane {
|
600 |
+
top: 0;
|
601 |
+
visibility: inherit;
|
602 |
+
min-height: 100%;
|
603 |
+
}
|
604 |
+
|
605 |
+
body.czr-skope-pane-open #customize-preview, body.czr-skope-pane-open .wp-full-overlay-sidebar {
|
606 |
+
opacity: 0.5;
|
607 |
+
}
|
608 |
+
|
609 |
+
body.czr-resetting-skope #czr-skope-pane .czr-spinner-wrapper {
|
610 |
+
visibility: visible;
|
611 |
+
}
|
612 |
+
|
613 |
+
.czr-skope-pane-open .wp-full-overlay.collapsed .wp-full-overlay-sidebar {
|
614 |
+
z-index: 30;
|
615 |
+
}
|
616 |
+
.czr-skope-pane-open .wp-full-overlay.expanded .collapse-sidebar {
|
617 |
+
bottom: 0 !important;
|
618 |
+
}
|
619 |
+
|
620 |
+
|
621 |
+
/* CONTROL INFOS */
|
622 |
+
.customize-control .czr-skope-notice {
|
623 |
+
color: #3a3a3a;
|
624 |
+
font-family: Verdana, 'DejaVu Sans', 'Bitstream Vera Sans', 'Geneva', sans-serif;
|
625 |
+
font-size: 10px;
|
626 |
+
line-height: 1.5em;
|
627 |
+
font-style: normal;
|
628 |
+
border-left: 3px solid rgba(99, 99, 99, 0.36);
|
629 |
+
padding-left: 5px;
|
630 |
+
}
|
631 |
+
|
632 |
+
.czr-toggle-notice {
|
633 |
+
color: #95a5a6;
|
634 |
+
text-shadow: 1px 1px 0px white;
|
635 |
+
-webkit-transition: color 0.4s;
|
636 |
+
transition: color 0.4s;
|
637 |
+
position: absolute;
|
638 |
+
padding-left: 3px;
|
639 |
+
line-height: 21px;
|
640 |
+
display: none;
|
641 |
+
}
|
642 |
+
.czr-notice-visible .czr-toggle-notice, .czr-toggle-notice:hover {
|
643 |
+
color: rgba(0, 0, 0, 0.67);
|
644 |
+
}
|
645 |
+
|
646 |
+
|
647 |
+
|
648 |
+
/* Error Notification */
|
649 |
+
.wp-full-overlay-header, .wp-full-overlay-sidebar .wp-full-overlay-sidebar-content {
|
650 |
+
-webkit-transition: height, top, .4s ease-in-out;
|
651 |
+
-moz-transition: height, top, .4s ease-in-out;
|
652 |
+
-ms-transition: height, top, .4s ease-in-out;
|
653 |
+
-o-transition: height, top, .4s ease-in-out;
|
654 |
+
transition: height, top, .4s ease-in-out;
|
655 |
+
}
|
656 |
+
.czr-server-notice {
|
657 |
+
width: calc(96% - 2px);
|
658 |
+
bottom: 75px;
|
659 |
+
text-align: center;
|
660 |
+
background: rgba(0, 156, 0, 0.18);
|
661 |
+
color: #000;
|
662 |
+
display: none;
|
663 |
+
position: absolute;
|
664 |
+
font-size: 12px;
|
665 |
+
line-height: 13px;
|
666 |
+
padding: 2%;
|
667 |
+
overflow: hidden;
|
668 |
+
}
|
669 |
+
.czr-server-notice.czr-server-error {
|
670 |
+
color: #000;
|
671 |
+
background: rgba(255, 0, 0, 0.24);
|
672 |
+
}
|
673 |
+
|
674 |
+
.czr-dismiss-notification {
|
675 |
+
position: absolute;
|
676 |
+
right: 5px;
|
677 |
+
top: 5px;
|
678 |
+
cursor: pointer;
|
679 |
+
}
|
680 |
+
|
681 |
+
/*ickeck specifics */
|
682 |
+
.wp-customizer .icheckbox_flat-grey, .wp-customizer .iradio_flat-grey {
|
683 |
+
border: 1px solid white;
|
684 |
+
-webkit-border-radius: 5px;
|
685 |
+
border-radius: 5px;
|
686 |
+
background-color : white;
|
687 |
+
}
|
688 |
+
|
689 |
+
/* SKOPE PAINTING */
|
690 |
+
.czr-painted {
|
691 |
+
-webkit-transition: background .3s ease-in-out!important;
|
692 |
+
-moz-transition: background .3s ease-in-out!important;
|
693 |
+
-ms-transition: background .3s ease-in-out!important;
|
694 |
+
-o-transition: background .3s ease-in-out!important;
|
695 |
+
transition: background .3s ease-in-out!important;
|
696 |
+
}
|
assets/czr/fmk/css/parts/czr-control-common.css
ADDED
@@ -0,0 +1,984 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* OVERRIDE WP CUSTOMIZER */
|
2 |
+
/* LINKS */
|
3 |
+
.wp-customizer a {
|
4 |
+
color: #000;
|
5 |
+
}
|
6 |
+
.wp-customizer a:hover, .wp-customizer a:focus {
|
7 |
+
color: #0073aa;
|
8 |
+
}
|
9 |
+
|
10 |
+
/* LAYOUT */
|
11 |
+
.wp-customizer .wp-full-overlay.expanded {
|
12 |
+
margin-left: 440px;
|
13 |
+
}
|
14 |
+
.wp-customizer .wp-full-overlay-sidebar {
|
15 |
+
width: 440px;
|
16 |
+
}
|
17 |
+
.wp-customizer .wp-full-overlay.collapsed .wp-full-overlay-sidebar {
|
18 |
+
margin-left: -440px;
|
19 |
+
}
|
20 |
+
/*.in-sub-panel #customize-info,
|
21 |
+
.in-sub-panel #customize-theme-controls > ul > .accordion-section {
|
22 |
+
left: -440px;
|
23 |
+
width: 440px;
|
24 |
+
}*/
|
25 |
+
#customize-theme-controls .control-section.current-panel > h3.accordion-section-title {
|
26 |
+
left: -440px;
|
27 |
+
}
|
28 |
+
.accordion-sub-container.control-panel-content {
|
29 |
+
left: 440px;
|
30 |
+
}
|
31 |
+
|
32 |
+
|
33 |
+
/* RTL*/
|
34 |
+
.rtl.wp-customizer .wp-full-overlay.expanded {
|
35 |
+
margin-right: 440px;
|
36 |
+
margin-left: 0;
|
37 |
+
}
|
38 |
+
.rtl.wp-customizer .wp-full-overlay-sidebar {
|
39 |
+
width: 440px;
|
40 |
+
}
|
41 |
+
.rtl.wp-customizer .wp-full-overlay.collapsed .wp-full-overlay-sidebar {
|
42 |
+
margin-right: -440px;
|
43 |
+
margin-left: 0;
|
44 |
+
}
|
45 |
+
/*.rtl .in-sub-panel #customize-info,
|
46 |
+
.rtl .in-sub-panel #customize-theme-controls > ul > .accordion-section {
|
47 |
+
right: -440px;
|
48 |
+
width: 440px;
|
49 |
+
}*/
|
50 |
+
.rtl #customize-theme-controls .control-section.current-panel > h3.accordion-section-title {
|
51 |
+
right: -440px;
|
52 |
+
}
|
53 |
+
.rtl .accordion-sub-container.control-panel-content {
|
54 |
+
right: 440px;
|
55 |
+
}
|
56 |
+
|
57 |
+
/* CUSTOM CSS ( since wp 4.7 ) */
|
58 |
+
.customize-section-description-container + #customize-control-custom_css:last-child {
|
59 |
+
margin: 0;
|
60 |
+
width: 100%;
|
61 |
+
}
|
62 |
+
li#customize-control-custom_css textarea {
|
63 |
+
font-size: 13px;
|
64 |
+
background: #394143;
|
65 |
+
color: #95ff0c;
|
66 |
+
min-height: 300px;
|
67 |
+
}
|
68 |
+
|
69 |
+
@media screen and (max-width: 1400px) {
|
70 |
+
.wp-customizer .wp-full-overlay.expanded {
|
71 |
+
margin-left: 380px;
|
72 |
+
}
|
73 |
+
.wp-customizer .wp-full-overlay-sidebar {
|
74 |
+
width: 380px;
|
75 |
+
}
|
76 |
+
.wp-customizer .wp-full-overlay.collapsed .wp-full-overlay-sidebar {
|
77 |
+
margin-left: -380px;
|
78 |
+
}
|
79 |
+
/* .in-sub-panel #customize-info,
|
80 |
+
.in-sub-panel #customize-theme-controls > ul > .accordion-section {
|
81 |
+
left: -380px;
|
82 |
+
width: 380px;
|
83 |
+
}*/
|
84 |
+
#customize-theme-controls .control-section.current-panel > h3.accordion-section-title {
|
85 |
+
left: -380px;
|
86 |
+
}
|
87 |
+
.accordion-sub-container.control-panel-content {
|
88 |
+
left: 380px;
|
89 |
+
}
|
90 |
+
|
91 |
+
/* RTL */
|
92 |
+
.rtl.wp-customizer .wp-full-overlay.expanded {
|
93 |
+
margin-right: 380px;
|
94 |
+
margin-left: 0;
|
95 |
+
}
|
96 |
+
.rtl.wp-customizer .wp-full-overlay-sidebar {
|
97 |
+
width: 380px;
|
98 |
+
}
|
99 |
+
.rtl.wp-customizer .wp-full-overlay.collapsed .wp-full-overlay-sidebar {
|
100 |
+
margin-right: -380px;
|
101 |
+
margin-left: 0;
|
102 |
+
}
|
103 |
+
/* .rtl .in-sub-panel #customize-info,
|
104 |
+
.rtl .in-sub-panel #customize-theme-controls > ul > .accordion-section {
|
105 |
+
right: -380px;
|
106 |
+
width: 380px;
|
107 |
+
}*/
|
108 |
+
.rtl #customize-theme-controls .control-section.current-panel > h3.accordion-section-title {
|
109 |
+
right: -380px;
|
110 |
+
}
|
111 |
+
.rtl .accordion-sub-container.control-panel-content {
|
112 |
+
right: 380px;
|
113 |
+
}
|
114 |
+
}
|
115 |
+
|
116 |
+
@media screen and (max-width: 979px) {
|
117 |
+
.wp-customizer .wp-full-overlay.expanded {
|
118 |
+
margin-left: 300px;
|
119 |
+
}
|
120 |
+
.wp-customizer .wp-full-overlay-sidebar {
|
121 |
+
width: 300px;
|
122 |
+
}
|
123 |
+
.wp-customizer .wp-full-overlay.collapsed .wp-full-overlay-sidebar {
|
124 |
+
margin-left: -300px;
|
125 |
+
}
|
126 |
+
/* .in-sub-panel #customize-info,
|
127 |
+
.in-sub-panel #customize-theme-controls > ul > .accordion-section {
|
128 |
+
left: -300px;
|
129 |
+
width: 300px;
|
130 |
+
}*/
|
131 |
+
#customize-theme-controls .control-section.current-panel > h3.accordion-section-title {
|
132 |
+
left: -300px;
|
133 |
+
}
|
134 |
+
.accordion-sub-container.control-panel-content {
|
135 |
+
left: 300px;
|
136 |
+
}
|
137 |
+
|
138 |
+
/* RTL */
|
139 |
+
.rtl.wp-customizer .wp-full-overlay.expanded {
|
140 |
+
margin-right: 300px;
|
141 |
+
margin-left: 0;
|
142 |
+
}
|
143 |
+
.rtl.wp-customizer .wp-full-overlay-sidebar {
|
144 |
+
width: 300px;
|
145 |
+
}
|
146 |
+
.rtl.wp-customizer .wp-full-overlay.collapsed .wp-full-overlay-sidebar {
|
147 |
+
margin-right: -300px;
|
148 |
+
margin-left: 0;
|
149 |
+
}
|
150 |
+
/* .rtl .in-sub-panel #customize-info,
|
151 |
+
.rtl .in-sub-panel #customize-theme-controls > ul > .accordion-section {
|
152 |
+
right: -300px;
|
153 |
+
width: 300px;
|
154 |
+
}*/
|
155 |
+
.rtl #customize-theme-controls .control-section.current-panel > h3.accordion-section-title {
|
156 |
+
right: -300px;
|
157 |
+
}
|
158 |
+
.rtl .accordion-sub-container.control-panel-content {
|
159 |
+
right: 300px;
|
160 |
+
}
|
161 |
+
}
|
162 |
+
|
163 |
+
/* at max-width 640px the wp-full-overlay-sidebar becomes 100% */
|
164 |
+
@media screen and (max-width: 640px) {
|
165 |
+
.wp-customizer .customize-controls-preview-toggle {
|
166 |
+
height: 46px;
|
167 |
+
border-bottom: 1px solid #ddd;
|
168 |
+
left: 87px;
|
169 |
+
}
|
170 |
+
|
171 |
+
.wp-customizer .wp-full-overlay.expanded {
|
172 |
+
margin-left: 0;
|
173 |
+
}
|
174 |
+
|
175 |
+
/* .in-sub-panel #customize-info,
|
176 |
+
.in-sub-panel #customize-theme-controls > ul > .accordion-section {
|
177 |
+
left: -100%;
|
178 |
+
width: 100%;
|
179 |
+
}*/
|
180 |
+
|
181 |
+
#customize-theme-controls .control-section.current-panel > h3.accordion-section-title {
|
182 |
+
left: -100%;
|
183 |
+
}
|
184 |
+
.accordion-sub-container.control-panel-content {
|
185 |
+
left: 100%;
|
186 |
+
}
|
187 |
+
|
188 |
+
/* RTL */
|
189 |
+
.rtl.wp-customizer .wp-full-overlay.expanded {
|
190 |
+
margin-right: 0;
|
191 |
+
}
|
192 |
+
|
193 |
+
/* .rtl .in-sub-panel #customize-info,
|
194 |
+
.rtl .in-sub-panel #customize-theme-controls > ul > .accordion-section {
|
195 |
+
right: -100%;
|
196 |
+
width: 100%;
|
197 |
+
left: auto;
|
198 |
+
}*/
|
199 |
+
.rtl .in-sub-panel #czr-donate-customizer,
|
200 |
+
.rtl .in-sub-panel .czr-cta-wrap,
|
201 |
+
.rtl #customize-theme-controls .control-section.current-panel > h3.accordion-section-title {
|
202 |
+
right: -100%;
|
203 |
+
left: auto;
|
204 |
+
}
|
205 |
+
.rtl .accordion-sub-container.control-panel-content {
|
206 |
+
right: 100%;
|
207 |
+
}
|
208 |
+
}
|
209 |
+
|
210 |
+
|
211 |
+
/* PANELS, SECTIONS and CONTROLS TITLES */
|
212 |
+
.wp-customizer .control-section.control-panel .accordion-section-title .panel-title {
|
213 |
+
font-size: 24px;
|
214 |
+
font-weight: inherit;
|
215 |
+
line-height: 30px;
|
216 |
+
}
|
217 |
+
|
218 |
+
.wp-core-ui h3 {
|
219 |
+
color: #555;
|
220 |
+
}
|
221 |
+
.accordion-section-content {
|
222 |
+
padding: 10px 10px 15px 20px;
|
223 |
+
}
|
224 |
+
.widget-action, .handlediv, .item-edit, .sidebar-name-arrow, .accordion-section-title:after {
|
225 |
+
color: #00a0d2;
|
226 |
+
}
|
227 |
+
.control-section.control-panel > .accordion-section-title:after {
|
228 |
+
color: #00a0d2;
|
229 |
+
}
|
230 |
+
.customize-control-title {
|
231 |
+
line-height: 1.5em;
|
232 |
+
/* font-size: 13px; */
|
233 |
+
font-family: Roboto;
|
234 |
+
font-weight: normal;
|
235 |
+
}
|
236 |
+
.customize-control span.customize-control-title:first-child {
|
237 |
+
position: relative;
|
238 |
+
padding: 10px 0px 5px;
|
239 |
+
/*margin-left: 14px;*/
|
240 |
+
}
|
241 |
+
|
242 |
+
/* since v4.3 */
|
243 |
+
.wp-customizer #customize-theme-controls .accordion-section-content {
|
244 |
+
background: #fff;
|
245 |
+
}
|
246 |
+
/*.wp-customizer .customize-panel-back {
|
247 |
+
height: 60px;
|
248 |
+
}*/
|
249 |
+
.wp-customizer #customize-controls .customize-info .customize-help-toggle:hover, .wp-customizer #customize-controls .customize-info.open .customize-help-toggle, .wp-customizer #customize-controls .customize-info .customize-help-toggle:focus {
|
250 |
+
color:#00a0d2;
|
251 |
+
}
|
252 |
+
.wp-customizer .customize-screen-options-toggle:focus:before, .wp-customizer #customize-controls .customize-info .customize-help-toggle:focus:before {
|
253 |
+
-webkit-box-shadow: 0 0 0 1px #00a0d2;
|
254 |
+
box-shadow: 0 0 0 1px #00a0d2;
|
255 |
+
-webkit-border-radius: 100%;
|
256 |
+
border-radius: 100%;
|
257 |
+
}
|
258 |
+
|
259 |
+
.wp-customizer .menu-item-handle:hover .item-type, .wp-customizer .menu-item-handle:hover .item-edit, .wp-customizer #available-menu-items .menu-item-handle:hover .item-add, .wp-customizer .menu-item-handle:hover{
|
260 |
+
color: #00a0d2;
|
261 |
+
}
|
262 |
+
|
263 |
+
.customize-screen-options-toggle:hover, .customize-screen-options-toggle:active, .customize-screen-options-toggle:focus, .active-menu-screen-options .customize-screen-options-toggle, #customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:hover, #customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:active, #customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:focus {
|
264 |
+
color: #00a0d2!important;
|
265 |
+
}
|
266 |
+
|
267 |
+
.customize-control input[type="text"] {
|
268 |
+
line-height: 23px;
|
269 |
+
}
|
270 |
+
|
271 |
+
/*<@4.9compat>*/
|
272 |
+
/* outer section introduced in v4.9 needs to keep its original width */
|
273 |
+
#customize-outer-theme-controls li[id*="customize-control-"] {
|
274 |
+
width: 100%;
|
275 |
+
}
|
276 |
+
#customize-outer-theme-controls input[type=checkbox], #customize-outer-theme-controls input[type=radio] {
|
277 |
+
float: none;
|
278 |
+
min-height: inherit;
|
279 |
+
}
|
280 |
+
/*</@4.9compat>*/
|
281 |
+
|
282 |
+
/* GENERAL STYLE */
|
283 |
+
.control-section .accordion-section-content {
|
284 |
+
overflow-y: auto;
|
285 |
+
}
|
286 |
+
|
287 |
+
.wp-customizer .control-section h3.accordion-section-title {
|
288 |
+
padding: 10px 25px 11px 14px;
|
289 |
+
|
290 |
+
}
|
291 |
+
.wp-customizer #customize-controls h3 {
|
292 |
+
font-size: 15px;
|
293 |
+
font-weight: 400;
|
294 |
+
}
|
295 |
+
|
296 |
+
.control-section .accordion-section-title:after {
|
297 |
+
top: 7px;
|
298 |
+
}
|
299 |
+
.control-section.control-panel .accordion-section-title:after {
|
300 |
+
top: 11px;
|
301 |
+
-webkit-transition: right .3s ease-in-out, opacity .3s ease-in-out;
|
302 |
+
-moz-transition: right .3s ease-in-out, opacity .3s ease-in-out;
|
303 |
+
-ms-transition: right .3s ease-in-out, opacity .3s ease-in-out;
|
304 |
+
-o-transition: right .3s ease-in-out, opacity .3s ease-in-out;
|
305 |
+
transition: right .3s ease-in-out, opacity .3s ease-in-out;
|
306 |
+
right: 10px;
|
307 |
+
opacity:0.7;
|
308 |
+
}
|
309 |
+
.rtl .control-section.control-panel .accordion-section-title:after {
|
310 |
+
-webkit-transition: left .3s ease-in-out, opacity .3s ease-in-out;
|
311 |
+
-moz-transition: left .3s ease-in-out, opacity .3s ease-in-out;
|
312 |
+
-ms-transition: left .3s ease-in-out, opacity .3s ease-in-out;
|
313 |
+
-o-transition: left .3s ease-in-out, opacity .3s ease-in-out;
|
314 |
+
transition: left .3s ease-in-out, opacity .3s ease-in-out;
|
315 |
+
left: 10px;
|
316 |
+
right: initial;
|
317 |
+
}
|
318 |
+
#customize-theme-controls .control-section.control-panel h3.accordion-section-title:hover:after , #customize-theme-controls .control-section.control-panel h3.accordion-section-title:focus:after {
|
319 |
+
right: 8px;
|
320 |
+
opacity:1;
|
321 |
+
color: #666!important;
|
322 |
+
}
|
323 |
+
|
324 |
+
.rtl #customize-theme-controls .control-section.control-panel h3.accordion-section-title:hover:after , .rtl #customize-theme-controls .control-section.control-panel h3.accordion-section-title:focus:after {
|
325 |
+
left: 6px;
|
326 |
+
right: initial;
|
327 |
+
}
|
328 |
+
/* Overrides WP built in style : hack for nested section arrow */
|
329 |
+
#customize-theme-controls .control-section.control-panel>h3.accordion-section-title:focus:after, #customize-theme-controls .control-section.control-panel>h3.accordion-section-title:hover:after, .control-section.control-panel>.accordion-section-title:after {
|
330 |
+
background: none!important;
|
331 |
+
border: none!important;
|
332 |
+
}
|
333 |
+
|
334 |
+
#customize-theme-controls h3.accordion-section-title {
|
335 |
+
/*font-family: "Open Sans", sans-serif;*/
|
336 |
+
-webkit-transition: background .1s ease-in-out;
|
337 |
+
-moz-transition: background .1s ease-in-out;
|
338 |
+
-ms-transition: background .1s ease-in-out;
|
339 |
+
-o-transition: background .1s ease-in-out;
|
340 |
+
transition: background .1s ease-in-out;
|
341 |
+
}
|
342 |
+
|
343 |
+
/*#customize-theme-controls > .control-section:hover .accordion-section-title::after, #customize-theme-controls .control-section .accordion-section-title:hover::after, #customize-theme-controls .control-section.open .accordion-section-title::after, #customize-theme-controls .control-section .accordion-section-title:focus::after {
|
344 |
+
color: #FFF;
|
345 |
+
}*/
|
346 |
+
|
347 |
+
|
348 |
+
.customize-control-checkbox label, .customize-control-nav_menu_auto_add label, .customize-control-radio label {
|
349 |
+
line-height: 16px;
|
350 |
+
margin-left: 0;
|
351 |
+
}
|
352 |
+
|
353 |
+
/* Placeholders Styling for inputs */
|
354 |
+
input::-webkit-input-placeholder {
|
355 |
+
color:#9A9A9A;
|
356 |
+
font-style: italic;
|
357 |
+
}
|
358 |
+
input:-moz-placeholder { /* Firefox 18- */
|
359 |
+
color: #9A9A9A;
|
360 |
+
font-style: italic;
|
361 |
+
}
|
362 |
+
input::-moz-placeholder { /* Firefox 19+ */
|
363 |
+
color: #9A9A9A;
|
364 |
+
font-style: italic;
|
365 |
+
}
|
366 |
+
input:-ms-input-placeholder {
|
367 |
+
color: #9A9A9A;
|
368 |
+
font-style: italic;
|
369 |
+
}
|
370 |
+
|
371 |
+
|
372 |
+
.customize-control select {
|
373 |
+
cursor: pointer;
|
374 |
+
width: 99%;
|
375 |
+
}
|
376 |
+
|
377 |
+
/* Nov-dec 2019 => adapt for WP 5.3 */
|
378 |
+
.czr-input .wp-picker-container .wp-color-result.button, .customize-control .wp-color-result.button {
|
379 |
+
border-color: #ccc;
|
380 |
+
min-height: 25px;
|
381 |
+
}
|
382 |
+
|
383 |
+
.czr-input .wp-color-result-text, .customize-control .wp-color-result-text {
|
384 |
+
line-height: 24px;
|
385 |
+
height: 24px;
|
386 |
+
}
|
387 |
+
|
388 |
+
/* Sept 2020 => fix alpha color picker style broken */
|
389 |
+
.wp-picker-container .iris-alpha-slider {
|
390 |
+
margin-left:5px!important;
|
391 |
+
}
|
392 |
+
|
393 |
+
|
394 |
+
|
395 |
+
|
396 |
+
|
397 |
+
|
398 |
+
.czr-customizr-title {
|
399 |
+
/* color: #555; */
|
400 |
+
text-transform: uppercase;
|
401 |
+
/* text-shadow: 0 1px 0 #FFF; */
|
402 |
+
margin: 1em 0em 5px 0em;
|
403 |
+
font-size: 15px!important;
|
404 |
+
border-bottom: 1px dotted #555;
|
405 |
+
padding-bottom: 5px;
|
406 |
+
text-align: center;
|
407 |
+
}
|
408 |
+
h3.czr-customizr-title::before {
|
409 |
+
content: '\00b7';
|
410 |
+
padding-right: 3px;
|
411 |
+
}
|
412 |
+
h3.czr-customizr-title::after {
|
413 |
+
content: '\00b7';
|
414 |
+
padding-left: 3px;
|
415 |
+
}
|
416 |
+
.czr-after-button {
|
417 |
+
border-color: white;
|
418 |
+
margin-top:15px;
|
419 |
+
}
|
420 |
+
.czr-emphasize {
|
421 |
+
line-height: 1.2em;
|
422 |
+
color: #2E2E2E;
|
423 |
+
}
|
424 |
+
i.czr-notice {
|
425 |
+
display: block;
|
426 |
+
clear: both;
|
427 |
+
}
|
428 |
+
span.czr-notice {
|
429 |
+
color: #313131;
|
430 |
+
font-size:12px;
|
431 |
+
font-style: italic;
|
432 |
+
clear: both;
|
433 |
+
display: block;
|
434 |
+
line-height: 18px;
|
435 |
+
padding: 5px 0;
|
436 |
+
}
|
437 |
+
|
438 |
+
.czr-html-before hr, .czr-html-after hr {
|
439 |
+
border-top: 1px solid #c5c5c5;
|
440 |
+
border-bottom: 1px solid #fafafa;
|
441 |
+
margin: 25px 0;
|
442 |
+
}
|
443 |
+
.czr-html-after {
|
444 |
+
float: left;
|
445 |
+
width: 100%;
|
446 |
+
}
|
447 |
+
|
448 |
+
.czr-customizer-separator-invisible {
|
449 |
+
border:none;
|
450 |
+
margin-top:15px;
|
451 |
+
}
|
452 |
+
.czr-skin-gen-label {
|
453 |
+
float: left;
|
454 |
+
}
|
455 |
+
.czr-skin-gen-color-picker {
|
456 |
+
float: right;
|
457 |
+
}
|
458 |
+
.czr-number-label {
|
459 |
+
float: left;
|
460 |
+
}
|
461 |
+
.czr-number-input {
|
462 |
+
float: right;
|
463 |
+
}
|
464 |
+
.czr-check-label {
|
465 |
+
float: left;
|
466 |
+
max-width: 85%;
|
467 |
+
}
|
468 |
+
/* RTL position fix */
|
469 |
+
.rtl .czr-check-label {
|
470 |
+
float: right;
|
471 |
+
}
|
472 |
+
input[type=checkbox], input[type=radio] {
|
473 |
+
float: right;
|
474 |
+
min-height: 18px;
|
475 |
+
}
|
476 |
+
.czr-font-select {
|
477 |
+
float: left;
|
478 |
+
}
|
479 |
+
|
480 |
+
/* CUSTOM CSS TEXT AREA */
|
481 |
+
li#customize-control-tc_theme_options-tc_custom_css textarea {
|
482 |
+
font-size: 14px;
|
483 |
+
background: #394143;
|
484 |
+
color: #E2E728;
|
485 |
+
min-height: 300px;
|
486 |
+
}
|
487 |
+
|
488 |
+
|
489 |
+
|
490 |
+
|
491 |
+
|
492 |
+
|
493 |
+
|
494 |
+
|
495 |
+
|
496 |
+
|
497 |
+
|
498 |
+
|
499 |
+
|
500 |
+
.customize-control .czr-navigate-to-post-list {
|
501 |
+
color: #00a0d2;
|
502 |
+
font-weight: bold;
|
503 |
+
float: left;
|
504 |
+
clear: both;
|
505 |
+
width: 100%;
|
506 |
+
margin-bottom: 8px;
|
507 |
+
}
|
508 |
+
|
509 |
+
.czr-sub-control {
|
510 |
+
padding-left: 13%;
|
511 |
+
max-width: 87%;
|
512 |
+
position: relative;
|
513 |
+
}
|
514 |
+
|
515 |
+
.czr-sub-control:before {
|
516 |
+
content: '';
|
517 |
+
height: 116%;
|
518 |
+
background: #00a0d2;
|
519 |
+
width: 2%;
|
520 |
+
position: absolute;
|
521 |
+
left: 7%;
|
522 |
+
}
|
523 |
+
|
524 |
+
/* Cropped Image style */
|
525 |
+
/* Unified with the default cropped_image CSS */
|
526 |
+
.customize-control-tc_cropped_image .upload-button {
|
527 |
+
float: right;
|
528 |
+
}
|
529 |
+
.customize-control-tc_cropped_image .remove-button {
|
530 |
+
float: left;
|
531 |
+
margin-right: 3px;
|
532 |
+
}
|
533 |
+
.customize-control-tc_cropped_image .actions {
|
534 |
+
margin-bottom: 32px;
|
535 |
+
}
|
536 |
+
.customize-control-tc_cropped_image .current {
|
537 |
+
margin-bottom: 8px;
|
538 |
+
}
|
539 |
+
.customize-control-tc_cropped_image .upload-button,
|
540 |
+
.customize-control-tc_cropped_image .remove-button {
|
541 |
+
white-space: normal;
|
542 |
+
width: 48%;
|
543 |
+
height: auto;
|
544 |
+
}
|
545 |
+
|
546 |
+
.customize-control-tc_cropped_image .current .container {
|
547 |
+
min-height: 40px;
|
548 |
+
overflow: hidden;
|
549 |
+
border: 1px solid #eee;
|
550 |
+
-webkit-border-radius: 2px;
|
551 |
+
border-radius: 2px;
|
552 |
+
}
|
553 |
+
.customize-control-tc_cropped_image img {
|
554 |
+
width: 100%;
|
555 |
+
-webkit-border-radius: 2px;
|
556 |
+
border-radius: 2px;
|
557 |
+
}
|
558 |
+
.customize-control-tc_cropped_image .inner {
|
559 |
+
line-height: 20px;
|
560 |
+
top: 10px;
|
561 |
+
}
|
562 |
+
/* rtl */
|
563 |
+
/* end tc cropped image */
|
564 |
+
.rtl .customize-control-tc_cropped_image .upload-button {
|
565 |
+
float: left;
|
566 |
+
}
|
567 |
+
.rtl .customize-control-tc_cropped_image .remove-button {
|
568 |
+
float: right;
|
569 |
+
margin-left: 3px;
|
570 |
+
}
|
571 |
+
|
572 |
+
|
573 |
+
|
574 |
+
|
575 |
+
|
576 |
+
/* LAYOUT SELECTION SPECIFICS */
|
577 |
+
.czr-layout-img {
|
578 |
+
height: 22px;
|
579 |
+
margin-top: 2px;
|
580 |
+
outline: 1px solid #FFF;
|
581 |
+
}
|
582 |
+
.czr-layout-title {
|
583 |
+
padding: 0 0px 18px 12px;
|
584 |
+
display: inline-block;
|
585 |
+
line-height: 0px;
|
586 |
+
vertical-align: middle;
|
587 |
+
}
|
588 |
+
|
589 |
+
|
590 |
+
|
591 |
+
/* MULTI INPUT */
|
592 |
+
.customize-control-czr_multi_input {
|
593 |
+
width: 96%;
|
594 |
+
border: 1px solid #ccc;
|
595 |
+
padding: 2%;
|
596 |
+
}
|
597 |
+
.czr-multi-input-wrapper {
|
598 |
+
width: 95%;
|
599 |
+
padding: 0px 0% 0 5%;
|
600 |
+
}
|
601 |
+
.czr-multi-input-wrapper [data-input-type="color"] .czr-input {
|
602 |
+
float: left;
|
603 |
+
clear: both;
|
604 |
+
}
|
605 |
+
|
606 |
+
|
607 |
+
|
608 |
+
/* SPECIFIC PANELS AND SECTIONS MARGIN */
|
609 |
+
#customize-theme-controls #accordion-panel-czr-footer-panel {
|
610 |
+
border-bottom: 1px solid #ddd;
|
611 |
+
}
|
612 |
+
#customize-theme-controls .control-panel-widgets,
|
613 |
+
#customize-theme-controls #accordion-panel-nav_menus,
|
614 |
+
#customize-theme-controls #accordion-panel-hu-advanced-panel {
|
615 |
+
margin-top: 10px;
|
616 |
+
}
|
617 |
+
#customize-theme-controls #accordion-panel-hu-header-panel,
|
618 |
+
#customize-theme-controls .control-panel-widgets,
|
619 |
+
#customize-theme-controls #accordion-panel-nav_menus,
|
620 |
+
#customize-theme-controls #accordion-panel-hu-advanced-panel {
|
621 |
+
border-top: 1px solid #ddd;
|
622 |
+
}
|
623 |
+
#customize-theme-controls #accordion-panel-hu-general-panel,
|
624 |
+
#customize-theme-controls #accordion-panel-tc-global-panel {
|
625 |
+
margin-bottom: 10px;
|
626 |
+
}
|
627 |
+
|
628 |
+
#customize-theme-controls #accordion-section-static_front_page,
|
629 |
+
#customize-theme-controls #accordion-section-frontpage_sec {
|
630 |
+
margin-bottom: 10px;
|
631 |
+
}
|
632 |
+
|
633 |
+
/* FPU */
|
634 |
+
#customize-theme-controls #accordion-section-tc_fpu {
|
635 |
+
margin-bottom: 10px;
|
636 |
+
}
|
637 |
+
|
638 |
+
/* WFC */
|
639 |
+
#customize-theme-controls #accordion-section-tc_font_customizer_settings {
|
640 |
+
margin-bottom: 10px;
|
641 |
+
}
|
642 |
+
|
643 |
+
/* NIMBLE */
|
644 |
+
#customize-theme-controls #accordion-panel-__sektions__ {
|
645 |
+
margin-bottom: 10px;
|
646 |
+
}
|
647 |
+
|
648 |
+
/* HEADER => HOME AND ADD MODULE BUTTON */
|
649 |
+
.czr-has-home-btn #customize-header-actions .customize-controls-close {
|
650 |
+
left: 45px;
|
651 |
+
}
|
652 |
+
|
653 |
+
.czr-has-home-btn .customize-controls-home-or-add, .customize-controls-close {
|
654 |
+
top: -1px;
|
655 |
+
}
|
656 |
+
.czr-has-home-btn .customize-controls-home-or-add {
|
657 |
+
display: block;
|
658 |
+
position: absolute;
|
659 |
+
left: 0;
|
660 |
+
width: 45px;
|
661 |
+
height: 41px;
|
662 |
+
padding: 0 2px 0 0;
|
663 |
+
background: #eee;
|
664 |
+
border: none;
|
665 |
+
border-top: 4px solid #eee;
|
666 |
+
border-right: 1px solid #ddd;
|
667 |
+
border-bottom: 1px solid #ddd;
|
668 |
+
color: #444;
|
669 |
+
text-align: left;
|
670 |
+
cursor: pointer;
|
671 |
+
text-decoration: none;
|
672 |
+
-webkit-transition: color .15s ease-in-out, border-color .15s ease-in-out, background .15s ease-in-out;
|
673 |
+
transition: color .1s ease-in-out, border-color .15s ease-in-out, background .15s ease-in-out;
|
674 |
+
-webkit-box-sizing: content-box;
|
675 |
+
-moz-box-sizing: content-box;
|
676 |
+
box-sizing: content-box;
|
677 |
+
}
|
678 |
+
/* for the Nimble button */
|
679 |
+
.czr-has-home-btn .customize-controls-home-or-add > .material-icons {
|
680 |
+
line-height: 39px;
|
681 |
+
text-align: center;
|
682 |
+
display: block;
|
683 |
+
}
|
684 |
+
|
685 |
+
.czr-has-home-btn .customize-controls-home-or-add:before {
|
686 |
+
font-size: 17px;
|
687 |
+
line-height:45px;
|
688 |
+
position: relative;
|
689 |
+
top: -4px;
|
690 |
+
left: 15px;
|
691 |
+
}
|
692 |
+
.czr-has-home-btn .customize-controls-home-or-add:hover {
|
693 |
+
background: #fff;
|
694 |
+
color: #0073aa;
|
695 |
+
border-top-color: #0073aa;
|
696 |
+
outline: none;
|
697 |
+
-webkit-box-shadow: none;
|
698 |
+
box-shadow: none;
|
699 |
+
}
|
700 |
+
/* rtl: home button */
|
701 |
+
.czr-has-home-btn .rtl.wp-customizer #customize-header-actions .customize-controls-close {
|
702 |
+
right: 45px;
|
703 |
+
left: auto;
|
704 |
+
}
|
705 |
+
.czr-has-home-btn .rtl.wp-customizer .customize-controls-home-or-add {
|
706 |
+
left: auto;
|
707 |
+
right: 0;
|
708 |
+
border-right: 0;
|
709 |
+
border-left: 1px solid #ddd;
|
710 |
+
}
|
711 |
+
|
712 |
+
|
713 |
+
|
714 |
+
|
715 |
+
/* HEADER MENU NOTICE */
|
716 |
+
.control-panel-content .hu-menu-notice {
|
717 |
+
margin-left: 3%;
|
718 |
+
|
719 |
+
}
|
720 |
+
|
721 |
+
/* PANEL SUBTITLE */
|
722 |
+
span.czr-panel-subtitle {
|
723 |
+
display: block;
|
724 |
+
font-size: 12px;
|
725 |
+
font-style: italic;
|
726 |
+
}
|
727 |
+
|
728 |
+
/* PRO BLOCK BEFORE SECTIONS AND PANELS TITLE */
|
729 |
+
.pro-title-block {
|
730 |
+
border: 1px solid #eea236;
|
731 |
+
padding: 0px 6px;
|
732 |
+
font-size: 0.7em;
|
733 |
+
display: inline-block;
|
734 |
+
margin-right: 3px;
|
735 |
+
bottom: 2px;
|
736 |
+
position: relative;
|
737 |
+
color: #f0ad4e;
|
738 |
+
webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1);
|
739 |
+
box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1);
|
740 |
+
border-radius: 3px;
|
741 |
+
-webkit-user-select: none;
|
742 |
+
-moz-user-select: none;
|
743 |
+
-ms-user-select: none;
|
744 |
+
}
|
745 |
+
|
746 |
+
|
747 |
+
/* GOPRO SECTION STYLE */
|
748 |
+
/* for both hueman and customizr */
|
749 |
+
|
750 |
+
#customize-controls .control-section-czr-customize-section-pro .accordion-section-title:hover,
|
751 |
+
#customize-controls .control-section-czr-customize-section-pro .accordion-section-title:focus {
|
752 |
+
background-color: #fff;
|
753 |
+
}
|
754 |
+
#customize-theme-controls .control-section-czr-customize-section-pro .accordion-section-title:after {
|
755 |
+
content: none;
|
756 |
+
}
|
757 |
+
#accordion-section-go_pro_sec .accordion-section-title{
|
758 |
+
margin: 0 0 15px;
|
759 |
+
}
|
760 |
+
.control-section-czr-customize-section-pro .accordion-section-title {
|
761 |
+
white-space: nowrap;
|
762 |
+
overflow: hidden;
|
763 |
+
text-overflow: ellipsis;
|
764 |
+
}
|
765 |
+
.control-section-czr-customize-section-pro .accordion-section-title .button {
|
766 |
+
font-size: 15px;
|
767 |
+
line-height: 24px;
|
768 |
+
height: 30px;
|
769 |
+
padding: 1px 20px;
|
770 |
+
display: inline-block;
|
771 |
+
color: #f59000;
|
772 |
+
background: #fff;
|
773 |
+
border: 1px solid #eea236;
|
774 |
+
-webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1);
|
775 |
+
box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1);
|
776 |
+
text-align: center;
|
777 |
+
white-space: nowrap;
|
778 |
+
vertical-align: middle;
|
779 |
+
cursor: pointer;
|
780 |
+
border-radius: 3px;
|
781 |
+
-webkit-transition: all 0.2s ease-in-out;
|
782 |
+
-moz-transition: all 0.2s ease-in-out;
|
783 |
+
-o-transition: all 0.2s ease-in-out;
|
784 |
+
-ms-transition: all 0.2s ease-in-out;
|
785 |
+
transition: all 0.2s ease-in-out;
|
786 |
+
-webkit-user-select: none;
|
787 |
+
-moz-user-select: none;
|
788 |
+
-ms-user-select: none;
|
789 |
+
user-select: none;
|
790 |
+
margin-top: -4px;
|
791 |
+
font-weight: 400;
|
792 |
+
margin-left: 8px;
|
793 |
+
|
794 |
+
}
|
795 |
+
.control-section-czr-customize-section-pro .accordion-section-title .button:hover {
|
796 |
+
color: #fff;
|
797 |
+
background: #ed9c28;
|
798 |
+
border-color: #d58512;
|
799 |
+
}
|
800 |
+
.rtl .control-section-czr-customize-section-pro .accordion-section-title .button {
|
801 |
+
margin-left: 0;
|
802 |
+
margin-right: 8px;
|
803 |
+
}
|
804 |
+
|
805 |
+
/* END GO PRO SECTION STYLE */
|
806 |
+
|
807 |
+
|
808 |
+
|
809 |
+
|
810 |
+
|
811 |
+
|
812 |
+
|
813 |
+
|
814 |
+
/* <CSS LOADER> */
|
815 |
+
@-webkit-keyframes czr-mr-loader {
|
816 |
+
0% {
|
817 |
+
-webkit-transform: scale(0.1);
|
818 |
+
transform: scale(0.1);
|
819 |
+
opacity: 1;
|
820 |
+
}
|
821 |
+
70% {
|
822 |
+
-webkit-transform: scale(1);
|
823 |
+
transform: scale(1);
|
824 |
+
opacity: 0.7;
|
825 |
+
}
|
826 |
+
100% {
|
827 |
+
opacity: 0.0;
|
828 |
+
}
|
829 |
+
}
|
830 |
+
|
831 |
+
@keyframes czr-mr-loader {
|
832 |
+
0% {
|
833 |
+
-webkit-transform: scale(0.1);
|
834 |
+
transform: scale(0.1);
|
835 |
+
opacity: 1;
|
836 |
+
}
|
837 |
+
70% {
|
838 |
+
-webkit-transform: scale(1);
|
839 |
+
transform: scale(1);
|
840 |
+
opacity: 0.7;
|
841 |
+
}
|
842 |
+
100% {
|
843 |
+
opacity: 0.0;
|
844 |
+
}
|
845 |
+
}
|
846 |
+
.czr-css-loader {
|
847 |
+
display: none;
|
848 |
+
width: 50px;
|
849 |
+
height: 50px;
|
850 |
+
/* background-color: #333;*/
|
851 |
+
position: absolute;
|
852 |
+
-webkit-transform: translate3d(-50%, -50%, 0);
|
853 |
+
transform: translate3d(-50%, -50%, 0);
|
854 |
+
top: 50%;
|
855 |
+
left: 50%;
|
856 |
+
}
|
857 |
+
|
858 |
+
.csstransforms3d .czr-css-loader {
|
859 |
+
display: block;
|
860 |
+
}
|
861 |
+
|
862 |
+
.czr-mr-loader > div:nth-child(0) {
|
863 |
+
-webkit-animation-delay: -0.8s;
|
864 |
+
animation-delay: -0.8s;
|
865 |
+
}
|
866 |
+
|
867 |
+
.czr-mr-loader > div:nth-child(1) {
|
868 |
+
-webkit-animation-delay: -0.6s;
|
869 |
+
animation-delay: -0.6s;
|
870 |
+
}
|
871 |
+
|
872 |
+
.czr-mr-loader > div:nth-child(2) {
|
873 |
+
-webkit-animation-delay: -0.4s;
|
874 |
+
animation-delay: -0.4s;
|
875 |
+
}
|
876 |
+
|
877 |
+
.czr-mr-loader > div:nth-child(3) {
|
878 |
+
-webkit-animation-delay: -0.2s;
|
879 |
+
animation-delay: -0.2s;
|
880 |
+
}
|
881 |
+
|
882 |
+
.czr-mr-loader > div {
|
883 |
+
-webkit-animation-fill-mode: both;
|
884 |
+
animation-fill-mode: both;
|
885 |
+
position: absolute;
|
886 |
+
/*top: -4%;
|
887 |
+
left: -4%;*/
|
888 |
+
top: -0%;
|
889 |
+
left: -0%;
|
890 |
+
width: 100%;
|
891 |
+
height: 100%;
|
892 |
+
border-radius: 100%;
|
893 |
+
border: 2px solid #777;
|
894 |
+
-webkit-animation: czr-mr-loader 1.25s 0s infinite cubic-bezier(0.21, 0.53, 0.56, 0.8);
|
895 |
+
animation: czr-mr-loader 1.25s 0s infinite cubic-bezier(0.21, 0.53, 0.56, 0.8);
|
896 |
+
}
|
897 |
+
/* </CSS LOADER> */
|
898 |
+
|
899 |
+
|
900 |
+
|
901 |
+
|
902 |
+
|
903 |
+
|
904 |
+
|
905 |
+
|
906 |
+
|
907 |
+
|
908 |
+
|
909 |
+
|
910 |
+
|
911 |
+
|
912 |
+
|
913 |
+
|
914 |
+
|
915 |
+
/* <OLD DONATE LINK> */
|
916 |
+
.in-sub-panel #czr-donate-customizer,
|
917 |
+
.in-sub-panel .czr-cta-wrap {
|
918 |
+
left: -450px;
|
919 |
+
height: 0;
|
920 |
+
}
|
921 |
+
|
922 |
+
|
923 |
+
.rtl .in-sub-panel #czr-donate-customizer,
|
924 |
+
.rtl .in-sub-panel .czr-cta-wrap {
|
925 |
+
right: -450px;
|
926 |
+
}
|
927 |
+
|
928 |
+
|
929 |
+
@media screen and (max-width: 1400px) {
|
930 |
+
|
931 |
+
.in-sub-panel #czr-donate-customizer,
|
932 |
+
.in-sub-panel .czr-cta-wrap {
|
933 |
+
left: -380px;
|
934 |
+
}
|
935 |
+
|
936 |
+
.rtl .in-sub-panel #czr-donate-customizer,
|
937 |
+
.rtl .in-sub-panel .czr-cta-wrap {
|
938 |
+
right: -380px;
|
939 |
+
}
|
940 |
+
}
|
941 |
+
|
942 |
+
|
943 |
+
|
944 |
+
|
945 |
+
@media screen and (max-width: 979px) {
|
946 |
+
|
947 |
+
|
948 |
+
.in-sub-panel #czr-donate-customizer,
|
949 |
+
.in-sub-panel .czr-cta-wrap {
|
950 |
+
left: -300px;
|
951 |
+
}
|
952 |
+
|
953 |
+
.rtl .in-sub-panel #czr-donate-customizer,
|
954 |
+
.rtl .in-sub-panel .czr-cta-wrap {
|
955 |
+
right: -300px;
|
956 |
+
}
|
957 |
+
}
|
958 |
+
|
959 |
+
/* at max-width 640px the wp-full-overlay-sidebar becomes 100% */
|
960 |
+
@media screen and (max-width: 640px) {
|
961 |
+
.in-sub-panel .czr-cta-wrap,
|
962 |
+
.in-sub-panel #czr-donate-customizer {
|
963 |
+
left: -100%;
|
964 |
+
}
|
965 |
+
|
966 |
+
.rtl .in-sub-panel #czr-donate-customizer,
|
967 |
+
.rtl .in-sub-panel .czr-cta-wrap {
|
968 |
+
right: -100%;
|
969 |
+
left: auto;
|
970 |
+
}
|
971 |
+
}
|
972 |
+
|
973 |
+
@media screen and (min-width: 980px) {
|
974 |
+
.wp-customizer .expanded #customize-footer-actions {
|
975 |
+
width: 380px;
|
976 |
+
}
|
977 |
+
}
|
978 |
+
|
979 |
+
@media screen and (min-width: 1401px) {
|
980 |
+
.wp-customizer .expanded #customize-footer-actions {
|
981 |
+
width: 440px;
|
982 |
+
}
|
983 |
+
}
|
984 |
+
/* </OLD DONATE LINK> */
|
assets/czr/fmk/css/parts/czr-control-input-types.css
ADDED
@@ -0,0 +1,900 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* Selecter v3.1.9 - 2014-09-02
|
3 |
+
* A jQuery plugin for replacing default select elements. Part of the Formstone Library.
|
4 |
+
* http://formstone.it/selecter/
|
5 |
+
*
|
6 |
+
* Copyright 2014 Ben Plum; MIT Licensed
|
7 |
+
*/
|
8 |
+
.selecter-element { *left: -999999px; position: absolute; opacity: 0; }
|
9 |
+
.selecter { display: block;float: right;margin: 2px 0;position: relative;width: 100%;z-index: 100; }
|
10 |
+
.selecter .selecter-selected { background: #F9F9F9 url(img/jquery.fs.selecter-arrow.png) no-repeat right center; border: 1px solid #ccc; border-radius: 3px; color: #333; cursor: pointer; display: block; font-size: 13px; margin: 0; overflow: hidden; padding: 4px 4%; position: relative; text-overflow: clip; z-index: 49; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.07);height: auto;line-height: 18px;width: 90%; }
|
11 |
+
|
12 |
+
.selecter .selecter-options { border: 1px solid #ccc; border-width: 0 1px 1px; background-color: #fefefe; border-radius: 0 0 3px 3px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15); display: none; left: 0; margin: 0; max-height: 260px; overflow: auto; overflow-x: hidden; padding: 0; position: relative; top: 100%; width: 99%; *width: auto; z-index: 50; }
|
13 |
+
.selecter .selecter-group { background: #F9F9F9; border-bottom: 1px solid #e3e3e3; color: #999; display: block; font-size: 11px; padding: 5px 6px 4px; text-transform: uppercase; }
|
14 |
+
.selecter .selecter-item { background: #fff; border-bottom: 1px solid #e3e3e3; color: #333; cursor: pointer; display: block; font-size: 13px; margin: 0; overflow: hidden; padding: 8px 10px; text-overflow: ellipsis; width: 86%;height: auto;line-height: 14px;padding: 8px 24px 8px 10px;}
|
15 |
+
.selecter .selecter-item.selected { background: #F9F9F9; }
|
16 |
+
.selecter .selecter-item.disabled { color: #999; cursor: default; }
|
17 |
+
.selecter .selecter-item:first-child { border-radius: 0; }
|
18 |
+
.selecter .selecter-item:last-child { border-radius: 0 0 2px 2px; border-bottom: 0; }
|
19 |
+
|
20 |
+
/* CUSTOM FOR CUSTOMIZR */
|
21 |
+
.rtl .selecter .selecter-selected {
|
22 |
+
background: #F9F9F9 url(img/jquery.fs.selecter-arrow.png) no-repeat 4% center;
|
23 |
+
}
|
24 |
+
|
25 |
+
@media screen and (min-width: 980px) {
|
26 |
+
.selecter .selecter-item:hover,
|
27 |
+
.selecter .selecter-item.selected:hover { background-color: #f3f3f3; }
|
28 |
+
.selecter .selecter-item.disabled:hover { background-color: #fff; }
|
29 |
+
|
30 |
+
.selecter:hover .selecter-selected { background-color: #fff; }
|
31 |
+
|
32 |
+
.selecter.disabled .selecter-item:hover { background: #fff; }
|
33 |
+
}
|
34 |
+
|
35 |
+
/* Open */
|
36 |
+
.selecter.open { z-index: 101; }
|
37 |
+
.selecter.open .selecter-selected { border-radius: 3px 3px 0 0; z-index: 51; }
|
38 |
+
|
39 |
+
.selecter.open .selecter-selected,
|
40 |
+
.selecter.focus .selecter-selected { background-color: #fff; box-shadow: 0 0 5px rgba(0, 0, 0, 0.1); }
|
41 |
+
|
42 |
+
/* 'Cover' Positioning */
|
43 |
+
.selecter.cover .selecter-options { border-radius: 3px; border-width: 1px; top: 0; }
|
44 |
+
.selecter.cover .selecter-options .selecter-item.first { border-radius: 3px 3px 0 0; }
|
45 |
+
.selecter.cover.open .selecter-selected { border-radius: 3px 3px 0 0; z-index: 49; }
|
46 |
+
|
47 |
+
/* 'Bottom' Positioning */
|
48 |
+
.selecter.bottom .selecter-options { border-width: 1px 1px 0; bottom: 100%; top: auto; }
|
49 |
+
.selecter.bottom .selecter-item:last-child { border: none; }
|
50 |
+
.selecter.bottom.open .selecter-selected { border-radius: 0 0 3px 3px; }
|
51 |
+
.selecter.bottom.open .selecter-options { border-radius: 3px 3px 0 0; }
|
52 |
+
|
53 |
+
/* 'Bottom' + 'Cover' Positioning */
|
54 |
+
.selecter.bottom.cover .selecter-options { bottom: 0; top: auto; }
|
55 |
+
.selecter.bottom.cover.open .selecter-selected { border-radius: 3px; }
|
56 |
+
.selecter.bottom.cover.open .selecter-options { border-radius: 3px; }
|
57 |
+
|
58 |
+
/* Multiple Select */
|
59 |
+
.selecter.multiple .selecter-options { border-radius: 3px; border-width: 1px; box-shadow: none; display: block; position: static; width: 100%; }
|
60 |
+
|
61 |
+
/* 'Disabled' State */
|
62 |
+
.selecter.disabled .selecter-selected { background: #fff; border-color: #eee; color: #ccc; cursor: default; }
|
63 |
+
.selecter.disabled .selecter-options { background: #fff; border-color: #eee; }
|
64 |
+
.selecter.disabled .selecter-group,
|
65 |
+
.selecter.disabled .selecter-item { border-color: #eee; color: #ccc; cursor: default; }
|
66 |
+
.selecter.disabled .selecter-item.selected { background: #fafafa; }
|
67 |
+
|
68 |
+
/* Scroller Support */
|
69 |
+
.selecter .selecter-options.scroller { overflow: hidden; }
|
70 |
+
.selecter .selecter-options.scroller .scroller-content { max-height: 260px; padding: 0; }
|
71 |
+
|
72 |
+
/* Media Queries */
|
73 |
+
@media screen and (max-width: 740px) {
|
74 |
+
.selecter { max-width: 100%; }
|
75 |
+
}
|
76 |
+
@media screen and (max-width: 500px) {
|
77 |
+
.selecter { max-width: 100%; }
|
78 |
+
}
|
79 |
+
|
80 |
+
|
81 |
+
|
82 |
+
|
83 |
+
|
84 |
+
|
85 |
+
|
86 |
+
|
87 |
+
|
88 |
+
|
89 |
+
|
90 |
+
/*
|
91 |
+
* Stepper v3.0.7 - 2014-05-07
|
92 |
+
* A jQuery plugin for cross browser number inputs. Part of the Formstone Library.
|
93 |
+
* http://formstone.it/stepper/
|
94 |
+
*
|
95 |
+
* Copyright 2014 Ben Plum; MIT Licensed
|
96 |
+
*/
|
97 |
+
.stepper { border-radius: 3px; margin: 0 0 10px 0; overflow: hidden; position: relative; width: 35%;float: left; clear: both;}
|
98 |
+
.stepper .stepper-input { background: #F9F9F9; border: 1px solid #ccc; border-radius: 3px; color: #333; font-size: 13px; line-height: 1.2; margin: 0; overflow: hidden; padding: 5px 10px 5px!important; width: 100%!important; z-index: 49; -moz-appearance: textfield;max-width: none!important;
|
99 |
+
}
|
100 |
+
|
101 |
+
.stepper .stepper-input::-webkit-inner-spin-button,
|
102 |
+
.stepper .stepper-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
|
103 |
+
|
104 |
+
.stepper .stepper-input:focus { background-color: #fff; }
|
105 |
+
.stepper .stepper-arrow { background: #eee url(img/jquery.fs.stepper-arrows.png) no-repeat; border: 1px solid #ccc; cursor: pointer; display: block; height: 46%; position: absolute; right: 0; text-indent: -99999px; width: 20px; z-index: 50; }
|
106 |
+
.stepper .stepper-arrow.up { background-position: center top; border-bottom: none; top: 0; }
|
107 |
+
.stepper .stepper-arrow.down { background-position: center bottom; bottom: 0; }
|
108 |
+
|
109 |
+
/* CUSTOM FOR CUSTOMIZR */
|
110 |
+
.rtl .stepper .stepper-input {
|
111 |
+
text-align: left;
|
112 |
+
}
|
113 |
+
|
114 |
+
@media screen and (min-width: 740px) {
|
115 |
+
.stepper:hover .stepper-input { background-color: #fff; }
|
116 |
+
|
117 |
+
.stepper .stepper-step:hover { background-color: #F9F9F9; }
|
118 |
+
|
119 |
+
.stepper.disabled .stepper-arrow { background: #fff; border-color: #eee; cursor: default; }
|
120 |
+
}
|
121 |
+
|
122 |
+
.stepper.disabled .stepper-input { background: #fff; border-color: #eee; color: #ccc; }
|
123 |
+
.stepper.disabled .stepper-arrow { background: #fff; border-color: #eee; cursor: default; }
|
124 |
+
|
125 |
+
|
126 |
+
|
127 |
+
|
128 |
+
|
129 |
+
|
130 |
+
|
131 |
+
|
132 |
+
|
133 |
+
|
134 |
+
|
135 |
+
|
136 |
+
/* iCheck plugin Flat skin, green
|
137 |
+
----------------------------------- */
|
138 |
+
.icheckbox_flat-green,
|
139 |
+
.iradio_flat-green {
|
140 |
+
display: inline-block;
|
141 |
+
*display: inline;
|
142 |
+
vertical-align: middle;
|
143 |
+
margin: 0;
|
144 |
+
padding: 0;
|
145 |
+
width: 20px;
|
146 |
+
height: 20px;
|
147 |
+
background: url(img/green.png) no-repeat;
|
148 |
+
border: none;
|
149 |
+
cursor: pointer;
|
150 |
+
top: 4px;
|
151 |
+
float: right;
|
152 |
+
}
|
153 |
+
/* RTL fix of check box position */
|
154 |
+
.rtl [class*=icheckbox_flat-] {
|
155 |
+
float: left;
|
156 |
+
}
|
157 |
+
.icheckbox_flat-green {
|
158 |
+
background-position: 0 0;
|
159 |
+
}
|
160 |
+
.icheckbox_flat-green.checked {
|
161 |
+
background-position: -22px 0;
|
162 |
+
}
|
163 |
+
.icheckbox_flat-green.disabled {
|
164 |
+
background-position: -44px 0;
|
165 |
+
cursor: default;
|
166 |
+
}
|
167 |
+
.icheckbox_flat-green.checked.disabled {
|
168 |
+
background-position: -66px 0;
|
169 |
+
}
|
170 |
+
|
171 |
+
.iradio_flat-green {
|
172 |
+
background-position: -88px 0;
|
173 |
+
}
|
174 |
+
.iradio_flat-green.checked {
|
175 |
+
background-position: -110px 0;
|
176 |
+
}
|
177 |
+
.iradio_flat-green.disabled {
|
178 |
+
background-position: -132px 0;
|
179 |
+
cursor: default;
|
180 |
+
}
|
181 |
+
.iradio_flat-green.checked.disabled {
|
182 |
+
background-position: -154px 0;
|
183 |
+
}
|
184 |
+
|
185 |
+
/* Retina support */
|
186 |
+
@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
|
187 |
+
only screen and (-moz-min-device-pixel-ratio: 1.5),
|
188 |
+
only screen and (-o-min-device-pixel-ratio: 3/2),
|
189 |
+
only screen and (min-device-pixel-ratio: 1.5) {
|
190 |
+
.icheckbox_flat-green,
|
191 |
+
.iradio_flat-green {
|
192 |
+
background-image: url(img/green@2x.png);
|
193 |
+
-webkit-background-size: 176px 22px;
|
194 |
+
background-size: 176px 22px;
|
195 |
+
}
|
196 |
+
}
|
197 |
+
|
198 |
+
/* iCheck plugin Flat skin, grey
|
199 |
+
----------------------------------- */
|
200 |
+
.icheckbox_flat-grey,
|
201 |
+
.iradio_flat-grey {
|
202 |
+
display: inline-block;
|
203 |
+
*display: inline;
|
204 |
+
vertical-align: middle;
|
205 |
+
margin: 0;
|
206 |
+
padding: 0;
|
207 |
+
width: 20px;
|
208 |
+
height: 20px;
|
209 |
+
background: url(img/grey.png) no-repeat;
|
210 |
+
border: none;
|
211 |
+
cursor: pointer;
|
212 |
+
top: 4px;
|
213 |
+
float: right;
|
214 |
+
}
|
215 |
+
|
216 |
+
.icheckbox_flat-grey {
|
217 |
+
background-position: 0 0;
|
218 |
+
}
|
219 |
+
.icheckbox_flat-grey.checked {
|
220 |
+
background-position: -22px 0;
|
221 |
+
}
|
222 |
+
.icheckbox_flat-grey.disabled {
|
223 |
+
background-position: -44px 0;
|
224 |
+
cursor: default;
|
225 |
+
}
|
226 |
+
.icheckbox_flat-grey.checked.disabled {
|
227 |
+
background-position: -66px 0;
|
228 |
+
}
|
229 |
+
|
230 |
+
.iradio_flat-grey {
|
231 |
+
background-position: -88px 0;
|
232 |
+
}
|
233 |
+
.iradio_flat-grey.checked {
|
234 |
+
background-position: -110px 0;
|
235 |
+
}
|
236 |
+
.iradio_flat-grey.disabled {
|
237 |
+
background-position: -132px 0;
|
238 |
+
cursor: default;
|
239 |
+
}
|
240 |
+
.iradio_flat-grey.checked.disabled {
|
241 |
+
background-position: -154px 0;
|
242 |
+
}
|
243 |
+
|
244 |
+
/* Retina support */
|
245 |
+
@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
|
246 |
+
only screen and (-moz-min-device-pixel-ratio: 1.5),
|
247 |
+
only screen and (-o-min-device-pixel-ratio: 3/2),
|
248 |
+
only screen and (min-device-pixel-ratio: 1.5) {
|
249 |
+
.icheckbox_flat-grey,
|
250 |
+
.iradio_flat-grey {
|
251 |
+
background-image: url(img/grey@2x.png);
|
252 |
+
-webkit-background-size: 176px 22px;
|
253 |
+
background-size: 176px 22px;
|
254 |
+
}
|
255 |
+
}
|
256 |
+
|
257 |
+
.czr-sub-set .icheckbox_flat-green, .iradio_flat-green {
|
258 |
+
float: left;
|
259 |
+
}
|
260 |
+
|
261 |
+
|
262 |
+
|
263 |
+
|
264 |
+
|
265 |
+
|
266 |
+
|
267 |
+
|
268 |
+
|
269 |
+
|
270 |
+
|
271 |
+
|
272 |
+
|
273 |
+
|
274 |
+
|
275 |
+
|
276 |
+
/* SELECT 2 SPECIFICS */
|
277 |
+
body .czrSelect2-container {
|
278 |
+
z-index: 1000000;
|
279 |
+
width: 100%!important;
|
280 |
+
}
|
281 |
+
|
282 |
+
.customize-control-czr_layouts .czrSelect2-selection--single {
|
283 |
+
height: 33px;
|
284 |
+
}
|
285 |
+
.customize-control-czr_layouts .czrSelect2-container--default .czrSelect2-selection--single .czrSelect2-selection__arrow {
|
286 |
+
height: 30px;
|
287 |
+
}
|
288 |
+
.czrSelect2-selection__rendered:focus, .customize-control-czr_layouts .czrSelect2-selection--single:focus {
|
289 |
+
outline: none;
|
290 |
+
}
|
291 |
+
|
292 |
+
/* Old SELECT2
|
293 |
+
* https://github.com/presscustomizr/themes-customizer-fmk/issues/30
|
294 |
+
*/
|
295 |
+
body .czrSelect2-drop {
|
296 |
+
z-index: 1000000;
|
297 |
+
}
|
298 |
+
|
299 |
+
|
300 |
+
/* SPECIFIC INPUT STYLE */
|
301 |
+
span.czrSelect2-results, body .czrSelect2-container {
|
302 |
+
font-size: 14px;
|
303 |
+
}
|
304 |
+
|
305 |
+
|
306 |
+
/* for multipe picker */
|
307 |
+
.czrSelect2-container--default .czrSelect2-selection--multiple {
|
308 |
+
-webkit-border-radius: 0px;
|
309 |
+
-moz-border-radius: 0px;
|
310 |
+
border-radius: 0;
|
311 |
+
width: 99%;
|
312 |
+
min-height: 36px;
|
313 |
+
border: 1px solid #ddd;
|
314 |
+
-webkit-box-shadow: inset 0 1px 2px rgba( 0, 0, 0, 0.07 );
|
315 |
+
box-shadow: inset 0 1px 2px rgba( 0, 0, 0, 0.07 );
|
316 |
+
}
|
317 |
+
.czrSelect2-container--default.czrSelect2-container--focus .czrSelect2-selection--multiple {
|
318 |
+
border-color: #00a0d2!important;
|
319 |
+
-webkit-box-shadow: 0 0 2px rgba(26, 188, 156, 0.8)!important;
|
320 |
+
box-shadow: 0 0 2px rgba(26, 188, 156, 0.8)!important;
|
321 |
+
}
|
322 |
+
.czrSelect2-results__options li {
|
323 |
+
margin-bottom: 0
|
324 |
+
}
|
325 |
+
.czrSelect2-container--default .czrSelect2-selection--multiple .czrSelect2-selection__choice {
|
326 |
+
padding: 2px;
|
327 |
+
font-size: 13px;
|
328 |
+
-webkit-border-radius: 2px;
|
329 |
+
-moz-border-radius: 2px;
|
330 |
+
border-radius: 2px;
|
331 |
+
margin-bottom: 0;
|
332 |
+
}
|
333 |
+
.czrSelect2-container--default .czrSelect2-results__option--highlighted[aria-selected] {
|
334 |
+
background-color: #00a0d2;
|
335 |
+
}
|
336 |
+
.czrSelect2-container--default .czrSelect2-selection--multiple .czrSelect2-selection__choice__remove {
|
337 |
+
font-size: 17px;
|
338 |
+
position: relative;
|
339 |
+
top: 2px;
|
340 |
+
color: #23282d;
|
341 |
+
}
|
342 |
+
|
343 |
+
/* Socials Specifics */
|
344 |
+
.customize-control-czr_socials .czrSelect2-container--default .czrSelect2-selection--single .czrSelect2-selection__rendered {
|
345 |
+
padding: 5px;
|
346 |
+
line-height: 16px;
|
347 |
+
}
|
348 |
+
|
349 |
+
|
350 |
+
|
351 |
+
|
352 |
+
|
353 |
+
|
354 |
+
|
355 |
+
|
356 |
+
|
357 |
+
|
358 |
+
|
359 |
+
|
360 |
+
/* WP TEXT EDITOR */
|
361 |
+
/* This CSS Code is inpired from the plugin customize-posts, GPLv2 or later licensed
|
362 |
+
Mostly class names have been modified.
|
363 |
+
Credits : xwp, westonruter, valendesigns, sayedwp, utkarshpatel.
|
364 |
+
Date of original code modification : July 2018
|
365 |
+
*/
|
366 |
+
#czr-customize-content_editor-pane {
|
367 |
+
border-top: solid 1px #ddd;
|
368 |
+
position: absolute;
|
369 |
+
height: 300px;
|
370 |
+
bottom: -301px;
|
371 |
+
right: 0;
|
372 |
+
left: 0;
|
373 |
+
z-index: 20;
|
374 |
+
background: #f1f1f1;
|
375 |
+
display: block;
|
376 |
+
-webkit-transition: all 0.2s;
|
377 |
+
transition: all 0.2s;
|
378 |
+
visibility: hidden;
|
379 |
+
}
|
380 |
+
.czr-close-editor {
|
381 |
+
position: absolute;
|
382 |
+
cursor: pointer;
|
383 |
+
right: 20px;
|
384 |
+
top: -33px;
|
385 |
+
color: #444;
|
386 |
+
background: #eee;
|
387 |
+
font-size: 13px;
|
388 |
+
line-height: 19px;
|
389 |
+
height: 20px;
|
390 |
+
margin: 5px 0 0 5px;
|
391 |
+
padding: 3px 8px 4px;
|
392 |
+
border: 1px solid #e5e5e5;
|
393 |
+
border-bottom: none;
|
394 |
+
}
|
395 |
+
body.czr-customize-content_editor-pane-resize #customize-preview,
|
396 |
+
body.czr-customize-content_editor-pane-resize #czr-customize-content_editor-pane {
|
397 |
+
-webkit-transition: none;
|
398 |
+
transition: none;
|
399 |
+
}
|
400 |
+
body.mce-fullscreen.czr-customize-content_editor-pane-open #czr-customize-content_editor-pane {
|
401 |
+
top: 0;
|
402 |
+
}
|
403 |
+
body.czr-customize-content_editor-pane-open #czr-customize-content_editor-pane {
|
404 |
+
bottom: 40px;
|
405 |
+
visibility: inherit;
|
406 |
+
}
|
407 |
+
#czr-customize-content_editor-pane .wp-editor-tools {
|
408 |
+
padding-top: 5px;
|
409 |
+
padding-right: 10px;
|
410 |
+
}
|
411 |
+
#czr-customize-content_editor-pane .wp-media-buttons {
|
412 |
+
padding-left: 5px;
|
413 |
+
}
|
414 |
+
#customize-preview {
|
415 |
+
height: auto;
|
416 |
+
}
|
417 |
+
body.czr-customize-content_editor-pane-open #customize-preview {
|
418 |
+
bottom: 300px;
|
419 |
+
}
|
420 |
+
body.mce-fullscreen #customize-preview {
|
421 |
+
bottom: 0;
|
422 |
+
}
|
423 |
+
body.mce-fullscreen.czr-customize-content_editor-pane-open div.mce-fullscreen {
|
424 |
+
position: relative;
|
425 |
+
left: 0;
|
426 |
+
}
|
427 |
+
#wp-czr-customize-content_editor-container {
|
428 |
+
border-left: 0;
|
429 |
+
}
|
430 |
+
/* vertical resize bar */
|
431 |
+
#czr-customize-content_editor-dragbar {
|
432 |
+
top: 0;
|
433 |
+
cursor: row-resize;
|
434 |
+
display: block;
|
435 |
+
height: 4px;
|
436 |
+
position: absolute;
|
437 |
+
width: 100%;
|
438 |
+
z-index: 21;
|
439 |
+
/* the following makes sure that the icon .czr-resize-handle is centered */
|
440 |
+
display: -webkit-box;
|
441 |
+
display: -ms-flexbox;
|
442 |
+
display: flex;
|
443 |
+
-webkit-box-align: center;
|
444 |
+
-ms-flex-align: center;
|
445 |
+
align-items: center;
|
446 |
+
-webkit-box-pack: center;
|
447 |
+
-ms-flex-pack: center;
|
448 |
+
justify-content: center;
|
449 |
+
}
|
450 |
+
body.czr-customize-content_editor-pane-resize #customize-preview:before {
|
451 |
+
top: 0;
|
452 |
+
right: 0;
|
453 |
+
bottom: 0;
|
454 |
+
left: 0;
|
455 |
+
position: absolute;
|
456 |
+
height: 100%;
|
457 |
+
width: 100%;
|
458 |
+
z-index: 999999;
|
459 |
+
}
|
460 |
+
/* @todo Mobile support for rich text editor */
|
461 |
+
.wp-customizer .ui-autocomplete.wplink-autocomplete {
|
462 |
+
z-index: 500110; /* originally 100110, but z-index of .wp-full-overlay is 500000 */
|
463 |
+
}
|
464 |
+
.wp-customizer #wp-link-wrap {
|
465 |
+
z-index: 500105; /* originally 100105, but z-index of .wp-full-overlay is 500000 */
|
466 |
+
}
|
467 |
+
.wp-customizer #wp_editbtns,
|
468 |
+
.wp-customizer #wp_gallerybtns {
|
469 |
+
z-index: 500020; /* originally 100020, but z-index of .wp-full-overlay is 500000 */
|
470 |
+
}
|
471 |
+
.wp-customizer #TB_overlay,
|
472 |
+
.wp-customizer #TB_window {
|
473 |
+
z-index: 500050;
|
474 |
+
}
|
475 |
+
.wp-customizer .mce-panel,
|
476 |
+
.wp-customizer .mce-tooltip {
|
477 |
+
z-index: 500100 !important; /* originally 100100, but z-index of .wp-full-overlay is 500000 */
|
478 |
+
}
|
479 |
+
.czr-customize-content_editor-pane-open .wp-full-overlay.collapsed .wp-full-overlay-sidebar {
|
480 |
+
z-index: 30;
|
481 |
+
}
|
482 |
+
.czr-customize-content_editor-pane-open .wp-full-overlay.collapsed .collapse-sidebar {
|
483 |
+
bottom: 308px;
|
484 |
+
}
|
485 |
+
.czr-customize-content_editor-pane-open .wp-full-overlay.expanded .collapse-sidebar {
|
486 |
+
bottom: 0 !important;
|
487 |
+
}
|
488 |
+
.czr-customize-content_editor-pane-resize .wp-full-overlay.collapsed .collapse-sidebar {
|
489 |
+
-webkit-transition: none;
|
490 |
+
transition: none;
|
491 |
+
}
|
492 |
+
.czr-customize-content_editor-pane-open.mce-fullscreen .wp-full-overlay.collapsed .collapse-sidebar {
|
493 |
+
bottom: 8px !important;
|
494 |
+
}
|
495 |
+
.czr-resize-handle {
|
496 |
+
color: #33b3db;
|
497 |
+
font-size: 12px;
|
498 |
+
position: relative;
|
499 |
+
bottom: 2px;
|
500 |
+
}
|
501 |
+
|
502 |
+
|
503 |
+
/* CONTENT PICKER */
|
504 |
+
.czr-sub-set[data-input-type="content_picker"] .customize-control-title {
|
505 |
+
width: 100%;
|
506 |
+
}
|
507 |
+
.czr-sub-set[data-input-type="content_picker"] .czr-input {
|
508 |
+
width: 100%;
|
509 |
+
}
|
510 |
+
.content-picker-item {
|
511 |
+
height: 2em;
|
512 |
+
}
|
513 |
+
.content-picker-item .czr-picker-item-type {
|
514 |
+
float: right;
|
515 |
+
display: inline-block;
|
516 |
+
}
|
517 |
+
.content-item-bar {
|
518 |
+
line-height: 1.2em;
|
519 |
+
font-size: 0.9em;
|
520 |
+
}
|
521 |
+
.content-item-bar .czr-picker-item-title {
|
522 |
+
display: block;
|
523 |
+
float: left;
|
524 |
+
max-width: 80%;
|
525 |
+
text-overflow: ellipsis;
|
526 |
+
overflow: hidden;
|
527 |
+
font-size: 13px;
|
528 |
+
line-height: 1.3em;
|
529 |
+
}
|
530 |
+
|
531 |
+
.czr-sub-set[data-input-type="content_picker"] span.czr-picker-item-title {
|
532 |
+
display: block;
|
533 |
+
float: left;
|
534 |
+
max-width: 80%;
|
535 |
+
text-overflow: ellipsis;
|
536 |
+
overflow: hidden;
|
537 |
+
font-size: 14px;
|
538 |
+
line-height: 2em;
|
539 |
+
color: #000;
|
540 |
+
}
|
541 |
+
|
542 |
+
.czr-sub-set[data-input-type="content_picker"] span.czr-picker-item-type {
|
543 |
+
display: inline-block;
|
544 |
+
padding: 0;
|
545 |
+
padding-right: 10px;
|
546 |
+
float: right;
|
547 |
+
line-height: 2em;
|
548 |
+
}
|
549 |
+
|
550 |
+
|
551 |
+
|
552 |
+
|
553 |
+
|
554 |
+
|
555 |
+
|
556 |
+
|
557 |
+
|
558 |
+
|
559 |
+
|
560 |
+
|
561 |
+
|
562 |
+
/* RANGE SLIDER rangeslider.js - v2.3.0 - https://github.com/andreruffert/rangeslider.js */
|
563 |
+
.czr-sub-set[data-input-type="range_slider"] {
|
564 |
+
padding: 20px 0;
|
565 |
+
}
|
566 |
+
.rangeslider,
|
567 |
+
.rangeslider__fill {
|
568 |
+
display: block;
|
569 |
+
-moz-box-shadow: inset 0px 1px 3px rgba(0, 0, 0, 0.3);
|
570 |
+
-webkit-box-shadow: inset 0px 1px 3px rgba(0, 0, 0, 0.3);
|
571 |
+
box-shadow: inset 0px 1px 3px rgba(0, 0, 0, 0.3);
|
572 |
+
-moz-border-radius: 10px;
|
573 |
+
-webkit-border-radius: 10px;
|
574 |
+
border-radius: 10px;
|
575 |
+
}
|
576 |
+
|
577 |
+
.rangeslider {
|
578 |
+
background: #e6e6e6;
|
579 |
+
position: relative;
|
580 |
+
}
|
581 |
+
|
582 |
+
.rangeslider--horizontal {
|
583 |
+
height: 12px;
|
584 |
+
width: 100%;
|
585 |
+
}
|
586 |
+
|
587 |
+
.rangeslider--vertical {
|
588 |
+
width: 12px;
|
589 |
+
min-height: 150px;
|
590 |
+
max-height: 100%;
|
591 |
+
}
|
592 |
+
|
593 |
+
.rangeslider--disabled {
|
594 |
+
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=40);
|
595 |
+
opacity: 0.4;
|
596 |
+
}
|
597 |
+
|
598 |
+
.rangeslider__fill {
|
599 |
+
background: #3b8dbd;
|
600 |
+
position: absolute;
|
601 |
+
}
|
602 |
+
.rangeslider--horizontal .rangeslider__fill {
|
603 |
+
top: 0;
|
604 |
+
height: 100%;
|
605 |
+
}
|
606 |
+
.rangeslider--vertical .rangeslider__fill {
|
607 |
+
bottom: 0;
|
608 |
+
width: 100%;
|
609 |
+
}
|
610 |
+
|
611 |
+
.rangeslider__handle {
|
612 |
+
background: white;
|
613 |
+
border: 1px solid #ccc;
|
614 |
+
cursor: pointer;
|
615 |
+
display: inline-block;
|
616 |
+
width: 34px;
|
617 |
+
height: 34px;
|
618 |
+
position: absolute;
|
619 |
+
background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIgc3RvcC1vcGFjaXR5PSIwLjAiLz48c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiMwMDAwMDAiIHN0b3Atb3BhY2l0eT0iMC4xIi8+PC9saW5lYXJHcmFkaWVudD48L2RlZnM+PHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0idXJsKCNncmFkKSIgLz48L3N2Zz4g');
|
620 |
+
background-size: 100%;
|
621 |
+
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, rgba(255, 255, 255, 0)), color-stop(100%, rgba(0, 0, 0, 0.1)));
|
622 |
+
background-image: -moz-linear-gradient(rgba(255, 255, 255, 0), rgba(0, 0, 0, 0.1));
|
623 |
+
background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0), rgba(0, 0, 0, 0.1));
|
624 |
+
background-image: linear-gradient(rgba(255, 255, 255, 0), rgba(0, 0, 0, 0.1));
|
625 |
+
-moz-box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
|
626 |
+
-webkit-box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
|
627 |
+
box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
|
628 |
+
-moz-border-radius: 50%;
|
629 |
+
-webkit-border-radius: 50%;
|
630 |
+
border-radius: 50%;
|
631 |
+
line-height: 35px;
|
632 |
+
text-align: center;
|
633 |
+
color: #000000;
|
634 |
+
font-size: 13px;
|
635 |
+
}
|
636 |
+
|
637 |
+
.rangeslider__handle:after {
|
638 |
+
content: "";
|
639 |
+
display: block;
|
640 |
+
width: 18px;
|
641 |
+
height: 18px;
|
642 |
+
margin: auto;
|
643 |
+
position: absolute;
|
644 |
+
top: 0;
|
645 |
+
right: 0;
|
646 |
+
bottom: 0;
|
647 |
+
left: 0;
|
648 |
+
background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzAwMDAwMCIgc3RvcC1vcGFjaXR5PSIwLjEzIi8+PHN0b3Agb2Zmc2V0PSIxMDAlIiBzdG9wLWNvbG9yPSIjZmZmZmZmIiBzdG9wLW9wYWNpdHk9IjAuMCIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');
|
649 |
+
background-size: 100%;
|
650 |
+
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, rgba(0, 0, 0, 0.13)), color-stop(100%, rgba(255, 255, 255, 0)));
|
651 |
+
background-image: -moz-linear-gradient(rgba(0, 0, 0, 0.13), rgba(255, 255, 255, 0));
|
652 |
+
background-image: -webkit-linear-gradient(rgba(0, 0, 0, 0.13), rgba(255, 255, 255, 0));
|
653 |
+
background-image: linear-gradient(rgba(0, 0, 0, 0.13), rgba(255, 255, 255, 0));
|
654 |
+
-moz-border-radius: 50%;
|
655 |
+
-webkit-border-radius: 50%;
|
656 |
+
border-radius: 50%;
|
657 |
+
}
|
658 |
+
.rangeslider__handle:active, .rangeslider--active .rangeslider__handle {
|
659 |
+
background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzAwMDAwMCIgc3RvcC1vcGFjaXR5PSIwLjEiLz48c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiMwMDAwMDAiIHN0b3Atb3BhY2l0eT0iMC4xMiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');
|
660 |
+
background-size: 100%;
|
661 |
+
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, rgba(0, 0, 0, 0.1)), color-stop(100%, rgba(0, 0, 0, 0.12)));
|
662 |
+
background-image: -moz-linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.12));
|
663 |
+
background-image: -webkit-linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.12));
|
664 |
+
background-image: linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.12));
|
665 |
+
}
|
666 |
+
.rangeslider--horizontal .rangeslider__handle {
|
667 |
+
top: -13px;
|
668 |
+
touch-action: pan-y;
|
669 |
+
-ms-touch-action: pan-y;
|
670 |
+
}
|
671 |
+
.rangeslider--vertical .rangeslider__handle {
|
672 |
+
left: -13px;
|
673 |
+
touch-action: pan-x;
|
674 |
+
-ms-touch-action: pan-x;
|
675 |
+
}
|
676 |
+
|
677 |
+
input[type="range"]:focus + .rangeslider .rangeslider__handle {
|
678 |
+
-moz-box-shadow: 0 0 8px rgba(255, 0, 255, 0.9);
|
679 |
+
-webkit-box-shadow: 0 0 8px rgba(255, 0, 255, 0.9);
|
680 |
+
box-shadow: 0 0 8px rgba(255, 0, 255, 0.9);
|
681 |
+
}
|
682 |
+
|
683 |
+
|
684 |
+
/* IMAGE UPLOADER */
|
685 |
+
.attachment-media-view button {
|
686 |
+
color: #000;
|
687 |
+
padding: 5px 7px;
|
688 |
+
line-height: 1.5em;
|
689 |
+
}
|
690 |
+
|
691 |
+
|
692 |
+
|
693 |
+
|
694 |
+
/* NIMBLECHECK */
|
695 |
+
/* ALIGNEMENT IN MODULES */
|
696 |
+
.czr-sub-set[data-input-type="nimblecheck"] {
|
697 |
+
display: -webkit-box;
|
698 |
+
display: -ms-flexbox;
|
699 |
+
display: flex;
|
700 |
+
-webkit-box-align: center;
|
701 |
+
-ms-flex-align: center;
|
702 |
+
align-items: center;
|
703 |
+
/* flex-direction: column; */
|
704 |
+
-webkit-box-flex: 0;
|
705 |
+
-ms-flex: 0 0 100%;
|
706 |
+
flex: 0 0 100%;
|
707 |
+
-ms-flex-wrap: wrap;
|
708 |
+
flex-wrap: wrap;
|
709 |
+
max-width: 100%;
|
710 |
+
}
|
711 |
+
.czr-sub-set[data-input-type="nimblecheck"] .czr-notice, .czr-sub-set[data-input-type="nimblecheck"] .czr-html-before {
|
712 |
+
-ms-flex-preferred-size: 100%;
|
713 |
+
flex-basis: 100%;
|
714 |
+
-ms-flex-negative: 0;
|
715 |
+
flex-shrink: 0;
|
716 |
+
flex: 0 0 100%;
|
717 |
+
}
|
718 |
+
/* ALIGNEMENT IN REGULAR CONTROLS */
|
719 |
+
.czr-control-nimblecheck {
|
720 |
+
display: -webkit-box;
|
721 |
+
display: -ms-flexbox;
|
722 |
+
display: flex;
|
723 |
+
-webkit-box-align: center;
|
724 |
+
-ms-flex-align: center;
|
725 |
+
align-items: center;
|
726 |
+
-webkit-justify-content: space-between;
|
727 |
+
justify-content: space-between;
|
728 |
+
/* flex-direction: column; */
|
729 |
+
-webkit-box-flex: 0;
|
730 |
+
-ms-flex: 0 0 100%;
|
731 |
+
flex: 0 0 100%;
|
732 |
+
-ms-flex-wrap: wrap;
|
733 |
+
flex-wrap: wrap;
|
734 |
+
max-width: 100%;
|
735 |
+
}
|
736 |
+
|
737 |
+
|
738 |
+
/* COMMON RULES TO MODULES AND CONTROLS */
|
739 |
+
.nimblecheck-wrap {
|
740 |
+
position: relative;
|
741 |
+
display: inline-block;
|
742 |
+
float: right;
|
743 |
+
}
|
744 |
+
.nimblecheck-wrap .nimblecheck-input:focus + label {
|
745 |
+
box-shadow: 0 0 0 1px #33b3db;
|
746 |
+
}
|
747 |
+
/* Hide the checkbox input (only needed for `:checked` property) */
|
748 |
+
.nimblecheck-wrap .nimblecheck-input {
|
749 |
+
/* display: none; <= May 2021 : display none breaks accessibility*/
|
750 |
+
opacity: 0;
|
751 |
+
position: absolute;
|
752 |
+
top: 0;
|
753 |
+
left: 0;
|
754 |
+
}
|
755 |
+
/* Switch */
|
756 |
+
.nimblecheck-wrap .nimblecheck-label {
|
757 |
+
display: block;
|
758 |
+
width: 35px;
|
759 |
+
height: 20px;
|
760 |
+
text-indent: -150%;
|
761 |
+
clip: rect(0 0 0 0);
|
762 |
+
color: transparent;
|
763 |
+
-webkit-user-select: none;
|
764 |
+
-moz-user-select: none;
|
765 |
+
-ms-user-select: none;
|
766 |
+
user-select: none;
|
767 |
+
/* Switch Rail & Knob */
|
768 |
+
/* Switch Rail */
|
769 |
+
/* Switch Knob */
|
770 |
+
}
|
771 |
+
.nimblecheck-wrap .nimblecheck-label:before,
|
772 |
+
.nimblecheck-wrap .nimblecheck-label:after {
|
773 |
+
content: "";
|
774 |
+
display: block;
|
775 |
+
position: absolute;
|
776 |
+
cursor: pointer;
|
777 |
+
}
|
778 |
+
.nimblecheck-wrap .nimblecheck-label:before {
|
779 |
+
width: 100%;
|
780 |
+
height: 100%;
|
781 |
+
background-color: #999;
|
782 |
+
border-radius: 9999em;
|
783 |
+
-webkit-transition: background-color 0.35s ease;
|
784 |
+
-o-transition: background-color 0.35s ease;
|
785 |
+
transition: background-color 0.35s ease;
|
786 |
+
}
|
787 |
+
.nimblecheck-wrap .nimblecheck-label:after {
|
788 |
+
top: 1px;
|
789 |
+
left: 1px;
|
790 |
+
width: 18px;
|
791 |
+
height: 18px;
|
792 |
+
border-radius: 50%;
|
793 |
+
background-color: #fff;
|
794 |
+
-webkit-box-shadow: 0 0 2px rgba(0, 0, 0, 0.45);
|
795 |
+
box-shadow: 0 0 2px rgba(0, 0, 0, 0.45);
|
796 |
+
-webkit-transition: left 0.15s ease;
|
797 |
+
-o-transition: left 0.15s ease;
|
798 |
+
transition: left 0.15s ease;
|
799 |
+
}
|
800 |
+
/* When input is checked */
|
801 |
+
.nimblecheck-wrap .nimblecheck-input:checked + .nimblecheck-label {
|
802 |
+
/* Switch Rail */
|
803 |
+
/* Switch Knob */
|
804 |
+
}
|
805 |
+
.nimblecheck-wrap .nimblecheck-input:checked + .nimblecheck-label:before {
|
806 |
+
background-color: #33b3db;
|
807 |
+
}
|
808 |
+
.nimblecheck-wrap .nimblecheck-input:checked + .nimblecheck-label:after {
|
809 |
+
left: 16px
|
810 |
+
}
|
811 |
+
|
812 |
+
|
813 |
+
|
814 |
+
|
815 |
+
|
816 |
+
/* DEPRECATED since april 2nd 2019 */
|
817 |
+
/* GUTENCHECK */
|
818 |
+
/* This custom checkbox input is inspired from the one used in the Gutenberg plugin ( https://github.com/WordPress/gutenberg ), released under GNU General Public License
|
819 |
+
credits : Gutenberg team @wordpress */
|
820 |
+
/*.czr-toggle-check {
|
821 |
+
position: relative;
|
822 |
+
float: right;
|
823 |
+
}
|
824 |
+
.czr-toggle-check__input[type=checkbox] {
|
825 |
+
cursor: pointer;
|
826 |
+
position: absolute;
|
827 |
+
top: 0;
|
828 |
+
left: 0;
|
829 |
+
width: 100%;
|
830 |
+
height: 100%;
|
831 |
+
opacity: 0;
|
832 |
+
margin: 0;
|
833 |
+
padding: 0;
|
834 |
+
z-index: 1;
|
835 |
+
}
|
836 |
+
.czr-toggle-check__input[type="checkbox"]:checked:before {
|
837 |
+
content: "\f147";
|
838 |
+
margin: -3px 0 0 -4px;
|
839 |
+
color: #1e8cbe;
|
840 |
+
float: left;
|
841 |
+
display: inline-block;
|
842 |
+
vertical-align: middle;
|
843 |
+
width: 16px;
|
844 |
+
font: normal 21px/1 dashicons;
|
845 |
+
speak: none;
|
846 |
+
-webkit-font-smoothing: antialiased;
|
847 |
+
-moz-osx-font-smoothing: grayscale;
|
848 |
+
}
|
849 |
+
|
850 |
+
.czr-toggle-check .czr-toggle-check__track {
|
851 |
+
content: "";
|
852 |
+
display: inline-block;
|
853 |
+
vertical-align: top;
|
854 |
+
box-sizing: border-box;
|
855 |
+
background-color: #fff;
|
856 |
+
border: 2px solid #6c7781;
|
857 |
+
width: 36px;
|
858 |
+
height: 18px;
|
859 |
+
border-radius: 9px;
|
860 |
+
transition: background .2s ease;
|
861 |
+
}
|
862 |
+
.czr-toggle-check.is-checked .czr-toggle-check__track {
|
863 |
+
background-color: #33b3db;
|
864 |
+
border: 2px solid #33b3db;
|
865 |
+
border: 9px solid transparent;
|
866 |
+
}
|
867 |
+
.czr-toggle-check .czr-toggle-check__thumb {
|
868 |
+
display: block;
|
869 |
+
position: absolute;
|
870 |
+
top: 4px;
|
871 |
+
left: 4px;
|
872 |
+
width: 10px;
|
873 |
+
height: 10px;
|
874 |
+
border-radius: 50%;
|
875 |
+
transition: transform .1s ease;
|
876 |
+
background-color: #6c7781;
|
877 |
+
border: 5px solid #6c7781;
|
878 |
+
box-sizing: border-box;
|
879 |
+
}
|
880 |
+
.czr-toggle-check.is-checked .czr-toggle-check__thumb {
|
881 |
+
background-color: #fff;
|
882 |
+
border-width: 0;
|
883 |
+
transform: translateX(18px);
|
884 |
+
}
|
885 |
+
.czr-toggle-check .czr-toggle-check__off {
|
886 |
+
color: #6c7781;
|
887 |
+
fill: currentColor;
|
888 |
+
right: 6px;
|
889 |
+
}
|
890 |
+
.czr-toggle-check .czr-toggle-check__on {
|
891 |
+
left: 8px;
|
892 |
+
-webkit-filter: invert(100%) contrast(500%);
|
893 |
+
filter: invert(100%) contrast(500%);
|
894 |
+
outline: 1px solid transparent;
|
895 |
+
outline-offset: -1px;
|
896 |
+
}
|
897 |
+
.czr-toggle-check .czr-toggle-check__off, .czr-toggle-check .czr-toggle-check__on {
|
898 |
+
position: absolute;
|
899 |
+
top: 6px;
|
900 |
+
}*/
|
assets/czr/fmk/css/parts/czr-control-modules.css
ADDED
@@ -0,0 +1,863 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*******************************************************************
|
2 |
+
* DYNAMIC CONTROLS : sidebars, socials, ...
|
3 |
+
********************************************************************/
|
4 |
+
li.customize-control[data-module] li {
|
5 |
+
margin-bottom: 0;
|
6 |
+
font-size: 0.85em;
|
7 |
+
}
|
8 |
+
li.customize-control[data-module] [class*="czr-"] {
|
9 |
+
font-size: 0.9rem;
|
10 |
+
}
|
11 |
+
li.customize-control[data-module] [class*="czr-"] .hidden {
|
12 |
+
display: none;
|
13 |
+
}
|
14 |
+
li.customize-control[data-module] .czr-notice {
|
15 |
+
font-size: 12px!important;
|
16 |
+
}
|
17 |
+
.czr-open-pre-add-new {
|
18 |
+
display: block;
|
19 |
+
float: left;
|
20 |
+
margin: 2% 2% 0%;
|
21 |
+
width: 98%;
|
22 |
+
padding: 2%;
|
23 |
+
background: #fff;
|
24 |
+
/* color: #fff;*/
|
25 |
+
color: inherit;
|
26 |
+
opacity: 1;
|
27 |
+
font-size: 16px;
|
28 |
+
cursor: pointer;
|
29 |
+
border-width: 1px;
|
30 |
+
border-style: solid;
|
31 |
+
-webkit-appearance: none;
|
32 |
+
-webkit-border-radius: 3px;
|
33 |
+
border-radius: 3px;
|
34 |
+
white-space: nowrap;
|
35 |
+
-webkit-box-sizing: border-box;
|
36 |
+
-moz-box-sizing: border-box;
|
37 |
+
box-sizing: border-box;
|
38 |
+
-webkit-transition: opacity 1s ease-in-out;
|
39 |
+
-moz-transition: opacity 1s ease-in-out;
|
40 |
+
-ms-transition: opacity 1s ease-in-out;
|
41 |
+
-o-transition: opacity 1s ease-in-out;
|
42 |
+
transition: opacity 1s ease-in-out;
|
43 |
+
}
|
44 |
+
|
45 |
+
.czr-open-pre-add-new.active {
|
46 |
+
background: #646464;
|
47 |
+
color: black;
|
48 |
+
opacity: 0.8;
|
49 |
+
border-radius: 3px 3px 0 0;
|
50 |
+
}
|
51 |
+
|
52 |
+
.czr-single-item {
|
53 |
+
padding: 0%;
|
54 |
+
/*border: 1px solid #ccc;*/
|
55 |
+
margin: 1% 0 0 2%;
|
56 |
+
float: left;
|
57 |
+
width: 98%;
|
58 |
+
-webkit-border-radius: 3px;
|
59 |
+
border-radius: 3px;
|
60 |
+
-webkit-transition: opacity 1s ease-in-out;
|
61 |
+
-moz-transition: opacity 1s ease-in-out;
|
62 |
+
-ms-transition: opacity 1s ease-in-out;
|
63 |
+
-o-transition: opacity 1s ease-in-out;
|
64 |
+
transition: opacity 1s ease-in-out;
|
65 |
+
}
|
66 |
+
/* Display a thin outline around opened item, for multi-items modules */
|
67 |
+
#customize-theme-controls .czr-single-item.open {
|
68 |
+
/*border: 1px solid #dedede;*/
|
69 |
+
outline: 1px solid #22a0d2;
|
70 |
+
}
|
71 |
+
/* Keep the normal border for single module, mono items controls */
|
72 |
+
#customize-theme-controls .mono-item-mod .czr-single-item {
|
73 |
+
outline: none;
|
74 |
+
}
|
75 |
+
|
76 |
+
.czr-single-item .czr-item-header, .czr-single-item .czr-item-content {
|
77 |
+
padding: 1%;
|
78 |
+
background: none;
|
79 |
+
}
|
80 |
+
|
81 |
+
.czr-items-wrapper .czr-single-item .czr-builtin-model {
|
82 |
+
background: #E1DFDF;
|
83 |
+
color: #555
|
84 |
+
}
|
85 |
+
|
86 |
+
.czr-items-wrapper .inactive {
|
87 |
+
opacity: 0.6;
|
88 |
+
}
|
89 |
+
|
90 |
+
.czr-item-sort-handle {
|
91 |
+
cursor: move;
|
92 |
+
}
|
93 |
+
|
94 |
+
.czr-single-item .czr-item-header {
|
95 |
+
position: relative;
|
96 |
+
background: #ededed;
|
97 |
+
color: white;
|
98 |
+
float: left;
|
99 |
+
width: 98%;
|
100 |
+
-webkit-transition: background .1s ease-in-out;
|
101 |
+
-moz-transition: background .1s ease-in-out;
|
102 |
+
-ms-transition: background .1s ease-in-out;
|
103 |
+
-o-transition: background .1s ease-in-out;
|
104 |
+
transition: background .1s ease-in-out;
|
105 |
+
}
|
106 |
+
|
107 |
+
|
108 |
+
/* sidebar specifics */
|
109 |
+
.czr_widget_areas_module .czr-single-item .czr-custom-model {
|
110 |
+
background: #3b8dbd;
|
111 |
+
}
|
112 |
+
. .czr-single-item .czr-custom-model:hover {
|
113 |
+
background: #aaa;
|
114 |
+
}
|
115 |
+
.czr-single-item .czr-item-header:hover {
|
116 |
+
background: #ccc;
|
117 |
+
}
|
118 |
+
|
119 |
+
/* sidebar specifics */
|
120 |
+
/*.czr-builtin-model .czr-single-item .czr-item-header {
|
121 |
+
background:#3b8dbd;
|
122 |
+
}*/
|
123 |
+
.czr-items-wrapper .czr-single-item .czr-builtin-model:hover {
|
124 |
+
background: #ccc;
|
125 |
+
}
|
126 |
+
|
127 |
+
.czr-move-icon {
|
128 |
+
position: absolute;
|
129 |
+
top: -2px;
|
130 |
+
left: 3px;
|
131 |
+
font-size: 10px;
|
132 |
+
color: #999;
|
133 |
+
}
|
134 |
+
.czr-item-title {
|
135 |
+
float: left;
|
136 |
+
font-size: 17px;
|
137 |
+
color: #000;
|
138 |
+
padding: 4px;
|
139 |
+
width: 67%;
|
140 |
+
}
|
141 |
+
|
142 |
+
.czr-inactive-alert {
|
143 |
+
font-size: 12px;
|
144 |
+
font-style: italic;
|
145 |
+
}
|
146 |
+
/* sidebar specifics */
|
147 |
+
.czr_widget_areas_module .czr-item-title {
|
148 |
+
color: #fff;
|
149 |
+
}
|
150 |
+
|
151 |
+
|
152 |
+
.czr-builtin-model .czr-item-title {
|
153 |
+
color: #23282d;
|
154 |
+
}
|
155 |
+
.czr-item-title h4 {
|
156 |
+
margin: 0;
|
157 |
+
}
|
158 |
+
.czr-item-title .fab::before,
|
159 |
+
.czr-item-title .fas::before,
|
160 |
+
.czr-item-title .far::before {
|
161 |
+
padding-right: 2px;
|
162 |
+
}
|
163 |
+
.czr-item-btns {
|
164 |
+
float: right;
|
165 |
+
}
|
166 |
+
.czr-item-btns a {
|
167 |
+
font-size: 17px;
|
168 |
+
padding: 7px 5px;
|
169 |
+
color: #9e9e9e;
|
170 |
+
-webkit-transition: color .25s ease-in-out;
|
171 |
+
-moz-transition: color .25s ease-in-out;
|
172 |
+
-ms-transition: color .25s ease-in-out;
|
173 |
+
-o-transition: color .25s ease-in-out;
|
174 |
+
transition: color .25s ease-in-ou
|
175 |
+
}
|
176 |
+
.czr-item-btns a:active, .czr-item-btns a:focus {
|
177 |
+
outline: none;
|
178 |
+
outline: 0;
|
179 |
+
-webkit-box-shadow: none;
|
180 |
+
box-shadow: none;
|
181 |
+
}
|
182 |
+
.czr-item-btns a:hover, .czr-item-btns a.active {
|
183 |
+
color: #23282d;
|
184 |
+
}
|
185 |
+
/* sidebar specifics */
|
186 |
+
.czr_widget_areas_module .czr-item-btns a {
|
187 |
+
color: #fff;
|
188 |
+
}
|
189 |
+
|
190 |
+
.czr-builtin-model .czr-item-btns a {
|
191 |
+
color: #555
|
192 |
+
}
|
193 |
+
|
194 |
+
.czr-builtin-model .czr-item-btns .czr-edit-view:hover, .czr-builtin-model .czr-item-btns .czr-edit-view.active {
|
195 |
+
color: #00a0d2;
|
196 |
+
}
|
197 |
+
|
198 |
+
.czr-item-btns .czr-edit-view:hover, .czr-item-btns .czr-edit-view.active {
|
199 |
+
color: #00a0d2;
|
200 |
+
}
|
201 |
+
|
202 |
+
/* sidebar specifics */
|
203 |
+
.czr_widget_areas_module .czr-edit-view:hover, .czr_widget_areas_module .czr-item-btns .czr-edit-view.active {
|
204 |
+
color: #000000;
|
205 |
+
}
|
206 |
+
.czr_widget_areas_module .czr-builtin-model .czr-edit-view:hover, .czr_widget_areas_module .czr-builtin-model .czr-edit-view.active {
|
207 |
+
color: #00a0d2;
|
208 |
+
}
|
209 |
+
|
210 |
+
.czr-item-btns .czr-display-alert:hover, .czr-item-btns .czr-display-alert.active {
|
211 |
+
color: #23282d;
|
212 |
+
}
|
213 |
+
|
214 |
+
|
215 |
+
.czr-single-item .czr-item-content {
|
216 |
+
float: left;
|
217 |
+
display: none;
|
218 |
+
/*background: rgba(238, 238, 238, 0.5);*/
|
219 |
+
clear: both;
|
220 |
+
width: 96%;
|
221 |
+
padding: 2%;
|
222 |
+
}
|
223 |
+
.czr-single-item .czr-item-content input {
|
224 |
+
margin-bottom: 0;
|
225 |
+
}
|
226 |
+
.czr-sub-set {
|
227 |
+
margin-bottom: 0;
|
228 |
+
display: block;
|
229 |
+
float: left;
|
230 |
+
width: 100%;
|
231 |
+
padding: 1% 0;
|
232 |
+
position: relative;
|
233 |
+
}
|
234 |
+
|
235 |
+
.czr-sub-set .czr-input {
|
236 |
+
float: right;
|
237 |
+
width: 60%;
|
238 |
+
}
|
239 |
+
|
240 |
+
.width-100 .czr-input,
|
241 |
+
.czr-sub-set .customize-control-title.width-100,
|
242 |
+
.width-100 {
|
243 |
+
width: 100%;
|
244 |
+
}
|
245 |
+
|
246 |
+
.czr-sub-set .customize-control-title {
|
247 |
+
float: left;
|
248 |
+
width: 40%;
|
249 |
+
padding: 1px 0;
|
250 |
+
font-size: 13px;
|
251 |
+
}
|
252 |
+
|
253 |
+
.customize-control-title.width-80 {
|
254 |
+
width: 80%!important;
|
255 |
+
}
|
256 |
+
.czr-input.width-20 {
|
257 |
+
width: 20%!important;
|
258 |
+
}
|
259 |
+
|
260 |
+
/* rtl */
|
261 |
+
.rtl.wp-customizer .czr-sub-set .customize-control-title {
|
262 |
+
float: right;
|
263 |
+
}
|
264 |
+
|
265 |
+
/* DISABLED STATE */
|
266 |
+
.disabled .customize-control-title, .disabled .czr-input {
|
267 |
+
opacity: 0.6;
|
268 |
+
filter: blur(1px);
|
269 |
+
-webkit-filter: blur(1px);
|
270 |
+
}
|
271 |
+
|
272 |
+
.czr-item-title .far,
|
273 |
+
.czr-item-title .fab,
|
274 |
+
.czr-item-title .fas {
|
275 |
+
font-size: 18px;
|
276 |
+
}
|
277 |
+
|
278 |
+
/* Remove alert block */
|
279 |
+
.czr-remove-alert-wrapper {
|
280 |
+
display: none;
|
281 |
+
clear: both;
|
282 |
+
float: left;
|
283 |
+
padding: 2%;
|
284 |
+
width: 95%;
|
285 |
+
margin: 10px 0;
|
286 |
+
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
|
287 |
+
background-color: #EEE;
|
288 |
+
color: #000;
|
289 |
+
-webkit-border-radius: 4px;
|
290 |
+
-moz-border-radius: 4px;
|
291 |
+
border-radius: 4px;
|
292 |
+
}
|
293 |
+
|
294 |
+
.czr-remove-alert-wrapper p {
|
295 |
+
padding: 5px;
|
296 |
+
margin: 0px;
|
297 |
+
}
|
298 |
+
|
299 |
+
/* pre add dialog */
|
300 |
+
.czr-pre-add-wrapper {
|
301 |
+
position: relative;
|
302 |
+
float: left;
|
303 |
+
width: 100%;
|
304 |
+
}
|
305 |
+
|
306 |
+
.czr-adding-new .czr-items-wrapper {
|
307 |
+
opacity: 0.6;
|
308 |
+
}
|
309 |
+
|
310 |
+
.czr-pre-add-view-content {
|
311 |
+
display: none;
|
312 |
+
padding: 3%;
|
313 |
+
border: 1px solid #ccc;
|
314 |
+
background: #fff;
|
315 |
+
border-top: none;
|
316 |
+
margin: 0 0 0 2%;
|
317 |
+
float: left;
|
318 |
+
width: 92%;
|
319 |
+
-webkit-border-radius: 0px 0px 3px 3px;
|
320 |
+
-moz-border-radius: 0px 0px 3px 3px;
|
321 |
+
border-radius: 0px 0px 3px 3px;
|
322 |
+
position: relative;
|
323 |
+
opacity: 1;
|
324 |
+
-webkit-transition: opacity .2s linear;
|
325 |
+
-moz-transition: opacity .2s linear;
|
326 |
+
-ms-transition: opacity .2s linear;
|
327 |
+
-o-transition: opacity .2s linear;
|
328 |
+
transition: opacity .2s linear;
|
329 |
+
}
|
330 |
+
|
331 |
+
.czr-model-added .czr-pre-add-view-content {
|
332 |
+
opacity: 0.2;
|
333 |
+
}
|
334 |
+
|
335 |
+
.czr-pre-add-wrapper .czr-add-new {
|
336 |
+
background: #3b8dbd;
|
337 |
+
color: #fff;
|
338 |
+
-webkit-transition: background .5s linear;
|
339 |
+
-moz-transition: background .5s linear;
|
340 |
+
-ms-transition: background .5s linear;
|
341 |
+
-o-transition: background .5s linear;
|
342 |
+
transition: background .5s linear;
|
343 |
+
float: right;
|
344 |
+
border: none;
|
345 |
+
}
|
346 |
+
|
347 |
+
.czr-add-success {
|
348 |
+
width: 100%;
|
349 |
+
margin: 0 0 0 2%;
|
350 |
+
position: absolute;
|
351 |
+
top: 0;
|
352 |
+
left: 0;
|
353 |
+
font-size: 25px;
|
354 |
+
text-align: center;
|
355 |
+
opacity: 0;
|
356 |
+
-webkit-transition: opacity .1s linear;
|
357 |
+
-moz-transition: opacity .1s linear;
|
358 |
+
-ms-transition: opacity .1s linear;
|
359 |
+
-o-transition: opacity .1s linear;
|
360 |
+
transition: opacity .1s linear;
|
361 |
+
}
|
362 |
+
.czr-model-added .czr-add-success {
|
363 |
+
opacity: 1;
|
364 |
+
}
|
365 |
+
|
366 |
+
.czr-add-success p {
|
367 |
+
vertical-align: middle;
|
368 |
+
display: inline-block;
|
369 |
+
line-height: 35px;
|
370 |
+
margin: 0;
|
371 |
+
font-size: 25px;
|
372 |
+
color: #82b965;
|
373 |
+
padding: 0 3%;
|
374 |
+
}
|
375 |
+
|
376 |
+
|
377 |
+
/* WIDGETS ZONE SPECIFICS */
|
378 |
+
.control-section-widget_zones_management {
|
379 |
+
margin: 10px 0;
|
380 |
+
z-index: 1;
|
381 |
+
}
|
382 |
+
/*#customize-theme-controls .control-section-widget_zones_management .accordion-section-content {
|
383 |
+
display: none;
|
384 |
+
left: 0;
|
385 |
+
position: relative;
|
386 |
+
}*/
|
387 |
+
|
388 |
+
.czr-zone-infos {
|
389 |
+
width: 96%;
|
390 |
+
padding: 0 2%;
|
391 |
+
font-size: 12px;
|
392 |
+
float: left;
|
393 |
+
font-style: italic;
|
394 |
+
}
|
395 |
+
|
396 |
+
/*#customize-theme-controls .control-section-widget_zones_management .accordion-section-title:after {
|
397 |
+
content: "\f078";
|
398 |
+
display: inline-block;
|
399 |
+
font: normal normal normal 14px/1 FontAwesome;
|
400 |
+
font-size: inherit;
|
401 |
+
text-rendering: auto;
|
402 |
+
-webkit-font-smoothing: antialiased;
|
403 |
+
-moz-osx-font-smoothing: grayscale;
|
404 |
+
}
|
405 |
+
|
406 |
+
#customize-theme-controls .control-section-widget_zones_management.open .accordion-section-title:after {
|
407 |
+
content: "\f077";
|
408 |
+
}*/
|
409 |
+
.czr-unavailable-location {
|
410 |
+
opacity: 0.7;
|
411 |
+
}
|
412 |
+
.czr-location-alert {
|
413 |
+
float: left;
|
414 |
+
width: 100%;
|
415 |
+
padding: 1% 0;
|
416 |
+
margin: 1% 0;
|
417 |
+
text-align: center;
|
418 |
+
border: 1px solid orange;
|
419 |
+
background: #FEE5B6;
|
420 |
+
color: #000;
|
421 |
+
font-size: 11px;
|
422 |
+
font-style: italic;
|
423 |
+
}
|
424 |
+
|
425 |
+
|
426 |
+
|
427 |
+
|
428 |
+
|
429 |
+
|
430 |
+
|
431 |
+
|
432 |
+
|
433 |
+
|
434 |
+
|
435 |
+
|
436 |
+
|
437 |
+
|
438 |
+
/* MODULE OPTIONS ICON AND PANEL*/
|
439 |
+
.czr-toggle-modopt {
|
440 |
+
color: #495050;
|
441 |
+
text-shadow: 1px 1px 0px white;
|
442 |
+
-webkit-transition: color 0.4s;
|
443 |
+
transition: color 0.4s;
|
444 |
+
position: absolute;
|
445 |
+
right: 0;
|
446 |
+
padding-left: 3px;
|
447 |
+
font-size: 25px;
|
448 |
+
line-height: 24px;
|
449 |
+
}
|
450 |
+
/* rtl */
|
451 |
+
.rtl.wp-customizer .czr-toggle-modopt {
|
452 |
+
left: 0;
|
453 |
+
right: auto;
|
454 |
+
padding-left: 0;
|
455 |
+
padding-right: 3px;
|
456 |
+
}
|
457 |
+
.czr-modopt-visible .czr-toggle-modopt, .czr-toggle-modopt:hover {
|
458 |
+
color: #3b8dbd;
|
459 |
+
}
|
460 |
+
|
461 |
+
body.czr-editing-modopt #customize-preview {
|
462 |
+
opacity: 0.7;
|
463 |
+
}
|
464 |
+
body #customize-controls {
|
465 |
+
-webkit-transition: opacity .4s ease-in-out;
|
466 |
+
-moz-transition: opacity .4s ease-in-out;
|
467 |
+
-ms-transition: opacity .4s ease-in-out;
|
468 |
+
-o-transition: opacity .4s ease-in-out;
|
469 |
+
transition: opacity .4s ease-in-out;
|
470 |
+
}
|
471 |
+
body.czr-editing-modopt #customize-controls {
|
472 |
+
opacity: 0.4;
|
473 |
+
}
|
474 |
+
.czr-mod-opt-wrapper {
|
475 |
+
position: absolute;
|
476 |
+
top: 0;
|
477 |
+
bottom: 0;
|
478 |
+
left: -301px;
|
479 |
+
/*visibility: hidden;*/
|
480 |
+
opacity: 0;
|
481 |
+
overflow-x: hidden;
|
482 |
+
overflow-y: auto;
|
483 |
+
margin: 0;
|
484 |
+
z-index: 999999;/* has to be greater than the Nimble top bar so we can click on the close "x" */
|
485 |
+
width: 60%;
|
486 |
+
min-width: 300px;
|
487 |
+
padding: 1% 2%;
|
488 |
+
color: #fff;
|
489 |
+
background: rgba(0, 0, 0, 0.8);
|
490 |
+
-webkit-transition: all .18s ease-in-out;
|
491 |
+
-moz-transition: all .18s ease-in-out;
|
492 |
+
-ms-transition: all .18s ease-in-out;
|
493 |
+
-o-transition: all .18s ease-in-out;
|
494 |
+
transition: all .18s ease-in-out;
|
495 |
+
border-right: 1px solid #4c4c4c;
|
496 |
+
}
|
497 |
+
|
498 |
+
body.czr-editing-modopt .czr-mod-opt-wrapper {
|
499 |
+
left: 0;
|
500 |
+
visibility: visible;
|
501 |
+
opacity: 1;
|
502 |
+
}
|
503 |
+
.czr-close-modopt {
|
504 |
+
position: absolute;
|
505 |
+
top: 10px;
|
506 |
+
right: 25px;
|
507 |
+
font-size: 31px;
|
508 |
+
cursor: pointer;
|
509 |
+
}
|
510 |
+
|
511 |
+
|
512 |
+
|
513 |
+
/* OPTIONS STYLE */
|
514 |
+
body .czr-mod-opt-wrapper .czr-sub-set {
|
515 |
+
/*border: 1px dotted #ccc;*/
|
516 |
+
background: rgba(238, 238, 238, 0.13);
|
517 |
+
padding: 3% 2%;
|
518 |
+
width: 96%;
|
519 |
+
margin: 5px 0;
|
520 |
+
}
|
521 |
+
.czr-mod-opt-wrapper .czr-notice {
|
522 |
+
color: #fff;
|
523 |
+
}
|
524 |
+
|
525 |
+
.czr-mod-opt-wrapper .mod-opt-title {
|
526 |
+
color: #fff;
|
527 |
+
border-bottom: 1px solid #fff;
|
528 |
+
padding: 5% 0;
|
529 |
+
text-align: center;
|
530 |
+
}
|
531 |
+
|
532 |
+
|
533 |
+
|
534 |
+
/**************************************
|
535 |
+
/* MODULE OPTIONS : TABS NAVIGATION */
|
536 |
+
/*************************************/
|
537 |
+
.tabs {
|
538 |
+
position: relative;
|
539 |
+
display: none;
|
540 |
+
overflow: hidden;
|
541 |
+
margin: 0 auto;
|
542 |
+
width: 100%;
|
543 |
+
font-weight: 300;
|
544 |
+
font-size: 1.25em;
|
545 |
+
}
|
546 |
+
|
547 |
+
/* Nav */
|
548 |
+
.tabs nav {
|
549 |
+
text-align: center;
|
550 |
+
}
|
551 |
+
|
552 |
+
.tabs nav ul {
|
553 |
+
position: relative;
|
554 |
+
overflow: hidden;
|
555 |
+
display: -ms-flexbox;
|
556 |
+
display: -webkit-flex;
|
557 |
+
display: -moz-flex;
|
558 |
+
display: -ms-flex;
|
559 |
+
display: flex;
|
560 |
+
margin: 0 auto;
|
561 |
+
padding: 0;
|
562 |
+
max-width: 1200px;
|
563 |
+
list-style: none;
|
564 |
+
-ms-box-orient: horizontal;
|
565 |
+
-ms-box-pack: center;
|
566 |
+
-webkit-flex-flow: row wrap;
|
567 |
+
-moz-flex-flow: row wrap;
|
568 |
+
-ms-flex-flow: row wrap;
|
569 |
+
flex-flow: row wrap;
|
570 |
+
-webkit-justify-content: center;
|
571 |
+
-moz-justify-content: center;
|
572 |
+
-ms-justify-content: center;
|
573 |
+
justify-content: center;
|
574 |
+
}
|
575 |
+
|
576 |
+
.tabs nav ul li {
|
577 |
+
font-size: 14px;
|
578 |
+
position: relative;
|
579 |
+
z-index: 1;
|
580 |
+
display: block;
|
581 |
+
margin: 0;
|
582 |
+
text-align: center;
|
583 |
+
-webkit-flex: 1;
|
584 |
+
-moz-flex: 1;
|
585 |
+
-ms-flex: 1;
|
586 |
+
flex: 1;
|
587 |
+
}
|
588 |
+
|
589 |
+
/* colums layouts */
|
590 |
+
.tabs nav ul li.cols-4 {
|
591 |
+
width: 25%
|
592 |
+
}
|
593 |
+
.tabs nav ul li.cols-3 {
|
594 |
+
width: 33%
|
595 |
+
}
|
596 |
+
.tabs nav ul li.cols-2 {
|
597 |
+
width: 50%
|
598 |
+
}
|
599 |
+
.tabs nav ul li.cols-1 {
|
600 |
+
width: 100%
|
601 |
+
}
|
602 |
+
.tabs nav a {
|
603 |
+
position: relative;
|
604 |
+
display: block;
|
605 |
+
overflow: hidden;
|
606 |
+
text-overflow: ellipsis;
|
607 |
+
white-space: nowrap;
|
608 |
+
line-height: 2.5;
|
609 |
+
}
|
610 |
+
|
611 |
+
.tabs nav a span {
|
612 |
+
vertical-align: middle;
|
613 |
+
font-size: 0.75em;
|
614 |
+
}
|
615 |
+
|
616 |
+
.tabs nav li.tab-current a {
|
617 |
+
color: #74777b;
|
618 |
+
}
|
619 |
+
|
620 |
+
.tabs nav a:focus {
|
621 |
+
outline: none;
|
622 |
+
}
|
623 |
+
|
624 |
+
li.tab-current::after, li.tab-current::before {
|
625 |
+
content: '';
|
626 |
+
height: 100%;
|
627 |
+
position: absolute;
|
628 |
+
-webkit-box-shadow: 4px 0px 15px 0px rgba(37, 37, 37, 0.63);
|
629 |
+
box-shadow: 4px 0px 15px 0px rgba(37, 37, 37, 0.63);
|
630 |
+
top: 0;
|
631 |
+
width: 0px;
|
632 |
+
right: 0px;
|
633 |
+
z-index: 4;
|
634 |
+
width: 100%;
|
635 |
+
}
|
636 |
+
|
637 |
+
li.tab-current::before{
|
638 |
+
left: 0;
|
639 |
+
-webkit-box-shadow: 0px 0px 15px 4px rgba(37, 37, 37, 0.63);
|
640 |
+
box-shadow: 0px 0px 15px 4px rgba(37, 37, 37, 0.63);
|
641 |
+
}
|
642 |
+
|
643 |
+
li.tab-inactive::after {
|
644 |
+
content: '';
|
645 |
+
width: 100%;
|
646 |
+
position: absolute;
|
647 |
+
height: 2px;
|
648 |
+
bottom: -7px;
|
649 |
+
left: 0;
|
650 |
+
-webkit-box-shadow: 4px 0px 15px 0px rgba(119, 119, 119, 0.58);;
|
651 |
+
box-shadow: 4px 0px 15px 0px rgba(0, 0, 0, 0.86);;
|
652 |
+
}
|
653 |
+
|
654 |
+
/* Content */
|
655 |
+
.content-wrap {
|
656 |
+
position: relative;
|
657 |
+
}
|
658 |
+
|
659 |
+
.content-wrap section {
|
660 |
+
display: none;
|
661 |
+
margin: 0 auto;
|
662 |
+
max-width: 1200px;
|
663 |
+
/*padding-top: 10px; commented for https://github.com/presscustomizr/hueman-pro-addons/issues/200 */
|
664 |
+
}
|
665 |
+
|
666 |
+
section .czr-sub-set:first-child {
|
667 |
+
margin: 0;
|
668 |
+
}
|
669 |
+
|
670 |
+
.content-wrap section.content-current {
|
671 |
+
display: block;
|
672 |
+
}
|
673 |
+
|
674 |
+
.no-flexbox nav ul {
|
675 |
+
display: block;
|
676 |
+
}
|
677 |
+
|
678 |
+
.no-flexbox nav ul li {
|
679 |
+
min-width: 15%;
|
680 |
+
display: inline-block;
|
681 |
+
}
|
682 |
+
|
683 |
+
/*****************************/
|
684 |
+
/* Top Line */
|
685 |
+
/*****************************/
|
686 |
+
|
687 |
+
.tabs-style-topline {
|
688 |
+
max-width: 1200px;
|
689 |
+
}
|
690 |
+
|
691 |
+
.tabs-style-topline nav li {
|
692 |
+
border: 1px solid rgba(40,44,42,0.1);
|
693 |
+
}
|
694 |
+
|
695 |
+
.czr-items-wrapper .tabs-style-topline nav li {
|
696 |
+
border: none;
|
697 |
+
}
|
698 |
+
|
699 |
+
.tabs-style-topline nav li:not(:last-child) {
|
700 |
+
border-right: none;
|
701 |
+
}
|
702 |
+
|
703 |
+
.tabs-style-topline nav li.tab-current {
|
704 |
+
border-top-color: #ffffff;
|
705 |
+
border-bottom: none;
|
706 |
+
background: rgba(238, 238, 238, 0.13);
|
707 |
+
}
|
708 |
+
|
709 |
+
.tabs-style-topline nav a {
|
710 |
+
padding: 0.65em 0.5em;
|
711 |
+
background: rgba(40,44,42,0.05);
|
712 |
+
color: #fff;
|
713 |
+
line-height: 1;
|
714 |
+
-webkit-transition: color 0.2s;
|
715 |
+
transition: color 0.2s;
|
716 |
+
text-decoration: none;
|
717 |
+
}
|
718 |
+
.czr-items-wrapper .tabs-style-topline nav a {
|
719 |
+
background: rgba(40, 44, 42, 0.45);
|
720 |
+
}
|
721 |
+
|
722 |
+
.tabs-style-topline nav a:hover,
|
723 |
+
.tabs-style-topline nav a:focus {
|
724 |
+
text-decoration: underline;
|
725 |
+
}
|
726 |
+
|
727 |
+
.tabs-style-topline nav li.tab-current a {
|
728 |
+
background: none;
|
729 |
+
box-shadow: inset 0 3px 0 #ffffff;
|
730 |
+
color: #ffffff;
|
731 |
+
text-decoration: underline;
|
732 |
+
}
|
733 |
+
|
734 |
+
.czr-items-wrapper .tabs-style-topline nav li.tab-current a {
|
735 |
+
color: #000;
|
736 |
+
}
|
737 |
+
|
738 |
+
.tabs-style-topline .icon::before {
|
739 |
+
display: block;
|
740 |
+
margin: 0;
|
741 |
+
}
|
742 |
+
|
743 |
+
.tabs-style-topline nav a span {
|
744 |
+
text-transform: uppercase;
|
745 |
+
/*letter-spacing: 1px;*/
|
746 |
+
font-weight: 700;
|
747 |
+
}
|
748 |
+
|
749 |
+
|
750 |
+
@media screen and (max-width: 58em) {
|
751 |
+
.tabs nav a.icon span {
|
752 |
+
display: none;
|
753 |
+
}
|
754 |
+
.tabs nav a:before {
|
755 |
+
margin-right: 0;
|
756 |
+
}
|
757 |
+
}
|
758 |
+
|
759 |
+
|
760 |
+
|
761 |
+
|
762 |
+
|
763 |
+
|
764 |
+
|
765 |
+
|
766 |
+
/* SLIDER MODULE SPECIFICS */
|
767 |
+
.czr_slide_module .czr-item-title {
|
768 |
+
padding: 0px 7px;
|
769 |
+
height: 32px;
|
770 |
+
}
|
771 |
+
.czr_slide_module .slide-title, .czr_slide_module .slide-thumb {
|
772 |
+
display: block;
|
773 |
+
height: 32px;
|
774 |
+
line-height: 32px;
|
775 |
+
float: left;
|
776 |
+
}
|
777 |
+
.czr_slide_module .slide-title {
|
778 |
+
padding-left: 5px;
|
779 |
+
}
|
780 |
+
|
781 |
+
/* styled like the wp api.notifications, info type */
|
782 |
+
.slide-mod-skope-notice {
|
783 |
+
padding: 3%;
|
784 |
+
background: #fff;
|
785 |
+
border-left: 4px solid #00a0d2;
|
786 |
+
box-shadow: 0 1px 1px 0 rgba( 0, 0, 0, 0.1 );
|
787 |
+
float: left;
|
788 |
+
font-size: 12px;
|
789 |
+
line-height: 1.5em;
|
790 |
+
}
|
791 |
+
/* Underline skope switch text in control notices and in the main skope switcher title */
|
792 |
+
.slide-mod-skope-notice .czr-skope-switch {
|
793 |
+
cursor: pointer;
|
794 |
+
text-decoration: underline;
|
795 |
+
}
|
796 |
+
|
797 |
+
.modopts-top-buttons {
|
798 |
+
width: 100%;
|
799 |
+
float: left;
|
800 |
+
margin-bottom: 4%;
|
801 |
+
text-align: center;
|
802 |
+
}
|
803 |
+
|
804 |
+
.item-bottom-buttons {
|
805 |
+
width: 100%;
|
806 |
+
float: left;
|
807 |
+
padding: 1% 0;
|
808 |
+
}
|
809 |
+
.item-bottom-btn {
|
810 |
+
|
811 |
+
}
|
812 |
+
.item-bottom-btn, .modopt-top-btn {
|
813 |
+
opacity: 1;
|
814 |
+
color: #fff;
|
815 |
+
font-size: 14px;
|
816 |
+
cursor: pointer;
|
817 |
+
border-width: 1px;
|
818 |
+
-webkit-appearance: none;
|
819 |
+
-webkit-border-radius: 3px;
|
820 |
+
border-radius: 4px;
|
821 |
+
-webkit-box-sizing: border-box;
|
822 |
+
-moz-box-sizing: border-box;
|
823 |
+
box-sizing: border-box;
|
824 |
+
-webkit-transition: all 0.2s ease-in-out;
|
825 |
+
-moz-transition: all 0.2s ease-in-out;
|
826 |
+
-ms-transition: all 0.2s ease-in-out;
|
827 |
+
-o-transition: all 0.2s ease-in-out;
|
828 |
+
transition: all 0.2s ease-in-out;
|
829 |
+
opacity: 1;
|
830 |
+
}
|
831 |
+
.item-bottom-btn {
|
832 |
+
background: #868686;
|
833 |
+
width: 47%;
|
834 |
+
margin-right: 2%;
|
835 |
+
padding: 1% 0;
|
836 |
+
}
|
837 |
+
.modopt-top-btn {
|
838 |
+
background: rgba(171, 171, 171, 0.5);
|
839 |
+
width: 170px;
|
840 |
+
padding: 2px 0;
|
841 |
+
}
|
842 |
+
.item-bottom-btn:hover {
|
843 |
+
background: #5d5d5d;
|
844 |
+
}
|
845 |
+
.modopt-top-btn:hover {
|
846 |
+
background:rgba(41, 41, 41, 0.53);
|
847 |
+
}
|
848 |
+
|
849 |
+
.item-bottom-btn[disabled], .modopt-top-btn[disabled], .item-bottom-btn[disabled]:hover, .modopt-top-btn[disabled]:hover {
|
850 |
+
opacity: 0.4;
|
851 |
+
cursor: default;
|
852 |
+
-webkit-box-shadow: none !important;
|
853 |
+
box-shadow: none !important;
|
854 |
+
/*border: none!important;*/
|
855 |
+
background: inherit;
|
856 |
+
}
|
857 |
+
|
858 |
+
|
859 |
+
/* NOTICES */
|
860 |
+
.czr-notice {
|
861 |
+
font-size: 12px;
|
862 |
+
font-weight: normal;
|
863 |
+
}
|
assets/czr/fmk/js/____modules/5_0_1_pro_modules_map.js
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
(function ( api, $, _ ) {
|
3 |
+
//provides a description of each module
|
4 |
+
//=> will determine :
|
5 |
+
//1) how to initialize the module model. If not crud, then the initial item(s) model shall be provided
|
6 |
+
//2) which js template(s) to use : if crud, the module template shall include the add new and pre-item elements.
|
7 |
+
// , if crud, the item shall be removable
|
8 |
+
//3) how to render : if multi item, the item content is rendered when user click on edit button.
|
9 |
+
// If not multi item, the single item content is rendered as soon as the item wrapper is rendered.
|
10 |
+
//4) some DOM behaviour. For example, a multi item shall be sortable.
|
11 |
+
api.czrModuleMap = api.czrModuleMap || {};
|
12 |
+
$.extend( api.czrModuleMap, {
|
13 |
+
// czr_sektion_module : {
|
14 |
+
// mthds : CZRSektionMths,
|
15 |
+
// crud : true,
|
16 |
+
// name : 'Sections'
|
17 |
+
// },
|
18 |
+
// czr_fp_module : {
|
19 |
+
// mthds : CZRFeaturedPageModuleMths,
|
20 |
+
// crud : true,
|
21 |
+
// name : 'Featured Pages'
|
22 |
+
// },
|
23 |
+
// czr_slide_module : {
|
24 |
+
// mthds : CZRSlideModuleMths,
|
25 |
+
// crud : true,
|
26 |
+
// name : 'Slider',
|
27 |
+
// has_mod_opt : true
|
28 |
+
// },
|
29 |
+
// czr_related_posts_module : {
|
30 |
+
// mthds : CZRRelatedPostsModMths,
|
31 |
+
// crud : false,
|
32 |
+
// multi_item : false,
|
33 |
+
// name : 'Related Posts',
|
34 |
+
// has_mod_opt : false
|
35 |
+
// },
|
36 |
+
// czr_text_module : {
|
37 |
+
// mthds : CZRTextModuleMths,
|
38 |
+
// crud : false,
|
39 |
+
// multi_item : false,
|
40 |
+
// name : 'Simple Text'
|
41 |
+
// },
|
42 |
+
// czr_text_editor_module : {
|
43 |
+
// mthds : CZRTextEditorModuleMths,
|
44 |
+
// crud : false,
|
45 |
+
// multi_item : false,
|
46 |
+
// name : 'WP Text Editor'
|
47 |
+
// }
|
48 |
+
});
|
49 |
+
})( wp.customize, jQuery, _ );
|
assets/czr/fmk/js/____modules/___MOVED_TO_HUEMAN_THEME_JUNE_2018_5_0_0_free_modules_map.js
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
(function ( api, $, _ ) {
|
3 |
+
//provides a description of each module
|
4 |
+
//=> will determine :
|
5 |
+
//1) how to initialize the module model. If not crud, then the initial item(s) model shall be provided
|
6 |
+
//2) which js template(s) to use : if crud, the module template shall include the add new and pre-item elements.
|
7 |
+
// , if crud, the item shall be removable
|
8 |
+
//3) how to render : if multi item, the item content is rendered when user click on edit button.
|
9 |
+
// If not multi item, the single item content is rendered as soon as the item wrapper is rendered.
|
10 |
+
//4) some DOM behaviour. For example, a multi item shall be sortable.
|
11 |
+
api.czrModuleMap = api.czrModuleMap || {};
|
12 |
+
$.extend( api.czrModuleMap, {
|
13 |
+
czr_widget_areas_module : {
|
14 |
+
mthds : CZRWidgetAreaModuleMths,
|
15 |
+
crud : true,
|
16 |
+
sektion_allowed : false,
|
17 |
+
name : 'Widget Areas'
|
18 |
+
},
|
19 |
+
czr_background : {
|
20 |
+
mthds : CZRBodyBgModuleMths,
|
21 |
+
crud : false,
|
22 |
+
multi_item : false,
|
23 |
+
name : 'Slider'
|
24 |
+
}
|
25 |
+
});
|
26 |
+
})( wp.customize, jQuery, _ );
|
assets/czr/fmk/js/____modules/free/___MOVED_TO_HUEMAN_THEME_JUNE_2018__2_6_widget_areas_module.js
ADDED
@@ -0,0 +1,1009 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
//extends api.CZRDynModule
|
2 |
+
|
3 |
+
var CZRWidgetAreaModuleMths = CZRWidgetAreaModuleMths || {};
|
4 |
+
( function ( api, $, _ ) {
|
5 |
+
$.extend( CZRWidgetAreaModuleMths, {
|
6 |
+
initialize: function( id, constructorOptions ) {
|
7 |
+
var module = this;
|
8 |
+
|
9 |
+
api.CZRDynModule.prototype.initialize.call( this, id, constructorOptions );
|
10 |
+
|
11 |
+
//extend the module with new template Selectors
|
12 |
+
$.extend( module, {
|
13 |
+
itemPreAddEl : 'czr-module-widgets-pre-add-view-content',
|
14 |
+
itemInputList : 'czr-module-widgets-item-input-list',
|
15 |
+
itemInputListReduced : 'czr-module-widgets-item-input-list-reduced',
|
16 |
+
ruItemPart : 'czr-module-widgets-ru-item-part'
|
17 |
+
} );
|
18 |
+
|
19 |
+
//EXTEND THE DEFAULT CONSTRUCTORS FOR INPUT
|
20 |
+
module.inputConstructor = api.CZRInput.extend( module.CZRWZonesInputMths || {} );
|
21 |
+
//EXTEND THE DEFAULT CONSTRUCTORS FOR MONOMODEL
|
22 |
+
module.itemConstructor = api.CZRItem.extend( module.CZRWZonesItemConstructor || {} );
|
23 |
+
|
24 |
+
module.serverParams = serverControlParams.widget_area_el_params || {};
|
25 |
+
|
26 |
+
//add a shortcut to the server side json properties
|
27 |
+
module.contexts = _.has( module.serverParams , 'sidebar_contexts') ? module.serverParams.sidebar_contexts : {};
|
28 |
+
|
29 |
+
//context match map
|
30 |
+
module.context_match_map = {
|
31 |
+
is_404 : '404',
|
32 |
+
is_category : 'archive-category',
|
33 |
+
is_home : 'home',
|
34 |
+
is_page : 'page',
|
35 |
+
is_search : 'search',
|
36 |
+
is_single : 'single'
|
37 |
+
};
|
38 |
+
|
39 |
+
|
40 |
+
module.locations = _.has( module.serverParams , 'sidebar_locations') ? module.serverParams.sidebar_locations : {};
|
41 |
+
|
42 |
+
//declares a default model
|
43 |
+
module.defaultItemModel = {
|
44 |
+
id : '',
|
45 |
+
title : serverControlParams.i18n.widgetZone,
|
46 |
+
contexts : _.without( _.keys(module.contexts), '_all_' ),//the server list of contexts is an object, we only need the keys, whitout _all_
|
47 |
+
locations : [ module.serverParams.defaultWidgetLocation ],
|
48 |
+
description : ''
|
49 |
+
};
|
50 |
+
|
51 |
+
//overrides the default success message
|
52 |
+
this.itemAddedMessage = serverControlParams.i18n.widgetZoneAdded;
|
53 |
+
|
54 |
+
//Observe and react to sidebar insights from the preview frame
|
55 |
+
// SIDEBAR INSIGHTS => stores and observes the sidebars and widgets settings sent by the preview */
|
56 |
+
if ( ! _.has( api, 'sidebar_insights' ) ) {
|
57 |
+
api.sidebar_insights = new api.Values();
|
58 |
+
api.sidebar_insights.create('candidates');//will store the sidebar candidates on preview refresh
|
59 |
+
api.sidebar_insights.create('actives');//will record the refreshed active list of active sidebars sent from the preview
|
60 |
+
api.sidebar_insights.create('inactives');
|
61 |
+
api.sidebar_insights.create('registered');
|
62 |
+
api.sidebar_insights.create('available_locations');
|
63 |
+
}
|
64 |
+
|
65 |
+
|
66 |
+
this.listenToSidebarInsights();
|
67 |
+
|
68 |
+
//React on 'houston-widget-settings'
|
69 |
+
//actives : data.renderedSidebars,
|
70 |
+
// inactives : _inactives,
|
71 |
+
// registered : _registered,
|
72 |
+
// candidates : _candidates,
|
73 |
+
// available_locations : data.availableWidgetLocations//built server side
|
74 |
+
api.czr_widgetZoneSettings = api.czr_widgetZoneSettings || new api.Value();
|
75 |
+
api.czr_widgetZoneSettings.bind( function( updated_data_sent_from_preview , from ) {
|
76 |
+
module.isReady.then( function() {
|
77 |
+
_.each( updated_data_sent_from_preview, function( _data, _key ) {
|
78 |
+
api.sidebar_insights( _key ).set( _data );
|
79 |
+
});
|
80 |
+
});
|
81 |
+
});
|
82 |
+
|
83 |
+
|
84 |
+
|
85 |
+
|
86 |
+
//AVAILABLE LOCATIONS FOR THE PRE MODEL
|
87 |
+
//1) add an observable value to module.preItem to handle the alert visibility
|
88 |
+
module.preItem_location_alert_view_state = new api.Value( 'closed');
|
89 |
+
//2) add state listeners
|
90 |
+
module.preItem_location_alert_view_state.callbacks.add( function( to, from ) {
|
91 |
+
module._toggleLocationAlertExpansion( module.container, to );
|
92 |
+
});
|
93 |
+
|
94 |
+
|
95 |
+
//REACT ON ADD / REMOVE ITEMS
|
96 |
+
module.bind( 'item-added', function( model ) {
|
97 |
+
module.addWidgetSidebar( model );
|
98 |
+
});
|
99 |
+
|
100 |
+
module.bind( 'pre_item_api_remove' , function(model) {
|
101 |
+
module.removeWidgetSidebar( model );
|
102 |
+
});
|
103 |
+
|
104 |
+
|
105 |
+
//records the top margin value of the widgets panel on each expansion
|
106 |
+
var fixTopMargin = new api.Values();
|
107 |
+
fixTopMargin.create('fixed_for_current_session');
|
108 |
+
fixTopMargin.create('value');
|
109 |
+
|
110 |
+
api.section(module.serverParams.dynWidgetSection).fixTopMargin = fixTopMargin;
|
111 |
+
api.section(module.serverParams.dynWidgetSection).fixTopMargin('fixed_for_current_session').set(false);
|
112 |
+
|
113 |
+
|
114 |
+
//setup reactions on widget section expansion
|
115 |
+
//change the expanded behaviour for the widget zone section
|
116 |
+
//api.section(module.serverParams.dynWidgetSection).expanded.callbacks.add( function() { return module.widgetSectionReact.apply(module, arguments ); } );
|
117 |
+
|
118 |
+
//bind actions on widget panel expansion and widget zone section expansion
|
119 |
+
//Fire the module
|
120 |
+
api.panel('widgets').expanded.callbacks.add( function(to, from) {
|
121 |
+
module.widgetPanelReact();//setup some visual adjustments, must be ran each time panel is closed or expanded
|
122 |
+
|
123 |
+
//Fire the module if not done already
|
124 |
+
if ( 'resolved' == module.isReady.state() )
|
125 |
+
return;
|
126 |
+
module.ready();
|
127 |
+
});
|
128 |
+
},//initialize
|
129 |
+
|
130 |
+
|
131 |
+
|
132 |
+
|
133 |
+
//When the control is embedded on the page, this method is fired in api.CZRBaseModuleControl:ready()
|
134 |
+
//=> right after the module is instantiated.
|
135 |
+
ready : function() {
|
136 |
+
var module = this;
|
137 |
+
api.CZRDynModule.prototype.ready.call( module );
|
138 |
+
|
139 |
+
//add state listener on pre Item view
|
140 |
+
module.preItemExpanded.callbacks.add( function( to, from ) {
|
141 |
+
if ( ! to )
|
142 |
+
return;
|
143 |
+
//refresh the location list
|
144 |
+
module.preItem.czr_Input('locations')._setupLocationSelect( true );//true for refresh
|
145 |
+
//refresh the location alert message
|
146 |
+
module.preItem.czr_Input('locations').mayBeDisplayModelAlert();
|
147 |
+
});
|
148 |
+
},
|
149 |
+
|
150 |
+
|
151 |
+
|
152 |
+
//overrides parent method
|
153 |
+
//adds the default widget zones in the items
|
154 |
+
initializeModuleModel : function( constructorOptions ) {
|
155 |
+
var module = this, dfd = $.Deferred();
|
156 |
+
constructorOptions.items = _.union( _.has( module.serverParams, 'default_zones' ) ? module.serverParams.default_zones : [], constructorOptions.items );
|
157 |
+
return dfd.resolve( constructorOptions ).promise();
|
158 |
+
},
|
159 |
+
|
160 |
+
|
161 |
+
|
162 |
+
|
163 |
+
|
164 |
+
|
165 |
+
|
166 |
+
|
167 |
+
|
168 |
+
|
169 |
+
|
170 |
+
|
171 |
+
|
172 |
+
|
173 |
+
|
174 |
+
|
175 |
+
CZRWZonesInputMths : {
|
176 |
+
ready : function() {
|
177 |
+
var input = this;
|
178 |
+
|
179 |
+
input.bind('locations:changed', function(){
|
180 |
+
input.mayBeDisplayModelAlert();
|
181 |
+
});
|
182 |
+
|
183 |
+
api.CZRInput.prototype.ready.call( input);
|
184 |
+
},
|
185 |
+
|
186 |
+
|
187 |
+
|
188 |
+
//////////////////////////////////////////////////
|
189 |
+
///SETUP SELECTS
|
190 |
+
//////////////////////////////////////////////////
|
191 |
+
//setup select on view_rendered|item_content_event_map
|
192 |
+
setupSelect : function() {
|
193 |
+
var input = this;
|
194 |
+
if ( 'locations' == this.id )
|
195 |
+
this._setupLocationSelect();
|
196 |
+
if ( 'contexts' == this.id )
|
197 |
+
this._setupContextSelect();
|
198 |
+
|
199 |
+
},
|
200 |
+
|
201 |
+
//helper
|
202 |
+
_setupContextSelect : function() {
|
203 |
+
var input = this,
|
204 |
+
input_contexts = input(),
|
205 |
+
item = input.input_parent,
|
206 |
+
module = input.module;
|
207 |
+
|
208 |
+
//generates the contexts options
|
209 |
+
_.each( module.contexts, function( title, key ) {
|
210 |
+
var _attributes = {
|
211 |
+
value : key,
|
212 |
+
html: title
|
213 |
+
};
|
214 |
+
if ( key == input_contexts || _.contains( input_contexts, key ) )
|
215 |
+
$.extend( _attributes, { selected : "selected" } );
|
216 |
+
|
217 |
+
$( 'select[data-type="contexts"]', input.container ).append( $('<option>', _attributes) );
|
218 |
+
});
|
219 |
+
//fire czrSelect2
|
220 |
+
$( 'select[data-type="contexts"]', input.container ).czrSelect2();
|
221 |
+
},
|
222 |
+
|
223 |
+
|
224 |
+
//helper
|
225 |
+
//the refresh param is a bool
|
226 |
+
_setupLocationSelect : function(refresh ) {
|
227 |
+
var input = this,
|
228 |
+
input_locations = input(),
|
229 |
+
item = input.input_parent,
|
230 |
+
module = input.module,
|
231 |
+
available_locs = api.sidebar_insights('available_locations')();
|
232 |
+
|
233 |
+
//generates the locations options
|
234 |
+
//append them if not set yet
|
235 |
+
if ( ! $( 'select[data-type="locations"]', input.container ).children().length ) {
|
236 |
+
_.each( module.locations, function( title, key ) {
|
237 |
+
var _attributes = {
|
238 |
+
value : key,
|
239 |
+
html: title
|
240 |
+
};
|
241 |
+
|
242 |
+
if ( key == input_locations || _.contains( input_locations, key ) )
|
243 |
+
$.extend( _attributes, { selected : "selected" } );
|
244 |
+
|
245 |
+
$( 'select[data-type="locations"]', input.container ).append( $('<option>', _attributes) );
|
246 |
+
});
|
247 |
+
}//if
|
248 |
+
|
249 |
+
function setAvailability( state ) {
|
250 |
+
if (! state.id) { return state.text; }
|
251 |
+
if ( _.contains(available_locs, state.element.value) ) { return state.text; }
|
252 |
+
var $state = $(
|
253 |
+
'<span class="czr-unavailable-location fas fa-ban" title="' + serverControlParams.i18n.unavailableLocation + '"> ' + state.text + '</span>'
|
254 |
+
);
|
255 |
+
return $state;
|
256 |
+
}
|
257 |
+
|
258 |
+
if ( refresh ) {
|
259 |
+
$( 'select[data-type="locations"]', input.container ).czrSelect2( 'destroy' );
|
260 |
+
}
|
261 |
+
|
262 |
+
//fire czrSelect2
|
263 |
+
$( 'select[data-type="locations"]', input.container ).czrSelect2( {
|
264 |
+
templateResult: setAvailability,
|
265 |
+
templateSelection: setAvailability
|
266 |
+
});
|
267 |
+
},
|
268 |
+
|
269 |
+
//fired on view event map : 'locations:changed'
|
270 |
+
//@param obj { dom_el: $() , model : {} )
|
271 |
+
mayBeDisplayModelAlert : function() {
|
272 |
+
var input = this,
|
273 |
+
item = input.input_parent,
|
274 |
+
module = input.module;
|
275 |
+
|
276 |
+
//check if we are in the pre Item case => if so, the locations might be empty
|
277 |
+
if ( ! _.has( item(), 'locations') || _.isEmpty( item().locations ) )
|
278 |
+
return;
|
279 |
+
|
280 |
+
var _selected_locations = $('select[data-type="locations"]', input.container ).val(),
|
281 |
+
available_locs = api.sidebar_insights('available_locations')(),
|
282 |
+
_unavailable = _.filter( _selected_locations, function( loc ) {
|
283 |
+
return ! _.contains(available_locs, loc);
|
284 |
+
});
|
285 |
+
|
286 |
+
//check if we are in the pre Item case => if so, the id is empty
|
287 |
+
if ( ! _.has( item(), 'id' ) || _.isEmpty( item().id ) ) {
|
288 |
+
module.preItem_location_alert_view_state.set( ! _.isEmpty( _unavailable ) ? 'expanded' : 'closed' );
|
289 |
+
} else {
|
290 |
+
item.czr_itemLocationAlert.set( ! _.isEmpty( _unavailable ) ? 'expanded' : 'closed' );
|
291 |
+
}
|
292 |
+
}
|
293 |
+
},//CZRWZonesInputMths
|
294 |
+
|
295 |
+
|
296 |
+
|
297 |
+
|
298 |
+
|
299 |
+
|
300 |
+
|
301 |
+
|
302 |
+
|
303 |
+
|
304 |
+
|
305 |
+
|
306 |
+
|
307 |
+
|
308 |
+
|
309 |
+
CZRWZonesItemConstructor : {
|
310 |
+
initialize : function( id, options ) {
|
311 |
+
var item = this,
|
312 |
+
module = item.module;
|
313 |
+
|
314 |
+
//Add some observable values for this item
|
315 |
+
item.czr_itemLocationAlert = new api.Value();
|
316 |
+
|
317 |
+
api.CZRItem.prototype.initialize.call( item, null, options );
|
318 |
+
|
319 |
+
// filter the params of the ajax query used to get the item wrapper template
|
320 |
+
// because we need a ru ( not a read update delete ) template for builtins widget zones
|
321 |
+
// requestParams = {
|
322 |
+
// tmpl : 'rud-item-part',
|
323 |
+
// module_type: 'all_modules',
|
324 |
+
// nonce: api.settings.nonce.save//<= do we need to set a specific nonce to fetch the tmpls ?
|
325 |
+
// };
|
326 |
+
// this has been introduced in March 2018, after the introduction of the tmpl ajax fetching
|
327 |
+
// it does the same job that the overriden getTemplateEl() was doing.
|
328 |
+
// This filter is declared in item::renderItemWrapper()
|
329 |
+
item.bind( 'item-wrapper-tmpl-params-before-fetching', function( requestParams ) {
|
330 |
+
//force view-content type to ru-item-part if the model is a built-in (primary, secondary, footer-1, ...)
|
331 |
+
//=> user can't delete a built-in model.
|
332 |
+
requestParams.tmpl = ( _.has( item(), 'is_builtin' ) && item().is_builtin ) ? 'ruItemPart' : requestParams.tmpl;
|
333 |
+
return requestParams;
|
334 |
+
});
|
335 |
+
},
|
336 |
+
|
337 |
+
|
338 |
+
|
339 |
+
//extend parent setupview
|
340 |
+
itemWrapperViewSetup : function() {
|
341 |
+
var item = this,
|
342 |
+
module = item.module;
|
343 |
+
|
344 |
+
api.CZRItem.prototype.itemWrapperViewSetup.call(item);
|
345 |
+
|
346 |
+
/// ALERT FOR NOT AVAILABLE LOCATION
|
347 |
+
item.czr_itemLocationAlert.set('closed');
|
348 |
+
|
349 |
+
//add a state listener on expansion change
|
350 |
+
item.czr_itemLocationAlert.callbacks.add( function( to, from ) {
|
351 |
+
module._toggleLocationAlertExpansion( item.container , to );
|
352 |
+
});
|
353 |
+
|
354 |
+
//update item title
|
355 |
+
item.writeSubtitleInfos(item());
|
356 |
+
|
357 |
+
//this is fired just after the itemWrapperViewSetupApiListeners
|
358 |
+
//=> add a callback to refresh the availability status of the locations in the select location picker
|
359 |
+
//add a state listener on expansion change
|
360 |
+
item.viewState.callbacks.add( function( to, from ) {
|
361 |
+
if ( -1 == to.indexOf('expanded') )//can take the expanded_noscroll value !
|
362 |
+
return;
|
363 |
+
//don't try to invoke the input instances before the content is actually rendered
|
364 |
+
//=> there might be cases when the content rendering is debounced...
|
365 |
+
item.bind('contentRendered', function() {
|
366 |
+
//refresh the location list
|
367 |
+
item.czr_Input('locations')._setupLocationSelect( true );//true for refresh
|
368 |
+
//refresh the location alert message
|
369 |
+
item.czr_Input('locations').mayBeDisplayModelAlert();
|
370 |
+
});
|
371 |
+
|
372 |
+
});
|
373 |
+
},
|
374 |
+
|
375 |
+
|
376 |
+
//extend parent listener
|
377 |
+
itemReact : function(to, from) {
|
378 |
+
var item = this;
|
379 |
+
api.CZRItem.prototype.itemReact.call(item, to, from);
|
380 |
+
|
381 |
+
item.writeSubtitleInfos(to);
|
382 |
+
item.updateSectionTitle(to).setModelUpdateTimer();
|
383 |
+
},
|
384 |
+
|
385 |
+
|
386 |
+
|
387 |
+
//Fired in setupItemListeners. Reacts to model change.
|
388 |
+
//Write html informations under the title : location(s) and context(s)
|
389 |
+
writeSubtitleInfos : function(model) {
|
390 |
+
var item = this,
|
391 |
+
module = item.module,
|
392 |
+
_model = _.clone( model || item() ),
|
393 |
+
_locations = [],
|
394 |
+
_contexts = [],
|
395 |
+
_html = '';
|
396 |
+
|
397 |
+
if ( ! item.container.length )
|
398 |
+
return this;
|
399 |
+
|
400 |
+
//generate the locations and the contexts text from the json data if exists
|
401 |
+
_model.locations =_.isString(_model.locations) ? [_model.locations] : _model.locations;
|
402 |
+
_.each( _model.locations, function( loc ) {
|
403 |
+
if ( _.has( module.locations , loc ) )
|
404 |
+
_locations.push(module.locations[loc]);
|
405 |
+
else
|
406 |
+
_locations.push(loc);
|
407 |
+
}
|
408 |
+
);
|
409 |
+
|
410 |
+
//build the context list
|
411 |
+
_model.contexts =_.isString(_model.contexts) ? [_model.contexts] : _model.contexts;
|
412 |
+
|
413 |
+
//all contexts cases ?
|
414 |
+
if ( item._hasModelAllContexts( model ) ) {
|
415 |
+
_contexts.push(module.contexts._all_);
|
416 |
+
} else {
|
417 |
+
_.each( _model.contexts, function( con ) {
|
418 |
+
if ( _.has( module.contexts , con ) )
|
419 |
+
_contexts.push(module.contexts[con]);
|
420 |
+
else
|
421 |
+
_contexts.push(con);
|
422 |
+
}
|
423 |
+
);
|
424 |
+
}
|
425 |
+
|
426 |
+
//Translated strings
|
427 |
+
var _locationText = serverControlParams.i18n.locations,
|
428 |
+
_contextText = serverControlParams.i18n.contexts,
|
429 |
+
_notsetText = serverControlParams.i18n.notset;
|
430 |
+
|
431 |
+
_locations = _.isEmpty( _locations ) ? '<span style="font-weight: bold;">' + _notsetText + '</span>' : _locations.join(', ');
|
432 |
+
_contexts = _.isEmpty( _contexts ) ? '<span style="font-weight: bold;">' + _notsetText + '</span>' : _contexts.join(', ');
|
433 |
+
|
434 |
+
//write the description if builtin
|
435 |
+
//else, write the dynamic location
|
436 |
+
// if ( _.has(_model, 'description') && _.has(_model, 'is_builtin') )
|
437 |
+
// _html = _model.description + ' <strong>|</strong> <u>Contexts</u> : ' + _contexts;
|
438 |
+
// else
|
439 |
+
|
440 |
+
_html = '<u>' + _locationText + '</u> : ' + _locations + ' <strong>|</strong> <u>' + _contextText + '</u> : ' + _contexts;
|
441 |
+
|
442 |
+
if ( ! $('.czr-zone-infos', item.container ).length ) {
|
443 |
+
var $_zone_infos = $('<div/>', {
|
444 |
+
class : [ 'czr-zone-infos' , module.control.css_attr.item_sort_handle ].join(' '),
|
445 |
+
html : _html
|
446 |
+
});
|
447 |
+
$( '.' + module.control.css_attr.item_btns, item.container ).after($_zone_infos);
|
448 |
+
} else {
|
449 |
+
$('.czr-zone-infos', item.container ).html(_html);
|
450 |
+
}
|
451 |
+
|
452 |
+
return this;
|
453 |
+
},//writeSubtitleInfos
|
454 |
+
|
455 |
+
|
456 |
+
|
457 |
+
////Fired in setupItemListeners
|
458 |
+
updateSectionTitle : function(model) {
|
459 |
+
var _sidebar_id = 'sidebar-widgets-' + model.id,
|
460 |
+
_new_title = model.title;
|
461 |
+
//does this section exists ?
|
462 |
+
if ( ! api.section.has(_sidebar_id) )
|
463 |
+
return this;
|
464 |
+
|
465 |
+
//update the section title
|
466 |
+
$('.accordion-section-title', api.section(_sidebar_id).container ).text(_new_title);
|
467 |
+
|
468 |
+
//update the top title ( visible when inside the expanded section )
|
469 |
+
$('.customize-section-title h3', api.section(_sidebar_id).container ).html(
|
470 |
+
'<span class="customize-action">' + api.section(_sidebar_id).params.customizeAction + '</span>' + _new_title
|
471 |
+
);
|
472 |
+
// $('.customize-section-title h3', api.section(_sidebar_id).container )
|
473 |
+
// .append('<span>', {
|
474 |
+
// class: 'customize-section-back',
|
475 |
+
// html: api.section(_sidebar_id).params.customizeAction
|
476 |
+
// } )
|
477 |
+
// .append(_new_title);
|
478 |
+
|
479 |
+
//remove and re-instanciate
|
480 |
+
//=> works for the section but the controls are not activated anymore.
|
481 |
+
//Should be easy to fix but useless to go further here. Jquery does the job.
|
482 |
+
// var _params = _.clone( api.section(_sidebar_id).params );
|
483 |
+
// _params.title = _new_title;
|
484 |
+
// api.section(_sidebar_id).container.remove();
|
485 |
+
// api.section.remove(_sidebar_id);
|
486 |
+
// api.section.add( _sidebar_id, new api.sectionConstructor[_params.type]( _params.id ,{ params : _params } ) );
|
487 |
+
return this;
|
488 |
+
},
|
489 |
+
|
490 |
+
|
491 |
+
//fired on model_update
|
492 |
+
//Don't hammer the preview with too many refreshs
|
493 |
+
//2 seconds delay
|
494 |
+
setModelUpdateTimer : function() {
|
495 |
+
var item = this,
|
496 |
+
module = item.module;
|
497 |
+
|
498 |
+
clearTimeout( $.data(this, 'modelUpdateTimer') );
|
499 |
+
$.data(
|
500 |
+
this,
|
501 |
+
'modelUpdateTimer',
|
502 |
+
setTimeout( function() {
|
503 |
+
//refresh preview
|
504 |
+
module.control.refreshPreview();
|
505 |
+
} , 1000)
|
506 |
+
);//$.data
|
507 |
+
},
|
508 |
+
|
509 |
+
|
510 |
+
//@return bool
|
511 |
+
//takes the model unique id
|
512 |
+
_hasModelAllContexts : function( model ) {
|
513 |
+
var item = this,
|
514 |
+
module = item.module,
|
515 |
+
moduleContexts = _.keys(module.contexts);
|
516 |
+
|
517 |
+
model = model || this();
|
518 |
+
|
519 |
+
if ( ! _.has(model, 'contexts') )
|
520 |
+
return;
|
521 |
+
|
522 |
+
if ( _.contains( model.contexts, '_all_') )
|
523 |
+
return true;
|
524 |
+
|
525 |
+
//case when model does not have _all_ but all the others
|
526 |
+
return _.isEmpty( _.difference( _.without(moduleContexts, '_all_') , model.contexts ) );
|
527 |
+
},
|
528 |
+
|
529 |
+
//@param contexts = array of contexts
|
530 |
+
//api.czr_wpQueryInfos is refreshed on each preview refresh
|
531 |
+
_getMatchingContexts : function( defaults ) {
|
532 |
+
var module = this,
|
533 |
+
_current = api.czr_wpQueryInfos().conditional_tags || {},
|
534 |
+
_matched = _.filter( module.context_match_map, function( hu, wp ) { return true === _current[wp]; } );
|
535 |
+
|
536 |
+
return _.isEmpty( _matched ) ? defaults : _matched;
|
537 |
+
}
|
538 |
+
},//CZRWZonesItemConstructor
|
539 |
+
|
540 |
+
|
541 |
+
|
542 |
+
|
543 |
+
|
544 |
+
|
545 |
+
|
546 |
+
|
547 |
+
|
548 |
+
|
549 |
+
|
550 |
+
|
551 |
+
|
552 |
+
|
553 |
+
//DEPRECATED : THE CONTROLS TO SYNCHRONIZE HAVE BEEN REMOVED
|
554 |
+
|
555 |
+
//fired on model_added_by_user and from the timer method
|
556 |
+
//1) model_added, before renderItemWrapper action
|
557 |
+
// when a new model is manually added ( isTrigger is undefined )
|
558 |
+
// => refresh the select options of the other controls using this collection
|
559 |
+
//2) model_updated, before updateCollection
|
560 |
+
// addControlOptions : function(obj) {
|
561 |
+
// var _controls = _.where( api.settings.controls, {section:"sidebars_select_sec"});
|
562 |
+
// _.map( _controls, function( _control ) {
|
563 |
+
// var $_select = api.control( _control.settings.default ).container.find('select');
|
564 |
+
|
565 |
+
// //if this option has already been added, simply updates its attributes
|
566 |
+
// if ( 1 === $_select.find('option[value="' + obj.model.id + '"]').length ) {
|
567 |
+
// $_select.find('option[value="' + obj.model.id + '"]').html(obj.model.title);
|
568 |
+
// $_select.selecter("destroy").selecter();
|
569 |
+
// } else {
|
570 |
+
// $_select.append( $('<option>', {value: obj.model.id, html:obj.model.title } ) ).selecter("destroy").selecter();
|
571 |
+
// }
|
572 |
+
// });//map
|
573 |
+
// },
|
574 |
+
|
575 |
+
//fired on model_removed
|
576 |
+
// removeControlOptions : function(obj) {
|
577 |
+
// var _controls = _.where( api.settings.controls, {section:"sidebars_select_sec"});
|
578 |
+
|
579 |
+
// _.map( _controls, function( _control ) {
|
580 |
+
// var $_select = api.control( _control.settings.default ).container.find('select');
|
581 |
+
|
582 |
+
// if ( ! $_select.find('option[value="' + obj.model.id + '"]').length )
|
583 |
+
// return;
|
584 |
+
|
585 |
+
// $( 'option[value="' + obj.model.id +'"]', $_select).remove();
|
586 |
+
// $_select.selecter("destroy").selecter();
|
587 |
+
// });//map
|
588 |
+
// },
|
589 |
+
|
590 |
+
|
591 |
+
|
592 |
+
|
593 |
+
|
594 |
+
|
595 |
+
|
596 |
+
|
597 |
+
|
598 |
+
|
599 |
+
|
600 |
+
|
601 |
+
/////////////////////////////////////////
|
602 |
+
/// ADD / REMOVE WIDGET ZONES
|
603 |
+
////////////////////////////////////////
|
604 |
+
//fired on model_added_by_user
|
605 |
+
//
|
606 |
+
//can also be called statically when a dynamic sidebar is added in the preview
|
607 |
+
//in this case the parameter are the sidebar data with id and name
|
608 |
+
addWidgetSidebar : function( model, sidebar_data ) {
|
609 |
+
if ( ! _.isObject(model) && _.isEmpty(sidebar_data) ) {
|
610 |
+
throw new Error('No valid input were provided to add a new Widget Zone.');
|
611 |
+
}
|
612 |
+
|
613 |
+
|
614 |
+
//ADD the new sidebar to the existing collection
|
615 |
+
//Clone the serverControlParams.defaultWidgetSidebar sidebar
|
616 |
+
var module = this,
|
617 |
+
_model = ! _.isEmpty(model) ? _.clone(model) : sidebar_data,
|
618 |
+
_new_sidebar = _.isEmpty(model) ? sidebar_data : $.extend(
|
619 |
+
_.clone( _.findWhere( api.Widgets.data.registeredSidebars, { id: module.serverParams.defaultWidgetSidebar } ) ),
|
620 |
+
{
|
621 |
+
name : _model.title,
|
622 |
+
id : _model.id
|
623 |
+
}
|
624 |
+
);
|
625 |
+
|
626 |
+
//Add it to the backbone collection
|
627 |
+
api.Widgets.registeredSidebars.add( _new_sidebar );
|
628 |
+
|
629 |
+
//test if added:
|
630 |
+
//api.Widgets.registeredSidebars('czr_sidebars_8');
|
631 |
+
|
632 |
+
|
633 |
+
//ADD the sidebar section
|
634 |
+
var _params = $.extend(
|
635 |
+
_.clone( api.section( "sidebar-widgets-" + module.serverParams.defaultWidgetSidebar ).params ),
|
636 |
+
{
|
637 |
+
id : "sidebar-widgets-" + _model.id,
|
638 |
+
instanceNumber: _.max(api.settings.sections, function(sec){ return sec.instanceNumber; }).instanceNumber + 1,
|
639 |
+
sidebarId: _new_sidebar.id,
|
640 |
+
title: _new_sidebar.name,
|
641 |
+
description : 'undefined' != typeof(sidebar_data) ? sidebar_data.description : api.section( "sidebar-widgets-" + module.serverParams.defaultWidgetSidebar ).params.description,
|
642 |
+
//always set the new priority to the maximum + 1 ( module.serverParams.dynWidgetSection is excluded from this calculation because it must always be at the bottom )
|
643 |
+
priority: _.max( _.omit( api.settings.sections, module.serverParams.dynWidgetSection), function(sec){ return sec.instanceNumber; }).priority + 1,
|
644 |
+
}
|
645 |
+
);
|
646 |
+
|
647 |
+
api.section.add( _params.id, new api.sectionConstructor[ _params.type ]( _params.id ,{ params : _params } ) );
|
648 |
+
|
649 |
+
//add it to the static collection of settings
|
650 |
+
api.settings.sections[ _params.id ] = _params.id;
|
651 |
+
|
652 |
+
//ADD A SETTING
|
653 |
+
//Clone the module.serverParams.defaultWidgetSidebar sidebar widget area setting
|
654 |
+
var _new_set_id = 'sidebars_widgets['+_model.id+']',
|
655 |
+
_new_set = $.extend(
|
656 |
+
_.clone( api.settings.settings['sidebars_widgets[' + module.serverParams.defaultWidgetSidebar + ']'] ),
|
657 |
+
{
|
658 |
+
value:[]
|
659 |
+
}
|
660 |
+
);
|
661 |
+
|
662 |
+
//add it to the static collection of settings
|
663 |
+
api.settings.settings[ _new_set_id ] = _new_set;
|
664 |
+
|
665 |
+
//instanciate it
|
666 |
+
api.create( _new_set_id, _new_set_id, _new_set.value, {
|
667 |
+
transport: _new_set.transport,
|
668 |
+
previewer: api.previewer,
|
669 |
+
dirty: false
|
670 |
+
} );
|
671 |
+
|
672 |
+
|
673 |
+
|
674 |
+
//ADD A CONTROL
|
675 |
+
var _cloned_control = $.extend(
|
676 |
+
_.clone( api.settings.controls['sidebars_widgets[' + module.serverParams.defaultWidgetSidebar + ']'] ),
|
677 |
+
{
|
678 |
+
settings : { default : _new_set_id }
|
679 |
+
}),
|
680 |
+
_new_control = {};
|
681 |
+
|
682 |
+
|
683 |
+
//replace serverControlParams.defaultWidgetSidebar by the new sidebar id
|
684 |
+
_.each( _cloned_control, function( param, key ) {
|
685 |
+
if ( 'string' == typeof(param) ) {
|
686 |
+
param = param.replace( module.serverParams.defaultWidgetSidebar , _model.id );
|
687 |
+
}
|
688 |
+
_new_control[key] = param;
|
689 |
+
});
|
690 |
+
|
691 |
+
//set the instance number (no sure if needed)
|
692 |
+
_new_control.instanceNumber = _.max(api.settings.controls, function(con){ return con.instanceNumber; }).instanceNumber + 1;
|
693 |
+
|
694 |
+
//add it to the static collection of controls
|
695 |
+
api.settings.controls[_new_set_id] = _new_control;
|
696 |
+
|
697 |
+
//instanciate it
|
698 |
+
api.control.add( _new_set_id, new api.controlConstructor[ _new_control.type ]( _new_set_id, {
|
699 |
+
params: _new_control,
|
700 |
+
previewer: api.previewer
|
701 |
+
} ) );
|
702 |
+
|
703 |
+
|
704 |
+
//say it to the control container
|
705 |
+
//only if we are in an instanciated object => because this method can be accessed statically
|
706 |
+
if ( _.has(this, 'container') )
|
707 |
+
this.container.trigger( 'widget_zone_created', { model : _model, section_id : "sidebar-widgets-" + _model.id , setting_id : _new_set_id });
|
708 |
+
},//addWidgetSidebar
|
709 |
+
|
710 |
+
|
711 |
+
//fired on "after_modelRemoved"
|
712 |
+
removeWidgetSidebar : function( model ) {
|
713 |
+
var module = this;
|
714 |
+
if ( ! _.isObject(model) || _.isEmpty(model) ) {
|
715 |
+
throw new Error('No valid data were provided to remove a Widget Zone.');
|
716 |
+
}
|
717 |
+
|
718 |
+
//Remove this sidebar from the backbone collection
|
719 |
+
api.Widgets.registeredSidebars.remove( model.id );
|
720 |
+
|
721 |
+
//remove the section from the api values and the DOM if exists
|
722 |
+
if ( api.section.has("sidebar-widgets-" + model.id) ) {
|
723 |
+
//Remove the section container from the DOM
|
724 |
+
api.section("sidebar-widgets-" + model.id).container.remove();
|
725 |
+
//Remove the sidebar section from the api
|
726 |
+
api.section.remove( "sidebar-widgets-" + model.id );
|
727 |
+
//Remove this section from the static collection
|
728 |
+
delete api.settings.sections[ "sidebar-widgets-" + model.id ];
|
729 |
+
}
|
730 |
+
|
731 |
+
//remove the setting from the api if exists
|
732 |
+
if ( api.has('sidebars_widgets['+model.id+']') ) {
|
733 |
+
//Remove this setting from the api
|
734 |
+
api.remove( 'sidebars_widgets['+model.id+']' );
|
735 |
+
//Remove this setting from the static collection
|
736 |
+
delete api.settings.settings['sidebars_widgets['+model.id+']'];
|
737 |
+
}
|
738 |
+
|
739 |
+
//remove the widget control of this sidebar from the api and the DOM if exists
|
740 |
+
if ( api.control.has('sidebars_widgets['+model.id+']') ) {
|
741 |
+
//Remove the control container from the DOM
|
742 |
+
api.control( 'sidebars_widgets['+model.id+']' ).container.remove();
|
743 |
+
//Remove this control from the api
|
744 |
+
api.control.remove( 'sidebars_widgets['+model.id+']' );
|
745 |
+
//Remove it to the static collection of controls
|
746 |
+
delete api.settings.controls['sidebars_widgets['+model.id+']'];
|
747 |
+
}
|
748 |
+
|
749 |
+
//refresh
|
750 |
+
var _refresh = function() {
|
751 |
+
api.previewer.refresh();
|
752 |
+
};
|
753 |
+
_refresh = _.debounce( _refresh, 500 );
|
754 |
+
$.when( _refresh() ).done( function() {
|
755 |
+
//say it
|
756 |
+
module.trigger( 'widget_zone_removed',
|
757 |
+
{
|
758 |
+
model : model,
|
759 |
+
section_id : "sidebar-widgets-" + model.id ,
|
760 |
+
setting_id : 'sidebars_widgets['+model.id+']'
|
761 |
+
}
|
762 |
+
);
|
763 |
+
});
|
764 |
+
},
|
765 |
+
|
766 |
+
|
767 |
+
|
768 |
+
|
769 |
+
|
770 |
+
|
771 |
+
|
772 |
+
|
773 |
+
|
774 |
+
|
775 |
+
|
776 |
+
/////////////////////////////////////////
|
777 |
+
/// SET EXPANSION CALLBACKS FOR WIDGET PANEL AND WIDGET ZONE CREATION SECTION
|
778 |
+
////////////////////////////////////////
|
779 |
+
//cb of : api.panel('widgets').expanded.callbacks.add
|
780 |
+
widgetPanelReact : function() {
|
781 |
+
var module = this;
|
782 |
+
//will be used for adjustments
|
783 |
+
var _top_margin = api.panel('widgets').container.find( '.control-panel-content' ).css('margin-top');
|
784 |
+
|
785 |
+
api.section(module.serverParams.dynWidgetSection).fixTopMargin('value').set( _top_margin );
|
786 |
+
|
787 |
+
var _section_content = api.section(module.serverParams.dynWidgetSection).container.find( '.accordion-section-content' ),
|
788 |
+
_panel_content = api.panel('widgets').container.find( '.control-panel-content' ),
|
789 |
+
_set_margins = function() {
|
790 |
+
_section_content.css( 'margin-top', '' );
|
791 |
+
_panel_content.css('margin-top', api.section(module.serverParams.dynWidgetSection).fixTopMargin('value')() );
|
792 |
+
};
|
793 |
+
|
794 |
+
// Fix the top margin after reflow.
|
795 |
+
api.bind( 'pane-contents-reflowed', _.debounce( function() {
|
796 |
+
_set_margins();
|
797 |
+
}, 150 ) );
|
798 |
+
|
799 |
+
//Close all views on widget panel expansion/clos
|
800 |
+
module.closeAllItems().closeRemoveDialogs();
|
801 |
+
//Close preItem dialog box if exists
|
802 |
+
if ( _.has( module, 'preItemExpanded' ) )
|
803 |
+
module.preItemExpanded.set(false);
|
804 |
+
},//widgetPanelReact()
|
805 |
+
|
806 |
+
|
807 |
+
//cb of api.section(module.serverParams.dynWidgetSection).expanded.callbacks
|
808 |
+
widgetSectionReact : function( to, from ) {
|
809 |
+
var module = this,
|
810 |
+
section = api.section(module.serverParams.dynWidgetSection),
|
811 |
+
container = section.container.closest( '.wp-full-overlay-sidebar-content' ),
|
812 |
+
content = section.container.find( '.accordion-section-content' ),
|
813 |
+
overlay = section.container.closest( '.wp-full-overlay' ),
|
814 |
+
backBtn = section.container.find( '.customize-section-back' ),
|
815 |
+
sectionTitle = section.container.find( '.accordion-section-title' ).first(),
|
816 |
+
headerActionsHeight = $( '#customize-header-actions' ).height(),
|
817 |
+
resizeContentHeight, expand, position, scroll;
|
818 |
+
|
819 |
+
if ( to ) {
|
820 |
+
overlay.removeClass( 'section-open' );
|
821 |
+
content.css( 'height', 'auto' );
|
822 |
+
//section.container.removeClass( 'open' );
|
823 |
+
sectionTitle.attr( 'tabindex', '0' );
|
824 |
+
content.css( 'margin-top', '' );
|
825 |
+
container.scrollTop( 0 );
|
826 |
+
}
|
827 |
+
|
828 |
+
module.closeAllItems().closeRemoveDialogs();
|
829 |
+
|
830 |
+
content.slideToggle();
|
831 |
+
},
|
832 |
+
|
833 |
+
|
834 |
+
|
835 |
+
|
836 |
+
|
837 |
+
|
838 |
+
|
839 |
+
/////////////////////////////////////////
|
840 |
+
/// LISTEN TO SIDEBAR INSIGHTS FROM THE PREVIEW FRAME
|
841 |
+
/// REACT TO THEM
|
842 |
+
////////////////////////////////////////
|
843 |
+
listenToSidebarInsights : function() {
|
844 |
+
var module = this;
|
845 |
+
|
846 |
+
//VISIBILITY BASED ON THE SIDEBAR INSIGHTS
|
847 |
+
api.sidebar_insights('registered').callbacks.add( function( _registered_zones ) {
|
848 |
+
var _current_collection = _.clone( module.itemCollection() );
|
849 |
+
_.each( _current_collection, function( _model ) {
|
850 |
+
if ( ! module.getViewEl(_model.id).length )
|
851 |
+
return;
|
852 |
+
|
853 |
+
module.getViewEl(_model.id).css('display' , _.contains( _registered_zones, _model.id ) ? 'block' : 'none' );
|
854 |
+
});
|
855 |
+
});
|
856 |
+
|
857 |
+
//OPACITY SIDEBAR INSIGHTS BASED
|
858 |
+
api.sidebar_insights('inactives').callbacks.add( function( _inactives_zones ) {
|
859 |
+
var _current_collection = _.clone( module.itemCollection() );
|
860 |
+
_.each( _current_collection, function( _model ) {
|
861 |
+
if ( ! module.getViewEl(_model.id).length )
|
862 |
+
return;
|
863 |
+
|
864 |
+
if ( _.contains( _inactives_zones, _model.id ) ) {
|
865 |
+
module.getViewEl( _model.id ).addClass('inactive');
|
866 |
+
if ( ! module.getViewEl( _model.id ).find('.czr-inactive-alert').length ) {
|
867 |
+
module.getViewEl( _model.id ).find('.czr-item-title').append(
|
868 |
+
$('<span/>', {class : "czr-inactive-alert", html : " [ " + serverControlParams.i18n.inactiveWidgetZone + " ]" })
|
869 |
+
);
|
870 |
+
}
|
871 |
+
}
|
872 |
+
else {
|
873 |
+
module.getViewEl( _model.id ).removeClass('inactive');
|
874 |
+
if ( module.getViewEl( _model.id ).find('.czr-inactive-alert').length )
|
875 |
+
module.getViewEl( _model.id ).find('.czr-inactive-alert').remove();
|
876 |
+
}
|
877 |
+
});
|
878 |
+
});
|
879 |
+
|
880 |
+
//WIDGET SIDEBAR CREATION BASED ON SIDEBAR INSIGHTS
|
881 |
+
//react to a new register candidate(s) on preview refresh
|
882 |
+
api.sidebar_insights('candidates').callbacks.add( function(_candidates) {
|
883 |
+
if ( ! _.isArray(_candidates) )
|
884 |
+
return;
|
885 |
+
_.each( _candidates, function( _sidebar ) {
|
886 |
+
if ( ! _.isObject(_sidebar) )
|
887 |
+
return;
|
888 |
+
//add this widget sidebar and the related setting and control.
|
889 |
+
//Only if not added already
|
890 |
+
if ( api.section.has("sidebar-widgets-" +_sidebar.id ) )
|
891 |
+
return;
|
892 |
+
|
893 |
+
//access the registration method statically
|
894 |
+
module.addWidgetSidebar( {}, _sidebar );
|
895 |
+
//activate it if so
|
896 |
+
if ( _.has( api.sidebar_insights('actives')(), _sidebar.id ) && api.section.has("sidebar-widgets-" +_sidebar.id ) )
|
897 |
+
api.section( "sidebar-widgets-" +_sidebar.id ).activate();
|
898 |
+
});
|
899 |
+
});
|
900 |
+
},//listenToSidebarInsights()
|
901 |
+
|
902 |
+
|
903 |
+
|
904 |
+
|
905 |
+
|
906 |
+
|
907 |
+
|
908 |
+
/////////////////////////////////////////
|
909 |
+
/// OVERRIDEN METHODS
|
910 |
+
////////////////////////////////////////
|
911 |
+
//fired in toggleItemExpansion()
|
912 |
+
//has to be overridden for the widget zones control because this control is embedded directly in a panel and not in a section
|
913 |
+
//therefore the module to animate the scrollTop is not the section container but $('.wp-full-overlay-sidebar-content')
|
914 |
+
_adjustScrollExpandedBlock : function( $_block_el, adjust ) {
|
915 |
+
if ( ! $_block_el.length )
|
916 |
+
return;
|
917 |
+
var module = this,
|
918 |
+
_currentScrollTopVal = $('.wp-full-overlay-sidebar-content').scrollTop(),
|
919 |
+
_scrollDownVal,
|
920 |
+
_adjust = adjust || 90;
|
921 |
+
setTimeout( function() {
|
922 |
+
if ( ( $_block_el.offset().top + $_block_el.height() + _adjust ) > $(window.top).height() ) {
|
923 |
+
_scrollDownVal = $_block_el.offset().top + $_block_el.height() + _adjust - $(window.top).height();
|
924 |
+
$('.wp-full-overlay-sidebar-content').animate({
|
925 |
+
scrollTop: _currentScrollTopVal + _scrollDownVal
|
926 |
+
}, 600);
|
927 |
+
}
|
928 |
+
}, 50);
|
929 |
+
},
|
930 |
+
|
931 |
+
|
932 |
+
|
933 |
+
//overrides the parent class default model getter
|
934 |
+
//=> add a dynamic title
|
935 |
+
getDefaultItemModel : function( id ) {
|
936 |
+
var module = this,
|
937 |
+
_current_collection = module.itemCollection(),
|
938 |
+
_default = _.clone( module.defaultItemModel ),
|
939 |
+
_default_contexts = _default.contexts;
|
940 |
+
return $.extend( _default, {
|
941 |
+
title : 'Widget Zone ' + ( _.size(_current_collection)*1 + 1 )
|
942 |
+
//contexts : module._getMatchingContexts( _default_contexts )
|
943 |
+
});
|
944 |
+
},
|
945 |
+
|
946 |
+
|
947 |
+
|
948 |
+
//overrides parent
|
949 |
+
//called before rendering a view. Fired in module::renderItemWrapper()
|
950 |
+
//can be overridden to set a specific view template depending on the model properties
|
951 |
+
//@return string
|
952 |
+
//@type can be
|
953 |
+
//Read Update Delete (rud...)
|
954 |
+
//Read Update (ru)
|
955 |
+
//...
|
956 |
+
//@item_model is an object describing the current item model
|
957 |
+
getTemplateEl : function( type, item_model ) {
|
958 |
+
var module = this, _el;
|
959 |
+
//force view-content type to ru-item-part if the model is a built-in (primary, secondary, footer-1, ...)
|
960 |
+
//=> user can't delete a built-in model.
|
961 |
+
if ( 'rudItemPart' == type ) {
|
962 |
+
type = ( _.has(item_model, 'is_builtin') && item_model.is_builtin ) ? 'ruItemPart' : type;
|
963 |
+
} else if ( 'itemInputList' == type ) {
|
964 |
+
type = ( _.has(item_model, 'is_builtin') && item_model.is_builtin ) ? 'itemInputListReduced' : type;
|
965 |
+
}
|
966 |
+
|
967 |
+
switch(type) {
|
968 |
+
case 'rudItemPart' :
|
969 |
+
_el = module.rudItemPart;
|
970 |
+
break;
|
971 |
+
case 'ruItemPart' :
|
972 |
+
_el = module.ruItemPart;
|
973 |
+
break;
|
974 |
+
case 'itemInputList' :
|
975 |
+
_el = module.itemInputList;
|
976 |
+
break;
|
977 |
+
case 'itemInputListReduced' :
|
978 |
+
_el = module.itemInputListReduced;
|
979 |
+
break;
|
980 |
+
}
|
981 |
+
|
982 |
+
if ( _.isEmpty(_el) ) {
|
983 |
+
throw new Error( 'No valid template has been found in getTemplateEl()' );
|
984 |
+
} else {
|
985 |
+
return _el;
|
986 |
+
}
|
987 |
+
},
|
988 |
+
|
989 |
+
|
990 |
+
_toggleLocationAlertExpansion : function( $view, to ) {
|
991 |
+
var $_alert_el = $view.find('.czr-location-alert');
|
992 |
+
if ( ! $_alert_el.length ) {
|
993 |
+
var _html = [
|
994 |
+
'<span>' + serverControlParams.i18n.locationWarning + '</span>',
|
995 |
+
api.CZR_Helpers.getDocSearchLink( serverControlParams.i18n.locationWarning ),
|
996 |
+
].join('');
|
997 |
+
|
998 |
+
$_alert_el = $('<div/>', {
|
999 |
+
class:'czr-location-alert',
|
1000 |
+
html:_html,
|
1001 |
+
style:"display:none"
|
1002 |
+
});
|
1003 |
+
|
1004 |
+
$('select[data-type="locations"]', $view ).closest('div').after($_alert_el);
|
1005 |
+
}
|
1006 |
+
$_alert_el.toggle( 'expanded' == to);
|
1007 |
+
}
|
1008 |
+
});//$.extend()
|
1009 |
+
})( wp.customize , jQuery, _ );
|
assets/czr/fmk/js/____modules/free/___MOVED_TO_HUEMAN_THEME_JUNE_2018__3_2_body_background_module.js
ADDED
@@ -0,0 +1,117 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
//extends api.CZRModule
|
3 |
+
var CZRBodyBgModuleMths = CZRBodyBgModuleMths || {};
|
4 |
+
( function ( api, $, _ ) {
|
5 |
+
$.extend( CZRBodyBgModuleMths, {
|
6 |
+
initialize: function( id, options ) {
|
7 |
+
var module = this;
|
8 |
+
//run the parent initialize
|
9 |
+
api.CZRModule.prototype.initialize.call( module, id, options );
|
10 |
+
|
11 |
+
//extend the module with new template Selectors
|
12 |
+
$.extend( module, {
|
13 |
+
itemInputList : 'czr-module-bodybg-item-content'
|
14 |
+
} );
|
15 |
+
|
16 |
+
//EXTEND THE DEFAULT CONSTRUCTORS FOR INPUT
|
17 |
+
module.inputConstructor = api.CZRInput.extend( module.CZRBodyBgInputMths || {} );
|
18 |
+
//EXTEND THE DEFAULT CONSTRUCTORS FOR MONOMODEL
|
19 |
+
module.itemConstructor = api.CZRItem.extend( module.CZBodyBgItemMths || {} );
|
20 |
+
|
21 |
+
//declares a default model
|
22 |
+
module.defaultItemModel = {
|
23 |
+
'background-color' : '#eaeaea',
|
24 |
+
'background-image' : '',
|
25 |
+
'background-repeat' : 'no-repeat',
|
26 |
+
'background-attachment' : 'fixed',
|
27 |
+
'background-position' : 'center center',
|
28 |
+
'background-size' : 'cover'
|
29 |
+
};
|
30 |
+
|
31 |
+
//fired ready :
|
32 |
+
//1) on section expansion
|
33 |
+
//2) or in the case of a module embedded in a regular control, if the module section is alreay opened => typically when skope is enabled
|
34 |
+
if ( _.has( api, 'czr_activeSectionId' ) && module.control.section() == api.czr_activeSectionId() && 'resolved' != module.isReady.state() ) {
|
35 |
+
module.ready();
|
36 |
+
}
|
37 |
+
api.section( module.control.section() ).expanded.bind(function(to) {
|
38 |
+
if ( 'resolved' == module.isReady.state() )
|
39 |
+
return;
|
40 |
+
module.ready();
|
41 |
+
});
|
42 |
+
},//initialize
|
43 |
+
|
44 |
+
|
45 |
+
|
46 |
+
CZRBodyBgInputMths : {
|
47 |
+
//////////////////////////////////////////////////
|
48 |
+
///SETUP SELECTS
|
49 |
+
//////////////////////////////////////////////////
|
50 |
+
//setup select on view_rendered|item_content_event_map
|
51 |
+
setupSelect : function() {
|
52 |
+
var input = this,
|
53 |
+
_id_param_map = {
|
54 |
+
'background-repeat' : 'bg_repeat_options',
|
55 |
+
'background-attachment' : 'bg_attachment_options',
|
56 |
+
'background-position' : 'bg_position_options'
|
57 |
+
},
|
58 |
+
item = input.input_parent,
|
59 |
+
serverParams = serverControlParams.body_bg_module_params,
|
60 |
+
options = {},
|
61 |
+
module = input.module;
|
62 |
+
|
63 |
+
if ( ! _.has( _id_param_map, input.id ) )
|
64 |
+
return;
|
65 |
+
|
66 |
+
if ( _.isUndefined( serverParams ) || _.isUndefined( serverParams[ _id_param_map[input.id] ] ) )
|
67 |
+
return;
|
68 |
+
options = serverParams[ _id_param_map[input.id] ];
|
69 |
+
if ( _.isEmpty(options) )
|
70 |
+
return;
|
71 |
+
//generates the options
|
72 |
+
_.each( options, function( title, key ) {
|
73 |
+
var _attributes = {
|
74 |
+
value : key,
|
75 |
+
html: title
|
76 |
+
};
|
77 |
+
if ( key == input() || _.contains( input(), key ) )
|
78 |
+
$.extend( _attributes, { selected : "selected" } );
|
79 |
+
|
80 |
+
$( 'select[data-czrtype]', input.container ).append( $('<option>', _attributes) );
|
81 |
+
});
|
82 |
+
//fire czrSelect2
|
83 |
+
$( 'select[data-czrtype]', input.container ).czrSelect2();
|
84 |
+
}
|
85 |
+
},
|
86 |
+
|
87 |
+
|
88 |
+
CZBodyBgItemMths : {
|
89 |
+
//Fired if the item has been instantiated
|
90 |
+
//The item.callbacks are declared.
|
91 |
+
ready : function() {
|
92 |
+
var item = this;
|
93 |
+
api.CZRItem.prototype.ready.call( item );
|
94 |
+
|
95 |
+
item.inputCollection.bind( function( _col_ ) {
|
96 |
+
if ( ! _.isEmpty( _col ) && item.czr_Input && item.czr_Input.has( 'background-image' ) ) {
|
97 |
+
item.czr_Input('background-image').isReady.done( function( input_instance ) {
|
98 |
+
var set_visibilities = function( bg_val ) {
|
99 |
+
var is_bg_img_set = ! _.isEmpty( bg_val ) ||_.isNumber( bg_val);
|
100 |
+
_.each( ['background-repeat', 'background-attachment', 'background-position', 'background-size'], function( dep ) {
|
101 |
+
item.czr_Input(dep).container.toggle( is_bg_img_set || false );
|
102 |
+
});
|
103 |
+
};
|
104 |
+
set_visibilities( input_instance() );
|
105 |
+
//update the item model on 'background-image' change
|
106 |
+
item.bind('background-image:changed', function(){
|
107 |
+
set_visibilities( item.czr_Input('background-image')() );
|
108 |
+
});
|
109 |
+
});
|
110 |
+
}
|
111 |
+
});
|
112 |
+
|
113 |
+
},
|
114 |
+
|
115 |
+
}
|
116 |
+
});//$.extend
|
117 |
+
})( wp.customize , jQuery, _ );
|
assets/czr/fmk/js/____modules/pro/_2_9_fps_module.js
ADDED
@@ -0,0 +1,272 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
//extends api.CZRDynModule
|
2 |
+
|
3 |
+
var CZRFeaturedPageModuleMths = CZRFeaturedPageModuleMths || {};
|
4 |
+
( function ( api, $, _ ) {
|
5 |
+
$.extend( CZRFeaturedPageModuleMths, {
|
6 |
+
initialize: function( id, options ) {
|
7 |
+
var module = this;
|
8 |
+
//run the parent initialize
|
9 |
+
api.CZRDynModule.prototype.initialize.call( module, id, options );
|
10 |
+
|
11 |
+
//extend the module with new template Selectors
|
12 |
+
$.extend( module, {
|
13 |
+
itemPreAddEl : 'czr-module-fp-pre-add-view-content',
|
14 |
+
itemInputList : 'czr-module-fp-view-content'
|
15 |
+
} );
|
16 |
+
|
17 |
+
//EXTEND THE DEFAULT CONSTRUCTORS FOR INPUT
|
18 |
+
module.inputConstructor = api.CZRInput.extend( module.CZRFeaturedPagesInputMths || {} );
|
19 |
+
//EXTEND THE DEFAULT CONSTRUCTORS FOR MONOMODEL
|
20 |
+
module.itemConstructor = api.CZRItem.extend( module.CZRFeaturedPagesItem || {} );
|
21 |
+
|
22 |
+
//declares a default model
|
23 |
+
this.defaultItemModel = {
|
24 |
+
id : '',
|
25 |
+
title : '' ,
|
26 |
+
'fp-post' : '',
|
27 |
+
'fp-title' : '',
|
28 |
+
'fp-text' : '',
|
29 |
+
'fp-image' : '',
|
30 |
+
};
|
31 |
+
|
32 |
+
//overrides the default success message
|
33 |
+
this.itemAddedMessage = serverControlParams.i18n.featuredPageAdded;
|
34 |
+
api.section( module.control.section() ).expanded.bind(function(to) {
|
35 |
+
if ( 'resolved' == module.isReady.state() )
|
36 |
+
return;
|
37 |
+
module.ready();
|
38 |
+
});
|
39 |
+
},//initialize
|
40 |
+
|
41 |
+
|
42 |
+
|
43 |
+
|
44 |
+
|
45 |
+
//@override
|
46 |
+
// wait for the ajax result!
|
47 |
+
//the item is manually added.
|
48 |
+
//We should have a pre Item
|
49 |
+
addItem : function(obj) {
|
50 |
+
var module = this,
|
51 |
+
item = module.preItem,
|
52 |
+
item_model = item();
|
53 |
+
|
54 |
+
if ( _.isEmpty(item_model) || ! _.isObject(item_model) ) {
|
55 |
+
throw new Error('addItem : an item should be an object and not empty. In : ' + module.id +'. Aborted.' );
|
56 |
+
}
|
57 |
+
|
58 |
+
var _fp_post = item_model['fp-post'];
|
59 |
+
if ( typeof _fp_post == "undefined" )
|
60 |
+
return;
|
61 |
+
|
62 |
+
_fp_post = _fp_post[0];
|
63 |
+
|
64 |
+
//AJAX ACTIONS ON ADD ITEM
|
65 |
+
//when a new featured page is added, update the model (text, featured image ) base on the selected post
|
66 |
+
//The parent method is called on ajaxrequest.done()
|
67 |
+
var done_callback = function( _to_update ) {
|
68 |
+
item.set( $.extend( item_model, _to_update) );
|
69 |
+
api.CZRDynModule.prototype.addItem.call( module, obj );
|
70 |
+
};
|
71 |
+
|
72 |
+
var request = module.CZRFeaturedPagesItem.setContentAjaxInfo( _fp_post.id, {}, done_callback );
|
73 |
+
},
|
74 |
+
|
75 |
+
|
76 |
+
|
77 |
+
|
78 |
+
|
79 |
+
|
80 |
+
|
81 |
+
CZRFeaturedPagesInputMths : {
|
82 |
+
ready : function() {
|
83 |
+
var input = this;
|
84 |
+
//update the item model on fp-post change
|
85 |
+
input.bind( 'fp-post:changed', function(){
|
86 |
+
input.updateItemModel();
|
87 |
+
});
|
88 |
+
//update the item title on fp-title change
|
89 |
+
input.bind( 'fp-title:changed', function(){
|
90 |
+
input.updateItemTitle();
|
91 |
+
});
|
92 |
+
|
93 |
+
api.CZRInput.prototype.ready.call( input );
|
94 |
+
},
|
95 |
+
//override czr img uploader input constructor
|
96 |
+
//we need this otherwise we cannot add the buttons to the input container
|
97 |
+
//when the input model is not, as the template will be rendered before the ready
|
98 |
+
//method is called
|
99 |
+
setupImageUploader: function(){
|
100 |
+
var input = this;
|
101 |
+
//temporary
|
102 |
+
input.container.bind( 'fp-image:content_rendered', function(){
|
103 |
+
input.addResetDefaultButton();
|
104 |
+
});
|
105 |
+
|
106 |
+
//see add a reset to default image button
|
107 |
+
input.container.on('click keydown', '.default-fpimage-button', function(){
|
108 |
+
input.setThumbnailAjax();
|
109 |
+
});
|
110 |
+
|
111 |
+
api.CZRInput.prototype.setupImageUploader.call( input );
|
112 |
+
},
|
113 |
+
//ACTIONS ON fp-title change
|
114 |
+
//Fired on 'fp-title:changed'
|
115 |
+
//Don't fire in pre item case
|
116 |
+
updateItemModel : function( _new_val ) {
|
117 |
+
|
118 |
+
var input = this,
|
119 |
+
item = this.input_parent,
|
120 |
+
is_preItemInput = _.has( input, 'is_preItemInput' ) && input.is_preItemInput;
|
121 |
+
|
122 |
+
//check if we are in the pre Item case => if so, the fp-post might be empty
|
123 |
+
if ( ! _.has( item(), 'fp-post') || _.isEmpty( item()['fp-post'] ) )
|
124 |
+
return;
|
125 |
+
|
126 |
+
var _new_model = _.clone( item() ),
|
127 |
+
_fp_post = _new_model['fp-post'][0],
|
128 |
+
_new_title = _fp_post.title,
|
129 |
+
inputCollection = is_preItemInput ? input.module.preItemInput : item.czr_Input;
|
130 |
+
|
131 |
+
if ( is_preItemInput ) {
|
132 |
+
$.extend( _new_model, { title : _new_title, 'fp-title' : _new_title } );
|
133 |
+
item.set( _new_model );
|
134 |
+
} else {
|
135 |
+
|
136 |
+
var done_callback = function( _to_update ) {
|
137 |
+
_.each( _to_update, function( value, id ){
|
138 |
+
item.czr_Input( id ).set( value );
|
139 |
+
});
|
140 |
+
};
|
141 |
+
//pass the fp-title so it gets updated after the ajax callback
|
142 |
+
var request = item.setContentAjaxInfo( _fp_post.id, {'fp-title' : _new_title}, done_callback );
|
143 |
+
}
|
144 |
+
},
|
145 |
+
|
146 |
+
|
147 |
+
updateItemTitle : function( _new_val ) {
|
148 |
+
var input = this,
|
149 |
+
item = this.input_parent,
|
150 |
+
is_preItemInput = _.has( input, 'is_preItemInput' ) && input.is_preItemInput;
|
151 |
+
|
152 |
+
if ( is_preItemInput )
|
153 |
+
return;
|
154 |
+
var _new_model = _.clone( item() ),
|
155 |
+
_new_title = "undefined" !== typeof _new_model['fp-title'] ? _new_model['fp-title'] : '';
|
156 |
+
|
157 |
+
$.extend( _new_model, { title : _new_title} );
|
158 |
+
item.set( _new_model );
|
159 |
+
},
|
160 |
+
|
161 |
+
|
162 |
+
setThumbnailAjax : function() {
|
163 |
+
var item = this.input_parent,
|
164 |
+
_fp_post = item.czr_Input('fp-post')(),
|
165 |
+
_post_id;
|
166 |
+
|
167 |
+
if ( typeof _fp_post == "undefined" )
|
168 |
+
return;
|
169 |
+
|
170 |
+
_fp_post = _fp_post[0];
|
171 |
+
_post_id = _fp_post.id;
|
172 |
+
|
173 |
+
$('.fpimage-reset-messages p').hide();
|
174 |
+
|
175 |
+
//AJAX STUFF
|
176 |
+
//retrieve some ajax info
|
177 |
+
request = wp.ajax.post( 'get-fp-post-tb', {
|
178 |
+
'wp_customize': 'on',
|
179 |
+
'id' : _post_id,
|
180 |
+
'CZRFPNonce' : serverControlParams.CZRFPNonce
|
181 |
+
//nonce needed USE 1 for everything?
|
182 |
+
});
|
183 |
+
|
184 |
+
|
185 |
+
request.done( function( data ){
|
186 |
+
var thumbnail = data,
|
187 |
+
input = item.czr_Input('fp-image');
|
188 |
+
|
189 |
+
if ( 0 !== thumbnail.length ) {
|
190 |
+
$('.fpimage-reset-messages .success', input.container ).show('fast').fadeOut();
|
191 |
+
input.set( thumbnail );
|
192 |
+
}else {
|
193 |
+
$('.fpimage-reset-messages .warning', input.container ).show('fast').delay(2000).fadeOut();
|
194 |
+
}
|
195 |
+
});
|
196 |
+
|
197 |
+
request.fail(function( data ) {
|
198 |
+
if ( typeof console !== 'undefined' && console.error ) {
|
199 |
+
console.error( data );
|
200 |
+
}
|
201 |
+
});
|
202 |
+
},
|
203 |
+
|
204 |
+
addResetDefaultButton : function( $_template_params ) {
|
205 |
+
var input = this,
|
206 |
+
item = input.input_parent,
|
207 |
+
buttonLabel = serverControlParams.i18n.featuredPageImgReset,
|
208 |
+
successMess = serverControlParams.i18n.featuredPageResetSucc,
|
209 |
+
errMess = serverControlParams.i18n.featuredPageResetErr,
|
210 |
+
messages = '<div class="fpimage-reset-messages" style="clear:both"><p class="success" style="display:none">'+successMess+'</p><p class="warning" style="display:none">'+errMess+'</p></div>';
|
211 |
+
|
212 |
+
$('.actions', input.container)
|
213 |
+
.append('<button type="button" class="button default-fpimage-button">'+ buttonLabel +'</button>');
|
214 |
+
$('.fpimage-reset-messages', input.container ).detach();
|
215 |
+
$(input.container).append( messages );
|
216 |
+
}
|
217 |
+
},//CZRFeaturedPagesInputMths
|
218 |
+
|
219 |
+
|
220 |
+
|
221 |
+
|
222 |
+
|
223 |
+
|
224 |
+
|
225 |
+
|
226 |
+
CZRFeaturedPagesItem : {
|
227 |
+
setContentAjaxInfo : function( _post_id, _additional_inputs, done_callback ) {
|
228 |
+
//called be called from the input and from the item
|
229 |
+
var _to_update = _additional_inputs || {};
|
230 |
+
|
231 |
+
//AJAX STUFF
|
232 |
+
//retrieve some ajax info
|
233 |
+
request = wp.ajax.post( 'get-fp-post', {
|
234 |
+
'wp_customize': 'on',
|
235 |
+
'id' : _post_id,
|
236 |
+
'CZRFPNonce' : serverControlParams.CZRFPNonce
|
237 |
+
//nonce needed USE 1 for everything?
|
238 |
+
});
|
239 |
+
|
240 |
+
request.done( function( data ){
|
241 |
+
var _post_info = data.post_info;
|
242 |
+
|
243 |
+
if ( 0 !== _post_info.length ) {
|
244 |
+
$.extend( _to_update, { 'fp-image' : _post_info.thumbnail, 'fp-text' : _post_info.excerpt } );
|
245 |
+
if ( "function" === typeof done_callback )
|
246 |
+
done_callback( _to_update );
|
247 |
+
}
|
248 |
+
});
|
249 |
+
|
250 |
+
request.fail(function( data ) {
|
251 |
+
if ( typeof console !== 'undefined' && console.error ) {
|
252 |
+
console.error( data );
|
253 |
+
}
|
254 |
+
});
|
255 |
+
|
256 |
+
return request;
|
257 |
+
},
|
258 |
+
|
259 |
+
//overrides the default parent method by a custom one
|
260 |
+
//at this stage, the model passed in the obj is up to date
|
261 |
+
writeItemViewTitle : function( model ) {
|
262 |
+
var item = this,
|
263 |
+
module = item.module,
|
264 |
+
_model = model || item(),
|
265 |
+
_title = _model.title ? _model.title : serverControlParams.i18n.featuredPageTitle;
|
266 |
+
|
267 |
+
_title = api.CZR_Helpers.truncate(_title, 25);
|
268 |
+
$( '.' + module.control.css_attr.item_title , item.container ).html( _title );
|
269 |
+
}
|
270 |
+
}
|
271 |
+
});//extend
|
272 |
+
})( wp.customize , jQuery, _ );
|
assets/czr/fmk/js/____modules/pro/_3_0_text_module.js
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
//extends api.CZRModule
|
3 |
+
var CZRTextModuleMths = CZRTextModuleMths || {};
|
4 |
+
( function ( api, $, _ ) {
|
5 |
+
$.extend( CZRTextModuleMths, {
|
6 |
+
initialize: function( id, options ) {
|
7 |
+
var module = this;
|
8 |
+
//run the parent initialize
|
9 |
+
api.CZRModule.prototype.initialize.call( module, id, options );
|
10 |
+
|
11 |
+
//extend the module with new template Selectors
|
12 |
+
$.extend( module, {
|
13 |
+
itemInputList : 'czr-module-text-view-content',
|
14 |
+
} );
|
15 |
+
|
16 |
+
//declares a default model
|
17 |
+
module.defaultItemModel = {
|
18 |
+
id : '',
|
19 |
+
text : ''
|
20 |
+
};
|
21 |
+
}//initialize
|
22 |
+
});
|
23 |
+
})( wp.customize , jQuery, _ );
|
assets/czr/fmk/js/____modules/pro/_3_15_text_editor_module.js
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
//extends api.CZRDynModule
|
2 |
+
|
3 |
+
var CZRTextEditorModuleMths = CZRTextEditorModuleMths || {};
|
4 |
+
( function ( api, $, _ ) {
|
5 |
+
$.extend( CZRTextEditorModuleMths, {
|
6 |
+
initialize: function( id, options ) {
|
7 |
+
var module = this;
|
8 |
+
//run the parent initialize
|
9 |
+
api.CZRModule.prototype.initialize.call( module, id, options );
|
10 |
+
|
11 |
+
//extend the module with new template Selectors
|
12 |
+
$.extend( module, {
|
13 |
+
itemInputList : 'czr-module-text_editor-item-content'
|
14 |
+
} );
|
15 |
+
|
16 |
+
//EXTEND THE DEFAULT CONSTRUCTORS FOR INPUT
|
17 |
+
module.inputConstructor = api.CZRInput.extend( module.CZRTextEditorInputMths || {} );
|
18 |
+
//EXTEND THE DEFAULT CONSTRUCTORS FOR MONOMODEL
|
19 |
+
module.itemConstructor = api.CZRItem.extend( module.CZRTextEditorItem || {} );
|
20 |
+
|
21 |
+
//declares a default model
|
22 |
+
this.defaultItemModel = {
|
23 |
+
id : '',
|
24 |
+
text: ''
|
25 |
+
};
|
26 |
+
|
27 |
+
// api.section( module.control.section() ).expanded.bind(function(to) {
|
28 |
+
|
29 |
+
// // if ( false !== module.container.length ) {
|
30 |
+
// // //say it*/
|
31 |
+
// // module.container.append( $_module_el );
|
32 |
+
// // module.embedded.resolve();
|
33 |
+
// // }
|
34 |
+
|
35 |
+
// if ( 'resolved' == module.isReady.state() )
|
36 |
+
// return;
|
37 |
+
|
38 |
+
// module.ready();
|
39 |
+
// });
|
40 |
+
},//initialize
|
41 |
+
|
42 |
+
|
43 |
+
|
44 |
+
|
45 |
+
CZRTextEditorInputMths : {
|
46 |
+
},//CZRTextEditorsInputMths
|
47 |
+
|
48 |
+
|
49 |
+
|
50 |
+
CZRTextEditorItem : {
|
51 |
+
|
52 |
+
},
|
53 |
+
});//extend
|
54 |
+
})( wp.customize , jQuery, _ );
|
assets/czr/fmk/js/base-fmk/0_2_api_override/_0_0_0_pre_900_Value_prototype.js
ADDED
@@ -0,0 +1,128 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
( function ( api, $, _ ) {
|
3 |
+
/*****************************************************************************
|
4 |
+
* A "CONTEXT AWARE" SET METHD
|
5 |
+
*****************************************************************************/
|
6 |
+
/**
|
7 |
+
* OVERRIDES BASE api.Value set method
|
8 |
+
* => adds the o {} param, allowing to pass additional contextual informations.
|
9 |
+
*
|
10 |
+
* Set the value and trigger all bound callbacks.
|
11 |
+
*
|
12 |
+
* @param {object} to New value.
|
13 |
+
*/
|
14 |
+
|
15 |
+
// set: function( to ) {
|
16 |
+
// var from = this._value;
|
17 |
+
|
18 |
+
// to = this._setter.apply( this, arguments );
|
19 |
+
// to = this.validate( to );
|
20 |
+
|
21 |
+
// // Bail if the sanitized value is null or unchanged.
|
22 |
+
// if ( null === to || _.isEqual( from, to ) ) {
|
23 |
+
// return this;
|
24 |
+
// }
|
25 |
+
|
26 |
+
// this._value = to;
|
27 |
+
// this._dirty = true;
|
28 |
+
|
29 |
+
// this.callbacks.fireWith( this, [ to, from ] );
|
30 |
+
|
31 |
+
// return this;
|
32 |
+
// },
|
33 |
+
api.Value.prototype.set = function( to, o ) {
|
34 |
+
var from = this._value, dfd = $.Deferred(), self = this, _promises = [];
|
35 |
+
|
36 |
+
to = this._setter.apply( this, arguments );
|
37 |
+
to = this.validate( to );
|
38 |
+
args = _.extend( { silent : false }, _.isObject( o ) ? o : {} );
|
39 |
+
|
40 |
+
// Bail if the sanitized value is null or unchanged.
|
41 |
+
if ( null === to || _.isEqual( from, to ) ) {
|
42 |
+
return dfd.resolveWith( self, [ to, from, o ] ).promise();
|
43 |
+
}
|
44 |
+
|
45 |
+
this._value = to;
|
46 |
+
this._dirty = true;
|
47 |
+
if ( true === args.silent ) {
|
48 |
+
return dfd.resolveWith( self, [ to, from, o ] ).promise();
|
49 |
+
}
|
50 |
+
|
51 |
+
if ( this._deferreds ) {
|
52 |
+
_.each( self._deferreds, function( _prom ) {
|
53 |
+
_promises.push( _prom.apply( null, [ to, from, o ] ) );
|
54 |
+
});
|
55 |
+
|
56 |
+
$.when.apply( null, _promises )
|
57 |
+
.fail( function() { api.errorLog( 'A deferred callback failed in api.Value::set()'); })
|
58 |
+
.then( function() {
|
59 |
+
self.callbacks.fireWith( self, [ to, from, o ] );
|
60 |
+
dfd.resolveWith( self, [ to, from, o ] );
|
61 |
+
});
|
62 |
+
} else {
|
63 |
+
this.callbacks.fireWith( this, [ to, from, o ] );
|
64 |
+
return dfd.resolveWith( self, [ to, from, o ] ).promise( self );
|
65 |
+
}
|
66 |
+
return dfd.promise( self );
|
67 |
+
};
|
68 |
+
|
69 |
+
//allows us to specify a list of callbacks + a { deferred : true } param
|
70 |
+
//if deferred is found and true, then the callback(s) are added in a list of deferred
|
71 |
+
//@see how this deferred list is used in api.Value.prototype.set()
|
72 |
+
api.Value.prototype.bind = function() {
|
73 |
+
//find an object in the argument
|
74 |
+
var self = this,
|
75 |
+
_isDeferred = false,
|
76 |
+
_cbs = [];
|
77 |
+
|
78 |
+
$.each( arguments, function( _key, _arg ) {
|
79 |
+
if ( ! _isDeferred )
|
80 |
+
_isDeferred = _.isObject( _arg ) && _arg.deferred;
|
81 |
+
if ( _.isFunction( _arg ) )
|
82 |
+
_cbs.push( _arg );
|
83 |
+
});
|
84 |
+
|
85 |
+
if ( _isDeferred ) {
|
86 |
+
self._deferreds = self._deferreds || [];
|
87 |
+
_.each( _cbs, function( _cb ) {
|
88 |
+
if ( ! _.contains( _cb, self._deferreds ) )
|
89 |
+
self._deferreds.push( _cb );
|
90 |
+
});
|
91 |
+
} else {
|
92 |
+
//original method
|
93 |
+
self.callbacks.add.apply( self.callbacks, arguments );
|
94 |
+
}
|
95 |
+
return this;
|
96 |
+
};
|
97 |
+
|
98 |
+
/*****************************************************************************
|
99 |
+
* A SILENT SET METHOD :
|
100 |
+
* => keep the dirtyness param unchanged
|
101 |
+
* => stores the api state before callback calls, and reset it after
|
102 |
+
* => add an object param to the callback to inform that this is a silent process
|
103 |
+
* , this is typically used in the overridden api.Setting.preview method
|
104 |
+
*****************************************************************************/
|
105 |
+
//@param to : the new value to set
|
106 |
+
//@param dirtyness : the current dirtyness status of this setting
|
107 |
+
//
|
108 |
+
api.Setting.prototype.silent_set =function( to, dirtyness ) {
|
109 |
+
var from = this._value,
|
110 |
+
_save_state = api.state('saved')();
|
111 |
+
|
112 |
+
to = this._setter.apply( this, arguments );
|
113 |
+
to = this.validate( to );
|
114 |
+
|
115 |
+
// Bail if the sanitized value is null or unchanged.
|
116 |
+
if ( null === to || _.isEqual( from, to ) ) {
|
117 |
+
return this;
|
118 |
+
}
|
119 |
+
|
120 |
+
this._value = to;
|
121 |
+
this._dirty = ( _.isUndefined( dirtyness ) || ! _.isBoolean( dirtyness ) ) ? this._dirty : dirtyness;
|
122 |
+
|
123 |
+
this.callbacks.fireWith( this, [ to, from, { silent : true } ] );
|
124 |
+
//reset the api state to its value before the callback call
|
125 |
+
api.state('saved')( _save_state );
|
126 |
+
return this;
|
127 |
+
};
|
128 |
+
})( wp.customize , jQuery, _ );
|
assets/czr/fmk/js/base-fmk/0_2_api_override/_0_0_0_pre_908_Setting_prototype.js
ADDED
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
( function ( api, $, _ ) {
|
3 |
+
//PREPARE THE SKOPE AWARE PREVIEWER
|
4 |
+
|
5 |
+
//@return void()
|
6 |
+
//Changed the core to specify that the setting preview is actually a deferred callback
|
7 |
+
//=> allows us to use syntax like :
|
8 |
+
//api( setId ).set( new_value ).done( function() { execute actions when all the setting callbacks have been done })
|
9 |
+
// api.Setting.prototype.initialize = function( id, value, options ) {
|
10 |
+
// var setting = this;
|
11 |
+
// api.Value.prototype.initialize.call( setting, value, options );
|
12 |
+
|
13 |
+
// setting.id = id;
|
14 |
+
// setting.transport = setting.transport || 'refresh';
|
15 |
+
// setting._dirty = options.dirty || false;
|
16 |
+
// setting.notifications = new api.Values({ defaultConstructor: api.Notification });
|
17 |
+
|
18 |
+
// // Whenever the setting's value changes, refresh the preview.
|
19 |
+
// setting.bind( setting.preview );
|
20 |
+
|
21 |
+
// // the deferred can be used in moduleCollectionReact to execute actions after the module has been set.
|
22 |
+
// // setting.bind( function( to, from , data ) {
|
23 |
+
// // return setting.preview( to, from , data );
|
24 |
+
// // }, { deferred : true } );
|
25 |
+
// };
|
26 |
+
|
27 |
+
|
28 |
+
//var _old_preview = api.Setting.prototype.preview;
|
29 |
+
//@return a deferred promise
|
30 |
+
api.Setting.prototype.preview = function( to, from , data ) {
|
31 |
+
var setting = this, transport, dfd = $.Deferred();
|
32 |
+
|
33 |
+
transport = setting.transport;
|
34 |
+
|
35 |
+
//as soon as the previewer is setup, let's behave as usual
|
36 |
+
//=> but don't refresh when silently updating
|
37 |
+
|
38 |
+
//Each input instantiated in an item or a modOpt can have a specific transport set.
|
39 |
+
//the input transport is hard coded in the module js template, with the attribute : data-transport="postMessage" or "refresh"
|
40 |
+
//=> this is optional, if not set, then the transport will be inherited from the the module, which inherits from the control.
|
41 |
+
//
|
42 |
+
//If the input transport is specifically set to postMessage, then we don't want to send the 'setting' event to the preview
|
43 |
+
//=> this will prevent any partial refresh to be triggered if the input control parent is defined has a partial refresh one.
|
44 |
+
//=> the input will be sent to preview with api.previewer.send( 'czr_input', {...} )
|
45 |
+
//
|
46 |
+
//One exception : if the input transport is set to postMessage but the setting has not been set yet in the api (from is undefined, null, or empty) , we usually need to make an initial refresh
|
47 |
+
//=> typically, the initial refresh can be needed to set the relevant module css id selector that will be used afterwards for the postMessage input preview
|
48 |
+
|
49 |
+
//If we are in an input postMessage situation, the not_preview_sent param has been set in the czr_Input.inputReact method
|
50 |
+
//=> 1) We bail here
|
51 |
+
//=> 2) and we will send a custom event to the preview looking like :
|
52 |
+
//api.previewer.send( 'czr_input', {
|
53 |
+
// set_id : module.control.id,
|
54 |
+
// module : { items : $.extend( true, {}, module().items) , modOpt : module.hasModOpt() ? $.extend( true, {}, module().modOpt ): {} },
|
55 |
+
// module_id : module.id,//<= will allow us to target the right dom element on front end
|
56 |
+
// input_id : input.id,
|
57 |
+
// input_parent_id : input.input_parent.id,//<= can be the mod opt or the item
|
58 |
+
// value : to
|
59 |
+
// });
|
60 |
+
|
61 |
+
//=> if no from (setting not set yet => fall back on defaut transport)
|
62 |
+
if ( ! _.isUndefined( from ) && ! _.isEmpty( from ) && ! _.isNull( from ) ) {
|
63 |
+
if ( _.isObject( data ) && true === data.not_preview_sent ) {
|
64 |
+
return dfd.resolve( arguments ).promise();
|
65 |
+
}
|
66 |
+
}
|
67 |
+
|
68 |
+
//Don't do anything id we are silent
|
69 |
+
if ( _.has( data, 'silent' ) && false !== data.silent )
|
70 |
+
return dfd.resolve( arguments ).promise();
|
71 |
+
|
72 |
+
|
73 |
+
//CORE PREVIEW AS OF WP 4.7+
|
74 |
+
if ( 'postMessage' === transport && ! api.state( 'previewerAlive' ).get() ) {
|
75 |
+
transport = 'refresh';
|
76 |
+
}
|
77 |
+
|
78 |
+
if ( 'postMessage' === transport ) {
|
79 |
+
//Pre setting event with a richer object passed
|
80 |
+
//=> can be used in a partial refresh scenario to execute actions prior to the actual selective refresh which is triggered on 'setting', just after
|
81 |
+
setting.previewer.send( 'pre_setting', {
|
82 |
+
set_id : setting.id,
|
83 |
+
data : data,//<= { module_id : 'string', module : {} } which typically includes the module_id and the module model ( items, mod options )
|
84 |
+
value : to
|
85 |
+
});
|
86 |
+
|
87 |
+
//WP Default
|
88 |
+
//=> the 'setting' event is used for normal and partial refresh post message actions
|
89 |
+
//=> the partial refresh is fired on the preview if a partial has been registered for this setting in the php customize API
|
90 |
+
//=> When a partial has been registered, the "normal" ( => the not partial refresh ones ) postMessage callbacks will be fired before the ajax ones
|
91 |
+
|
92 |
+
// Nimble Builder => the 'setting' event triggers a refresh of the previewer dirty values
|
93 |
+
// The dirties are then used to populate $_POST['customized'] params via $.ajaxPrefilter()
|
94 |
+
// @see core customize-preview.js
|
95 |
+
// This is how NB can :
|
96 |
+
// - dynamically register settings server side in PHP customize manager while doing ajax actions
|
97 |
+
// - get the customized sektion collection. @see sek_get_skoped_seks() and Nimble_Collection_Setting::filter_previewed_sek_get_skoped_seks
|
98 |
+
setting.previewer.send( 'setting', [ setting.id, setting() ] );
|
99 |
+
|
100 |
+
dfd.resolve( arguments );
|
101 |
+
|
102 |
+
} else if ( 'refresh' === transport ) {
|
103 |
+
setting.previewer.refresh();
|
104 |
+
dfd.resolve( arguments );
|
105 |
+
}
|
106 |
+
|
107 |
+
return dfd.promise();
|
108 |
+
};//api.Setting.prototype.preview
|
109 |
+
})( wp.customize , jQuery, _ );
|
assets/czr/fmk/js/base-fmk/0_2_api_override/_0_0_0_pre_990_various_overrides.js
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
( function ( api, $, _ ) {
|
3 |
+
/* monkey patch for the content height set */
|
4 |
+
//wp.customize.Section is not available before wp 4.1
|
5 |
+
if ( 'function' == typeof api.Section ) {
|
6 |
+
// backup the original function
|
7 |
+
var _original_section_initialize = api.Section.prototype.initialize;
|
8 |
+
api.Section.prototype.initialize = function( id, options ) {
|
9 |
+
//call the original constructor
|
10 |
+
_original_section_initialize.apply( this, [id, options] );
|
11 |
+
var section = this;
|
12 |
+
|
13 |
+
this.expanded.callbacks.add( function( _expanded ) {
|
14 |
+
if ( ! _expanded )
|
15 |
+
return;
|
16 |
+
|
17 |
+
var container = section.container.closest( '.wp-full-overlay-sidebar-content' ),
|
18 |
+
content = section.container.find( '.accordion-section-content' );
|
19 |
+
//content resizing to the container height
|
20 |
+
_resizeContentHeight = function() {
|
21 |
+
content.css( 'height', container.innerHeight() );
|
22 |
+
};
|
23 |
+
_resizeContentHeight();
|
24 |
+
//this is set to off in the original expand callback if 'expanded' is false
|
25 |
+
$( window ).on( 'resize.customizer-section', _.debounce( _resizeContentHeight, 110 ) );
|
26 |
+
});
|
27 |
+
};
|
28 |
+
}
|
29 |
+
})( wp.customize , jQuery, _ );
|
assets/czr/fmk/js/base-fmk/0_3_api_helpers/_0_0_0_pre_97_api_helpers_setup_input_from_dom.js
ADDED
@@ -0,0 +1,117 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
(function (api, $, _) {
|
3 |
+
api.CZR_Helpers = api.CZR_Helpers || {};
|
4 |
+
//////////////////////////////////////////////////
|
5 |
+
/// ACTIONS AND DOM LISTENERS
|
6 |
+
//////////////////////////////////////////////////
|
7 |
+
//adds action to an existing event map
|
8 |
+
//@event map = [ {event1}, {event2}, ... ]
|
9 |
+
//@new_event = { trigger : event name , actions : [ 'cb1', 'cb2', ... ] }
|
10 |
+
api.CZR_Helpers = $.extend( api.CZR_Helpers, {
|
11 |
+
//This method is now statically accessed by item and modopt instances because it does the same job for both.
|
12 |
+
//=> It instantiates the inputs based on what it finds in the DOM ( item or mod opt js templates )
|
13 |
+
//
|
14 |
+
//Fired on 'contentRendered' for items and on user click for module options (mod opt)
|
15 |
+
//creates the inputs based on the rendered parent item or mod option
|
16 |
+
//inputParentInst can be an item instance or a module option instance
|
17 |
+
setupInputCollectionFromDOM : function() {
|
18 |
+
var inputParentInst = this;//<= because fired with .call( inputParentInst )
|
19 |
+
if ( ! _.isFunction( inputParentInst ) ) {
|
20 |
+
throw new Error( 'setupInputCollectionFromDOM => inputParentInst is not valid.' );
|
21 |
+
}
|
22 |
+
var module = inputParentInst.module,
|
23 |
+
is_mod_opt = _.has( inputParentInst() , 'is_mod_opt' );
|
24 |
+
|
25 |
+
//bail if already done
|
26 |
+
//_.has( inputParentInst, 'czr_Input')
|
27 |
+
if ( ! _.isEmpty( inputParentInst.inputCollection() ) )
|
28 |
+
return;
|
29 |
+
|
30 |
+
//INPUTS => Setup as soon as the view content is rendered
|
31 |
+
//the inputParentInst is a collection of inputs, each one has its own view module.
|
32 |
+
inputParentInst.czr_Input = inputParentInst.czr_Input || new api.Values();
|
33 |
+
|
34 |
+
//IS THE PARENT AN ITEM OR A MODULE OPTION ?
|
35 |
+
//those default constructors (declared in the module init ) can be overridden by extended item or mod opt constructors inside the modules
|
36 |
+
inputParentInst.inputConstructor = is_mod_opt ? module.inputModOptConstructor : module.inputConstructor;
|
37 |
+
|
38 |
+
var _defaultInputParentModel = is_mod_opt ? inputParentInst.defaultModOptModel : inputParentInst.defaultItemModel;
|
39 |
+
|
40 |
+
if ( _.isEmpty( _defaultInputParentModel ) || _.isUndefined( _defaultInputParentModel ) ) {
|
41 |
+
throw new Error( 'setupInputCollectionFromDOM => No default model found in item or mod opt ' + inputParentInst.id + '.' );
|
42 |
+
}
|
43 |
+
|
44 |
+
//prepare and sets the inputParentInst value on api ready
|
45 |
+
//=> triggers the module rendering + DOM LISTENERS
|
46 |
+
var inputParentInst_model = $.extend( true, {}, inputParentInst() );
|
47 |
+
|
48 |
+
if ( ! _.isObject( inputParentInst_model ) ) {
|
49 |
+
inputParentInst_model = _defaultInputParentModel;
|
50 |
+
} else {
|
51 |
+
inputParentInst_model = $.extend( _defaultInputParentModel, inputParentInst_model );
|
52 |
+
}
|
53 |
+
|
54 |
+
var dom_inputParentInst_model = {};
|
55 |
+
|
56 |
+
if ( $( '.' + module.control.css_attr.sub_set_wrapper, inputParentInst.container).length < 1 ) {
|
57 |
+
api.errare( 'setupInputCollectionFromDOM => no input elements found in the DOM' );
|
58 |
+
}
|
59 |
+
|
60 |
+
//creates the inputs based on the rendered item or mod opt
|
61 |
+
$( '.' + module.control.css_attr.sub_set_wrapper, inputParentInst.container).each( function( _index ) {
|
62 |
+
var _id = $(this).find('[data-czrtype]').attr( 'data-czrtype' ),
|
63 |
+
_value = _.has( inputParentInst_model, _id ) ? inputParentInst_model[ _id ] : '';
|
64 |
+
|
65 |
+
//console.log('/// ID /// => ', _id );
|
66 |
+
//skip if no valid input data-czrtype is found in this node
|
67 |
+
if ( _.isUndefined( _id ) || _.isEmpty( _id ) ) {
|
68 |
+
api.errare( 'setupInputCollectionFromDOM => missing data-czrtype id for input type ' + $(this).data( 'input-type' ) + ' in module ' + module.id + '. Check that the server input template is properly declared.' );
|
69 |
+
return;
|
70 |
+
}
|
71 |
+
//check if this property exists in the current inputParentInst model
|
72 |
+
if ( ! _.has( inputParentInst_model, _id ) ) {
|
73 |
+
throw new Error('setupInputCollectionFromDOM => The item or mod opt property : ' + _id + ' has been found in the DOM but not in the item or mod opt model : '+ inputParentInst.id + '. The input can not be instantiated.');
|
74 |
+
}
|
75 |
+
|
76 |
+
//Do we have a specific set of options defined in the parent module for this inputConstructor ?
|
77 |
+
var _inputType = $(this).data( 'input-type' ),
|
78 |
+
_inputTransport = $(this).data( 'transport' ) || 'inherit',//<= if no specific transport ( refresh or postMessage ) has been defined in the template, inherits the control transport
|
79 |
+
_inputOptions = _.has( module.inputOptions, _inputType ) ? module.inputOptions[ _inputType ] : {},
|
80 |
+
_inputArgs = {
|
81 |
+
id : _id,
|
82 |
+
type : _inputType,
|
83 |
+
transport : _inputTransport,
|
84 |
+
input_value : _value,
|
85 |
+
input_options : _inputOptions,//<= a module can define a specific set of option
|
86 |
+
container : $(this),
|
87 |
+
input_parent : inputParentInst,
|
88 |
+
is_mod_opt : is_mod_opt,
|
89 |
+
module : module
|
90 |
+
};
|
91 |
+
|
92 |
+
// ALLOW PLUGINS TO FILTER THE INPUT ARGS BEFORE INSTANTIATION
|
93 |
+
api.trigger( 'input-args-before-instantiation', _inputArgs );
|
94 |
+
|
95 |
+
// INSTANTIATE THE INPUT
|
96 |
+
inputParentInst.czr_Input.add( _id, new inputParentInst.inputConstructor( _id, _inputArgs ) );
|
97 |
+
|
98 |
+
// FIRE THE INPUT
|
99 |
+
// fires ready once the input Value() instance is initialized
|
100 |
+
inputParentInst.czr_Input( _id ).ready();
|
101 |
+
|
102 |
+
// POPULATES THE PARENT INPUT COLLECTION
|
103 |
+
dom_inputParentInst_model[ _id ] = _value;
|
104 |
+
// shall we trigger a specific event when the input collection from DOM has been populated ?
|
105 |
+
});//each
|
106 |
+
|
107 |
+
//stores the collection
|
108 |
+
inputParentInst.inputCollection( dom_inputParentInst_model );
|
109 |
+
|
110 |
+
//chain
|
111 |
+
return inputParentInst;
|
112 |
+
}
|
113 |
+
});//$.extend
|
114 |
+
// $( window ).on( 'message', function( e, o) {
|
115 |
+
// api.consoleLog('WHAT ARE WE LISTENING TO?', e, o );
|
116 |
+
// });
|
117 |
+
})( wp.customize , jQuery, _);
|
assets/czr/fmk/js/base-fmk/0_3_api_helpers/_0_0_1_pre_97_api_helpers_get_module_template.js
ADDED
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
(function (api, $, _) {
|
3 |
+
api.CZR_Helpers = api.CZR_Helpers || {};
|
4 |
+
//////////////////////////////////////////////////
|
5 |
+
/// ACTIONS AND DOM LISTENERS
|
6 |
+
//////////////////////////////////////////////////
|
7 |
+
//adds action to an existing event map
|
8 |
+
//@event map = [ {event1}, {event2}, ... ]
|
9 |
+
//@new_event = { trigger : event name , actions : [ 'cb1', 'cb2', ... ] }
|
10 |
+
api.CZR_Helpers = $.extend( api.CZR_Helpers, {
|
11 |
+
|
12 |
+
// Fetches a module tmpl from the server if not yet cached
|
13 |
+
// {
|
14 |
+
// tmpl : 'item-inputs',
|
15 |
+
// module_type: module.module_type || 'all_modules',
|
16 |
+
// module_id : ''
|
17 |
+
// ... <= other custom args can be added dynamically here. Like the item_model when fetching the item content template
|
18 |
+
// }
|
19 |
+
// @return a promise()
|
20 |
+
getModuleTmpl : function( args ) {
|
21 |
+
var dfd = $.Deferred();
|
22 |
+
args = _.extend( {
|
23 |
+
tmpl : '',
|
24 |
+
module_type: '',
|
25 |
+
module_id : '',
|
26 |
+
cache : true,//<= shall we cache the tmpl or not. Should be true in almost all cases.
|
27 |
+
nonce: api.settings.nonce.save//<= do we need to set a specific nonce to fetch the tmpls ?
|
28 |
+
}, args );
|
29 |
+
|
30 |
+
// are we good to go ?
|
31 |
+
if ( _.isEmpty( args.tmpl ) || _.isEmpty( args.module_type ) ) {
|
32 |
+
dfd.reject( 'api.CZR_Helpers.getModuleTmpl => missing tmpl or module_type param' );
|
33 |
+
}
|
34 |
+
|
35 |
+
// This will be used to store the previously fetched template
|
36 |
+
// 1) the generic templates used for all_modules
|
37 |
+
// 2) each module templates : pre-item inputs, item inputs and mod options
|
38 |
+
api.CZR_Helpers.czr_cachedTmpl = api.CZR_Helpers.czr_cachedTmpl || {};
|
39 |
+
api.CZR_Helpers.czr_cachedTmpl[ args.module_type ] = api.CZR_Helpers.czr_cachedTmpl[ args.module_type ] || {};
|
40 |
+
|
41 |
+
// when cache is on, use the cached template
|
42 |
+
// Example of cache set to off => the skoped items templates are all different because based on the control type => we can't cache them
|
43 |
+
if ( true === args.cache && ! _.isEmpty( api.CZR_Helpers.czr_cachedTmpl[ args.module_type ][ args.tmpl ] ) && _.isString( api.CZR_Helpers.czr_cachedTmpl[ args.module_type ][ args.tmpl ] ) ) {
|
44 |
+
//console.log('Cached => ', args.tmpl );
|
45 |
+
dfd.resolve( api.CZR_Helpers.czr_cachedTmpl[ args.module_type ][ args.tmpl ] );
|
46 |
+
} else {
|
47 |
+
// if the tmpl is currently being fetched, return the temporary promise()
|
48 |
+
// this can occurs when rendering a multi-item module for the first time
|
49 |
+
// assigning the tmpl ajax request to the future cache entry allows us to fetch only once
|
50 |
+
if ( _.isObject( api.CZR_Helpers.czr_cachedTmpl[ args.module_type ][ args.tmpl ] ) && 'pending' == api.CZR_Helpers.czr_cachedTmpl[ args.module_type ][ args.tmpl ].state() ) {
|
51 |
+
return api.CZR_Helpers.czr_cachedTmpl[ args.module_type ][ args.tmpl ];//<= this is a $.promise()
|
52 |
+
} else {
|
53 |
+
//console.log('Needs to be fetched => ', args.tmpl );
|
54 |
+
// First time fetch
|
55 |
+
api.CZR_Helpers.czr_cachedTmpl[ args.module_type ][ args.tmpl ] = wp.ajax.post( 'ac_get_template', args )
|
56 |
+
.done( function( _serverTmpl_ ) {
|
57 |
+
// resolve and cache
|
58 |
+
dfd.resolve( _serverTmpl_ );
|
59 |
+
api.CZR_Helpers.czr_cachedTmpl[ args.module_type ][ args.tmpl ] = _serverTmpl_;
|
60 |
+
}).fail( function( _r_ ) {
|
61 |
+
//console.log( 'api.CZR_Helpers.getModuleTmpl => ', _r_ );
|
62 |
+
api.errare( 'api.CZR_Helpers.getModuleTmpl => Problem when fetching the ' + args.tmpl + ' tmpl from server for module : ' + args.module_id + ' ' + args.module_type, _r_);
|
63 |
+
dfd.reject( _r_ );
|
64 |
+
// Nimble => display an error notification when
|
65 |
+
// - session has expired
|
66 |
+
// - when statusText is "Bad Request"
|
67 |
+
if ( _.isObject( _r_ ) ) {
|
68 |
+
if ( 'invalid_nonce' === _r_.code || 'Bad Request' === _r_.statusText ) {
|
69 |
+
if ( window.sektionsLocalizedData && sektionsLocalizedData.i18n ) {
|
70 |
+
api.previewer.trigger( 'sek-notify', { type : 'error', duration : 30000, message : sektionsLocalizedData.i18n['Something went wrong, please refresh this page.'] });
|
71 |
+
}
|
72 |
+
}
|
73 |
+
}
|
74 |
+
});
|
75 |
+
}
|
76 |
+
}
|
77 |
+
return dfd.promise();
|
78 |
+
}
|
79 |
+
|
80 |
+
});//$.extend
|
81 |
+
// $( window ).on( 'message', function( e, o) {
|
82 |
+
// api.consoleLog('WHAT ARE WE LISTENING TO?', e, o );
|
83 |
+
// });
|
84 |
+
})( wp.customize , jQuery, _);
|
assets/czr/fmk/js/base-fmk/0_3_api_helpers/_0_0_2_pre_97_api_helpers_register_utils.js
ADDED
@@ -0,0 +1,196 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
(function (api, $, _) {
|
3 |
+
api.CZR_Helpers = api.CZR_Helpers || {};
|
4 |
+
api.CZR_Helpers = $.extend( api.CZR_Helpers, {
|
5 |
+
// @params {}. Example :
|
6 |
+
// origin : 'nimble',
|
7 |
+
// what : 'section',
|
8 |
+
// id : params.id,
|
9 |
+
// title: sektionsLocalizedData.i18n['Content for'] + ' ' + moduleName,
|
10 |
+
// panel : sektionsLocalizedData.sektionsPanelId,
|
11 |
+
// priority : 1000,
|
12 |
+
// track : false//don't register in the self.registered()
|
13 |
+
// constructWith : MainSectionConstructor,
|
14 |
+
register : function( params ) {
|
15 |
+
if ( ! _.has( params, 'id' ) ) {
|
16 |
+
api.errare( 'register => missing id ', params );
|
17 |
+
return;
|
18 |
+
}
|
19 |
+
// For the UI elements that we want to track, a level property is needed
|
20 |
+
// if ( false !== params.track && ! _.has( params, 'level' ) ){
|
21 |
+
// api.errare( 'register => missing trackable level ', params );
|
22 |
+
// return;
|
23 |
+
// }
|
24 |
+
|
25 |
+
var __element__ = {}, defaults;
|
26 |
+
|
27 |
+
switch ( params.what ) {
|
28 |
+
// Register only if not registered already
|
29 |
+
// For example, when saved as draft in a changeset, the setting is already dynamically registered server side
|
30 |
+
// => in this case, we only need to register the associated control
|
31 |
+
// @params args { id : , value : , transport : , type : }
|
32 |
+
case 'setting' :
|
33 |
+
if ( api.has( params.id ) ) {
|
34 |
+
//api.consoleLog( 'registerSetting => setting Id already registered : ' + params.id );
|
35 |
+
break;
|
36 |
+
}
|
37 |
+
defaults = $.extend( true, {}, api.Setting.prototype.defaults );
|
38 |
+
var settingArgs = _.extend(
|
39 |
+
defaults ,
|
40 |
+
{
|
41 |
+
dirty : ! _.isUndefined( params.dirty ) ? params.dirty : false,
|
42 |
+
value : _.isUndefined( params.value ) ? null : params.value,
|
43 |
+
transport : params.transport || 'refresh',
|
44 |
+
type : params.type || 'option'
|
45 |
+
}
|
46 |
+
);
|
47 |
+
// assign the value sent from the server
|
48 |
+
|
49 |
+
var SettingConstructor = api.settingConstructor[ settingArgs.type ] || api.Setting;
|
50 |
+
|
51 |
+
// extend with specific additional options provided on registration
|
52 |
+
if ( _.isObject( params.options ) ) {
|
53 |
+
settingArgs = _.extend( settingArgs , params.options );
|
54 |
+
}
|
55 |
+
|
56 |
+
try { api.add( new SettingConstructor( params.id, settingArgs.value, settingArgs ) ); } catch ( er ) {
|
57 |
+
api.errare( 'api.CZR_Helpers::register => problem when adding a setting to the api', er );
|
58 |
+
}
|
59 |
+
break;
|
60 |
+
|
61 |
+
|
62 |
+
case 'panel' :
|
63 |
+
// Check if we have a correct section
|
64 |
+
if ( ! _.has( params, 'id' ) ){
|
65 |
+
throw new Error( 'registerPanel => missing panel id ');
|
66 |
+
}
|
67 |
+
|
68 |
+
if ( api.panel.has( params.id ) ) {
|
69 |
+
//api.errare( 'registerPanel => ' + params.id + ' is already registered');
|
70 |
+
break;
|
71 |
+
}
|
72 |
+
|
73 |
+
defaults = $.extend( true, {}, api.Panel.prototype.defaults );
|
74 |
+
var panelParams = _.extend(
|
75 |
+
defaults , {
|
76 |
+
id: params.id,
|
77 |
+
title: params.title || params.id,
|
78 |
+
priority: _.has( params, 'priority' ) ? params.priority : 0
|
79 |
+
}
|
80 |
+
);
|
81 |
+
|
82 |
+
var PanelConstructor = _.isObject( params.constructWith ) ? params.constructWith : api.Panel;
|
83 |
+
|
84 |
+
// extend with specific additional options provided on registration
|
85 |
+
if ( _.isObject( params.options ) ) {
|
86 |
+
panelParams = _.extend( panelParams , params.options );
|
87 |
+
}
|
88 |
+
panelParams = _.extend( { params: panelParams }, panelParams ); // Inclusion of params alias is for back-compat for custom panels that expect to augment this property.
|
89 |
+
|
90 |
+
try { __element__ = api.panel.add( new PanelConstructor( params.id, panelParams ) ); } catch ( er ) {
|
91 |
+
api.errare( 'api.CZR_Helpers::register => problem when adding a panel to the api', er );
|
92 |
+
}
|
93 |
+
break;
|
94 |
+
|
95 |
+
|
96 |
+
case 'section' :
|
97 |
+
// MAYBE REGISTER THE SECTION
|
98 |
+
// Check if we have a correct section
|
99 |
+
if ( ! _.has( params, 'id' ) ){
|
100 |
+
throw new Error( 'registerSection => missing section id ');
|
101 |
+
}
|
102 |
+
|
103 |
+
if ( api.section.has( params.id ) ) {
|
104 |
+
//api.infoLog( 'registerSection => ' + params.id + ' is already registered');
|
105 |
+
break;
|
106 |
+
}
|
107 |
+
|
108 |
+
defaults = $.extend( true, {}, api.Section.prototype.defaults );
|
109 |
+
var sectionParams = _.extend(
|
110 |
+
defaults, {
|
111 |
+
content : '',
|
112 |
+
id: params.id,
|
113 |
+
title: params.title,
|
114 |
+
panel: params.panel,
|
115 |
+
priority: params.priority,
|
116 |
+
description_hidden : false,
|
117 |
+
customizeAction: serverControlParams.i18n['Customizing']
|
118 |
+
}
|
119 |
+
);
|
120 |
+
|
121 |
+
var SectionConstructor = api.Section;
|
122 |
+
if ( ! _.isUndefined( params.constructWith ) ) {
|
123 |
+
SectionConstructor = params.constructWith;
|
124 |
+
} else if ( ! _.isEmpty( params.type ) && api.sectionConstructor[ params.type ] ) {
|
125 |
+
SectionConstructor = api.sectionConstructor[ params.type ];
|
126 |
+
}
|
127 |
+
|
128 |
+
// extend with specific additional options provided on registration
|
129 |
+
if ( _.isObject( params.options ) ) {
|
130 |
+
sectionParams = _.extend( sectionParams , params.options );
|
131 |
+
}
|
132 |
+
|
133 |
+
sectionParams = _.extend( { params: sectionParams }, sectionParams ); // Inclusion of params alias is for back-compat for custom panels that expect to augment this property.
|
134 |
+
try { __element__ = api.section.add( new SectionConstructor( params.id, sectionParams ) ); } catch ( er ) {
|
135 |
+
api.errare( 'api.CZR_Helpers::register => problem when adding a section to the api', er );
|
136 |
+
}
|
137 |
+
break;
|
138 |
+
|
139 |
+
|
140 |
+
case 'control' :
|
141 |
+
if ( api.control.has( params.id ) ) {
|
142 |
+
//api.errorLog( 'registerControl => ' + params.id + ' is already registered');
|
143 |
+
break;
|
144 |
+
}
|
145 |
+
|
146 |
+
//@see api.settings.controls,
|
147 |
+
defaults = $.extend( true, {}, api.Control.prototype.defaults );
|
148 |
+
var controlArgs = _.extend(
|
149 |
+
defaults,
|
150 |
+
{
|
151 |
+
content : '',
|
152 |
+
label : params.label || params.id,
|
153 |
+
priority : params.priority,
|
154 |
+
section : params.section,
|
155 |
+
settings: params.settings,
|
156 |
+
type : params.type, //'czr_module',
|
157 |
+
module_type : params.module_type,
|
158 |
+
input_attrs : params.input_attrs,//<= can be used with the builtin "button" type control
|
159 |
+
sek_registration_params : params// <= used when refreshing a level for example
|
160 |
+
}
|
161 |
+
),
|
162 |
+
ControlConstructor = api.controlConstructor[ controlArgs.type ] || api.Control,
|
163 |
+
options;
|
164 |
+
|
165 |
+
// extend with specific additional options provided on registration
|
166 |
+
if ( _.isObject( params.options ) ) {
|
167 |
+
controlArgs = _.extend( controlArgs, params.options );
|
168 |
+
}
|
169 |
+
|
170 |
+
options = _.extend( { params: controlArgs }, controlArgs ); // Inclusion of params alias is for back-compat for custom controls that expect to augment this property.
|
171 |
+
|
172 |
+
try { __element__ = api.control.add( new ControlConstructor( params.id, options ) ); } catch ( er ) {
|
173 |
+
api.errare( 'api.CZR_Helpers::register => problem when adding a control to the api', er );
|
174 |
+
}
|
175 |
+
break;
|
176 |
+
default :
|
177 |
+
api.errorLog('invalid "what" when invoking the register() method');
|
178 |
+
break;
|
179 |
+
|
180 |
+
}//switch
|
181 |
+
__element__ = ! _.isEmpty( __element__ ) ? __element__ : { deferred : { embedded : $.Deferred( function() { this.resolve(); }) } };
|
182 |
+
|
183 |
+
// this is where we populate the registered collection
|
184 |
+
// if the registered element is "tracked", we inform the api about its registration
|
185 |
+
// @see Nimble or Contextualizer for tracking usage => ui re-rendering, etc...
|
186 |
+
if ( false !== params.track ) {
|
187 |
+
api.trigger( 'czr-new-registered', params );
|
188 |
+
}
|
189 |
+
|
190 |
+
return 'setting' == params.what ? params : __element__.deferred.embedded;
|
191 |
+
}
|
192 |
+
});//$.extend
|
193 |
+
// $( window ).on( 'message', function( e, o) {
|
194 |
+
// api.consoleLog('WHAT ARE WE LISTENING TO?', e, o );
|
195 |
+
// });
|
196 |
+
})( wp.customize , jQuery, _);
|
assets/czr/fmk/js/base-fmk/0_3_api_helpers/_0_0_9_pre_97_api_helpers_various.js
ADDED
@@ -0,0 +1,320 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
(function (api, $, _) {
|
3 |
+
api.CZR_Helpers = api.CZR_Helpers || {};
|
4 |
+
//////////////////////////////////////////////////
|
5 |
+
/// ACTIONS AND DOM LISTENERS
|
6 |
+
//////////////////////////////////////////////////
|
7 |
+
//adds action to an existing event map
|
8 |
+
//@event map = [ {event1}, {event2}, ... ]
|
9 |
+
//@new_event = { trigger : event name , actions : [ 'cb1', 'cb2', ... ] }
|
10 |
+
api.CZR_Helpers = $.extend( api.CZR_Helpers, {
|
11 |
+
css_loader_html : '<div class="czr-css-loader czr-mr-loader" style="display:none"><div></div><div></div><div></div></div>',
|
12 |
+
|
13 |
+
//While a control should always have a default setting,
|
14 |
+
//It can have additional setting assigned
|
15 |
+
//This method returns the default setting or the specified type if requested
|
16 |
+
//Example : header_image has default and data
|
17 |
+
getControlSettingId : function( control_id, setting_type ) {
|
18 |
+
setting_type = 'default' || setting_type;
|
19 |
+
if ( ! api.control.has( control_id ) ) {
|
20 |
+
// api.consoleLog( 'getControlSettingId : The requested control_id is not registered in the api yet : ' + control_id );
|
21 |
+
return control_id;
|
22 |
+
}
|
23 |
+
if ( ! _.has( api.control( control_id ), 'settings' ) || _.isEmpty( api.control( control_id ).settings ) )
|
24 |
+
return control_id;
|
25 |
+
|
26 |
+
if ( ! _.has( api.control( control_id ).settings, setting_type ) ) {
|
27 |
+
api.consoleLog( 'getControlSettingId : The requested control_id does not have the requested setting type : ' + control_id + ' , ' + setting_type );
|
28 |
+
return control_id;
|
29 |
+
}
|
30 |
+
if ( _.isUndefined( api.control( control_id ).settings[setting_type].id ) ) {
|
31 |
+
api.consoleLog( 'getControlSettingId : The requested control_id has no setting id assigned : ' + control_id );
|
32 |
+
return control_id;
|
33 |
+
}
|
34 |
+
return api.control( control_id ).settings[setting_type].id;
|
35 |
+
},
|
36 |
+
|
37 |
+
|
38 |
+
|
39 |
+
getDocSearchLink : function( text ) {
|
40 |
+
text = ! _.isString(text) ? '' : text;
|
41 |
+
var _searchtext = text.replace( / /g, '+'),
|
42 |
+
_url = [ serverControlParams.docURL, 'search?query=', _searchtext ].join('');
|
43 |
+
return [
|
44 |
+
'<a href="' + _url + '" title="' + serverControlParams.i18n.readDocumentation + '" target="_blank">',
|
45 |
+
' ',
|
46 |
+
'<span class="far fa-question-circle-o"></span>'
|
47 |
+
].join('');
|
48 |
+
},
|
49 |
+
|
50 |
+
|
51 |
+
/*
|
52 |
+
* @return string
|
53 |
+
* simple helper to build the setting wp api ready id
|
54 |
+
*/
|
55 |
+
build_setId : function ( setId ) {
|
56 |
+
if ( _.isUndefined( window.themeServerControlParams ) || ! _.isArray( themeServerControlParams.wpBuiltinSettings ) ) {
|
57 |
+
//api.errorLog( 'build_setId => missing themeServerControlParams !');
|
58 |
+
return setId;
|
59 |
+
}
|
60 |
+
//exclude the WP built-in settings like blogdescription, show_on_front, etc
|
61 |
+
if ( _.contains( themeServerControlParams.wpBuiltinSettings, setId ) )
|
62 |
+
return setId;
|
63 |
+
|
64 |
+
// //extract the setting id for theme mods
|
65 |
+
// var _pattern;
|
66 |
+
|
67 |
+
//exclude the WP built-in settings like sidebars_widgets*, nav_menu_*, widget_*, custom_css
|
68 |
+
// var _patterns = [ 'widget_', 'nav_menu', 'sidebars_', 'custom_css' ],
|
69 |
+
// _isExcld = false;
|
70 |
+
// _.each( _patterns, function( _ptrn ) {
|
71 |
+
// if ( _isExcld )
|
72 |
+
// return;
|
73 |
+
// _isExcld = _ptrn == setId.substring( 0, _ptrn.length );
|
74 |
+
// });
|
75 |
+
// if ( _isExcld )
|
76 |
+
// return setId;
|
77 |
+
if ( ! _.contains( themeServerControlParams.themeSettingList, setId ) )
|
78 |
+
return setId;
|
79 |
+
|
80 |
+
return -1 == setId.indexOf( themeServerControlParams.themeOptions ) ? [ themeServerControlParams.themeOptions +'[' , setId , ']' ].join('') : setId;
|
81 |
+
},
|
82 |
+
|
83 |
+
/*
|
84 |
+
* @return string
|
85 |
+
* simple helper to extract the option name from a setting id
|
86 |
+
*/
|
87 |
+
getOptionName : function( name ) {
|
88 |
+
if ( _.isEmpty( window.themeServerControlParams ) || _.isEmpty( themeServerControlParams.themeOptions ) ) {
|
89 |
+
//api.errorLog( 'getOptionName => missing themeServerControlParams !');
|
90 |
+
return name;
|
91 |
+
}
|
92 |
+
var self = this;
|
93 |
+
//targets only the options of the theme
|
94 |
+
if ( -1 == name.indexOf( themeServerControlParams.themeOptions) )
|
95 |
+
return name;
|
96 |
+
return name.replace(/\[|\]/g, '').replace( themeServerControlParams.themeOptions, '');
|
97 |
+
},
|
98 |
+
|
99 |
+
|
100 |
+
|
101 |
+
//@return bool
|
102 |
+
//@uses api.czr_partials
|
103 |
+
hasPartRefresh : function( setId ) {
|
104 |
+
if ( ! _.has( api, 'czr_partials') )
|
105 |
+
return;
|
106 |
+
return _.contains( _.map( api.czr_partials(), function( partial, key ) {
|
107 |
+
return _.contains( partial.settings, setId );
|
108 |
+
}), true );
|
109 |
+
},
|
110 |
+
|
111 |
+
//@return the array of controls in a given section_id
|
112 |
+
getSectionControlIds : function( section_id ) {
|
113 |
+
section_id = section_id || api.czr_activeSectionId();
|
114 |
+
return ! api.section.has( section_id ) ?
|
115 |
+
[] :
|
116 |
+
_.map( api.section( section_id ).controls(), function( _ctrl ) {
|
117 |
+
return _ctrl.id;
|
118 |
+
});
|
119 |
+
},
|
120 |
+
|
121 |
+
|
122 |
+
//1) get the control of a given section
|
123 |
+
//2) for each control get the associated setting(s)
|
124 |
+
//=> important, a control might have several associated settings. Typical example : header_image.
|
125 |
+
//@return [] of setting ids for a given czr section
|
126 |
+
getSectionSettingIds : function( section_id ) {
|
127 |
+
section_id = section_id || api.czr_activeSectionId();
|
128 |
+
if ( ! api.section.has( section_id) )
|
129 |
+
return;
|
130 |
+
var self = this,
|
131 |
+
_sec_settings = [],
|
132 |
+
_sec_controls = self.getSectionControlIds( section_id );
|
133 |
+
|
134 |
+
_.each( _sec_controls, function( ctrlId ) {
|
135 |
+
_.each( api.control(ctrlId).settings, function( _instance, _k ) {
|
136 |
+
_sec_settings.push( _instance.id );
|
137 |
+
});
|
138 |
+
});
|
139 |
+
return _sec_settings;
|
140 |
+
},
|
141 |
+
|
142 |
+
|
143 |
+
//////////////////////////////////////////////////
|
144 |
+
/// STRINGS HELPERS
|
145 |
+
//////////////////////////////////////////////////
|
146 |
+
capitalize : function( string ) {
|
147 |
+
if( ! _.isString(string) )
|
148 |
+
return string;
|
149 |
+
return string.charAt(0).toUpperCase() + string.slice(1);
|
150 |
+
},
|
151 |
+
|
152 |
+
truncate : function( string, n, useWordBoundary ){
|
153 |
+
if ( ! _.isString( string ) )
|
154 |
+
return '';
|
155 |
+
n = n || 20;
|
156 |
+
var isTooLong = string.length > n,
|
157 |
+
s_ = isTooLong ? string.substr(0,n-1) : string;
|
158 |
+
s_ = (useWordBoundary && isTooLong) ? s_.substr(0,s_.lastIndexOf(' ')) : s_;
|
159 |
+
return isTooLong ? s_ + '...' : s_;
|
160 |
+
},
|
161 |
+
|
162 |
+
|
163 |
+
//////////////////////////////////////////////////
|
164 |
+
/// STRINGS HELPERS
|
165 |
+
//////////////////////////////////////////////////
|
166 |
+
//is a module multi item ?
|
167 |
+
//@return bool
|
168 |
+
isMultiItemModule : function( module_type, moduleInst ) {
|
169 |
+
if ( _.isUndefined( module_type ) && ! _.isObject( moduleInst ) )
|
170 |
+
return;
|
171 |
+
if ( _.isObject( moduleInst ) && _.has( moduleInst, 'module_type' ) )
|
172 |
+
module_type = moduleInst.module_type;
|
173 |
+
else if ( _.isUndefined( module_type ) || _.isNull( module_type ) )
|
174 |
+
return;
|
175 |
+
if ( ! _.has( api.czrModuleMap, module_type ) )
|
176 |
+
return;
|
177 |
+
|
178 |
+
return api.czrModuleMap[module_type].crud || api.czrModuleMap[module_type].multi_item || false;
|
179 |
+
},
|
180 |
+
|
181 |
+
//is a module crud ?
|
182 |
+
//@return bool
|
183 |
+
isCrudModule : function( module_type, moduleInst ) {
|
184 |
+
if ( _.isUndefined( module_type ) && ! _.isObject( moduleInst ) )
|
185 |
+
return;
|
186 |
+
if ( _.isObject( moduleInst ) && _.has( moduleInst, 'module_type' ) )
|
187 |
+
module_type = moduleInst.module_type;
|
188 |
+
else if ( _.isUndefined( module_type ) || _.isNull( module_type ) )
|
189 |
+
return;
|
190 |
+
if ( ! _.has( api.czrModuleMap, module_type ) )
|
191 |
+
return;
|
192 |
+
|
193 |
+
return api.czrModuleMap[module_type].crud || false;
|
194 |
+
},
|
195 |
+
|
196 |
+
//is a module crud ?
|
197 |
+
//@return bool
|
198 |
+
hasModuleModOpt : function( module_type, moduleInst ) {
|
199 |
+
if ( _.isUndefined( module_type ) && ! _.isObject( moduleInst ) )
|
200 |
+
return;
|
201 |
+
if ( _.isObject( moduleInst ) && _.has( moduleInst, 'module_type' ) )
|
202 |
+
module_type = moduleInst.module_type;
|
203 |
+
else if ( _.isUndefined( module_type ) || _.isNull( module_type ) )
|
204 |
+
return;
|
205 |
+
if ( ! _.has( api.czrModuleMap, module_type ) )
|
206 |
+
return;
|
207 |
+
|
208 |
+
return api.czrModuleMap[module_type].has_mod_opt || false;
|
209 |
+
},
|
210 |
+
|
211 |
+
|
212 |
+
|
213 |
+
//@self explanatory: removes a collection of input from a parent item or modOpt instance
|
214 |
+
//Triggered by : user actions usually when an item is collapsed or when the modOpt panel is closed
|
215 |
+
removeInputCollection : function() {
|
216 |
+
var inputParentInst = this;//<= because fired with .call( inputParentInst )
|
217 |
+
if ( ! _.isFunction( inputParentInst ) ) {
|
218 |
+
throw new Error( 'removeInputCollection : inputParentInst is not valid.' );
|
219 |
+
}
|
220 |
+
if ( ! _.has( inputParentInst, 'czr_Input') )
|
221 |
+
return;
|
222 |
+
//remove each input api.Value() instance
|
223 |
+
inputParentInst.czr_Input.each( function( _input ) {
|
224 |
+
inputParentInst.czr_Input.remove( _input.id );
|
225 |
+
});
|
226 |
+
//reset the input collection property
|
227 |
+
inputParentInst.inputCollection({});
|
228 |
+
},
|
229 |
+
|
230 |
+
//Re-instantiate a module control based on its id
|
231 |
+
//@param wpSetId : the api id of the control to refresh
|
232 |
+
refreshModuleControl : function( wpSetId ) {
|
233 |
+
var _constructor = api.controlConstructor.czr_module,
|
234 |
+
_control_type = api.control( wpSetId ).params.type,
|
235 |
+
_control_data = api.settings.controls[wpSetId];
|
236 |
+
|
237 |
+
//remove the container and its control
|
238 |
+
$.when( api.control( wpSetId ).container.remove() ).done( function() {
|
239 |
+
//remove the control from the api control collection
|
240 |
+
api.control.remove( wpSetId );
|
241 |
+
|
242 |
+
//re-instantiate the control with the updated _control_data
|
243 |
+
api.control.add( wpSetId, new _constructor( wpSetId, { params : _control_data, previewer : api.previewer }) );
|
244 |
+
});
|
245 |
+
|
246 |
+
},
|
247 |
+
|
248 |
+
|
249 |
+
// BOOLEAN CHECK
|
250 |
+
// @return bool
|
251 |
+
isChecked : function( v ) {
|
252 |
+
if ( _.isBoolean( v ) ) {
|
253 |
+
return v;
|
254 |
+
} else if ( _.isNumber( v ) ) {
|
255 |
+
return v > 0;
|
256 |
+
} else if ( _.isString( v ) ) {
|
257 |
+
return '0' !== v && '' !== v && 'off' !== v;
|
258 |
+
}
|
259 |
+
return false;
|
260 |
+
},
|
261 |
+
|
262 |
+
|
263 |
+
// COLORS
|
264 |
+
hexToRgb : function( hex ) {
|
265 |
+
// Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF")
|
266 |
+
var shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
|
267 |
+
try {
|
268 |
+
hex = hex.replace(shorthandRegex, function(m, r, g, b) {
|
269 |
+
return r + r + g + g + b + b;
|
270 |
+
});
|
271 |
+
} catch( er ) {
|
272 |
+
api.errorLog( 'Error in Helpers::hexToRgb : ' + er );
|
273 |
+
return hex;
|
274 |
+
}
|
275 |
+
|
276 |
+
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec( hex );
|
277 |
+
result = result ? [
|
278 |
+
parseInt(result[1], 16),//r
|
279 |
+
parseInt(result[2], 16),//g
|
280 |
+
parseInt(result[3], 16)//b
|
281 |
+
] : [];
|
282 |
+
return 'rgb(' + result.join(',') + ')';
|
283 |
+
},
|
284 |
+
|
285 |
+
rgbToHex : function ( r, g, b ) {
|
286 |
+
var componentToHex = function(c) {
|
287 |
+
var hex = c.toString(16);
|
288 |
+
return hex.length == 1 ? "0" + hex : hex;
|
289 |
+
};
|
290 |
+
return "#" + componentToHex(r) + componentToHex(g) + componentToHex(b);
|
291 |
+
},
|
292 |
+
|
293 |
+
|
294 |
+
|
295 |
+
// inspired from wp.template in wp-includes/js/wp-util.js
|
296 |
+
parseTemplate : _.memoize(function ( html ) {
|
297 |
+
var compiled,
|
298 |
+
/*
|
299 |
+
* Underscore's default ERB-style templates are incompatible with PHP
|
300 |
+
* when asp_tags is enabled, so WordPress uses Mustache-inspired templating syntax.
|
301 |
+
*
|
302 |
+
* @see trac ticket #22344.
|
303 |
+
*/
|
304 |
+
options = {
|
305 |
+
evaluate: /<#([\s\S]+?)#>/g,
|
306 |
+
interpolate: /\{\{\{([\s\S]+?)\}\}\}/g,
|
307 |
+
escape: /\{\{([^\}]+?)\}\}(?!\})/g,
|
308 |
+
variable: 'data'
|
309 |
+
};
|
310 |
+
|
311 |
+
return function ( data ) {
|
312 |
+
compiled = compiled || _.template( html, options );
|
313 |
+
return compiled( data );
|
314 |
+
};
|
315 |
+
})
|
316 |
+
});//$.extend
|
317 |
+
// $( window ).on( 'message', function( e, o) {
|
318 |
+
// api.consoleLog('WHAT ARE WE LISTENING TO?', e, o );
|
319 |
+
// });
|
320 |
+
})( wp.customize , jQuery, _);
|
assets/czr/fmk/js/base-fmk/0_3_api_helpers/_0_1_0_pre_98_api_helpers_setup_dom_listeners.js
ADDED
@@ -0,0 +1,223 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
(function (api, $, _) {
|
3 |
+
api.CZR_Helpers = api.CZR_Helpers || {};
|
4 |
+
//////////////////////////////////////////////////
|
5 |
+
/// ACTIONS AND DOM LISTENERS
|
6 |
+
//////////////////////////////////////////////////
|
7 |
+
//adds action to an existing event map
|
8 |
+
//@event map = [ {event1}, {event2}, ... ]
|
9 |
+
//@new_event = { trigger : event name , actions : [ 'cb1', 'cb2', ... ] }
|
10 |
+
api.CZR_Helpers = $.extend( api.CZR_Helpers, {
|
11 |
+
addActions : function( event_map, new_events, instance ) {
|
12 |
+
var control = this;
|
13 |
+
instance = instance || control;
|
14 |
+
instance[event_map] = instance[event_map] || [];
|
15 |
+
new_event_map = _.clone( instance[event_map] );
|
16 |
+
instance[event_map] = _.union( new_event_map, ! _.isArray(new_events) ? [new_events] : new_events );
|
17 |
+
},
|
18 |
+
|
19 |
+
doActions : function( action, $dom_el, obj ) {
|
20 |
+
$dom_el.trigger( action, obj );
|
21 |
+
},
|
22 |
+
|
23 |
+
|
24 |
+
//@args = {model : model, dom_el : $_view_el, refreshed : _refreshed }
|
25 |
+
setupDOMListeners : function( event_map , args, instance ) {
|
26 |
+
var control = this,
|
27 |
+
_defaultArgs = {
|
28 |
+
model : {},
|
29 |
+
dom_el : {}
|
30 |
+
};
|
31 |
+
|
32 |
+
instance = instance || control;
|
33 |
+
//event_map : are we good ?
|
34 |
+
if ( ! _.isArray( event_map ) ) {
|
35 |
+
api.errare( 'setupDomListeners : event_map should be an array', args );
|
36 |
+
return;
|
37 |
+
}
|
38 |
+
|
39 |
+
//args : are we good ?
|
40 |
+
if ( ! _.isObject( args ) ) {
|
41 |
+
api.errare( 'setupDomListeners : args should be an object', event_map );
|
42 |
+
return;
|
43 |
+
}
|
44 |
+
|
45 |
+
args = _.extend( _defaultArgs, args );
|
46 |
+
|
47 |
+
// => we need a dom_el as an existing jQuery object
|
48 |
+
if ( ! ( args.dom_el instanceof jQuery ) || 1 > args.dom_el.length ) {
|
49 |
+
api.errare( 'setupDomListeners : dom element should be an existing dom element', args );
|
50 |
+
return;
|
51 |
+
}
|
52 |
+
|
53 |
+
//loop on the event map and map the relevant callbacks by event name
|
54 |
+
// @param _event :
|
55 |
+
//{
|
56 |
+
// trigger : '',
|
57 |
+
// selector : '',
|
58 |
+
// name : '',
|
59 |
+
// actions : ''
|
60 |
+
// },
|
61 |
+
_.map( event_map , function( _event ) {
|
62 |
+
if ( ! _.isString( _event.selector ) || _.isEmpty( _event.selector ) ) {
|
63 |
+
api.errare( 'setupDOMListeners : selector must be a string not empty. Aborting setup of action(s) : ' + _event.actions.join(',') );
|
64 |
+
return;
|
65 |
+
}
|
66 |
+
|
67 |
+
//Are we good ?
|
68 |
+
if ( ! _.isString( _event.selector ) || _.isEmpty( _event.selector ) ) {
|
69 |
+
api.errare( 'setupDOMListeners : selector must be a string not empty. Aborting setup of action(s) : ' + _event.actions.join(',') );
|
70 |
+
return;
|
71 |
+
}
|
72 |
+
|
73 |
+
// if ( ! _event.name && ! _.isEmpty( _event.name ) ) {
|
74 |
+
// api.errare('in setupDOMListeners : missing name', _event );
|
75 |
+
// }
|
76 |
+
|
77 |
+
// DON'T CREATE THE SAME LISTENERS MULTIPLE TIMES
|
78 |
+
//Make sure that we add this listener only once to a particular dom element
|
79 |
+
//A listener id is a combination of event name + selector
|
80 |
+
//if not set, the name is a concatenation of trigger + selector
|
81 |
+
var _name = ( _event.name && ! _.isEmpty( _event.name ) ) ? _event.name : [ _event.trigger, _event.selector ].join('');
|
82 |
+
|
83 |
+
var _currentListenerCollection = args.dom_el.data( 'czr-listener-collection' );
|
84 |
+
if ( ! _currentListenerCollection || ! _.isArray( _currentListenerCollection ) ) {
|
85 |
+
_currentListenerCollection = [ _name ];
|
86 |
+
} else {
|
87 |
+
_currentListenerCollection = _.isArray( _currentListenerCollection ) ? _currentListenerCollection : [];
|
88 |
+
if ( ! _.contains( _currentListenerCollection, _name ) ) {
|
89 |
+
_currentListenerCollection.push( _name );
|
90 |
+
} else {
|
91 |
+
api.errare('setupDOMListeners : aborting because listener already created for event : ' + _name );
|
92 |
+
return;
|
93 |
+
}
|
94 |
+
|
95 |
+
}
|
96 |
+
// add this listener to the collection
|
97 |
+
args.dom_el.data( 'czr-listener-collection' , _currentListenerCollection );
|
98 |
+
|
99 |
+
//LISTEN TO THE DOM => USES EVENT DELEGATION
|
100 |
+
args.dom_el.on( _event.trigger , _event.selector, function( e, event_params ) {
|
101 |
+
//stop propagation to ancestors modules, typically a sektion
|
102 |
+
e.stopPropagation();
|
103 |
+
//particular treatment
|
104 |
+
if ( api.utils.isKeydownButNotEnterEvent( e ) ) {
|
105 |
+
return;
|
106 |
+
}
|
107 |
+
e.preventDefault(); // Keep this AFTER the key filter above
|
108 |
+
|
109 |
+
//It is important to deconnect the original object from its source
|
110 |
+
//=> because we will extend it when used as params for the action chain execution
|
111 |
+
var actionsParams = $.extend( true, {}, args );
|
112 |
+
|
113 |
+
//always get the latest model from the collection
|
114 |
+
if ( _.has( actionsParams, 'model') && _.has( actionsParams.model, 'id') ) {
|
115 |
+
if ( _.has( instance, 'get' ) )
|
116 |
+
actionsParams.model = instance();
|
117 |
+
else
|
118 |
+
actionsParams.model = instance.getModel( actionsParams.model.id );
|
119 |
+
}
|
120 |
+
|
121 |
+
//always add the event obj to the passed args
|
122 |
+
//+ the dom event
|
123 |
+
$.extend( actionsParams, { event : _event, dom_event : e } );
|
124 |
+
|
125 |
+
//add the event param => useful for triggered event
|
126 |
+
$.extend( actionsParams, event_params );
|
127 |
+
|
128 |
+
//SETUP THE EMITTERS
|
129 |
+
//inform the container that something has happened
|
130 |
+
//pass the model and the current dom_el
|
131 |
+
//the model is always passed as parameter
|
132 |
+
if ( ! _.has( actionsParams, 'event' ) || ! _.has( actionsParams.event, 'actions' ) ) {
|
133 |
+
api.errare( 'executeEventActionChain : missing obj.event or obj.event.actions' );
|
134 |
+
return;
|
135 |
+
}
|
136 |
+
if ( serverControlParams.isDevMode ) {
|
137 |
+
control.executeEventActionChain( actionsParams, instance );
|
138 |
+
} else {
|
139 |
+
try { control.executeEventActionChain( actionsParams, instance ); } catch( er ) {
|
140 |
+
api.errare( 'In setupDOMListeners : problem when trying to fire actions : ' + actionsParams.event.actions , er );
|
141 |
+
}
|
142 |
+
}
|
143 |
+
});//.on()
|
144 |
+
});//_.map()
|
145 |
+
},//setupDomListeners
|
146 |
+
|
147 |
+
|
148 |
+
|
149 |
+
//GENERIC METHOD TO SETUP EVENT LISTENER
|
150 |
+
//NOTE : the args.event must alway be defined
|
151 |
+
//Example of args :
|
152 |
+
// {
|
153 |
+
// trigger : 'click keydown',
|
154 |
+
// selector : [ '.' + module.control.css_attr.open_pre_add_btn, '.' + module.control.css_attr.cancel_pre_add_btn ].join(','),
|
155 |
+
// name : 'pre_add_item',
|
156 |
+
// actions : [
|
157 |
+
// 'closeAllItems',
|
158 |
+
// 'closeRemoveDialogs',
|
159 |
+
// function(obj) {
|
160 |
+
// var module = this;
|
161 |
+
// module.preItemExpanded.set( ! module.preItemExpanded() );
|
162 |
+
// },
|
163 |
+
// ],
|
164 |
+
// },
|
165 |
+
executeEventActionChain : function( args, instance ) {
|
166 |
+
var control = this;
|
167 |
+
|
168 |
+
//if the actions param is not an array but is an anonymous function, fire it and stop there
|
169 |
+
if ( 'function' === typeof( args.event.actions ) )
|
170 |
+
return args.event.actions.call( instance, args );
|
171 |
+
|
172 |
+
//execute the various actions required
|
173 |
+
//first normalizes the provided actions into an array of callback methods
|
174 |
+
//then loop on the array and fire each cb if exists
|
175 |
+
if ( ! _.isArray( args.event.actions ) )
|
176 |
+
args.event.actions = [ args.event.actions ];
|
177 |
+
|
178 |
+
//if one of the callbacks returns false, then we break the loop
|
179 |
+
//=> allows us to stop a chain of callbacks if a condition is not met
|
180 |
+
var _break = false;
|
181 |
+
_.map( args.event.actions, function( _cb ) {
|
182 |
+
if ( _break )
|
183 |
+
return;
|
184 |
+
|
185 |
+
var _cbCandidate = function() {};
|
186 |
+
|
187 |
+
// is the _cb an anonymous function ?
|
188 |
+
// if not, we expect the method to exist in the provided object instance
|
189 |
+
if ( 'function' === typeof( _cb ) ) {
|
190 |
+
_cbCandidate = _cb;
|
191 |
+
} else {
|
192 |
+
if ( 'function' != typeof( instance[ _cb ] ) ) {
|
193 |
+
throw new Error( 'executeEventActionChain : the action : ' + _cb + ' has not been found when firing event : ' + args.event.selector );
|
194 |
+
} else {
|
195 |
+
_cbCandidate = instance[ _cb ];
|
196 |
+
}
|
197 |
+
}
|
198 |
+
|
199 |
+
// Allow other actions to be bound before action and after
|
200 |
+
//
|
201 |
+
// => we don't want the event in the object here => we use the one in the event map if set
|
202 |
+
// => otherwise will loop infinitely because triggering always the same cb from args.event.actions[_cb]
|
203 |
+
// => the dom element shall be get from the passed args and fall back to the controler container.
|
204 |
+
var $_dom_el = ( _.has(args, 'dom_el') && -1 != args.dom_el.length ) ? args.dom_el : control.container;
|
205 |
+
|
206 |
+
if ( 'string' === typeof( _cb ) ) {
|
207 |
+
$_dom_el.trigger( 'before_' + _cb, _.omit( args, 'event' ) );
|
208 |
+
}
|
209 |
+
|
210 |
+
//executes the _cb and stores the result in a local var
|
211 |
+
var _cb_return = _cbCandidate.call( instance, args );
|
212 |
+
//shall we stop the action chain here ?
|
213 |
+
if ( false === _cb_return )
|
214 |
+
_break = true;
|
215 |
+
|
216 |
+
if ( 'string' === typeof( _cb ) ) {
|
217 |
+
//allow other actions to be bound after
|
218 |
+
$_dom_el.trigger( 'after_' + _cb, _.omit( args, 'event' ) );
|
219 |
+
}
|
220 |
+
});//_.map
|
221 |
+
}
|
222 |
+
});//$.extend
|
223 |
+
})( wp.customize , jQuery, _);
|
assets/czr/fmk/js/base-fmk/0_4_preview_listeners/_0_0_0_pre_99_preview_listeners.js
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
(function (api, $, _) {
|
3 |
+
/*****************************************************************************
|
4 |
+
* CAPTURE PREVIEW INFORMATIONS ON REFRESH + REACT TO THEM
|
5 |
+
*****************************************************************************/
|
6 |
+
//This promise will let us know when we have the first set of preview query ready to use
|
7 |
+
//This is needed for modules contextually dependant
|
8 |
+
//For example, the slider module will initialize the module model based on the contextual informations, if no items have been set yet.
|
9 |
+
api.czr_wpQueryDataReady = api.czr_wpQueryDataReady || $.Deferred();
|
10 |
+
api.czr_wpQueryInfos = api.czr_wpQueryInfos || new api.Value();
|
11 |
+
|
12 |
+
//Data are sent by the preview frame when the panel has sent the 'sync' or even better 'active' event
|
13 |
+
api.bind( 'ready', function() {
|
14 |
+
/* WP CONDITIONAL TAGS => stores and observes the WP conditional tags sent by the preview */
|
15 |
+
api.previewer.bind( 'czr-query-data-ready', function( data ) {
|
16 |
+
|
17 |
+
api.czr_wpQueryInfos( data );
|
18 |
+
|
19 |
+
if ( 'pending' == api.czr_wpQueryDataReady.state() ) {
|
20 |
+
api.czr_wpQueryDataReady.resolve( data );
|
21 |
+
}
|
22 |
+
});
|
23 |
+
|
24 |
+
//PARTIAL REFRESHS => stores and observes the partials data sent by the preview
|
25 |
+
//=> this is used in api.CZR_Helpers.hasPartRefresh( control_id )
|
26 |
+
//=> as of WP4.7.5, there's no way to get the list of control with partial refresh in the customize-control api
|
27 |
+
api.previewer.bind( 'czr-partial-refresh-data', function( data ) {
|
28 |
+
api.czr_partials = api.czr_partials || new api.Value();
|
29 |
+
api.czr_partials.set( data );
|
30 |
+
});
|
31 |
+
|
32 |
+
//PARTIAL REFRESHS : React on partial refresh done
|
33 |
+
// @data : { set_id : api setting id }
|
34 |
+
api.previewer.bind( 'czr-partial-refresh-done', function( data ) {
|
35 |
+
if ( ! _.has( data, 'set_id' ) )
|
36 |
+
return;
|
37 |
+
var setId = api.CZR_Helpers.build_setId( data.set_id );
|
38 |
+
if ( ! api.has( setId ) )
|
39 |
+
return;
|
40 |
+
//inform the control
|
41 |
+
var ctrlId = api.CZR_Helpers.getControlSettingId( setId );
|
42 |
+
if ( ! api.control.has( ctrlId ) )
|
43 |
+
return;
|
44 |
+
api.control( ctrlId ).trigger( 'czr-partial-refresh-done' );
|
45 |
+
});
|
46 |
+
});//api.bind('ready')
|
47 |
+
})( wp.customize , jQuery, _ );
|
assets/czr/fmk/js/base-fmk/1_0_input_item_module_control/1_0_input/_0_0_1_input_0_init.js
ADDED
@@ -0,0 +1,413 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
var CZRInputMths = CZRInputMths || {};
|
2 |
+
|
3 |
+
//extends api.Value
|
4 |
+
//an input is instanciated with the typical set of options :
|
5 |
+
// container : $(this),
|
6 |
+
// id : _id,
|
7 |
+
// input_options : {} <= a set of options that are used when setting up the input type
|
8 |
+
// input_parent : {} can be an item instance or a modOpt instance (Value instance, has a parent module)
|
9 |
+
// input_value : $(this).find('[data-czrtype]').val(),
|
10 |
+
// module : module,
|
11 |
+
// transport : inherit or specified in the template with data-transport="postMessage" or "refresh".
|
12 |
+
// type : $(this).attr('data-input-type'),
|
13 |
+
// is_mod_opt : bool,
|
14 |
+
// is_preItemInput : bool
|
15 |
+
( function ( api, $, _ ) {
|
16 |
+
$.extend( CZRInputMths , {
|
17 |
+
initialize: function( name, options ) {
|
18 |
+
if ( _.isUndefined( options.input_parent ) || _.isEmpty(options.input_parent) ) {
|
19 |
+
throw new Error('No input_parent assigned to input ' + options.id + '. Aborting');
|
20 |
+
}
|
21 |
+
if ( _.isUndefined(options.module ) ) {
|
22 |
+
throw new Error('No module assigned to input ' + options.id + '. Aborting');
|
23 |
+
}
|
24 |
+
|
25 |
+
api.Value.prototype.initialize.call( this, null, options );
|
26 |
+
|
27 |
+
var input = this;
|
28 |
+
//input.options = options;
|
29 |
+
//write the options as properties, name is included
|
30 |
+
$.extend( input, options || {} );
|
31 |
+
|
32 |
+
// store the constructor options
|
33 |
+
input.constructorOptions = $.extend( true, {}, options );
|
34 |
+
|
35 |
+
//DEFERRED STATES
|
36 |
+
//store the state of ready.
|
37 |
+
input.isReady = $.Deferred();
|
38 |
+
|
39 |
+
//initialize to the provided value if any
|
40 |
+
if ( ! _.isUndefined( options.input_value ) ) {
|
41 |
+
input.set( options.input_value );
|
42 |
+
}
|
43 |
+
|
44 |
+
|
45 |
+
// Setup a default user event map
|
46 |
+
// can be overriden when setting up the input
|
47 |
+
var trigger_map = {
|
48 |
+
text : 'keyup',
|
49 |
+
textarea : 'keyup',
|
50 |
+
password : 'keyup',
|
51 |
+
color : 'colorpickerchange',
|
52 |
+
range : 'input propertychange'
|
53 |
+
};
|
54 |
+
|
55 |
+
// Default Input Event Map
|
56 |
+
input.input_event_map = [
|
57 |
+
//set input value
|
58 |
+
{
|
59 |
+
trigger : ['change', trigger_map[input.type] || '' ].join(' ').trim(),//was 'propertychange change click keyup input',//colorpickerchange is a custom colorpicker event @see method setupColorPicker => otherwise we don't
|
60 |
+
selector : 'input[data-czrtype], select[data-czrtype], textarea[data-czrtype]',
|
61 |
+
name : 'set_input_value',
|
62 |
+
actions : function( obj ) {
|
63 |
+
if ( ! _.has( input.input_parent, 'syncElements') || ! _.has( input.input_parent.syncElements, input.id ) ) {
|
64 |
+
throw new Error('WARNING : THE INPUT ' + input.id + ' HAS NO SYNCED ELEMENT.');
|
65 |
+
}
|
66 |
+
}//was 'updateInput'
|
67 |
+
}
|
68 |
+
];
|
69 |
+
|
70 |
+
// 1) Check the input instance to see if the default callback has been overriden in an extended Constructor
|
71 |
+
// ( @see column width module in Nimble Builder to see how the overrides works )
|
72 |
+
// 2) if not, try to find a match with the provided constructor type
|
73 |
+
// => fire the relevant callback with the provided input_options
|
74 |
+
// input.type_map is declared in extend_api_base
|
75 |
+
if ( input[input.type] && _.isFunction( input[input.type]) ) {
|
76 |
+
try { input[input.type]( options.input_options || null ); } catch( er ) {
|
77 |
+
api.errare( 'Error in overriden callback method in input init => for input id :' + input.id + ' in module type : ' + input.module.module_type, er );
|
78 |
+
}
|
79 |
+
} else if ( api.czrInputMap && _.has( api.czrInputMap, input.type ) ) {
|
80 |
+
var _meth = api.czrInputMap[ input.type ];
|
81 |
+
if ( _.isFunction( input[_meth]) ) {
|
82 |
+
try { input[_meth]( options.input_options || null ); } catch( er ) {
|
83 |
+
api.errare( 'Error in input init => for input id :' + input.id + ' in module type : ' + input.module.module_type, er );
|
84 |
+
}
|
85 |
+
} else if ( _.isFunction( api.czrInputMap[ input.type ] ) ) {
|
86 |
+
try { api.czrInputMap[ input.type ].apply( input, [ options.input_options || null ] ); } catch( er ) {
|
87 |
+
api.errare( 'Error in input init => for input id :' + input.id + ' in module type : ' + input.module.module_type, er );
|
88 |
+
}
|
89 |
+
}
|
90 |
+
} else {
|
91 |
+
api.errare('Warning the input : ' + input.id + ' with type ' + input.type + ' has no corresponding method defined in api.czrInputMap.');
|
92 |
+
}
|
93 |
+
|
94 |
+
|
95 |
+
// Visibility => typically used when implementing the input dependencies
|
96 |
+
// true by default
|
97 |
+
input.visible = new api.Value( true );
|
98 |
+
input.isReady.done( function() {
|
99 |
+
input.visible.bind( function( visible ) {
|
100 |
+
if ( visible ) {
|
101 |
+
input.container.stop( true, true ).slideDown( 200 );
|
102 |
+
} else {
|
103 |
+
input.container.stop( true, true ).slideUp( 200 );
|
104 |
+
}
|
105 |
+
});
|
106 |
+
});
|
107 |
+
|
108 |
+
// Enabled status => control the toggling of a "disabled" css class => blur + decrease opacity
|
109 |
+
// used for the hueman pro slide module
|
110 |
+
input.enabled = new api.Value( true );
|
111 |
+
input.isReady.done( function() {
|
112 |
+
input.enabled.bind( function( enabled ) {
|
113 |
+
input.container.toggleClass( 'disabled', ! enabled );
|
114 |
+
});
|
115 |
+
});
|
116 |
+
},
|
117 |
+
|
118 |
+
|
119 |
+
// this method is not fired automatically
|
120 |
+
// It has to be invoked once the input has been instantiated
|
121 |
+
// input instantiation is performed from what is found in the DOM
|
122 |
+
// @see api.CZR_Helpers.setupInputCollectionFromDOM
|
123 |
+
ready : function() {
|
124 |
+
var input = this;
|
125 |
+
input.setupDOMListeners( input.input_event_map , { dom_el : input.container }, input );
|
126 |
+
//Setup individual input listener
|
127 |
+
input.callbacks.add( function() { return input.inputReact.apply( input, arguments ); } );
|
128 |
+
//synchronizer setup
|
129 |
+
//the input instance must be initialized. => initialize method has been done.
|
130 |
+
$.when( input.setupSynchronizer() ).done( function() {
|
131 |
+
input.isReady.resolve( input );
|
132 |
+
} );
|
133 |
+
|
134 |
+
},
|
135 |
+
|
136 |
+
|
137 |
+
//fired when input is intanciated and ready.
|
138 |
+
//=> we must have an input instance to synchronize,
|
139 |
+
//invoking this method in the initialize() method is too early, instance not ready
|
140 |
+
setupSynchronizer: function() {
|
141 |
+
var input = this,
|
142 |
+
input_parent = input.input_parent,
|
143 |
+
$_input_el = input.container.find('[data-czrtype]'),
|
144 |
+
is_textarea = input.container.find('[data-czrtype]').is('textarea');
|
145 |
+
|
146 |
+
//@hack => todo
|
147 |
+
//for text area inputs, the synchronizer is buggy
|
148 |
+
// if ( is_textarea ) {
|
149 |
+
// api.errorLog('TO DO : THE TEXTAREA INPUT ARE NOT IMPLEMENTED YET IN THE SYNCHRONIZER!');
|
150 |
+
// }
|
151 |
+
|
152 |
+
var syncElement = new api.Element( $_input_el );
|
153 |
+
input_parent.syncElements = input_parent.syncElements || {};
|
154 |
+
input_parent.syncElements[input.id] = syncElement;//adds the input syncElement to the collection
|
155 |
+
syncElement.sync( input );//sync with the input instance
|
156 |
+
syncElement.set( input() );
|
157 |
+
},
|
158 |
+
|
159 |
+
|
160 |
+
|
161 |
+
//@return void()
|
162 |
+
//react to a single input change
|
163 |
+
//update the collection of input
|
164 |
+
//cb of input.callbacks.add
|
165 |
+
inputReact : function( to, from, data ) {
|
166 |
+
var input = this,
|
167 |
+
_current_input_parent = input.input_parent(),
|
168 |
+
_new_model = _.clone( _current_input_parent ),//initialize it to the current value
|
169 |
+
_isPreItemInput = input.is_preItemInput;
|
170 |
+
|
171 |
+
//is this input currently enabled ?
|
172 |
+
if ( ! input.enabled() )
|
173 |
+
return;
|
174 |
+
|
175 |
+
// September 2020 => introduced an "inactive" input type in order to display pro info for Nimble
|
176 |
+
// this input should be "hidden" type, and should not trigger an API change.
|
177 |
+
if ( 'inactive' === input.type )
|
178 |
+
return;
|
179 |
+
|
180 |
+
//make sure the _new_model is an object and is not empty
|
181 |
+
_new_model = ( ! _.isObject(_new_model) || _.isEmpty(_new_model) ) ? {} : _new_model;
|
182 |
+
//set the new val to the changed property
|
183 |
+
_new_model[ input.id ] = to;
|
184 |
+
|
185 |
+
//inform the input_parent : item or modOpt
|
186 |
+
input.input_parent.set( _new_model, {
|
187 |
+
input_changed : input.id,
|
188 |
+
input_value : input(),
|
189 |
+
input_transport : input.transport,
|
190 |
+
not_preview_sent : 'postMessage' === input.transport,//<= this parameter set to true will prevent the setting to be sent to the preview ( @see api.Setting.prototype.preview override ). This is useful to decide if a specific input should refresh or not the preview.
|
191 |
+
inputRegistrationParams : input.constructorOptions
|
192 |
+
} );
|
193 |
+
|
194 |
+
//Trigger and send specific events when changing a published input item
|
195 |
+
if ( ! _isPreItemInput ) {
|
196 |
+
//inform the input_parent that an input has changed
|
197 |
+
//=> useful to handle dependant reactions between different inputs
|
198 |
+
input.input_parent.trigger( input.id + ':changed', to );
|
199 |
+
|
200 |
+
//Each input instantiated in an item or a modOpt can have a specific transport set.
|
201 |
+
//the input transport is hard coded in the module js template, with the attribute : data-transport="postMessage" or "refresh"
|
202 |
+
//=> this is optional, if not set, then the transport will be inherited from the one of the module, which is inherited from the control.
|
203 |
+
//send input to the preview. On update only, not on creation.
|
204 |
+
if ( ! _.isEmpty( from ) || ! _.isUndefined( from ) && 'postMessage' === input.transport ) {
|
205 |
+
input.module.sendInputToPreview( {
|
206 |
+
input_id : input.id,
|
207 |
+
input_parent_id : input.input_parent.id,
|
208 |
+
to : to,
|
209 |
+
from : from
|
210 |
+
} );
|
211 |
+
}
|
212 |
+
}
|
213 |
+
},
|
214 |
+
|
215 |
+
|
216 |
+
/*-----------------------------------------
|
217 |
+
SOME DEFAULT CALLBACKS
|
218 |
+
------------------------------------------*/
|
219 |
+
setupColorPicker : function() {
|
220 |
+
var input = this;
|
221 |
+
|
222 |
+
input.container.find('input').iris( {
|
223 |
+
palettes: true,
|
224 |
+
hide:false,
|
225 |
+
change : function( e, o ) {
|
226 |
+
//if the input val is not updated here, it's not detected right away.
|
227 |
+
//weird
|
228 |
+
//is there a "change complete" kind of event for iris ?
|
229 |
+
//$(this).val($(this).wpColorPicker('color'));
|
230 |
+
//input.container.find('[data-czrtype]').trigger('colorpickerchange');
|
231 |
+
|
232 |
+
//synchronizes with the original input
|
233 |
+
//OLD => $(this).val( $(this).wpColorPicker('color') ).trigger('colorpickerchange').trigger('change');
|
234 |
+
$(this).val( o.color.toString() ).trigger('colorpickerchange').trigger('change');
|
235 |
+
}
|
236 |
+
});
|
237 |
+
},
|
238 |
+
|
239 |
+
setupColorPickerAlpha : function() {
|
240 |
+
var input = this;
|
241 |
+
|
242 |
+
input.container.find('input').wpColorPicker({
|
243 |
+
palettes: true,
|
244 |
+
//hide:false,
|
245 |
+
width: window.innerWidth >= 1440 ? 271 : 251,
|
246 |
+
change : function( e, o ) {
|
247 |
+
//if the input val is not updated here, it's not detected right away.
|
248 |
+
//weird
|
249 |
+
//is there a "change complete" kind of event for iris ?
|
250 |
+
//$(this).val($(this).wpColorPicker('color'));
|
251 |
+
//input.container.find('[data-czrtype]').trigger('colorpickerchange');
|
252 |
+
|
253 |
+
//synchronizes with the original input
|
254 |
+
//OLD => $(this).val( $(this).wpColorPicker('color') ).trigger('colorpickerchange').trigger('change');
|
255 |
+
$(this).val( o.color.toString() ).trigger('colorpickerchange').trigger('change');
|
256 |
+
},
|
257 |
+
clear : function( e, o ) {
|
258 |
+
//$(this).val('').trigger('colorpickerchange').trigger('change');
|
259 |
+
input('');
|
260 |
+
}
|
261 |
+
});
|
262 |
+
},
|
263 |
+
|
264 |
+
setupSelect : function() {
|
265 |
+
var input = this;
|
266 |
+
$('select', input.container ).not('.no-selecter-js')
|
267 |
+
.each( function() {
|
268 |
+
$(this).selecter({
|
269 |
+
//triggers a change event on the view, passing the newly selected value + index as parameters.
|
270 |
+
// callback : function(value, index) {
|
271 |
+
// self.triggerSettingChange( window.event || {} , value, index); // first param is a null event.
|
272 |
+
// }
|
273 |
+
});
|
274 |
+
});
|
275 |
+
},
|
276 |
+
|
277 |
+
setupIcheck : function( obj ) {
|
278 |
+
var input = this;
|
279 |
+
|
280 |
+
$( 'input[type=checkbox]', input.container ).each( function(e) {
|
281 |
+
if ( 0 !== $(this).closest('div[class^="icheckbox"]').length )
|
282 |
+
return;
|
283 |
+
|
284 |
+
$(this).iCheck({
|
285 |
+
checkboxClass: 'icheckbox_flat-grey',
|
286 |
+
checkedClass: 'checked',
|
287 |
+
radioClass: 'iradio_flat-grey',
|
288 |
+
})
|
289 |
+
.on( 'ifChanged', function(e){
|
290 |
+
$(this).val( false === $(this).is(':checked') ? 0 : 1 );
|
291 |
+
$(e.currentTarget).trigger('change');
|
292 |
+
});
|
293 |
+
});
|
294 |
+
},
|
295 |
+
|
296 |
+
// DEPRECATED since april 2nd 2019
|
297 |
+
// setupGutenCheck : function( params ) {
|
298 |
+
// var input = this;
|
299 |
+
// var $input = input.container.find('input[type=checkbox]'),
|
300 |
+
// $checkWrapper = $( '.czr-toggle-check', input.container );
|
301 |
+
// var _do_ = function() {
|
302 |
+
// $input.closest('.czr-toggle-check').toggleClass( 'is-checked', $input.is(':checked') );
|
303 |
+
// $checkWrapper.find('svg').remove();
|
304 |
+
// $checkWrapper.append(
|
305 |
+
// ! $input.is(':checked') ? '<svg class="czr-toggle-check__off" width="6" height="6" aria-hidden="true" role="img" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 6 6"><path d="M3 1.5c.8 0 1.5.7 1.5 1.5S3.8 4.5 3 4.5 1.5 3.8 1.5 3 2.2 1.5 3 1.5M3 0C1.3 0 0 1.3 0 3s1.3 3 3 3 3-1.3 3-3-1.3-3-3-3z"></path></svg>' : '<svg class="czr-toggle-check__on" width="2" height="6" aria-hidden="true" role="img" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2 6"><path d="M0 0h2v6H0z"></path></svg>'
|
306 |
+
// );
|
307 |
+
// };
|
308 |
+
// $input.on( 'change', _do_ );
|
309 |
+
// _do_();
|
310 |
+
// },
|
311 |
+
|
312 |
+
// when input and label are tied by an id - for relationship
|
313 |
+
// clicking on any of them changes the input
|
314 |
+
// => We need a unique ID here so that input and label are tied by a unique link
|
315 |
+
// The unique ID is generated server side as a GUID
|
316 |
+
// @see https://www.w3.org/TR/html401/interact/forms.html#h-17.9.1
|
317 |
+
// @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input/checkbox
|
318 |
+
setupNimbleCheck : function( params ) {
|
319 |
+
var input = this;
|
320 |
+
var $input = input.container.find('input[type=checkbox]'),
|
321 |
+
$checkWrapper = $( '.czr-toggle-check', input.container );
|
322 |
+
var _do_ = function() {};
|
323 |
+
// $input.on( 'change', _do_ );
|
324 |
+
// _do_();
|
325 |
+
},
|
326 |
+
|
327 |
+
setupRadio : function( obj ) {
|
328 |
+
var input = this;
|
329 |
+
$( 'input[type=radio]', input.container ).each( function(e) {
|
330 |
+
if ( 0 !== $(this).closest('div[class^="icheckbox"]').length )
|
331 |
+
return;
|
332 |
+
|
333 |
+
$(this).iCheck({
|
334 |
+
checkboxClass: 'icheckbox_flat-grey',
|
335 |
+
checkedClass: 'checked',
|
336 |
+
radioClass: 'iradio_flat-grey',
|
337 |
+
})
|
338 |
+
.on( 'ifChanged', function(e){
|
339 |
+
$(e.currentTarget).trigger('change');
|
340 |
+
});
|
341 |
+
});
|
342 |
+
},
|
343 |
+
|
344 |
+
setupStepper : function( obj ) {
|
345 |
+
var input = this;
|
346 |
+
$('input[type="number"]',input.container ).each( function( e ) {
|
347 |
+
$(this).stepper();
|
348 |
+
});
|
349 |
+
},
|
350 |
+
|
351 |
+
// Empty for the moment, to be overriden
|
352 |
+
setupSimpleRange : function() {},
|
353 |
+
|
354 |
+
//@use rangeslider https://github.com/andreruffert/rangeslider.js
|
355 |
+
setupRangeSlider : function( options ) {
|
356 |
+
var input = this,
|
357 |
+
$handle,
|
358 |
+
_updateHandle = function(el, val) {
|
359 |
+
var _unit = input.container.find('input').data( 'unit' );
|
360 |
+
el.textContent = val + ( _.isEmpty( input.container.find('input').data( 'unit' ) ) ? '' : _unit );
|
361 |
+
};
|
362 |
+
|
363 |
+
$( input.container ).find('input').rangeslider( {
|
364 |
+
// Feature detection the default is `true`.
|
365 |
+
// Set this to `false` if you want to use
|
366 |
+
// the polyfill also in Browsers which support
|
367 |
+
// the native <input type="range"> element.
|
368 |
+
polyfill: false,
|
369 |
+
|
370 |
+
// Default CSS classes
|
371 |
+
rangeClass: 'rangeslider',
|
372 |
+
disabledClass: 'rangeslider--disabled',
|
373 |
+
horizontalClass: 'rangeslider--horizontal',
|
374 |
+
verticalClass: 'rangeslider--vertical',
|
375 |
+
fillClass: 'rangeslider__fill',
|
376 |
+
handleClass: 'rangeslider__handle',
|
377 |
+
|
378 |
+
// Callback function
|
379 |
+
onInit: function() {
|
380 |
+
$handle = $('.rangeslider__handle', this.$range);
|
381 |
+
$('.rangeslider__handle', this.$range);
|
382 |
+
_updateHandle( $handle[0], this.value );
|
383 |
+
},
|
384 |
+
// Callback function
|
385 |
+
onSlide: function(position, value) {
|
386 |
+
_updateHandle( $handle[0], value );
|
387 |
+
},
|
388 |
+
// Callback function
|
389 |
+
//onSlideEnd: function(position, value) {}
|
390 |
+
} );
|
391 |
+
// .on('input', function() {
|
392 |
+
// _updateHandle( $handle[0], this.value );
|
393 |
+
// });
|
394 |
+
},
|
395 |
+
|
396 |
+
// for h_alignment and h_text_alignment types
|
397 |
+
setupHAlignement : function( input_options ) {
|
398 |
+
var input = this,
|
399 |
+
$wrapper = $('.sek-h-align-wrapper', input.container );
|
400 |
+
// on init
|
401 |
+
$wrapper.find( 'div[data-sek-align="' + input() +'"]' ).addClass('selected');
|
402 |
+
|
403 |
+
// on click
|
404 |
+
$wrapper.on( 'click', '[data-sek-align]', function(evt) {
|
405 |
+
evt.preventDefault();
|
406 |
+
$wrapper.find('.selected').removeClass('selected');
|
407 |
+
$.when( $(this).addClass('selected') ).done( function() {
|
408 |
+
input( $(this).data('sek-align') );
|
409 |
+
});
|
410 |
+
});
|
411 |
+
}
|
412 |
+
});//$.extend
|
413 |
+
})( wp.customize , jQuery, _ );
|
assets/czr/fmk/js/base-fmk/1_0_input_item_module_control/1_0_input/_0_0_1_input_1_img_upload.js
ADDED
@@ -0,0 +1,259 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
var CZRInputMths = CZRInputMths || {};
|
2 |
+
( function ( api, $, _ ) {
|
3 |
+
$.extend( CZRInputMths , {
|
4 |
+
// callback for data-input-type="upload"
|
5 |
+
setupImageUploaderSaveAsId : function() {
|
6 |
+
this.setupImageUploader();
|
7 |
+
},
|
8 |
+
|
9 |
+
// callback for data-input-type="upload_url"
|
10 |
+
setupImageUploaderSaveAsUrl : function() {
|
11 |
+
this.setupImageUploader( { save_as_url : true } );
|
12 |
+
},
|
13 |
+
|
14 |
+
//@param args { save_as_url : false }
|
15 |
+
setupImageUploader : function( args ) {
|
16 |
+
var input = this,
|
17 |
+
_model = input();
|
18 |
+
|
19 |
+
args = _.extend( { save_as_url : false }, args || {} );
|
20 |
+
input.save_as_url = args.save_as_url;
|
21 |
+
|
22 |
+
//an instance field where we'll store the current attachment
|
23 |
+
input.attachment = {};
|
24 |
+
|
25 |
+
//do we have an html template and a input container?
|
26 |
+
if ( ! input.container )
|
27 |
+
return this;
|
28 |
+
|
29 |
+
input.tmplRendered = $.Deferred();
|
30 |
+
input.setupContentRendering( _model, {} );
|
31 |
+
|
32 |
+
//valid just in the init
|
33 |
+
input.tmplRendered
|
34 |
+
.done( function(){
|
35 |
+
input.czrImgUploaderBinding();
|
36 |
+
})
|
37 |
+
.fail( function() {
|
38 |
+
api.errorLog( 'setupImageUploader => failed to fetch the template.');
|
39 |
+
});
|
40 |
+
},
|
41 |
+
|
42 |
+
setupContentRendering : function( to, from ) {
|
43 |
+
var input = this, _attachment;
|
44 |
+
//retrieve new image if 'to' is different from the saved one
|
45 |
+
//NEED A BETTER WAY?
|
46 |
+
if ( ( input.attachment.id != to ) && from !== to ) {
|
47 |
+
if ( _.isEmpty( to ) ) {
|
48 |
+
input.attachment = {};
|
49 |
+
input.renderImageUploaderTemplate();
|
50 |
+
// handles the case when a url is provided
|
51 |
+
// Occurs for example when contextualizing the header_image with skope
|
52 |
+
} else if ( ! _.isNumber( to ) ) {
|
53 |
+
input.renderImageUploaderTemplate( { fromUrl : true, url : to });
|
54 |
+
}
|
55 |
+
//Has this image already been fetched ?
|
56 |
+
_attachment = wp.media.attachment( to );
|
57 |
+
if ( _.isObject( _attachment ) && _.has( _attachment, 'attributes' ) && _.has( _attachment.attributes, 'sizes' ) ) {
|
58 |
+
input.attachment = _attachment.attributes;
|
59 |
+
input.renderImageUploaderTemplate();
|
60 |
+
}
|
61 |
+
// If not, try to fetch it but only if the candidate "to" is a number
|
62 |
+
else {
|
63 |
+
if ( _.isNumber( to ) ) {
|
64 |
+
wp.media.attachment( to ).fetch().done( function() {
|
65 |
+
input.attachment = this.attributes;
|
66 |
+
input.renderImageUploaderTemplate();
|
67 |
+
}).fail( function() {
|
68 |
+
api.errorLog('renderImageUploaderTemplate => failed attempt to fetch an img with id : ' + to );
|
69 |
+
// input.attachment = {};
|
70 |
+
// input.renderImageUploaderTemplate();
|
71 |
+
});
|
72 |
+
}
|
73 |
+
}
|
74 |
+
}//Standard reaction, the image has been updated by the user or init
|
75 |
+
else if ( ! input.attachment.id || input.attachment.id === to ) {
|
76 |
+
input.renderImageUploaderTemplate();
|
77 |
+
}
|
78 |
+
},
|
79 |
+
|
80 |
+
czrImgUploaderBinding : function() {
|
81 |
+
var input = this;
|
82 |
+
//Bind events
|
83 |
+
// Shortcut so that we don't have to use _.bind every time we add a callback.
|
84 |
+
_.bindAll( input, 'czrImgUploadRemoveFile', 'czrImgUploadOpenFrame', 'czrImgUploadSelect');
|
85 |
+
|
86 |
+
// Bind events, with delegation to facilitate re-rendering.
|
87 |
+
input.container.on( 'click keydown', '.upload-button', input.czrImgUploadOpenFrame );
|
88 |
+
input.container.on( 'click keydown', '.thumbnail-image img', input.czrImgUploadOpenFrame );
|
89 |
+
input.container.on( 'click keydown', '.remove-button', input.czrImgUploadRemoveFile );
|
90 |
+
|
91 |
+
input.bind( input.id + ':changed', function( to, from ){
|
92 |
+
input.tmplRendered = $.Deferred();
|
93 |
+
input.setupContentRendering( to, from );
|
94 |
+
});
|
95 |
+
},
|
96 |
+
/**
|
97 |
+
* Open the media modal.
|
98 |
+
*/
|
99 |
+
czrImgUploadOpenFrame: function( event ) {
|
100 |
+
if ( api.utils.isKeydownButNotEnterEvent( event ) ) {
|
101 |
+
return;
|
102 |
+
}
|
103 |
+
|
104 |
+
event.preventDefault();
|
105 |
+
|
106 |
+
if ( ! this.frame ) {
|
107 |
+
this.czrImgUploadInitFrame();
|
108 |
+
}
|
109 |
+
|
110 |
+
this.frame.open();
|
111 |
+
},
|
112 |
+
|
113 |
+
/**
|
114 |
+
* Create a media modal select frame, and store it so the instance can be reused when needed.
|
115 |
+
*/
|
116 |
+
czrImgUploadInitFrame: function() {
|
117 |
+
var input = this,
|
118 |
+
button_labels = this.getUploaderLabels();
|
119 |
+
|
120 |
+
input.frame = wp.media({
|
121 |
+
button: {
|
122 |
+
text: button_labels.frame_button
|
123 |
+
},
|
124 |
+
states: [
|
125 |
+
new wp.media.controller.Library({
|
126 |
+
title: button_labels.frame_title,
|
127 |
+
library: wp.media.query({ type: 'image' }),
|
128 |
+
multiple: false,
|
129 |
+
date: false
|
130 |
+
})
|
131 |
+
]
|
132 |
+
});
|
133 |
+
// When a file is selected, run a callback.
|
134 |
+
input.frame.on( 'select', input.czrImgUploadSelect );
|
135 |
+
},
|
136 |
+
|
137 |
+
/**
|
138 |
+
* Called when the "Remove" link is clicked. Empties the setting.
|
139 |
+
*
|
140 |
+
* @param {object} event jQuery Event object
|
141 |
+
*/
|
142 |
+
czrImgUploadRemoveFile: function( event ) {
|
143 |
+
var input = this;
|
144 |
+
|
145 |
+
if ( api.utils.isKeydownButNotEnterEvent( event ) ) {
|
146 |
+
return;
|
147 |
+
}
|
148 |
+
event.preventDefault();
|
149 |
+
//reset the attachment class field
|
150 |
+
input.attachment = {};
|
151 |
+
//set the model
|
152 |
+
input.set('');
|
153 |
+
},
|
154 |
+
|
155 |
+
|
156 |
+
/**
|
157 |
+
* Callback handler for when an attachment is selected in the media modal.
|
158 |
+
* Gets the selected image information, and sets it within the input.
|
159 |
+
*/
|
160 |
+
czrImgUploadSelect: function() {
|
161 |
+
var node,
|
162 |
+
input = this,
|
163 |
+
attachment = input.frame.state().get( 'selection' ).first().toJSON(), // Get the attachment from the modal frame.
|
164 |
+
mejsSettings = window._wpmejsSettings || {};
|
165 |
+
//save the attachment in a class field
|
166 |
+
input.attachment = attachment;
|
167 |
+
//set the model
|
168 |
+
input.set( input.save_as_url ? attachment.url : attachment.id );
|
169 |
+
},
|
170 |
+
|
171 |
+
|
172 |
+
|
173 |
+
|
174 |
+
//////////////////////////////////////////////////
|
175 |
+
/// HELPERS
|
176 |
+
//////////////////////////////////////////////////
|
177 |
+
// @param args = { fromUrl : true, url : to } || null
|
178 |
+
renderImageUploaderTemplate: function( args ) {
|
179 |
+
var input = this;
|
180 |
+
args = _.extend( { fromUrl : false, url : '' }, args || {} );
|
181 |
+
|
182 |
+
// //do we have view template script?
|
183 |
+
// if ( 0 === $( '#tmpl-czr-input-img-uploader-view-content' ).length ) {
|
184 |
+
// throw new Error('renderImageUploaderTemplate => Missing template for input ' + input.id );
|
185 |
+
// }
|
186 |
+
|
187 |
+
|
188 |
+
// var view_template = wp.template('czr-input-img-uploader-view-content');
|
189 |
+
|
190 |
+
// // do we have an html template and a module container?
|
191 |
+
// if ( ! view_template || ! input.container )
|
192 |
+
// return;
|
193 |
+
|
194 |
+
var $_view_el = input.container.find('.' + input.module.control.css_attr.img_upload_container );
|
195 |
+
|
196 |
+
if ( ! $_view_el.length || 1 > input.container.length )
|
197 |
+
return;
|
198 |
+
|
199 |
+
var _template_params = {
|
200 |
+
button_labels : input.getUploaderLabels(),
|
201 |
+
settings : input.id,
|
202 |
+
attachment : input.attachment,
|
203 |
+
fromUrl : args.url,
|
204 |
+
canUpload : true
|
205 |
+
};
|
206 |
+
|
207 |
+
if ( $('#tmpl-czr-img-uploader').length > 0 ) {
|
208 |
+
$_view_el.html( wp.template( 'czr-img-uploader' )( _template_params ) );
|
209 |
+
input.tmplRendered.resolve();
|
210 |
+
input.container.trigger( input.id + ':content_rendered' );
|
211 |
+
} else {
|
212 |
+
api.CZR_Helpers.getModuleTmpl( {
|
213 |
+
tmpl : 'img-uploader',
|
214 |
+
module_type: 'all_modules',
|
215 |
+
module_id : input.module.id
|
216 |
+
} ).done( function( _serverTmpl_ ) {
|
217 |
+
//console.log( 'renderModuleParts => success response =>', input.module.id, _serverTmpl_);
|
218 |
+
$_view_el.html( api.CZR_Helpers.parseTemplate( _serverTmpl_ )( _template_params ) );
|
219 |
+
input.tmplRendered.resolve();
|
220 |
+
input.container.trigger( input.id + ':content_rendered' );
|
221 |
+
}).fail( function( _r_ ) {
|
222 |
+
//console.log( 'renderModuleParts => fail response =>', _r_);
|
223 |
+
input.tmplRendered.reject( 'renderImageUploaderTemplate => Problem when fetching the tmpl from server for module : '+ input.module.id );
|
224 |
+
});
|
225 |
+
}
|
226 |
+
|
227 |
+
|
228 |
+
return true;
|
229 |
+
},
|
230 |
+
|
231 |
+
getUploaderLabels : function() {
|
232 |
+
var _ts = serverControlParams.i18n,
|
233 |
+
input = this,
|
234 |
+
_map = {
|
235 |
+
'select' : _ts.select_image,
|
236 |
+
'change' : _ts.change_image,
|
237 |
+
'remove' : _ts.remove_image,
|
238 |
+
'default' : _ts.default_image,
|
239 |
+
'placeholder' : _ts.placeholder_image,
|
240 |
+
'frame_title' : _ts.frame_title_image,
|
241 |
+
'frame_button': _ts.frame_button_image
|
242 |
+
};
|
243 |
+
|
244 |
+
//are we fine ?
|
245 |
+
var _fallbackmap = {};
|
246 |
+
_.each( _map, function( ts_string, key ) {
|
247 |
+
if ( _.isEmpty( ts_string ) ) {
|
248 |
+
api.errorLog( 'A translated string is missing ( ' + key + ' ) for the image uploader input in module : ' + input.module.id );
|
249 |
+
_fallbackmap[ key ] = key;
|
250 |
+
return;
|
251 |
+
} else {
|
252 |
+
_fallbackmap[ key ] = ts_string;
|
253 |
+
}
|
254 |
+
});
|
255 |
+
|
256 |
+
return _fallbackmap;
|
257 |
+
}
|
258 |
+
});//$.extend
|
259 |
+
})( wp.customize , jQuery, _ );
|
assets/czr/fmk/js/base-fmk/1_0_input_item_module_control/1_0_input/_0_0_1_input_4_content_picker.js
ADDED
@@ -0,0 +1,270 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* Fix caching, czrSelect2 default one seems to not correctly work, or it doesn't what I think it should */
|
2 |
+
// the content_picker options are set in the module with :
|
3 |
+
// $.extend( module.inputOptions, {
|
4 |
+
// 'content_picker' : {
|
5 |
+
// post : '',//<= all post types
|
6 |
+
// taxonomy : ''//<= all taxonomy types
|
7 |
+
// }
|
8 |
+
// });
|
9 |
+
// To narrow down the post or taxonomy types, the option can be set this way :
|
10 |
+
// $.extend( module.inputOptions, {
|
11 |
+
// 'content_picker' : {
|
12 |
+
// post : [ 'page', 'cpt1', ...]
|
13 |
+
// taxonomy : [ 'category', 'tag', 'Custom_Tax_1', ... ]
|
14 |
+
// }
|
15 |
+
// });
|
16 |
+
// To disable all posts or taxonomy, use '_none_'
|
17 |
+
// $.extend( module.inputOptions, {
|
18 |
+
// 'content_picker' : {
|
19 |
+
// post : [ 'page', 'cpt1', ...]
|
20 |
+
// taxonomy : '_none_' //<= won't load or search in taxonomies when requesting wp in ajax
|
21 |
+
// }
|
22 |
+
// });
|
23 |
+
//
|
24 |
+
// input is an object structured this way
|
25 |
+
// {
|
26 |
+
// id:"2838"
|
27 |
+
// object_type:"post"
|
28 |
+
// title:"The Importance of Water and Drinking Lots Of It"
|
29 |
+
// type_label:"Post"
|
30 |
+
// url:"http://customizr-dev.dev/?p=2838"
|
31 |
+
// }
|
32 |
+
var CZRInputMths = CZRInputMths || {};
|
33 |
+
( function ( api, $, _ ) {
|
34 |
+
$.extend( CZRInputMths , {
|
35 |
+
// fired in the input::initialize()
|
36 |
+
setupContentPicker: function( wpObjectTypes ) {
|
37 |
+
var input = this,
|
38 |
+
_event_map = [];
|
39 |
+
|
40 |
+
/* Dummy for the prototype purpose */
|
41 |
+
//input.object = ['post']; //this.control.params.object_types - array('page', 'post')
|
42 |
+
$.extend( _.isObject( wpObjectTypes ) ? wpObjectTypes : {}, {
|
43 |
+
post : '',
|
44 |
+
taxonomy : ''
|
45 |
+
} );
|
46 |
+
|
47 |
+
input.wpObjectTypes = wpObjectTypes;
|
48 |
+
|
49 |
+
/* Methodize this or use a template */
|
50 |
+
input.container.find('.czr-input').append('<select data-select-type="content-picker-select" class="js-example-basic-simple"></select>');
|
51 |
+
|
52 |
+
// Overrides the default input_event_map declared in ::initialize()
|
53 |
+
input.input_event_map = [
|
54 |
+
//set input value
|
55 |
+
{
|
56 |
+
trigger : 'change',
|
57 |
+
selector : 'select[data-select-type]',
|
58 |
+
name : 'set_input_value',
|
59 |
+
actions : function( obj ){
|
60 |
+
var $_changed_input = $( obj.dom_event.currentTarget, obj.dom_el ),
|
61 |
+
_raw_val = $( $_changed_input, obj.dom_el ).czrSelect2( 'data' ),
|
62 |
+
_val_candidate = {},
|
63 |
+
_default = {
|
64 |
+
id : '',
|
65 |
+
type_label : '',
|
66 |
+
title : '',
|
67 |
+
object_type : '',
|
68 |
+
url : ''
|
69 |
+
};
|
70 |
+
|
71 |
+
_raw_val = _.isArray( _raw_val ) ? _raw_val[0] : _raw_val;
|
72 |
+
if ( ! _.isObject( _raw_val ) || _.isEmpty( _raw_val ) ) {
|
73 |
+
api.errare( 'Content Picker Input : the picked value should be an object not empty.');
|
74 |
+
return;
|
75 |
+
}
|
76 |
+
|
77 |
+
//normalize and purge useless czrSelect2 fields
|
78 |
+
//=> skip a possible _custom_ id, used for example in the slider module to set a custom url
|
79 |
+
_.each( _default, function( val, k ){
|
80 |
+
if ( '_custom_' !== _raw_val.id ) {
|
81 |
+
if ( ! _.has( _raw_val, k ) || _.isEmpty( _raw_val[ k ] ) ) {
|
82 |
+
api.errare( 'content_picker : missing input param : ' + k );
|
83 |
+
return;
|
84 |
+
}
|
85 |
+
}
|
86 |
+
_val_candidate[ k ] = _raw_val[ k ];
|
87 |
+
} );
|
88 |
+
//set the value now
|
89 |
+
input.set( _val_candidate );
|
90 |
+
}
|
91 |
+
}
|
92 |
+
];
|
93 |
+
|
94 |
+
//input.setupDOMListeners( _event_map , { dom_el : input.container }, input );
|
95 |
+
//setup when ready.
|
96 |
+
input.isReady.done( function() {
|
97 |
+
input.setupContentSelecter();
|
98 |
+
});
|
99 |
+
|
100 |
+
},
|
101 |
+
|
102 |
+
|
103 |
+
// input is an object structured this way
|
104 |
+
// {
|
105 |
+
// id:"2838"
|
106 |
+
// object_type:"post"
|
107 |
+
// title:"The Importance of Water and Drinking Lots Of It"
|
108 |
+
// type_label:"Post"
|
109 |
+
// url:"http://customizr-dev.dev/?p=2838"
|
110 |
+
// }
|
111 |
+
setupContentSelecter : function() {
|
112 |
+
var input = this;
|
113 |
+
//set the previously selected value
|
114 |
+
if ( ! _.isEmpty( input() ) ) {
|
115 |
+
var _attributes = {
|
116 |
+
value : input().id || '',
|
117 |
+
title : input().title || '',
|
118 |
+
selected : "selected"
|
119 |
+
};
|
120 |
+
//input.container.find('select')
|
121 |
+
input.container.find('select').append( $( '<option>', _attributes ) );
|
122 |
+
}
|
123 |
+
|
124 |
+
// Stores the current ajax action
|
125 |
+
input.currentAjaxAction = input.currentAjaxAction || new api.Value();
|
126 |
+
|
127 |
+
// When the ajax action changes, reset the rendering status of the defaultContentPickerOption
|
128 |
+
// fixes "Set Custom Url" being printed multiple times, @see https://github.com/presscustomizr/nimble-builder/issues/207
|
129 |
+
input.currentAjaxAction.bind( function( ajaxAction ) {
|
130 |
+
input.defaultValueHasBeenPushed = false;
|
131 |
+
});
|
132 |
+
|
133 |
+
// reset the rendering status of the defaultContentPickerOption
|
134 |
+
// fixes "Set Custom Url" being printed multiple times, @see https://github.com/presscustomizr/nimble-builder/issues/207
|
135 |
+
input.container.find( 'select' ).on('czrSelect2:select czrSelect2:unselect czrSelect2:close czrSelect2:open', function (e) {
|
136 |
+
input.defaultValueHasBeenPushed = false;
|
137 |
+
});
|
138 |
+
|
139 |
+
input.container.find( 'select' ).czrSelect2( {
|
140 |
+
placeholder: {
|
141 |
+
id: '-1', // the value of the option
|
142 |
+
title: 'Select'
|
143 |
+
},
|
144 |
+
data : input.setupSelectedContents(),
|
145 |
+
// allowClear: true,
|
146 |
+
ajax: {
|
147 |
+
url: wp.ajax.settings.url,// was serverControlParams.AjaxUrl,
|
148 |
+
type: 'POST',
|
149 |
+
dataType: 'json',
|
150 |
+
delay: 250,
|
151 |
+
debug: true,
|
152 |
+
data: function ( params ) {
|
153 |
+
//for some reason I'm not getting at the moment the params.page returned when searching is different
|
154 |
+
var page = params.page ? params.page : 0;
|
155 |
+
page = params.term ? params.page : page;
|
156 |
+
|
157 |
+
// Set the current ajax action now
|
158 |
+
input.currentAjaxAction( params.term ? "search-available-content-items-customizer" : "load-available-content-items-customizer" );
|
159 |
+
|
160 |
+
return {
|
161 |
+
action : input.currentAjaxAction(),
|
162 |
+
search : params.term,
|
163 |
+
wp_customize : 'on',
|
164 |
+
page : page,
|
165 |
+
wp_object_types : JSON.stringify( input.wpObjectTypes ),
|
166 |
+
nonce : api.settings.nonce.save
|
167 |
+
};
|
168 |
+
},
|
169 |
+
// transport: function (params, success, failure) {
|
170 |
+
// console.log('params', params );
|
171 |
+
// console.log('success', success );
|
172 |
+
// console.log('failure', failure );
|
173 |
+
// var $request = $.ajax(params);
|
174 |
+
|
175 |
+
// $request.then(success);
|
176 |
+
// $request.fail(failure);
|
177 |
+
|
178 |
+
// return $request;
|
179 |
+
// },
|
180 |
+
processResults: function ( data, params ) {
|
181 |
+
//allows us to remotely set a default option like custom link when initializing the content picker input.
|
182 |
+
var defaultContentPickerOption = { defaultOption : {
|
183 |
+
id : '',
|
184 |
+
title : '',
|
185 |
+
type_label : '',
|
186 |
+
object_type : '',
|
187 |
+
url : ''
|
188 |
+
}
|
189 |
+
};
|
190 |
+
if ( input.input_parent && input.input_parent.module ) {
|
191 |
+
input.input_parent.module.trigger( 'set_default_content_picker_options', { defaultContentPickerOption : defaultContentPickerOption } );
|
192 |
+
} else {
|
193 |
+
api.infoLog(' content_picker input => ::processResults => event "set_default_content_picker_option" not triggered when in pre-item');
|
194 |
+
}
|
195 |
+
|
196 |
+
if ( ! data.success ) {
|
197 |
+
api.errare('request failure in setupContentPicker => processResults', data );
|
198 |
+
return { results: defaultContentPickerOption.defaultOption };
|
199 |
+
}
|
200 |
+
|
201 |
+
var items = data.data.items,
|
202 |
+
_results = [];
|
203 |
+
|
204 |
+
// cast items to an array
|
205 |
+
items = !_.isArray( items ) ? [] : items;
|
206 |
+
|
207 |
+
input.defaultValueHasBeenPushed = input.defaultValueHasBeenPushed || false;
|
208 |
+
|
209 |
+
if ( 'load-available-content-items-customizer' === input.currentAjaxAction() && ! _.isEmpty( defaultContentPickerOption.defaultOption ) ) {
|
210 |
+
if ( defaultContentPickerOption.defaultOption.id && ! input.defaultValueHasBeenPushed ) {
|
211 |
+
_results.push( defaultContentPickerOption.defaultOption );
|
212 |
+
input.defaultValueHasBeenPushed = true;
|
213 |
+
}
|
214 |
+
}
|
215 |
+
|
216 |
+
_.each( items, function( item ) {
|
217 |
+
_results.push({
|
218 |
+
id : item.id,
|
219 |
+
title : item.title,
|
220 |
+
type_label : item.type_label,
|
221 |
+
object_type : item.object,
|
222 |
+
url : item.url
|
223 |
+
});
|
224 |
+
});
|
225 |
+
|
226 |
+
return {
|
227 |
+
results: _results,
|
228 |
+
//The pagination param will trigger the infinite load
|
229 |
+
//@to be improved
|
230 |
+
pagination: { more: items.length >= 1 }//<= the pagination boolean param can be tricky => here set to >= 10 because we query 10 + add a custom link item on the first query
|
231 |
+
};
|
232 |
+
},
|
233 |
+
},//ajax
|
234 |
+
templateSelection: input.czrFormatContentSelected,
|
235 |
+
templateResult: input.czrFormatContentSelected,
|
236 |
+
escapeMarkup: function ( markup ) { return markup; },
|
237 |
+
});//czrSelect2 setup
|
238 |
+
},
|
239 |
+
|
240 |
+
// item is structured this way :
|
241 |
+
// {
|
242 |
+
// id : item.id,
|
243 |
+
// title : item.title,
|
244 |
+
// type_label : item.type_label,
|
245 |
+
// object_type : item.object,
|
246 |
+
// url : item.url
|
247 |
+
// }
|
248 |
+
czrFormatContentSelected: function ( item ) {
|
249 |
+
if ( item.loading ) return item.text;
|
250 |
+
var markup = "<div class='content-picker-item'>" +
|
251 |
+
"<div class='content-item-bar'>" +
|
252 |
+
"<span class='czr-picker-item-title'>" + item.title + "</span>";
|
253 |
+
|
254 |
+
if ( item.type_label ) {
|
255 |
+
markup += "<span class='czr-picker-item-type'>" + item.type_label + "</span>";
|
256 |
+
}
|
257 |
+
|
258 |
+
markup += "</div></div>";
|
259 |
+
|
260 |
+
return markup;
|
261 |
+
},
|
262 |
+
|
263 |
+
setupSelectedContents : function() {
|
264 |
+
var input = this,
|
265 |
+
_model = input();
|
266 |
+
|
267 |
+
return _model;
|
268 |
+
}
|
269 |
+
});//$.extend
|
270 |
+
})( wp.customize , jQuery, _ );
|
assets/czr/fmk/js/base-fmk/1_0_input_item_module_control/1_1_item_and_modopt/1_1_0_item/_0_0_2_item_0_init.js
ADDED
@@ -0,0 +1,247 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
//extends api.Value
|
2 |
+
//options:
|
3 |
+
// id : item.id,
|
4 |
+
// initial_item_model : item,
|
5 |
+
// defaultItemModel : module.defaultItemModel,
|
6 |
+
// module : module,
|
7 |
+
// is_added_by_user : is_added_by_user || false
|
8 |
+
|
9 |
+
var CZRItemMths = CZRItemMths || {};
|
10 |
+
( function ( api, $, _ ) {
|
11 |
+
$.extend( CZRItemMths , {
|
12 |
+
initialize: function( id, options ) {
|
13 |
+
if ( _.isUndefined(options.module) || _.isEmpty(options.module) ) {
|
14 |
+
throw new Error('No module assigned to item ' + id + '. Aborting');
|
15 |
+
}
|
16 |
+
|
17 |
+
var item = this;
|
18 |
+
api.Value.prototype.initialize.call( item, null, options );
|
19 |
+
|
20 |
+
//DEFERRED STATES
|
21 |
+
//store the state of ready.
|
22 |
+
//=> we don't want the ready method to be fired several times
|
23 |
+
item.isReady = $.Deferred();
|
24 |
+
//will store the embedded and content rendered state
|
25 |
+
item.embedded = $.Deferred();
|
26 |
+
item.container = null;//will store the item $ dom element
|
27 |
+
item.contentContainer = null;//will store the item content $ dom element
|
28 |
+
|
29 |
+
// this collection will be populated based on the DOM rendered input candidates
|
30 |
+
// will allows us to set and get any individual input : item.czr_Input('font-family')()
|
31 |
+
// declaring the collection Values here allows us to schedule actions for not yet registered inputs
|
32 |
+
// like for example :
|
33 |
+
// => when the font-family input is registered, then listen to it
|
34 |
+
// item.czr_Input.when( 'font-family', function( _input_ ) {
|
35 |
+
// _input_.bind( function( to, from ) {
|
36 |
+
// console.log('font-family input changed ', to ,from );
|
37 |
+
// });
|
38 |
+
// });
|
39 |
+
item.czr_Input = new api.Values();
|
40 |
+
|
41 |
+
// the item.inputCollection stores all instantiated input from DOM at the end of api.CZR_Helpers.setupInputCollectionFromDOM.call( item );
|
42 |
+
// the collection of each individual input object is stored in item.czr_Input()
|
43 |
+
// this inputCollection is designed to be listened to, in order to fire action when the collection has been populated.
|
44 |
+
item.inputCollection = new api.Value({});
|
45 |
+
|
46 |
+
//VIEW STATES FOR ITEM AND REMOVE DIALOG
|
47 |
+
//viewState stores the current expansion status of a given view => one value by created by item.id
|
48 |
+
//viewState can take 3 values : expanded, expanded_noscroll (=> used on view creation), closed
|
49 |
+
item.viewState = new api.Value( 'closed' );
|
50 |
+
item.removeDialogVisible = new api.Value( false );
|
51 |
+
|
52 |
+
//input.options = options;
|
53 |
+
//write the options as properties, name is included
|
54 |
+
$.extend( item, options || {} );
|
55 |
+
|
56 |
+
//declares a default model
|
57 |
+
item.defaultItemModel = _.clone( options.defaultItemModel ) || { id : '', title : '' };
|
58 |
+
|
59 |
+
//set initial values
|
60 |
+
var _initial_model = $.extend( item.defaultItemModel, options.initial_item_model );
|
61 |
+
|
62 |
+
// Check initial model here : to be overriden in each module
|
63 |
+
_initial_model = item.validateItemModelOnInitialize( _initial_model );
|
64 |
+
|
65 |
+
//this won't be listened to at this stage
|
66 |
+
item.set( _initial_model );
|
67 |
+
|
68 |
+
//USER EVENT MAP
|
69 |
+
item.userEventMap = new api.Value( [
|
70 |
+
//toggles remove view alert
|
71 |
+
{
|
72 |
+
trigger : 'click keydown',
|
73 |
+
selector : [ '.' + item.module.control.css_attr.display_alert_btn, '.' + item.module.control.css_attr.cancel_alert_btn ].join(','),
|
74 |
+
name : 'toggle_remove_alert',
|
75 |
+
actions : ['toggleRemoveAlert']
|
76 |
+
},
|
77 |
+
//removes item and destroys its view
|
78 |
+
{
|
79 |
+
trigger : 'click keydown',
|
80 |
+
selector : '.' + item.module.control.css_attr.remove_view_btn,
|
81 |
+
name : 'remove_item',
|
82 |
+
actions : ['removeItem']
|
83 |
+
},
|
84 |
+
//edit view
|
85 |
+
{
|
86 |
+
trigger : 'click keydown',
|
87 |
+
selector : [ '.' + item.module.control.css_attr.edit_view_btn, '.' + item.module.control.css_attr.item_title ].join(','),
|
88 |
+
name : 'edit_view',
|
89 |
+
actions : [ 'setViewVisibility' ]
|
90 |
+
},
|
91 |
+
//clone view
|
92 |
+
{
|
93 |
+
trigger : 'click keydown',
|
94 |
+
selector : '.czr-clone-item',
|
95 |
+
name : 'clone_view',
|
96 |
+
actions : function( args ) {
|
97 |
+
args = args || {};
|
98 |
+
var _cloned_item_model = $.extend( {}, true, item() );
|
99 |
+
_cloned_item_model.id = '';
|
100 |
+
this.module.addItem( args, _cloned_item_model ).done( function() {
|
101 |
+
// Nimble Builder => make sure the dynamic stylesheet is refreshed
|
102 |
+
if ( window.sektionsLocalizedData && api.czr_skopeBase ) {
|
103 |
+
api.previewer.trigger( 'sek-refresh-stylesheet', {
|
104 |
+
local_skope_id : api.czr_skopeBase.getSkopeProperty( 'skope_id' ),
|
105 |
+
location_skope_id : sektionsLocalizedData.globalSkopeId
|
106 |
+
});
|
107 |
+
}
|
108 |
+
});
|
109 |
+
}
|
110 |
+
},
|
111 |
+
//tabs navigation
|
112 |
+
{
|
113 |
+
trigger : 'click keydown',
|
114 |
+
selector : '.tabs nav li',
|
115 |
+
name : 'tab_nav',
|
116 |
+
actions : function( args ) {
|
117 |
+
//toggleTabVisibility is declared in the module ctor and its "this" is the item or the modOpt
|
118 |
+
var tabIdSwitchedTo = $( args.dom_event.currentTarget, args.dom_el ).data('tab-id');
|
119 |
+
this.module.toggleTabVisibility.call( this, tabIdSwitchedTo );
|
120 |
+
this.trigger( 'tab-switch', { id : tabIdSwitchedTo } );
|
121 |
+
}
|
122 |
+
}
|
123 |
+
]);
|
124 |
+
|
125 |
+
|
126 |
+
|
127 |
+
|
128 |
+
//ITEM IS READY
|
129 |
+
//1) push it to the module item collection
|
130 |
+
//2) observe its changes
|
131 |
+
item.isReady.done( function() {
|
132 |
+
//push it to the collection
|
133 |
+
item.module.updateItemsCollection( { item : item() } );
|
134 |
+
//listen to each single item change
|
135 |
+
item.callbacks.add( function() { return item.itemReact.apply(item, arguments ); } );
|
136 |
+
|
137 |
+
//SCHEDULE INPUTS SETUP
|
138 |
+
//=> when the item content has been rendered. Typically on item expansion for a multi-items module.
|
139 |
+
// => or for mono item, right on item.renderItemWrapper()
|
140 |
+
item.bind( 'contentRendered', function() {
|
141 |
+
//create the collection of inputs if needed
|
142 |
+
//first time or after a removal
|
143 |
+
// previous condition included : ! _.has( item, 'czr_Input' )
|
144 |
+
if ( _.isEmpty( item.inputCollection() ) ) {
|
145 |
+
if ( serverControlParams.isDevMode ) {
|
146 |
+
api.CZR_Helpers.setupInputCollectionFromDOM.call( item );
|
147 |
+
//the item.container is now available
|
148 |
+
//Setup the tabs navigation
|
149 |
+
//setupTabNav is defined in the module ctor and its this is the item or the modOpt
|
150 |
+
item.module.setupTabNav.call( item );
|
151 |
+
} else {
|
152 |
+
try {
|
153 |
+
api.CZR_Helpers.setupInputCollectionFromDOM.call( item );
|
154 |
+
//the item.container is now available
|
155 |
+
//Setup the tabs navigation
|
156 |
+
//setupTabNav is defined in the module ctor and its this is the item or the modOpt
|
157 |
+
item.module.setupTabNav.call( item );
|
158 |
+
} catch( er ) {
|
159 |
+
api.errorLog( 'In item.isReady.done : ' + er );
|
160 |
+
}
|
161 |
+
}
|
162 |
+
}
|
163 |
+
});
|
164 |
+
|
165 |
+
//SCHEDULE INPUTS DESTROY
|
166 |
+
item.bind( 'contentRemoved', function() {
|
167 |
+
if ( _.has( item, 'czr_Input' ) )
|
168 |
+
api.CZR_Helpers.removeInputCollection.call( item );
|
169 |
+
});
|
170 |
+
|
171 |
+
//When shall we render the item ?
|
172 |
+
//If the module is part of a simple control, the item can be render now,
|
173 |
+
if ( item.canBeRendered() ) {
|
174 |
+
item.mayBeRenderItemWrapper();
|
175 |
+
}
|
176 |
+
|
177 |
+
//ITEM WRAPPER VIEW SETUP
|
178 |
+
//defer actions on item view embedded
|
179 |
+
item.embedded.done( function() {
|
180 |
+
//define the item view DOM event map
|
181 |
+
//bind actions when the item is embedded : item title, etc.
|
182 |
+
item.itemWrapperViewSetup( _initial_model );
|
183 |
+
});
|
184 |
+
});//item.isReady.done()
|
185 |
+
|
186 |
+
//if an item is manually added : open it
|
187 |
+
// if ( item.is_added_by_user ) {
|
188 |
+
// item.setViewVisibility( {}, true );//empty obj because this method can be fired by the dom chain actions, always passing an object. true for added_by_user
|
189 |
+
// }
|
190 |
+
//item.setViewVisibility( {}, item.is_added_by_user );
|
191 |
+
|
192 |
+
},//initialize
|
193 |
+
|
194 |
+
//overridable method
|
195 |
+
//Fired if the item has been instantiated
|
196 |
+
//The item.callbacks are declared.
|
197 |
+
ready : function() {
|
198 |
+
// July 2021 introduced so we can remotely add visibility functions
|
199 |
+
api.trigger('czr_module_item_is_ready', {
|
200 |
+
module_type : this.module.module_type,
|
201 |
+
item : this
|
202 |
+
});
|
203 |
+
this.isReady.resolve();
|
204 |
+
},
|
205 |
+
|
206 |
+
// overridable method introduced with the flat skope
|
207 |
+
// problem to solve => an instantiated item, doesn't necessary have to be rendered in a given context.
|
208 |
+
canBeRendered : function() {
|
209 |
+
return true;
|
210 |
+
},
|
211 |
+
|
212 |
+
// @return validated model object
|
213 |
+
// To be overriden in each module
|
214 |
+
validateItemModelOnInitialize : function( item_model_candidate ) {
|
215 |
+
return item_model_candidate;
|
216 |
+
},
|
217 |
+
|
218 |
+
// React to a single item change
|
219 |
+
// cb of module.czr_Item( item.id ).callbacks
|
220 |
+
// the params can typically hold informations passed by the input that has been changed and its specific preview transport (can be PostMessage )
|
221 |
+
// params looks like :
|
222 |
+
// {
|
223 |
+
// module : {}
|
224 |
+
// input_changed : string input.id
|
225 |
+
// input_transport : 'postMessage' or '',
|
226 |
+
// not_preview_sent : bool
|
227 |
+
// }
|
228 |
+
itemReact : function( to, from, params ) {
|
229 |
+
var item = this,
|
230 |
+
module = item.module;
|
231 |
+
|
232 |
+
params = params || {};
|
233 |
+
|
234 |
+
//update the collection
|
235 |
+
module.updateItemsCollection( { item : to, params : params } ).done( function() {
|
236 |
+
//Always update the view title when the item collection has been updated
|
237 |
+
item.writeItemViewTitle( to, params );
|
238 |
+
});
|
239 |
+
|
240 |
+
//send item to the preview. On update only, not on creation.
|
241 |
+
// if ( ! _.isEmpty(from) || ! _.isUndefined(from) ) {
|
242 |
+
// api.consoleLog('DO WE REALLY NEED TO SEND THIS TO THE PREVIEW WITH _sendItem(to, from) ?');
|
243 |
+
// item._sendItem(to, from);
|
244 |
+
// }
|
245 |
+
}
|
246 |
+
});//$.extend
|
247 |
+
})( wp.customize , jQuery, _ );
|
assets/czr/fmk/js/base-fmk/1_0_input_item_module_control/1_1_item_and_modopt/1_1_0_item/_0_0_2_item_2_model.js
ADDED
@@ -0,0 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
//extends api.CZRBaseControl
|
2 |
+
|
3 |
+
var CZRItemMths = CZRItemMths || {};
|
4 |
+
( function ( api, $, _ ) {
|
5 |
+
$.extend( CZRItemMths , {
|
6 |
+
//The idea is to send only the currently modified item instead of the entire collection
|
7 |
+
//the entire collection is sent anyway on api(setId).set( value ), and accessible in the preview via api(setId).bind( fn( to) )
|
8 |
+
_sendItem : function( to, from ) {
|
9 |
+
var item = this,
|
10 |
+
module = item.module,
|
11 |
+
_changed_props = [];
|
12 |
+
|
13 |
+
//which property(ies) has(ve) changed ?
|
14 |
+
_.each( from, function( _val, _key ) {
|
15 |
+
if ( _val != to[_key] )
|
16 |
+
_changed_props.push(_key);
|
17 |
+
});
|
18 |
+
|
19 |
+
_.each( _changed_props, function( _prop ) {
|
20 |
+
api.previewer.send( 'sub_setting', {
|
21 |
+
set_id : module.control.id,
|
22 |
+
id : to.id,
|
23 |
+
changed_prop : _prop,
|
24 |
+
value : to[_prop]
|
25 |
+
});
|
26 |
+
|
27 |
+
//add a hook here
|
28 |
+
module.trigger('item_sent', { item : to , dom_el: item.container, changed_prop : _prop } );
|
29 |
+
});
|
30 |
+
},
|
31 |
+
|
32 |
+
// fired on click event
|
33 |
+
// @see initialize()
|
34 |
+
toggleRemoveAlert : function() {
|
35 |
+
var _isVisible = this.removeDialogVisible();
|
36 |
+
this.module.closeRemoveDialogs();
|
37 |
+
this.removeDialogVisible( ! _isVisible );
|
38 |
+
},
|
39 |
+
|
40 |
+
//fired on click dom event
|
41 |
+
//for dynamic multi input modules
|
42 |
+
//@return void()
|
43 |
+
//@param params : { dom_el : {}, dom_event : {}, event : {}, model {} }
|
44 |
+
removeItem : function( params ) {
|
45 |
+
params = params || {};
|
46 |
+
var item = this,
|
47 |
+
module = this.module,
|
48 |
+
_new_collection = _.clone( module.itemCollection() );
|
49 |
+
|
50 |
+
//hook here
|
51 |
+
module.trigger('pre_item_dom_remove', item() );
|
52 |
+
|
53 |
+
//destroy the Item DOM el
|
54 |
+
item._destroyView();
|
55 |
+
|
56 |
+
//new collection
|
57 |
+
//say it
|
58 |
+
_new_collection = _.without( _new_collection, _.findWhere( _new_collection, {id: item.id }) );
|
59 |
+
module.itemCollection.set( _new_collection );
|
60 |
+
//hook here
|
61 |
+
module.trigger('pre_item_api_remove', item() );
|
62 |
+
|
63 |
+
var _item_ = $.extend( true, {}, item() );
|
64 |
+
|
65 |
+
// <REMOVE THE ITEM FROM THE COLLECTION>
|
66 |
+
module.czr_Item.remove( item.id );
|
67 |
+
// </REMOVE THE ITEM FROM THE COLLECTION>
|
68 |
+
|
69 |
+
//refresh the preview frame (only needed if transport is postMessage && has no partial refresh set )
|
70 |
+
//must be a dom event not triggered
|
71 |
+
//otherwise we are in the init collection case where the items are fetched and added from the setting in initialize
|
72 |
+
if ( 'postMessage' == api(module.control.id).transport && _.has( params, 'dom_event') && ! _.has( params.dom_event, 'isTrigger' ) && ! api.CZR_Helpers.hasPartRefresh( module.control.id ) ) {
|
73 |
+
// api.previewer.refresh().done( function() {
|
74 |
+
// _dfd_.resolve();
|
75 |
+
// });
|
76 |
+
// It would be better to wait for the refresh promise
|
77 |
+
// The following approach to bind and unbind when refreshing the preview is similar to the one coded in module::addItem()
|
78 |
+
var triggerEventWhenPreviewerReady = function() {
|
79 |
+
api.previewer.unbind( 'ready', triggerEventWhenPreviewerReady );
|
80 |
+
module.trigger( 'item-removed', _item_ );
|
81 |
+
};
|
82 |
+
api.previewer.bind( 'ready', triggerEventWhenPreviewerReady );
|
83 |
+
api.previewer.refresh();
|
84 |
+
} else {
|
85 |
+
module.trigger( 'item-removed', _item_ );
|
86 |
+
module.control.trigger( 'item-removed', _item_ );
|
87 |
+
}
|
88 |
+
|
89 |
+
},
|
90 |
+
|
91 |
+
//@return the item {...} from the collection
|
92 |
+
//takes a item unique id as param
|
93 |
+
getModel : function(id) {
|
94 |
+
return this();
|
95 |
+
}
|
96 |
+
|
97 |
+
});//$.extend
|
98 |
+
})( wp.customize , jQuery, _ );
|
assets/czr/fmk/js/base-fmk/1_0_input_item_module_control/1_1_item_and_modopt/1_1_0_item/_0_0_2_item_3_view.js
ADDED
@@ -0,0 +1,500 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
//extends api.CZRBaseControl
|
3 |
+
var CZRItemMths = CZRItemMths || {};
|
4 |
+
( function ( api, $, _ ) {
|
5 |
+
$.extend( CZRItemMths , {
|
6 |
+
//fired on initialize for items in module embedded in a regular control
|
7 |
+
mayBeRenderItemWrapper : function() {
|
8 |
+
var item = this;
|
9 |
+
|
10 |
+
if ( 'pending' != item.embedded.state() )
|
11 |
+
return;
|
12 |
+
// Make sure we don't print twice
|
13 |
+
if ( ! _.isEmpty( item.container ) && item.container.length > 0 )
|
14 |
+
return;
|
15 |
+
|
16 |
+
$.when( item.renderItemWrapper() ).done( function( $_container ) {
|
17 |
+
item.container = $_container;
|
18 |
+
if ( _.isUndefined( item.container ) || ! item.container.length ) {
|
19 |
+
throw new Error( 'In mayBeRenderItemWrapper the Item view has not been rendered : ' + item.id );
|
20 |
+
} else {
|
21 |
+
//say it
|
22 |
+
item.embedded.resolve();
|
23 |
+
}
|
24 |
+
});
|
25 |
+
},
|
26 |
+
|
27 |
+
//the view wrapper has been rendered by WP
|
28 |
+
//the content ( the various inputs ) is rendered by the following methods
|
29 |
+
//an event is triggered on the control.container when content is rendered
|
30 |
+
renderItemWrapper : function( _item_model_ ) {
|
31 |
+
//=> an array of objects
|
32 |
+
var item = this,
|
33 |
+
module = item.module,
|
34 |
+
dfd = $.Deferred(),
|
35 |
+
$_view_el;
|
36 |
+
|
37 |
+
// Create a deep copy of the item, so we can inject custom properties before parsing the template, without affecting the original item
|
38 |
+
var item_model_for_template_injection = $.extend( true, {}, _item_model_ || item() );
|
39 |
+
|
40 |
+
var appendAndResolve = function( _tmpl_ ) {
|
41 |
+
//if module is multi item, then render the item crud header part
|
42 |
+
//Note : for the widget module, the getTemplateSelectorPart method is overridden
|
43 |
+
if ( module.isMultiItem() ) {
|
44 |
+
//do we have an html template ?
|
45 |
+
if ( _.isEmpty( _tmpl_ ) ) {
|
46 |
+
dfd.reject( 'renderItemWrapper => Missing html template for module : '+ module.id );
|
47 |
+
}
|
48 |
+
$_view_el.append( _tmpl_ );
|
49 |
+
}
|
50 |
+
|
51 |
+
//then, append the item content wrapper
|
52 |
+
$_view_el.append( $( '<div/>', { class: module.control.css_attr.item_content } ) );
|
53 |
+
|
54 |
+
dfd.resolve( $_view_el );
|
55 |
+
};//appendAndResolve
|
56 |
+
|
57 |
+
|
58 |
+
// allow plugin to alter the item_model before template injection
|
59 |
+
item.trigger( 'item-model-before-item-wrapper-template-injection', item_model_for_template_injection );
|
60 |
+
|
61 |
+
//render the item wrapper
|
62 |
+
$_view_el = $('<li>', { class : module.control.css_attr.single_item, 'data-id' : item_model_for_template_injection.id, id : item_model_for_template_injection.id } );
|
63 |
+
|
64 |
+
//append the item view to the first module view wrapper
|
65 |
+
//!!note : => there could be additional sub view wrapper inside !!
|
66 |
+
//$( '.' + module.control.css_attr.items_wrapper , module.container).first().append( $_view_el );
|
67 |
+
// module.itemsWrapper has been stored as a $ var in module initialize() when the tmpl has been embedded
|
68 |
+
module.itemsWrapper.append( $_view_el );
|
69 |
+
|
70 |
+
if ( module.isMultiItem() ) {
|
71 |
+
var _template_selector;
|
72 |
+
// Do we have view content template script?
|
73 |
+
// if yes, let's use it <= Old way
|
74 |
+
// Otherwise let's fetch the html template from the server
|
75 |
+
if ( ! _.isEmpty( module.rudItemPart ) ) {
|
76 |
+
_template_selector = module.getTemplateSelectorPart( 'rudItemPart', item_model_for_template_injection );
|
77 |
+
//do we have view template script?
|
78 |
+
if ( 1 > $( '#tmpl-' + _template_selector ).length ) {
|
79 |
+
dfd.reject( 'Missing template for item ' + item.id + '. The provided template script has no been found : #tmpl-' + _template_selector );
|
80 |
+
}
|
81 |
+
var items_are_clonable = api.czrModuleMap[module.module_type] && api.czrModuleMap[module.module_type].items_are_clonable;
|
82 |
+
appendAndResolve( wp.template( _template_selector )( $.extend( item_model_for_template_injection, { is_sortable : module.sortable, items_are_clonable : items_are_clonable } ) ) );
|
83 |
+
} else {
|
84 |
+
|
85 |
+
// allow plugin to alter the ajax params before fetching
|
86 |
+
var requestParams = {
|
87 |
+
tmpl : 'rud-item-part',
|
88 |
+
module_type: 'all_modules',
|
89 |
+
module_id : module.id,
|
90 |
+
control_id : module.control.id
|
91 |
+
};
|
92 |
+
item.trigger( 'item-wrapper-tmpl-params-before-fetching', requestParams );
|
93 |
+
|
94 |
+
// Let's check if the filtered requested params can find a match of a printed tmpl of the module
|
95 |
+
// this filter 'item-wrapper-tmpl-params-before-fetching', is used in the widget zone module of the Hueman theme (june 2018 )
|
96 |
+
// it allows us to assign a specific template for the built-in widget zones
|
97 |
+
if ( ! _.isEmpty( module[ requestParams.tmpl ] ) ) {
|
98 |
+
_template_selector = module.getTemplateSelectorPart( requestParams.tmpl, item_model_for_template_injection );
|
99 |
+
//do we have view template script?
|
100 |
+
if ( 1 > $( '#tmpl-' + _template_selector ).length ) {
|
101 |
+
dfd.reject( 'Missing template for item ' + item.id + '. The provided template script has no been found : #tmpl-' + _template_selector );
|
102 |
+
}
|
103 |
+
appendAndResolve( wp.template( _template_selector )( item_model_for_template_injection ) );
|
104 |
+
} else {
|
105 |
+
api.CZR_Helpers.getModuleTmpl( requestParams ).done( function( _serverTmpl_ ) {
|
106 |
+
//console.log( 'renderItemWrapper => success response =>', module.id, _serverTmpl_);
|
107 |
+
appendAndResolve( api.CZR_Helpers.parseTemplate( _serverTmpl_ )( $.extend( item_model_for_template_injection, { is_sortable : module.sortable } ) ) );
|
108 |
+
}).fail( function( _r_ ) {
|
109 |
+
//console.log( 'renderItemWrapper => fail response =>', _r_);
|
110 |
+
dfd.reject( 'renderItemWrapper => Problem when fetching the rud-item-part tmpl from server for module : '+ module.id );
|
111 |
+
});
|
112 |
+
}
|
113 |
+
}
|
114 |
+
} else {//if ( module.isMultiItem() ) {}
|
115 |
+
appendAndResolve();
|
116 |
+
}
|
117 |
+
|
118 |
+
return dfd.promise();
|
119 |
+
},
|
120 |
+
|
121 |
+
|
122 |
+
// fired when item is ready and embedded
|
123 |
+
// define the item view DOM event map
|
124 |
+
// bind actions when the item is embedded
|
125 |
+
itemWrapperViewSetup : function( _item_model_ ) {
|
126 |
+
var item = this,
|
127 |
+
module = this.module;
|
128 |
+
|
129 |
+
// _item_model_ = item() || item.initial_item_model;//could not be set yet
|
130 |
+
|
131 |
+
// Let's create a deep copy now
|
132 |
+
item_model = item() || item.initial_item_model;//$.extend( true, {}, _item_model_ );
|
133 |
+
|
134 |
+
// always write the title
|
135 |
+
item.writeItemViewTitle();
|
136 |
+
|
137 |
+
|
138 |
+
// When do we render the item content ?
|
139 |
+
// If this is a multi-item module, let's render each item content when they are expanded.
|
140 |
+
// In the case of a single item module, we can render the item content now.
|
141 |
+
var _updateItemContentDeferred = function( $_item_content, to, from ) {
|
142 |
+
//update the $.Deferred state
|
143 |
+
if ( ! _.isUndefined( $_item_content ) && false !== $_item_content.length ) {
|
144 |
+
item.contentContainer = $_item_content;
|
145 |
+
// The 'contentRendered' event triggers the api.CZR_Helpers.setupInputCollectionFromDOM.call( item );
|
146 |
+
item.trigger( 'contentRendered', { item_content : $_item_content } );
|
147 |
+
item.toggleItemExpansion( to, item.module.isMultiItem() ? 150 : 0 );//the second param is the duration
|
148 |
+
item.cleanLoader();
|
149 |
+
|
150 |
+
}
|
151 |
+
else {
|
152 |
+
throw new Error( 'Module : ' + item.module.id + ', the item content has not been rendered for ' + item.id );
|
153 |
+
}
|
154 |
+
};
|
155 |
+
|
156 |
+
// MULTI-ITEM MODULE
|
157 |
+
if ( item.module.isMultiItem() ) {
|
158 |
+
item.viewState.callbacks.add( function( to, from ) {
|
159 |
+
//viewState can take 3 states : expanded, expanded_noscroll, closed
|
160 |
+
var _isExpanded = -1 !== to.indexOf( 'expanded' );
|
161 |
+
|
162 |
+
//If this module has mod Opt, always close the opt pane on view state change
|
163 |
+
if ( module.hasModOpt() && _isExpanded ) {
|
164 |
+
api.czr_ModOptVisible( false, {
|
165 |
+
module : module,//the current module for which the modOpt is being expanded
|
166 |
+
focus : false//the id of the tab we want to focus on
|
167 |
+
});
|
168 |
+
}
|
169 |
+
|
170 |
+
if ( _isExpanded ) {
|
171 |
+
//item already rendered ?
|
172 |
+
if ( _.isObject( item.contentContainer ) && false !== item.contentContainer.length ) {
|
173 |
+
//toggle on view state change
|
174 |
+
item.toggleItemExpansion(to);
|
175 |
+
} else {
|
176 |
+
item.printLoader();
|
177 |
+
item.renderItemContent( item() || item.initial_item_model )
|
178 |
+
.done( function( $_item_content ) {
|
179 |
+
//introduce a small delay to give some times to the modules to be printed.
|
180 |
+
//@todo : needed ?
|
181 |
+
//_updateItemContentDeferred = _.debounce(_updateItemContentDeferred, 50 );
|
182 |
+
_updateItemContentDeferred( $_item_content, to, from );
|
183 |
+
})
|
184 |
+
.fail( function( _r_ ) {
|
185 |
+
api.errorLog( "multi-item module => failed item.renderItemContent for module : " + module.id, _r_ );
|
186 |
+
});
|
187 |
+
}
|
188 |
+
} else {
|
189 |
+
//toggle on view state change
|
190 |
+
item.toggleItemExpansion( to ).done( function() {
|
191 |
+
if ( _.isObject( item.contentContainer ) && false !== item.contentContainer.length ) {
|
192 |
+
item.trigger( 'beforeContenRemoved' );
|
193 |
+
//Removes DOM input nodes
|
194 |
+
$( '.' + module.control.css_attr.item_content, item.container ).children().each( function() {
|
195 |
+
$(this).remove();
|
196 |
+
});
|
197 |
+
//clean any other content like a commented html markup
|
198 |
+
$( '.' + module.control.css_attr.item_content, item.container ).html('');
|
199 |
+
//reset the contentContainer property
|
200 |
+
item.contentContainer = null;
|
201 |
+
//will remove the input collection values
|
202 |
+
item.trigger( 'contentRemoved' );
|
203 |
+
}
|
204 |
+
});
|
205 |
+
}
|
206 |
+
});
|
207 |
+
}
|
208 |
+
// SINGLE ITEM MODULE
|
209 |
+
else {
|
210 |
+
//react to the item state changes
|
211 |
+
item.viewState.callbacks.add( function( to, from ) {
|
212 |
+
//toggle on view state change
|
213 |
+
item.toggleItemExpansion.apply( item, [ to, 0 ] );
|
214 |
+
});
|
215 |
+
item.printLoader();
|
216 |
+
//renderview content now for a single item module
|
217 |
+
item.renderItemContent( item_model )
|
218 |
+
.done( function( $_item_content ) {
|
219 |
+
_updateItemContentDeferred( $_item_content, true );
|
220 |
+
//item.viewState.set('expanded');
|
221 |
+
})
|
222 |
+
.fail( function( _r_ ) {
|
223 |
+
api.errare( "mono-item module => failed item.renderItemContent for module : " + module.id, _r_ );
|
224 |
+
});
|
225 |
+
}
|
226 |
+
|
227 |
+
//DOM listeners for the user action in item view wrapper
|
228 |
+
api.CZR_Helpers.setupDOMListeners(
|
229 |
+
item.userEventMap(),//actions to execute
|
230 |
+
{ model:item_model, dom_el:item.container },//model + dom scope
|
231 |
+
item //instance where to look for the cb methods
|
232 |
+
);
|
233 |
+
|
234 |
+
//Listen to the remove dialog state
|
235 |
+
item.removeDialogVisible.bind( function( visible ) {
|
236 |
+
var module = item.module,
|
237 |
+
$_alert_el = $( '.' + module.control.css_attr.remove_alert_wrapper, item.container ).first();
|
238 |
+
|
239 |
+
//first close all open items views and dialogs
|
240 |
+
if ( visible )
|
241 |
+
module.closeAllItems();
|
242 |
+
|
243 |
+
//Close Mod opts if any
|
244 |
+
if ( visible && module.hasModOpt() ) {
|
245 |
+
api.czr_ModOptVisible( false, {
|
246 |
+
module : module,//the current module for which the modOpt is being expanded
|
247 |
+
focus : false//the id of the tab we want to focus on
|
248 |
+
});
|
249 |
+
}
|
250 |
+
|
251 |
+
//Close Pre item dialog
|
252 |
+
if ( visible && _.has( module, 'preItem' ) ) {
|
253 |
+
module.preItemExpanded(false);
|
254 |
+
}
|
255 |
+
|
256 |
+
//then close any other open remove dialog in the item container
|
257 |
+
$('.' + module.control.css_attr.remove_alert_wrapper, item.container ).not( $_alert_el ).each( function() {
|
258 |
+
if ( $(this).hasClass( 'open' ) ) {
|
259 |
+
$(this).slideToggle( {
|
260 |
+
duration : 200,
|
261 |
+
done : function() {
|
262 |
+
$(this).toggleClass('open' , false );
|
263 |
+
//deactivate the icons
|
264 |
+
$(this).siblings().find('.' + module.control.css_attr.display_alert_btn).toggleClass( 'active' , false );
|
265 |
+
}
|
266 |
+
} );
|
267 |
+
}
|
268 |
+
});
|
269 |
+
|
270 |
+
//print the html if dialod is expanded
|
271 |
+
if ( visible ) {
|
272 |
+
// Do we have view content template script?
|
273 |
+
// if yes, let's use it <= Old way
|
274 |
+
// Otherwise let's fetch the html template from the server
|
275 |
+
if ( ! _.isEmpty( module.alertPart ) ) {
|
276 |
+
if ( 1 > $( '#tmpl-' + module.alertPart ).length || _.isEmpty( item.container ) ) {
|
277 |
+
api.errare( 'No removal alert template available for items in module :' + module.id );
|
278 |
+
return;
|
279 |
+
}
|
280 |
+
$_alert_el.html( wp.template( module.alertPart )( { title : ( item().title || item.id ) } ) );
|
281 |
+
item.trigger( 'remove-dialog-rendered');
|
282 |
+
} else {
|
283 |
+
api.CZR_Helpers.getModuleTmpl( {
|
284 |
+
tmpl : 'rud-item-alert-part',
|
285 |
+
module_type: 'all_modules',
|
286 |
+
module_id : module.id,
|
287 |
+
control_id : module.control.id
|
288 |
+
} ).done( function( _serverTmpl_ ) {
|
289 |
+
//console.log( 'item.removeDialogVisible => success response =>', module.id, _serverTmpl_);
|
290 |
+
$_alert_el.html( api.CZR_Helpers.parseTemplate( _serverTmpl_ )( { title : ( item().title || item.id ) } ) );
|
291 |
+
item.trigger( 'remove-dialog-rendered');
|
292 |
+
}).fail( function( _r_ ) {
|
293 |
+
//console.log( 'item.removeDialogVisible => fail response =>', _r_);
|
294 |
+
api.errare( 'item.removeDialogVisible => Problem when fetching the tmpl from server for module : '+ module.id, _r_ );
|
295 |
+
});
|
296 |
+
}
|
297 |
+
}
|
298 |
+
|
299 |
+
//Slide it
|
300 |
+
var _slideComplete = function( visible ) {
|
301 |
+
$_alert_el.toggleClass( 'open' , visible );
|
302 |
+
//set the active class of the clicked icon
|
303 |
+
item.container.find('.' + module.control.css_attr.display_alert_btn ).toggleClass( 'active', visible );
|
304 |
+
//adjust scrolling to display the entire dialog block
|
305 |
+
if ( visible )
|
306 |
+
module._adjustScrollExpandedBlock( item.container );
|
307 |
+
};
|
308 |
+
if ( visible ) {
|
309 |
+
$_alert_el.stop( true, true ).slideDown( 200, function() { _slideComplete( visible ); } );
|
310 |
+
} else {
|
311 |
+
$_alert_el.stop( true, true ).slideUp( 200, function() { _slideComplete( visible ); } );
|
312 |
+
}
|
313 |
+
});//item.removeDialogVisible.bind()
|
314 |
+
},//itemWrapperViewSetup
|
315 |
+
|
316 |
+
|
317 |
+
|
318 |
+
//renders saved items views and attach event handlers
|
319 |
+
//the saved item look like :
|
320 |
+
//array[ { id : 'sidebar-one', title : 'A Title One' }, {id : 'sidebar-two', title : 'A Title Two' }]
|
321 |
+
renderItemContent : function( _item_model_ ) {
|
322 |
+
//=> an array of objects
|
323 |
+
var item = this,
|
324 |
+
module = this.module,
|
325 |
+
dfd = $.Deferred();
|
326 |
+
|
327 |
+
// Create a deep copy of the item, so we can inject custom properties before parsing the template, without affecting the original item
|
328 |
+
var item_model_for_template_injection = $.extend( true, {}, _item_model_ || item() );
|
329 |
+
|
330 |
+
// allow plugin to alter the item_model before template injection
|
331 |
+
item.trigger( 'item-model-before-item-content-template-injection', item_model_for_template_injection );
|
332 |
+
|
333 |
+
var appendAndResolve = function( _tmpl_ ) {
|
334 |
+
//do we have an html template ?
|
335 |
+
if ( _.isEmpty( _tmpl_ ) ) {
|
336 |
+
dfd.reject( 'renderItemContent => Missing html template for module : '+ module.id );
|
337 |
+
}
|
338 |
+
var $itemContentWrapper = $( '.' + module.control.css_attr.item_content, item.container );
|
339 |
+
// append the view content
|
340 |
+
$( _tmpl_ ).appendTo( $itemContentWrapper );
|
341 |
+
dfd.resolve( $itemContentWrapper );
|
342 |
+
};//appendAndResolve
|
343 |
+
|
344 |
+
// Do we have view content template script?
|
345 |
+
// if yes, let's use it <= Old way
|
346 |
+
// Otherwise let's fetch the html template from the server
|
347 |
+
if ( ! _.isEmpty( module.itemInputList ) || _.isFunction( module.itemInputList ) ) {
|
348 |
+
var tmplSelectorSuffix = module.getTemplateSelectorPart( 'itemInputList', item_model_for_template_injection );
|
349 |
+
if ( 1 > $( '#tmpl-' + tmplSelectorSuffix ).length ) {
|
350 |
+
dfd.reject( 'renderItemContent => No itemInputList content template defined for module ' + module.id + '. The template script id should be : #tmpl-' + tmplSelectorSuffix );
|
351 |
+
} else {
|
352 |
+
appendAndResolve( wp.template( tmplSelectorSuffix )( $.extend( item_model_for_template_injection, { control_id : module.control.id } ) ) );
|
353 |
+
}
|
354 |
+
|
355 |
+
} else {
|
356 |
+
var requestParams = {
|
357 |
+
tmpl : 'item-inputs',
|
358 |
+
module_type: module.module_type,
|
359 |
+
module_id : module.id,
|
360 |
+
control_id : module.control.id,
|
361 |
+
item_model : item_model_for_template_injection
|
362 |
+
};
|
363 |
+
// allow plugins to filter the query param before fetching the template for item content
|
364 |
+
module.trigger( 'filter-request-params-before-fetching-for-item-content-tmpl', requestParams );
|
365 |
+
|
366 |
+
api.CZR_Helpers.getModuleTmpl( requestParams ).done( function( _serverTmpl_ ) {
|
367 |
+
//console.log( 'renderItemContent => success response =>', _serverTmpl_);
|
368 |
+
appendAndResolve( api.CZR_Helpers.parseTemplate( _serverTmpl_ )( $.extend( item_model_for_template_injection, { control_id : module.control.id } ) ) );
|
369 |
+
}).fail( function( _r_ ) {
|
370 |
+
//console.log( 'renderItemContent => fail response =>', _r_);
|
371 |
+
dfd.reject( _r_ );
|
372 |
+
});
|
373 |
+
}
|
374 |
+
return dfd.promise();
|
375 |
+
},
|
376 |
+
|
377 |
+
|
378 |
+
|
379 |
+
|
380 |
+
|
381 |
+
//fired in setupItemListeners
|
382 |
+
writeItemViewTitle : function( item_model ) {
|
383 |
+
var item = this,
|
384 |
+
module = item.module,
|
385 |
+
_model = item_model || item(),
|
386 |
+
//Let's fall back on the id if the title is not set or empty
|
387 |
+
_title = ( _.has( _model, 'title') && ! _.isEmpty( _model.title ) ) ? api.CZR_Helpers.capitalize( _model.title ) : _model.id;
|
388 |
+
|
389 |
+
_title = api.CZR_Helpers.truncate( _title, 20 );
|
390 |
+
$( '.' + module.control.css_attr.item_title , item.container ).text( _title );
|
391 |
+
//add a hook here
|
392 |
+
api.CZR_Helpers.doActions('after_writeViewTitle', item.container , _model, item );
|
393 |
+
},
|
394 |
+
|
395 |
+
|
396 |
+
|
397 |
+
//@param : obj = { event : {}, model : {}, view : ${} }
|
398 |
+
//Fired on view_rendered:new when a new model has been added
|
399 |
+
//Fired on click on edit_view_btn
|
400 |
+
setViewVisibility : function( obj, is_added_by_user ) {
|
401 |
+
var item = this,
|
402 |
+
module = this.module;
|
403 |
+
if ( is_added_by_user ) {
|
404 |
+
item.viewState.set( 'expanded_noscroll' );
|
405 |
+
} else {
|
406 |
+
module.closeAllItems( item.id );
|
407 |
+
if ( _.has(module, 'preItem') ) {
|
408 |
+
module.preItemExpanded.set(false);
|
409 |
+
}
|
410 |
+
item.viewState.set( 'expanded' == item._getViewState() ? 'closed' : 'expanded' );
|
411 |
+
}
|
412 |
+
},
|
413 |
+
|
414 |
+
|
415 |
+
_getViewState : function() {
|
416 |
+
return -1 == this.viewState().indexOf('expanded') ? 'closed' : 'expanded';
|
417 |
+
},
|
418 |
+
|
419 |
+
|
420 |
+
// callback of item.viewState.callbacks
|
421 |
+
// viewState can take 3 states : expanded, expanded_noscroll, closed
|
422 |
+
toggleItemExpansion : function( status, duration ) {
|
423 |
+
var visible = 'closed' != status,
|
424 |
+
item = this,
|
425 |
+
module = this.module,
|
426 |
+
$el = $( '.' + module.control.css_attr.item_content , item.container ).first(),
|
427 |
+
dfd = $.Deferred(),
|
428 |
+
_slideComplete = function( visible ) {
|
429 |
+
item.container.toggleClass( 'open' , visible );
|
430 |
+
//close all remove dialogs
|
431 |
+
if ( visible )
|
432 |
+
module.closeRemoveDialogs();
|
433 |
+
|
434 |
+
//toggle the icon activate class depending on the status
|
435 |
+
//switch icon
|
436 |
+
var $_edit_icon = $el.siblings().find('.' + module.control.css_attr.edit_view_btn );
|
437 |
+
|
438 |
+
$_edit_icon.toggleClass('active' , visible );
|
439 |
+
if ( visible )
|
440 |
+
$_edit_icon.removeClass('fa-pencil-alt').addClass('fa-minus-square').attr('title', serverControlParams.i18n.close );
|
441 |
+
else
|
442 |
+
$_edit_icon.removeClass('fa-minus-square').addClass('fa-pencil-alt').attr('title', serverControlParams.i18n.edit );
|
443 |
+
|
444 |
+
//scroll to the currently expanded view
|
445 |
+
if ( 'expanded' == status ) {
|
446 |
+
module._adjustScrollExpandedBlock( item.container );
|
447 |
+
}
|
448 |
+
|
449 |
+
dfd.resolve();
|
450 |
+
};
|
451 |
+
duration = _.isUndefined( duration ) ? 150 : duration;
|
452 |
+
if ( visible ) {
|
453 |
+
$el.stop( true, true ).slideDown( duration, function() { _slideComplete( visible ); } );
|
454 |
+
} else {
|
455 |
+
$el.stop( true, true ).slideUp( 0, function() { _slideComplete( visible ); } );
|
456 |
+
}
|
457 |
+
|
458 |
+
return dfd.promise();
|
459 |
+
},
|
460 |
+
|
461 |
+
|
462 |
+
//removes the view dom module
|
463 |
+
_destroyView : function ( duration ) {
|
464 |
+
this.container.fadeOut( {
|
465 |
+
duration : duration ||400,
|
466 |
+
done : function() {
|
467 |
+
$(this).remove();
|
468 |
+
}
|
469 |
+
});
|
470 |
+
},
|
471 |
+
|
472 |
+
|
473 |
+
|
474 |
+
|
475 |
+
|
476 |
+
|
477 |
+
// LOADER HELPERS
|
478 |
+
// @return void()
|
479 |
+
// print a loader between the moment the item container is appended, and the item content is fetched from the server
|
480 |
+
printLoader : function() {
|
481 |
+
var item = this;
|
482 |
+
item.container
|
483 |
+
.css({'position' :'relative'})
|
484 |
+
.append( api.CZR_Helpers.css_loader_html ).find('.czr-css-loader').fadeIn( 'fast' );
|
485 |
+
|
486 |
+
// Start the countdown for auto-cleaning
|
487 |
+
clearTimeout( $.data( this, '_czr_loader_active_timer_') );
|
488 |
+
$.data( this, '_czr_loader_active_timer_', setTimeout(function() {
|
489 |
+
item.cleanLoader();
|
490 |
+
}, 5000 ) );
|
491 |
+
},
|
492 |
+
|
493 |
+
// @return void()
|
494 |
+
cleanLoader : function() {
|
495 |
+
this.container
|
496 |
+
.css({'min-height' : ''})
|
497 |
+
.find('.czr-css-loader').remove();
|
498 |
+
},
|
499 |
+
});//$.extend
|
500 |
+
})( wp.customize , jQuery, _ );
|
assets/czr/fmk/js/base-fmk/1_0_input_item_module_control/1_1_item_and_modopt/1_1_1_module_options/_0_0_2_mod_opt_0_init.js
ADDED
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
//extends api.Value
|
2 |
+
//options:
|
3 |
+
// module : module,
|
4 |
+
// initial_modOpt_model : modOpt, can contains the already db saved values
|
5 |
+
// defaultModOptModel : module.defaultModOptModel
|
6 |
+
// control : control instance
|
7 |
+
|
8 |
+
var CZRModOptMths = CZRModOptMths || {};
|
9 |
+
( function ( api, $, _ ) {
|
10 |
+
$.extend( CZRModOptMths , {
|
11 |
+
initialize: function( options ) {
|
12 |
+
if ( _.isUndefined(options.module) || _.isEmpty(options.module) ) {
|
13 |
+
throw new Error('No module assigned to modOpt.');
|
14 |
+
}
|
15 |
+
|
16 |
+
var modOpt = this;
|
17 |
+
api.Value.prototype.initialize.call( modOpt, null, options );
|
18 |
+
|
19 |
+
//DEFERRED STATES
|
20 |
+
//store the state of ready.
|
21 |
+
//=> we don't want the ready method to be fired several times
|
22 |
+
modOpt.isReady = $.Deferred();
|
23 |
+
|
24 |
+
//VARIOUS DEFINITIONS
|
25 |
+
modOpt.container = null;//will store the modOpt $ dom element
|
26 |
+
modOpt.inputCollection = new api.Value({});
|
27 |
+
|
28 |
+
//input.options = options;
|
29 |
+
//write the options as properties, name is included
|
30 |
+
$.extend( modOpt, options || {} );
|
31 |
+
|
32 |
+
//declares a default modOpt model
|
33 |
+
modOpt.defaultModOptModel = _.clone( options.defaultModOptModel ) || { is_mod_opt : true };
|
34 |
+
|
35 |
+
//set initial values
|
36 |
+
var _initial_model = $.extend( modOpt.defaultModOptModel, options.initial_modOpt_model );
|
37 |
+
var ctrl = modOpt.module.control;
|
38 |
+
//this won't be listened to at this stage
|
39 |
+
modOpt.set( _initial_model );
|
40 |
+
|
41 |
+
//OPTIONS IS READY
|
42 |
+
//observe its changes when ready
|
43 |
+
modOpt.isReady.done( function() {
|
44 |
+
//listen to any modOpt change
|
45 |
+
//=> done in the module
|
46 |
+
//modOpt.callbacks.add( function() { return modOpt.modOptReact.apply(modOpt, arguments ); } );
|
47 |
+
|
48 |
+
//When shall we render the modOpt ?
|
49 |
+
//If the module is part of a simple control, the modOpt can be render now,
|
50 |
+
//modOpt.mayBeRenderModOptWrapper();
|
51 |
+
|
52 |
+
//RENDER THE CONTROL TITLE GEAR ICON
|
53 |
+
if( ! $( '.' + ctrl.css_attr.edit_modopt_icon, ctrl.container ).length ) {
|
54 |
+
$.when( ctrl.container
|
55 |
+
.find('.customize-control-title').first()//was.find('.customize-control-title')
|
56 |
+
.append( $( '<span/>', {
|
57 |
+
class : [ ctrl.css_attr.edit_modopt_icon, 'fas fa-cog' ].join(' '),
|
58 |
+
title : serverControlParams.i18n['Settings']
|
59 |
+
} ) ) )
|
60 |
+
.done( function(){
|
61 |
+
$( '.' + ctrl.css_attr.edit_modopt_icon, ctrl.container ).fadeIn( 400 );
|
62 |
+
});
|
63 |
+
}
|
64 |
+
|
65 |
+
//LISTEN TO USER ACTIONS ON CONTROL EL
|
66 |
+
api.CZR_Helpers.setupDOMListeners(
|
67 |
+
[
|
68 |
+
//toggle mod options
|
69 |
+
{
|
70 |
+
trigger : 'click keydown',
|
71 |
+
selector : '.' + ctrl.css_attr.edit_modopt_icon,
|
72 |
+
name : 'toggle_mod_option',
|
73 |
+
actions : function() {
|
74 |
+
// @see : moduleCtor::maybeAwakeAndBindSharedModOpt => api.czr_ModOptVisible.bind()
|
75 |
+
api.czr_ModOptVisible( ! api.czr_ModOptVisible(), {
|
76 |
+
module : modOpt.module,//the current module for which the modOpt is being expanded
|
77 |
+
focus : false//the id of the tab we want to focus on
|
78 |
+
});
|
79 |
+
}
|
80 |
+
}
|
81 |
+
],//actions to execute
|
82 |
+
{ dom_el: ctrl.container },//dom scope
|
83 |
+
modOpt //instance where to look for the cb methods
|
84 |
+
);
|
85 |
+
//modOpt.userEventMap = new api.Value( [] );
|
86 |
+
});//modOpt.isReady.done()
|
87 |
+
|
88 |
+
},//initialize
|
89 |
+
|
90 |
+
//overridable method
|
91 |
+
//Fired if the modOpt has been instantiated
|
92 |
+
//The modOpt.callbacks are declared.
|
93 |
+
ready : function() {
|
94 |
+
this.isReady.resolve();
|
95 |
+
}
|
96 |
+
});//$.extend
|
97 |
+
})( wp.customize , jQuery, _ );
|
assets/czr/fmk/js/base-fmk/1_0_input_item_module_control/1_1_item_and_modopt/1_1_1_module_options/_0_0_2_mod_opt_2_view.js
ADDED
@@ -0,0 +1,160 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
//extends api.CZRBaseControl
|
2 |
+
|
3 |
+
var CZRModOptMths = CZRModOptMths || {};
|
4 |
+
( function ( api, $, _ ) {
|
5 |
+
$.extend( CZRModOptMths , {
|
6 |
+
//fired when modOpt is ready and embedded
|
7 |
+
//define the modOpt view DOM event map
|
8 |
+
//bind actions when the modOpt is embedded
|
9 |
+
modOptWrapperViewSetup : function( modOpt_model ) {
|
10 |
+
var modOpt = this,
|
11 |
+
module = this.module,
|
12 |
+
dfd = $.Deferred(),
|
13 |
+
_setupDOMListeners = function( $_container ) {
|
14 |
+
//DOM listeners for the user action in modOpt view wrapper
|
15 |
+
api.CZR_Helpers.setupDOMListeners(
|
16 |
+
[
|
17 |
+
//toggle mod options
|
18 |
+
{
|
19 |
+
trigger : 'click keydown',
|
20 |
+
selector : '.' + module.control.css_attr.close_modopt_icon,
|
21 |
+
name : 'close_mod_option',
|
22 |
+
actions : function() {
|
23 |
+
// @see : moduleCtor::maybeAwakeAndBindSharedModOpt => api.czr_ModOptVisible.bind()
|
24 |
+
api.czr_ModOptVisible( false, {
|
25 |
+
module : module,//the current module for which the modOpt is being expanded
|
26 |
+
focus : false//the id of the tab we want to focus on
|
27 |
+
});
|
28 |
+
}
|
29 |
+
},
|
30 |
+
//tabs navigation
|
31 |
+
{
|
32 |
+
trigger : 'click keydown',
|
33 |
+
selector : '.tabs nav li',
|
34 |
+
name : 'tab_nav',
|
35 |
+
actions : function( args ) {
|
36 |
+
//toggleTabVisibility is declared in the module ctor and its "this" is the item or the modOpt
|
37 |
+
var tabIdSwitchedTo = $( args.dom_event.currentTarget, args.dom_el ).data('tab-id');
|
38 |
+
this.module.toggleTabVisibility.call( this, tabIdSwitchedTo );
|
39 |
+
this.trigger( 'tab-switch', { id : tabIdSwitchedTo } );
|
40 |
+
}
|
41 |
+
}
|
42 |
+
],//actions to execute
|
43 |
+
{ dom_el: $_container },//model + dom scope
|
44 |
+
modOpt //instance where to look for the cb methods
|
45 |
+
);
|
46 |
+
};
|
47 |
+
|
48 |
+
modOpt_model = modOpt() || modOpt.initial_modOpt_model;//could not be set yet
|
49 |
+
|
50 |
+
//renderview content now
|
51 |
+
modOpt.renderModOptContent( modOpt_model )
|
52 |
+
.done( function( $_container ) {
|
53 |
+
//update the $.Deferred state
|
54 |
+
if ( ! _.isEmpty( $_container ) && 0 < $_container.length ) {
|
55 |
+
_setupDOMListeners( $_container );
|
56 |
+
dfd.resolve( $_container );
|
57 |
+
}
|
58 |
+
else {
|
59 |
+
throw new Error( 'Module : ' + modOpt.module.id + ', the modOpt content has not been rendered' );
|
60 |
+
}
|
61 |
+
})
|
62 |
+
.fail( function( _r_ ) {
|
63 |
+
api.errorLog( "failed modOpt.renderModOptContent for module : " + module.id, _r_ );
|
64 |
+
})
|
65 |
+
.then( function() {
|
66 |
+
//the modOpt.container is now available
|
67 |
+
//Setup the tabs navigation
|
68 |
+
//setupTabNav is defined in the module ctor and its this is the item or the modOpt
|
69 |
+
modOpt.module.setupTabNav.call( modOpt );
|
70 |
+
});
|
71 |
+
|
72 |
+
return dfd.promise();
|
73 |
+
},
|
74 |
+
|
75 |
+
|
76 |
+
//renders saved modOpt views
|
77 |
+
//returns a promise( $container )
|
78 |
+
//the saved modOpt look like :
|
79 |
+
//array[ { id : 'sidebar-one', title : 'A Title One' }, {id : 'sidebar-two', title : 'A Title Two' }]
|
80 |
+
renderModOptContent : function( modOpt_model ) {
|
81 |
+
//=> an array of objects
|
82 |
+
var modOpt = this,
|
83 |
+
module = this.module,
|
84 |
+
dfd = $.Deferred();
|
85 |
+
|
86 |
+
modOpt_model = modOpt_model || modOpt();
|
87 |
+
|
88 |
+
var appendAndResolve = function( _tmpl_ ) {
|
89 |
+
//do we have an html template ?
|
90 |
+
if ( _.isEmpty( _tmpl_ ) ) {
|
91 |
+
dfd.reject( 'renderModOptContent => Missing html template for module : '+ module.id );
|
92 |
+
}
|
93 |
+
|
94 |
+
var _ctrlLabel = '';
|
95 |
+
try {
|
96 |
+
_ctrlLabel = [ serverControlParams.i18n['Options for'], module.control.params.label ].join(' ');
|
97 |
+
} catch( er ) {
|
98 |
+
api.errorLog( 'renderItemContent => Problem with ctrl label => ' + er );
|
99 |
+
_ctrlLabel = serverControlParams.i18n['Settings'];
|
100 |
+
}
|
101 |
+
|
102 |
+
$('#widgets-left').after( $( '<div/>', {
|
103 |
+
class : module.control.css_attr.mod_opt_wrapper,
|
104 |
+
html : [
|
105 |
+
[ '<h2 class="mod-opt-title">', _ctrlLabel , '</h2>' ].join(''),
|
106 |
+
'<span class="fas fa-times ' + module.control.css_attr.close_modopt_icon + '" title="close"></span>'
|
107 |
+
].join('')
|
108 |
+
} ) );
|
109 |
+
|
110 |
+
//render the mod opt content for this module
|
111 |
+
$( '.' + module.control.css_attr.mod_opt_wrapper ).append( _tmpl_ );
|
112 |
+
|
113 |
+
dfd.resolve( $( '.' + module.control.css_attr.mod_opt_wrapper ) );
|
114 |
+
};//appendAndResolve
|
115 |
+
|
116 |
+
// Do we have view content template script?
|
117 |
+
// if yes, let's use it <= Old way
|
118 |
+
// Otherwise let's fetch the html template from the server
|
119 |
+
if ( ! _.isEmpty( module.itemPreAddEl ) ) {
|
120 |
+
var tmplSelectorSuffix = module.getTemplateSelectorPart( 'modOptInputList', modOpt_model );
|
121 |
+
if ( 1 > $( '#tmpl-' + tmplSelectorSuffix ).length ) {
|
122 |
+
dfd.reject( 'renderModOptContent => No modOpt content template defined for module ' + module.id + '. The template script id should be : #tmpl-' + tmplSelectorSuffix );
|
123 |
+
}
|
124 |
+
appendAndResolve( wp.template( tmplSelectorSuffix )( modOpt_model ) );
|
125 |
+
} else {
|
126 |
+
api.CZR_Helpers.getModuleTmpl( {
|
127 |
+
tmpl : 'mod-opt',
|
128 |
+
module_type: module.module_type,
|
129 |
+
module_id : module.id,
|
130 |
+
control_id : module.control.id
|
131 |
+
} ).done( function( _serverTmpl_ ) {
|
132 |
+
//console.log( 'renderModOptContent => success response =>', _serverTmpl_);
|
133 |
+
appendAndResolve( api.CZR_Helpers.parseTemplate( _serverTmpl_ )( modOpt_model ) );
|
134 |
+
}).fail( function( _r_ ) {
|
135 |
+
//console.log( 'renderModOptContent => fail response =>', _r_);
|
136 |
+
dfd.reject( 'renderPreItemView => Problem when fetching the mod-opt tmpl from server for module : '+ module.id );
|
137 |
+
});
|
138 |
+
}
|
139 |
+
|
140 |
+
return dfd.promise();
|
141 |
+
},
|
142 |
+
|
143 |
+
|
144 |
+
|
145 |
+
toggleModPanelView : function( visible ) {
|
146 |
+
var modOpt = this,
|
147 |
+
module = this.module,
|
148 |
+
ctrl = module.control,
|
149 |
+
dfd = $.Deferred();
|
150 |
+
|
151 |
+
module.control.container.toggleClass( 'czr-modopt-visible', visible );
|
152 |
+
$('body').toggleClass('czr-editing-modopt', visible );
|
153 |
+
//Let the panel slide ( -webkit-transition: left .18s ease-in-out )
|
154 |
+
_.delay( function() {
|
155 |
+
dfd.resolve();
|
156 |
+
}, 200 );
|
157 |
+
return dfd.promise();
|
158 |
+
}
|
159 |
+
});//$.extend
|
160 |
+
})( wp.customize , jQuery, _ );
|
assets/czr/fmk/js/base-fmk/1_0_input_item_module_control/1_3_module/_0_0_3_module_0_init.js
ADDED
@@ -0,0 +1,575 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
//MULTI CONTROL CLASS
|
2 |
+
//extends api.Value
|
3 |
+
//
|
4 |
+
//Setup the collection of items
|
5 |
+
//renders the control view
|
6 |
+
//Listen to items collection changes and update the control setting
|
7 |
+
//MODULE OPTIONS :
|
8 |
+
// control : control,
|
9 |
+
// crud : bool
|
10 |
+
// id : '',
|
11 |
+
// items : [], module.items,
|
12 |
+
// modOpt : {}
|
13 |
+
// module_type : module.module_type,
|
14 |
+
// multi_item : bool
|
15 |
+
// section : module.section,
|
16 |
+
var CZRModuleMths = CZRModuleMths || {};
|
17 |
+
( function ( api, $, _ ) {
|
18 |
+
$.extend( CZRModuleMths, {
|
19 |
+
initialize: function( id, constructorOptions ) {
|
20 |
+
if ( _.isUndefined(constructorOptions.control) || _.isEmpty(constructorOptions.control) ) {
|
21 |
+
throw new Error('No control assigned to module ' + id );
|
22 |
+
}
|
23 |
+
var module = this;
|
24 |
+
api.Value.prototype.initialize.call( this, null, constructorOptions );
|
25 |
+
|
26 |
+
//store the state of ready.
|
27 |
+
//=> we don't want the ready method to be fired several times
|
28 |
+
module.isReady = $.Deferred();
|
29 |
+
|
30 |
+
//write the module constructor options as properties
|
31 |
+
// The default module model can be get with
|
32 |
+
// and is formed this way :
|
33 |
+
//@see getDefaultModuleApiModel : function() {
|
34 |
+
//if embedded in a control, amend the common model with the section id
|
35 |
+
// return {
|
36 |
+
// id : '',//module.id,
|
37 |
+
// module_type : '',//module.module_type,
|
38 |
+
// modOpt : {},//the module modOpt property, typically high level properties that area applied to all items of the module
|
39 |
+
// items : [],//$.extend( true, {}, module.items ),
|
40 |
+
// crud : false,
|
41 |
+
// hasPreItem : true,//a crud module has a pre item by default
|
42 |
+
// refresh_on_add_item : true,// the preview is refreshed on item add
|
43 |
+
// multi_item : false,
|
44 |
+
// sortable : false,//<= a module can be multi-item but not necessarily sortable
|
45 |
+
// control : {},//control,
|
46 |
+
// section : ''
|
47 |
+
// };
|
48 |
+
// },
|
49 |
+
|
50 |
+
$.extend( module, constructorOptions || {} );
|
51 |
+
|
52 |
+
//extend the module with new template Selectors
|
53 |
+
//can have been overriden at this stage from a module constructor
|
54 |
+
$.extend( module, {
|
55 |
+
crudModulePart : module.crudModulePart || '', //'czr-crud-module-part',//create, read, update, delete
|
56 |
+
rudItemPart : module.rudItemPart || '',// 'czr-rud-item-part',//read, update, delete
|
57 |
+
ruItemPart : module.ruItemPart || '',// 'czr-ru-item-part',//read, update <= ONLY USED IN THE WIDGET MODULE
|
58 |
+
alertPart : module.alertPart || '',// 'czr-rud-item-alert-part',//used both for items and modules removal
|
59 |
+
itemInputList : module.itemInputList || '',//is specific for each crud module
|
60 |
+
modOptInputList : module.modOptInputList || ''//is specific for each module
|
61 |
+
} );
|
62 |
+
|
63 |
+
//embed : define a container, store the embed state, fire the render method
|
64 |
+
module.embedded = $.Deferred();
|
65 |
+
module.itemsWrapper = '';//will store the $ item container
|
66 |
+
|
67 |
+
//if a module is embedded in a control, its container == the control container.
|
68 |
+
module.container = $( module.control.selector );
|
69 |
+
|
70 |
+
//render the item(s) wrapper
|
71 |
+
//and resolve the module.embedded promise()
|
72 |
+
module.renderModuleParts()
|
73 |
+
.done( function( $_module_items_wrapper ){
|
74 |
+
if ( false === $_module_items_wrapper.length ) {
|
75 |
+
throw new Error( 'The items wrapper has not been rendered for module : ' + module.id );
|
76 |
+
}
|
77 |
+
//stores the items wrapper ( </ul> el ) as a jQuery var
|
78 |
+
module.itemsWrapper = $_module_items_wrapper;
|
79 |
+
module.embedded.resolve();
|
80 |
+
})
|
81 |
+
.fail( function( _r_ ) {
|
82 |
+
throw new Error( [ "initialize module => failed module.renderModuleParts() for module : " , module.id , _r_ ].join(' '));
|
83 |
+
});
|
84 |
+
|
85 |
+
/*-----------------------------------------------
|
86 |
+
* MODULE OPTIONS
|
87 |
+
------------------------------------------------*/
|
88 |
+
//declares a default Mod options API model
|
89 |
+
module.defaultAPImodOptModel = {
|
90 |
+
initial_modOpt_model : {},
|
91 |
+
defaultModOptModel : {},
|
92 |
+
control : {},//control instance
|
93 |
+
module : {}//module instance
|
94 |
+
};
|
95 |
+
|
96 |
+
//declares a default modOpt model
|
97 |
+
module.defaultModOptModel = {};
|
98 |
+
|
99 |
+
//define a default Constructors
|
100 |
+
module.modOptConstructor = module.modOptConstructor || api.CZRModOpt;
|
101 |
+
|
102 |
+
/*-----------------------------------------------
|
103 |
+
* ITEMS
|
104 |
+
------------------------------------------------*/
|
105 |
+
module.itemCollection = new api.Value( [] );
|
106 |
+
|
107 |
+
//declares a default Item API model
|
108 |
+
module.defaultAPIitemModel = {
|
109 |
+
id : '',
|
110 |
+
initial_item_model : {},
|
111 |
+
defaultItemModel : {},
|
112 |
+
control : {},//control instance
|
113 |
+
module : {},//module instance
|
114 |
+
is_added_by_user : false
|
115 |
+
};
|
116 |
+
|
117 |
+
// declares a default item model
|
118 |
+
module.defaultItemModel = api.czrModuleMap[ module.module_type ].defaultItemModel || { id : '', title : '' };
|
119 |
+
|
120 |
+
// item constuctor : use the constructor already defined in a module, or fallback on the default one
|
121 |
+
module.itemConstructor = module.itemConstructor || api.CZRItem;
|
122 |
+
|
123 |
+
// czr_model stores the each model value => one value by created by model.id
|
124 |
+
module.czr_Item = new api.Values();
|
125 |
+
|
126 |
+
|
127 |
+
/*-----------------------------------------------
|
128 |
+
* SET THE DEFAULT INPUT CONSTRUCTOR AND INPUT OPTIONS
|
129 |
+
------------------------------------------------*/
|
130 |
+
// input constuctor : use the constructor already defined in a module, or fallback on the default one
|
131 |
+
module.inputConstructor = module.inputConstructor || api.CZRInput;//constructor for the items input
|
132 |
+
if ( module.hasModOpt() ) {
|
133 |
+
//use the constructor already defined in a module, or fallback on the default one
|
134 |
+
module.inputModOptConstructor = module.inputModOptConstructor || api.CZRInput;//constructor for the modOpt input
|
135 |
+
}
|
136 |
+
module.inputOptions = {};//<= can be set by each module specifically
|
137 |
+
//For example, if I need specific options for the content_picker, this is where I will set them in the module extended object
|
138 |
+
|
139 |
+
|
140 |
+
/*-----------------------------------------------
|
141 |
+
* FIRE ON isReady
|
142 |
+
------------------------------------------------*/
|
143 |
+
//module.ready(); => fired by children
|
144 |
+
module.isReady.done( function() {
|
145 |
+
//store the module dirtyness, => no items set
|
146 |
+
module.isDirty = new api.Value( constructorOptions.dirty || false );
|
147 |
+
|
148 |
+
//initialize the module api.Value()
|
149 |
+
//constructorOptions has the same structure as the one described in prepareModuleforAPI
|
150 |
+
//setting the module Value won't be listen to at this stage
|
151 |
+
//api.infoLog('module.isReady.done() => constructorOptions', constructorOptions);
|
152 |
+
module.initializeModuleModel( constructorOptions )
|
153 |
+
.done( function( initialModuleValue ) {
|
154 |
+
module.set( initialModuleValue );
|
155 |
+
})
|
156 |
+
.fail( function( response ){ api.errare( 'Module : ' + module.id + ' initialize module model failed : ', response ); })
|
157 |
+
.always( function( initialModuleValue ) {
|
158 |
+
//listen to each single module change
|
159 |
+
module.callbacks.add( function() { return module.moduleReact.apply( module, arguments ); } );
|
160 |
+
|
161 |
+
//if the module is not registered yet (for example when the module is added by user),
|
162 |
+
//=> push it to the collection of the module-collection control
|
163 |
+
//=> updates the wp api setting
|
164 |
+
if ( ! module.control.isModuleRegistered( module.id ) ) {
|
165 |
+
module.control.updateModulesCollection( { module : constructorOptions, is_registered : false } );
|
166 |
+
}
|
167 |
+
|
168 |
+
module.bind('items-collection-populated', function( collection ) {
|
169 |
+
//listen to item Collection changes
|
170 |
+
module.itemCollection.callbacks.add( function() { return module.itemCollectionReact.apply( module, arguments ); } );
|
171 |
+
|
172 |
+
// The sortable property is set on module registration
|
173 |
+
// if not specified, the sortable will be set to true by default if the module is crud or multi-item
|
174 |
+
if ( false !== module.sortable ) {
|
175 |
+
module._makeItemsSortable();
|
176 |
+
}
|
177 |
+
|
178 |
+
// this event is listened to by Nimble Builder to expand the module once all the items collection is populated
|
179 |
+
module.control.container.trigger('items-collection-populated');
|
180 |
+
});
|
181 |
+
|
182 |
+
//populate and instantiate the items now when a module is embedded in a regular control
|
183 |
+
module.populateSavedItemCollection();
|
184 |
+
|
185 |
+
//When the module has modOpt :
|
186 |
+
//=> Instantiate the modOpt and setup listener
|
187 |
+
if ( module.hasModOpt() ) {
|
188 |
+
module.instantiateModOpt();
|
189 |
+
}
|
190 |
+
});
|
191 |
+
});//module.isReady.done()
|
192 |
+
|
193 |
+
|
194 |
+
/*-----------------------------------------------
|
195 |
+
* Maybe resolve isReady() on parent section expanded
|
196 |
+
------------------------------------------------*/
|
197 |
+
if ( true === api.czrModuleMap[ module.module_type ].ready_on_section_expanded ) {
|
198 |
+
//fired ready :
|
199 |
+
//1) on section expansion
|
200 |
+
//2) or in the case of a module embedded in a regular control, if the module section is already opened => typically when skope is enabled
|
201 |
+
if ( _.has( api, 'czr_activeSectionId' ) && module.control.section() == api.czr_activeSectionId() && 'resolved' != module.isReady.state() ) {
|
202 |
+
module.embedded.then( function() {
|
203 |
+
module.ready();
|
204 |
+
});
|
205 |
+
}
|
206 |
+
|
207 |
+
// defer the expanded callback when the section is instantiated
|
208 |
+
api.section( module.control.section(), function( _section_ ) {
|
209 |
+
_section_.expanded.bind(function(to) {
|
210 |
+
//set module ready on section expansion
|
211 |
+
if ( 'resolved' != module.isReady.state() ) {
|
212 |
+
module.embedded.then( function() {
|
213 |
+
module.ready();
|
214 |
+
});
|
215 |
+
}
|
216 |
+
});
|
217 |
+
});
|
218 |
+
}
|
219 |
+
|
220 |
+
/*-----------------------------------------------
|
221 |
+
* Maybe resolve isReady() on custom control event
|
222 |
+
// To be specified when registering the control
|
223 |
+
// used in Nimble to delay the instantiation of the input when the control accordion is expanded with event 'sek-accordion-expanded'
|
224 |
+
------------------------------------------------*/
|
225 |
+
var _control_event = api.czrModuleMap[ module.module_type ].ready_on_control_event;
|
226 |
+
if ( ! _.isUndefined( _control_event ) ) {
|
227 |
+
// defer the expanded callback when the section is instantiated
|
228 |
+
api.control( module.control.id, function( _control_ ) {
|
229 |
+
_control_.container.on( _control_event, function(evt) {
|
230 |
+
//set module ready on module accordion expansion
|
231 |
+
if ( 'resolved' != module.isReady.state() ) {
|
232 |
+
module.embedded.then( function() {
|
233 |
+
module.ready();
|
234 |
+
});
|
235 |
+
}
|
236 |
+
});
|
237 |
+
|
238 |
+
// Nov 2020 => in WP 5.6, this setup was made too late
|
239 |
+
// That's why we need to introduce an event + a property informing Nimble that we're ready
|
240 |
+
// @see Nimble ::scheduleModuleAccordion
|
241 |
+
_control_.container.data('module_ready_on_custom_control_event_is_setup',true);
|
242 |
+
_control_.container.trigger('module_ready_on_custom_control_event_is_setup');
|
243 |
+
});
|
244 |
+
}
|
245 |
+
|
246 |
+
// Maybe instantiate and bind the api.Value() controlling the module option panel, for the module using it ( has_mod_opt : true on registration )
|
247 |
+
this.maybeAwakeAndBindSharedModOpt();
|
248 |
+
},//initialize()
|
249 |
+
|
250 |
+
|
251 |
+
|
252 |
+
|
253 |
+
//////////////////////////////////
|
254 |
+
///READY
|
255 |
+
//////////////////////////////////
|
256 |
+
//When the control is embedded on the page, this method is fired in api.CZRBaseModuleControl:ready()
|
257 |
+
//=> right after the module is instantiated.
|
258 |
+
//If the module is a dynamic one (CRUD like), then this method is invoked by the child class
|
259 |
+
ready : function() {
|
260 |
+
var module = this;
|
261 |
+
module.isReady.resolve();
|
262 |
+
},
|
263 |
+
|
264 |
+
|
265 |
+
|
266 |
+
//fired when module is initialized, on module.isReady.done()
|
267 |
+
//designed to be extended or overridden to add specific items or properties
|
268 |
+
initializeModuleModel : function( constructorOptions ) {
|
269 |
+
var module = this, dfd = $.Deferred();
|
270 |
+
if ( ! module.isMultiItem() && ! module.isCrud() ) {
|
271 |
+
//this is a static module. We only have one item
|
272 |
+
//init module item if needed.
|
273 |
+
if ( _.isEmpty( constructorOptions.items ) ) {
|
274 |
+
var def = _.clone( module.defaultItemModel );
|
275 |
+
constructorOptions.items = [ $.extend( def, { id : module.id } ) ];
|
276 |
+
}
|
277 |
+
}
|
278 |
+
return dfd.resolve( constructorOptions ).promise();
|
279 |
+
},
|
280 |
+
|
281 |
+
|
282 |
+
//cb of : module.itemCollection.callbacks
|
283 |
+
//the data can typically hold informations passed by the input that has been changed and its specific preview transport (can be PostMessage )
|
284 |
+
//data looks like :
|
285 |
+
//{
|
286 |
+
// module : {}
|
287 |
+
// input_changed : string input.id
|
288 |
+
// input_transport : 'postMessage' or '',
|
289 |
+
// not_preview_sent : bool
|
290 |
+
//}
|
291 |
+
itemCollectionReact : function( to, from, data ) {
|
292 |
+
var module = this,
|
293 |
+
_current_model = module(),
|
294 |
+
_new_model = $.extend( true, {}, _current_model );
|
295 |
+
_new_model.items = to;
|
296 |
+
//update the dirtyness state
|
297 |
+
module.isDirty.set(true);
|
298 |
+
//set the the new items model
|
299 |
+
module.set( _new_model, data || {} );
|
300 |
+
},
|
301 |
+
|
302 |
+
//This method is fired from the control
|
303 |
+
filterItemsBeforeCoreApiSettingValue : function( itemsToReturn ) {
|
304 |
+
return itemsToReturn;
|
305 |
+
},
|
306 |
+
|
307 |
+
//cb of module.callbacks
|
308 |
+
//=> sets the setting value via the module collection !
|
309 |
+
moduleReact : function( to, from, data ) {
|
310 |
+
//cb of : module.callbacks
|
311 |
+
var module = this,
|
312 |
+
control = module.control,
|
313 |
+
isItemUpdate = ( _.size( from.items ) == _.size( to.items ) ) && ! _.isEmpty( _.difference( to.items, from.items ) ),
|
314 |
+
isColumnUpdate = to.column_id != from.column_id,
|
315 |
+
refreshPreview = function() {
|
316 |
+
api.previewer.refresh();
|
317 |
+
};
|
318 |
+
|
319 |
+
//update the collection + pass data
|
320 |
+
control.updateModulesCollection( {
|
321 |
+
module : $.extend( true, {}, to ),
|
322 |
+
data : data//useful to pass contextual info when a change happens
|
323 |
+
} );
|
324 |
+
|
325 |
+
// //Always update the view title
|
326 |
+
// module.writeViewTitle(to);
|
327 |
+
|
328 |
+
// //@todo : do we need that ?
|
329 |
+
// //send module to the preview. On update only, not on creation.
|
330 |
+
// if ( ! _.isEmpty(from) || ! _.isUndefined(from) ) {
|
331 |
+
// module._sendModule(to, from);
|
332 |
+
// }
|
333 |
+
},
|
334 |
+
|
335 |
+
//@todo : create a smart helper to get either the wp api section or the czr api sektion, depending on the module context
|
336 |
+
getModuleSection : function() {
|
337 |
+
return this.section;
|
338 |
+
},
|
339 |
+
|
340 |
+
//is this module multi item ?
|
341 |
+
//@return bool
|
342 |
+
isMultiItem : function() {
|
343 |
+
return api.CZR_Helpers.isMultiItemModule( null, this );
|
344 |
+
},
|
345 |
+
|
346 |
+
//is this module crud ?
|
347 |
+
//@return bool
|
348 |
+
isCrud : function() {
|
349 |
+
return api.CZR_Helpers.isCrudModule( null, this );
|
350 |
+
},
|
351 |
+
|
352 |
+
hasModOpt : function() {
|
353 |
+
return api.CZR_Helpers.hasModuleModOpt( null, this );
|
354 |
+
},
|
355 |
+
|
356 |
+
|
357 |
+
//////////////////////////////////
|
358 |
+
///MODULE OPTION :
|
359 |
+
///1) PREPARE
|
360 |
+
///2) INSTANTIATE
|
361 |
+
///3) LISTEN TO AND SET PARENT MODULE ON CHANGE
|
362 |
+
//////////////////////////////////
|
363 |
+
//fired when module isReady
|
364 |
+
instantiateModOpt : function() {
|
365 |
+
var module = this;
|
366 |
+
//Prepare the modOpt and instantiate it
|
367 |
+
var modOpt_candidate = module.prepareModOptForAPI( module().modOpt || {} );
|
368 |
+
module.czr_ModOpt = new module.modOptConstructor( modOpt_candidate );
|
369 |
+
module.czr_ModOpt.ready();
|
370 |
+
//update the module model on modOpt change
|
371 |
+
module.czr_ModOpt.callbacks.add( function( to, from, data ) {
|
372 |
+
var _current_model = module(),
|
373 |
+
_new_model = $.extend( true, {}, _current_model );
|
374 |
+
_new_model.modOpt = to;
|
375 |
+
//update the dirtyness state
|
376 |
+
module.isDirty(true);
|
377 |
+
//set the the new items model
|
378 |
+
//the data can typically hold informations passed by the input that has been changed and its specific preview transport (can be PostMessage )
|
379 |
+
//data looks like :
|
380 |
+
//{
|
381 |
+
// module : {}
|
382 |
+
// input_changed : string input.id
|
383 |
+
// input_transport : 'postMessage' or '',
|
384 |
+
// not_preview_sent : bool
|
385 |
+
//}
|
386 |
+
module( _new_model, data );
|
387 |
+
});
|
388 |
+
},
|
389 |
+
|
390 |
+
//@return an API ready modOpt object with the following properties
|
391 |
+
// initial_modOpt_model : {},
|
392 |
+
// defaultModOptModel : {},
|
393 |
+
// control : {},//control instance
|
394 |
+
// module : {},//module instance
|
395 |
+
//@param modOpt_candidate is an object. Can contain the saved modOpt properties on init.
|
396 |
+
prepareModOptForAPI : function( modOpt_candidate ) {
|
397 |
+
var module = this,
|
398 |
+
api_ready_modOpt = {};
|
399 |
+
// if ( ! _.isObject( modOpt_candidate ) ) {
|
400 |
+
// throw new Error('preparemodOptForAPI : a modOpt must be an object to be instantiated.');
|
401 |
+
// }
|
402 |
+
modOpt_candidate = _.isObject( modOpt_candidate ) ? modOpt_candidate : {};
|
403 |
+
|
404 |
+
_.each( module.defaultAPImodOptModel, function( _value, _key ) {
|
405 |
+
var _candidate_val = modOpt_candidate[_key];
|
406 |
+
switch( _key ) {
|
407 |
+
case 'initial_modOpt_model' :
|
408 |
+
//make sure that the provided modOpt has all the default properties set
|
409 |
+
_.each( module.getDefaultModOptModel() , function( _value, _property ) {
|
410 |
+
if ( ! _.has( modOpt_candidate, _property) )
|
411 |
+
modOpt_candidate[_property] = _value;
|
412 |
+
});
|
413 |
+
api_ready_modOpt[_key] = modOpt_candidate;
|
414 |
+
|
415 |
+
break;
|
416 |
+
case 'defaultModOptModel' :
|
417 |
+
api_ready_modOpt[_key] = _.clone( module.defaultModOptModel );
|
418 |
+
break;
|
419 |
+
case 'control' :
|
420 |
+
api_ready_modOpt[_key] = module.control;
|
421 |
+
break;
|
422 |
+
case 'module' :
|
423 |
+
api_ready_modOpt[_key] = module;
|
424 |
+
break;
|
425 |
+
}//switch
|
426 |
+
});
|
427 |
+
return api_ready_modOpt;
|
428 |
+
},
|
429 |
+
|
430 |
+
//Returns the default modOpt defined in initialize
|
431 |
+
//Each chid class can override the default item and the following method
|
432 |
+
getDefaultModOptModel : function( id ) {
|
433 |
+
var module = this;
|
434 |
+
return $.extend( _.clone( module.defaultModOptModel ), { is_mod_opt : true } );
|
435 |
+
},
|
436 |
+
|
437 |
+
|
438 |
+
//The idea is to send only the currently modified item instead of the entire collection
|
439 |
+
//the entire collection is sent anyway on api(setId).set( value ), and accessible in the preview via api(setId).bind( fn( to) )
|
440 |
+
//This method can be called on input change and on czr-partial-refresh-done
|
441 |
+
//{
|
442 |
+
// input_id :
|
443 |
+
// input_parent_id :
|
444 |
+
// is_mod_opt :
|
445 |
+
// to :
|
446 |
+
// from :
|
447 |
+
// isPartialRefresh : bool//<= let us know if it is a full wrapper refresh or a single input update ( true when fired from sendModuleInputsToPreview )
|
448 |
+
//}
|
449 |
+
sendInputToPreview : function( args ) {
|
450 |
+
var module = this;
|
451 |
+
//normalizes the args
|
452 |
+
args = _.extend(
|
453 |
+
{
|
454 |
+
input_id : '',
|
455 |
+
input_parent_id : '',//<= can be the mod opt or an item
|
456 |
+
to : null,
|
457 |
+
from : null
|
458 |
+
} , args );
|
459 |
+
|
460 |
+
if ( _.isEqual( args.to, args.from ) )
|
461 |
+
return;
|
462 |
+
|
463 |
+
//This is listened to by the preview frame
|
464 |
+
api.previewer.send( 'czr_input', {
|
465 |
+
set_id : api.CZR_Helpers.getControlSettingId( module.control.id ),
|
466 |
+
module_id : module.id,//<= will allow us to target the right dom element on front end
|
467 |
+
module : { items : $.extend( true, {}, module().items ) , modOpt : module.hasModOpt() ? $.extend( true, {}, module().modOpt ): {} },
|
468 |
+
input_parent_id : args.input_parent_id,//<= can be the mod opt or the item
|
469 |
+
input_id : args.input_id,
|
470 |
+
value : args.to,
|
471 |
+
isPartialRefresh : args.isPartialRefresh//<= let us know if it is a full wrapper refresh or a single input update ( true when fired from sendModuleInputsToPreview )
|
472 |
+
});
|
473 |
+
|
474 |
+
//add a hook here
|
475 |
+
module.trigger( 'input_sent', { input : args.to , dom_el: module.container } );
|
476 |
+
},
|
477 |
+
|
478 |
+
|
479 |
+
//@return void()
|
480 |
+
//Fired on partial refresh in base control initialize, only for module type controls
|
481 |
+
//This method can be called when don't have input instances available
|
482 |
+
//=> typically when reordering items, mod options and items are closed, therefore there's no input instances.
|
483 |
+
//=> the input id are being retrieved from the input parent models : items and mod options.
|
484 |
+
//@param args = { isPartialRefresh : bool }
|
485 |
+
sendModuleInputsToPreview : function( args ) {
|
486 |
+
var module = this,
|
487 |
+
_sendInputData = function() {
|
488 |
+
var inputParent = this,//this is the input parent : item or modOpt
|
489 |
+
inputParentModel = $.extend( true, {}, inputParent() );
|
490 |
+
//we don't need to send the id, which is never an input, but generated by the api.
|
491 |
+
inputParentModel = _.omit( inputParentModel, 'id' );
|
492 |
+
|
493 |
+
_.each( inputParentModel, function( inputVal, inputId ) {
|
494 |
+
module.sendInputToPreview( {
|
495 |
+
input_id : inputId,
|
496 |
+
input_parent_id : inputParent.id,
|
497 |
+
to : inputVal,
|
498 |
+
from : null,
|
499 |
+
isPartialRefresh : args.isPartialRefresh
|
500 |
+
});
|
501 |
+
});
|
502 |
+
};
|
503 |
+
|
504 |
+
module.czr_Item.each( function( _itm_ ) {
|
505 |
+
_sendInputData.call( _itm_ );
|
506 |
+
});
|
507 |
+
|
508 |
+
if ( module.hasModOpt() ) {
|
509 |
+
_sendInputData.call( module.czr_ModOpt );
|
510 |
+
}
|
511 |
+
},
|
512 |
+
|
513 |
+
|
514 |
+
// Fired in ::initialize()
|
515 |
+
// Maybe instantiate and bind the api.Value() controlling the visibility of the module option panel, for the module using it ( has_mod_opt : true on registration )
|
516 |
+
maybeAwakeAndBindSharedModOpt : function() {
|
517 |
+
if ( ! _.isUndefined( api.czr_ModOptVisible ) )
|
518 |
+
return;
|
519 |
+
|
520 |
+
//MOD OPT PANEL SETTINGS
|
521 |
+
api.czr_ModOptVisible = new api.Value( false );
|
522 |
+
|
523 |
+
//MOD OPT VISIBLE REACT
|
524 |
+
// passing an optional args object allows us to expand the modopt panel and focus on a specific tab right after
|
525 |
+
//@args : {
|
526 |
+
// module : module,//the current module for which the modOpt is being expanded
|
527 |
+
// focus : 'section-topline-2'//the id of the tab we want to focus on
|
528 |
+
//}
|
529 |
+
api.czr_ModOptVisible.bind( function( visible, from, args ) {
|
530 |
+
args = args || {};
|
531 |
+
if ( ! _.isFunction( args.module ) || ! _.isFunction( args.module.czr_ModOpt ) ) {
|
532 |
+
api.errare( 'moduleCtor::maybeAwakeAndBindSharedModOpt => api.czr_ModOptVisible.bind() => incorrect arguments', args );
|
533 |
+
return;
|
534 |
+
}
|
535 |
+
var modOpt = args.module.czr_ModOpt,
|
536 |
+
module = args.module;
|
537 |
+
|
538 |
+
// Append content on expansion
|
539 |
+
// Remove on collapse
|
540 |
+
if ( visible ) {
|
541 |
+
//first close all opened remove dialogs and opened items
|
542 |
+
module.closeRemoveDialogs().closeAllItems();
|
543 |
+
|
544 |
+
modOpt.modOptWrapperViewSetup( modOpt() ).done( function( $_container ) {
|
545 |
+
modOpt.container = $_container;
|
546 |
+
try {
|
547 |
+
api.CZR_Helpers.setupInputCollectionFromDOM.call( modOpt ).toggleModPanelView( visible );
|
548 |
+
} catch(e) {
|
549 |
+
api.consoleLog(e);
|
550 |
+
}
|
551 |
+
if ( module && args.focus ) {
|
552 |
+
_.delay( function() {
|
553 |
+
if ( _.isNull( modOpt.container ) || ! modOpt.container.find('[data-tab-id="' + args.focus + '"] a').length )
|
554 |
+
return;
|
555 |
+
modOpt.container.find('[data-tab-id="' + args.focus + '"] a').trigger('click');
|
556 |
+
}, 200 );
|
557 |
+
}
|
558 |
+
});
|
559 |
+
|
560 |
+
} else {
|
561 |
+
modOpt.toggleModPanelView( visible ).done( function() {
|
562 |
+
if ( modOpt.container && 0 < modOpt.container.length ) {
|
563 |
+
$.when( modOpt.container.remove() ).done( function() {
|
564 |
+
api.CZR_Helpers.removeInputCollection.call( modOpt );
|
565 |
+
});
|
566 |
+
} else {
|
567 |
+
api.CZR_Helpers.removeInputCollection.call( modOpt );
|
568 |
+
}
|
569 |
+
modOpt.container = null;
|
570 |
+
});
|
571 |
+
}
|
572 |
+
} );
|
573 |
+
}
|
574 |
+
});//$.extend//CZRBaseControlMths
|
575 |
+
})( wp.customize , jQuery, _ );
|
assets/czr/fmk/js/base-fmk/1_0_input_item_module_control/1_3_module/_0_0_3_module_1_collection.js
ADDED
@@ -0,0 +1,416 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
//MULTI CONTROL CLASS
|
2 |
+
//extends api.CZRBaseControl
|
3 |
+
//
|
4 |
+
//Setup the collection of items
|
5 |
+
//renders the module view
|
6 |
+
//Listen to items collection changes and update the control setting
|
7 |
+
|
8 |
+
var CZRModuleMths = CZRModuleMths || {};
|
9 |
+
( function ( api, $, _ ) {
|
10 |
+
$.extend( CZRModuleMths, {
|
11 |
+
//@fired in module ready on api('ready')
|
12 |
+
//the module().items has been set in initialize
|
13 |
+
//A collection of items can be supplied.
|
14 |
+
populateSavedItemCollection : function( _itemCollection_ ) {
|
15 |
+
var module = this,
|
16 |
+
_deepCopyOfItemCollection;
|
17 |
+
|
18 |
+
if ( ! _.isArray( _itemCollection_ || module().items ) ) {
|
19 |
+
api.errorLog( 'populateSavedItemCollection : The saved items collection must be an array in module :' + module.id );
|
20 |
+
return;
|
21 |
+
}
|
22 |
+
_deepCopyOfItemCollection = $.extend( true, [], _itemCollection_ || module().items );
|
23 |
+
|
24 |
+
//populates the collection with the saved items
|
25 |
+
//the modOpt must be skipped
|
26 |
+
//the saved items + modOpt is an array looking like :
|
27 |
+
////MODOPT IS THE FIRST ARRAY ELEMENT: A modOpt has no unique id and has the property is_mod_opt set to true
|
28 |
+
//[
|
29 |
+
// is_mod_opt : true //<= inform us that this is not an item but a modOpt
|
30 |
+
//],
|
31 |
+
////THEN COME THE ITEMS
|
32 |
+
//[
|
33 |
+
// id : "czr_slide_module_0"
|
34 |
+
// slide-background : 21,
|
35 |
+
// ....
|
36 |
+
// ],
|
37 |
+
// [
|
38 |
+
// id : "czr_slide_module_1"
|
39 |
+
// slide-background : 21,
|
40 |
+
// ....
|
41 |
+
// ]
|
42 |
+
|
43 |
+
// CHECK THAT WE DON'T HAVE ANY MODOPT AT THIS STAGE
|
44 |
+
//=> the items and the modOpt should already be split at this stage, because it's done before module instantiation... this check is totally paranoid.
|
45 |
+
_.each( _deepCopyOfItemCollection , function( item_candidate , key ) {
|
46 |
+
if ( _.has( item_candidate, 'is_mod_opt' ) ) {
|
47 |
+
throw new Error( 'populateSavedItemCollection => there should be no mod opt to instantiate here.');
|
48 |
+
}
|
49 |
+
});
|
50 |
+
|
51 |
+
// allow modules to hook here
|
52 |
+
module.trigger( 'filterItemCandidatesBeforeInstantiation', _deepCopyOfItemCollection );
|
53 |
+
|
54 |
+
//INSTANTIATE THE ITEMS
|
55 |
+
_.each( _deepCopyOfItemCollection, function( item_candidate , key ) {
|
56 |
+
//instantiates and fires ready
|
57 |
+
var _doInstantiate_ = function() {
|
58 |
+
var _item_instance_ = module.instantiateItem( item_candidate );
|
59 |
+
if ( _.isFunction( _item_instance_ ) ) {
|
60 |
+
_item_instance_.ready();
|
61 |
+
} else {
|
62 |
+
api.errare( 'populateSavedItemCollection => Could not instantiate item in module ' + module.id , item_candidate );
|
63 |
+
}
|
64 |
+
};
|
65 |
+
//adds it to the collection and fire item.ready()
|
66 |
+
if ( serverControlParams.isDevMode ) {
|
67 |
+
_doInstantiate_();
|
68 |
+
} else {
|
69 |
+
try { _doInstantiate_(); } catch( er ) {
|
70 |
+
api.errare( 'populateSavedItemCollection => ' + er );
|
71 |
+
}
|
72 |
+
}
|
73 |
+
});
|
74 |
+
|
75 |
+
//check if everything went well
|
76 |
+
_.each( _deepCopyOfItemCollection, function( _item ) {
|
77 |
+
if ( ! _.isObject( _item ) ) {
|
78 |
+
return;
|
79 |
+
}
|
80 |
+
if ( _.isUndefined( _.findWhere( module.itemCollection(), _item.id ) ) ) {
|
81 |
+
throw new Error( 'populateSavedItemCollection => The saved items have not been properly populated in module : ' + module.id );
|
82 |
+
}
|
83 |
+
});
|
84 |
+
|
85 |
+
module.trigger( 'items-collection-populated' );
|
86 |
+
//do we need to chain this method ?
|
87 |
+
//return this;
|
88 |
+
},
|
89 |
+
|
90 |
+
|
91 |
+
instantiateItem : function( item_candidate, is_added_by_user ) {
|
92 |
+
var module = this;
|
93 |
+
|
94 |
+
// Cast to an object now.
|
95 |
+
item_candidate = _.isObject( item_candidate ) ? item_candidate : {};
|
96 |
+
|
97 |
+
// FIRST VALIDATION
|
98 |
+
//allow modules to validate the item_candidate before addition
|
99 |
+
item_candidate = module.validateItemBeforeAddition( item_candidate, is_added_by_user );
|
100 |
+
|
101 |
+
// Abort here and display a simple console message if item is null or false, for example if validateItemBeforeAddition returned null or false
|
102 |
+
if ( ! item_candidate || _.isNull( item_candidate ) ) {
|
103 |
+
api.errare( 'CZRModule::instantiateItem() => item_candidate did not pass validation in module ' + module.id );
|
104 |
+
return;
|
105 |
+
}
|
106 |
+
|
107 |
+
// NORMALIZE
|
108 |
+
//Prepare the item, make sure its id is set and unique
|
109 |
+
item_candidate = module.prepareItemForAPI( item_candidate );
|
110 |
+
|
111 |
+
if ( ! _.isObject( item_candidate ) ) {
|
112 |
+
api.errare( 'CZRModule::instantiateItem() => an item should be described by an object in module type : ' + module.module_type, 'module id : ' + module.id );
|
113 |
+
return;
|
114 |
+
}
|
115 |
+
|
116 |
+
// Display a simple console message if item is null or false, for example if validateItemBeforeInstantiation returned null or false
|
117 |
+
if ( ! item_candidate || _.isNull( item_candidate ) ) {
|
118 |
+
api.errare( 'CZRModule::instantiateItem() => item_candidate invalid in module ' + module.id );
|
119 |
+
return;
|
120 |
+
}
|
121 |
+
|
122 |
+
//ITEM ID CHECKS
|
123 |
+
if ( ! _.has( item_candidate, 'id' ) ) {
|
124 |
+
throw new Error('CZRModule::instantiateItem() => an item has no id and could not be added in the collection of : ' + this.id );
|
125 |
+
}
|
126 |
+
if ( module.czr_Item.has( item_candidate.id ) ) {
|
127 |
+
throw new Error('CZRModule::instantiateItem() => the following item id ' + item_candidate.id + ' already exists in module.czr_Item() for module ' + this.id );
|
128 |
+
}
|
129 |
+
//instantiate the item with the item constructor, default one or provided by the module
|
130 |
+
module.czr_Item.add( item_candidate.id, new module.itemConstructor( item_candidate.id, item_candidate ) );
|
131 |
+
|
132 |
+
if ( ! module.czr_Item.has( item_candidate.id ) ) {
|
133 |
+
throw new Error('CZRModule::instantiateItem() => instantiation failed for item id ' + item_candidate.id + ' for module ' + this.id );
|
134 |
+
}
|
135 |
+
//the item is now ready and will listen to changes
|
136 |
+
//return the instance
|
137 |
+
return module.czr_Item( item_candidate.id );
|
138 |
+
},
|
139 |
+
|
140 |
+
|
141 |
+
// Designed to be overriden in modules
|
142 |
+
validateItemBeforeAddition : function( item_candidate, is_added_by_user ) {
|
143 |
+
return item_candidate;
|
144 |
+
},
|
145 |
+
|
146 |
+
//@return an API ready item object with the following properties
|
147 |
+
// id : '',
|
148 |
+
// initial_item_model : {},
|
149 |
+
// defaultItemModel : {},
|
150 |
+
// control : {},//control instance
|
151 |
+
// module : {},//module instance
|
152 |
+
// is_added_by_user : false
|
153 |
+
prepareItemForAPI : function( item_candidate ) {
|
154 |
+
var module = this,
|
155 |
+
api_ready_item = {};
|
156 |
+
// if ( ! _.isObject( item_candidate ) ) {
|
157 |
+
// throw new Error('prepareitemForAPI : a item must be an object to be instantiated.');
|
158 |
+
// }
|
159 |
+
item_candidate = _.isObject( item_candidate ) ? item_candidate : {};
|
160 |
+
|
161 |
+
_.each( module.defaultAPIitemModel, function( _value, _key ) {
|
162 |
+
var _candidate_val = item_candidate[_key];
|
163 |
+
switch( _key ) {
|
164 |
+
case 'id' :
|
165 |
+
// The id can be specified in a module ( ex: the pre defined item ids of the Font Customizer module )
|
166 |
+
// => that's why we need to check here if the item id is not already registered here
|
167 |
+
if ( _.isEmpty( _candidate_val ) ) {
|
168 |
+
api_ready_item[_key] = module.generateItemId( module.module_type );
|
169 |
+
} else {
|
170 |
+
if ( module.isItemRegistered( _candidate_val ) ) {
|
171 |
+
module.generateItemId( _candidate_val );
|
172 |
+
} else {
|
173 |
+
api_ready_item[_key] = _candidate_val;
|
174 |
+
}
|
175 |
+
}
|
176 |
+
break;
|
177 |
+
case 'initial_item_model' :
|
178 |
+
//make sure that the provided item has all the default properties set
|
179 |
+
_.each( module.getDefaultItemModel() , function( _value, _property ) {
|
180 |
+
if ( ! _.has( item_candidate, _property) )
|
181 |
+
item_candidate[_property] = _value;
|
182 |
+
});
|
183 |
+
api_ready_item[_key] = item_candidate;
|
184 |
+
|
185 |
+
break;
|
186 |
+
case 'defaultItemModel' :
|
187 |
+
api_ready_item[_key] = _.clone( module.defaultItemModel );
|
188 |
+
break;
|
189 |
+
case 'control' :
|
190 |
+
api_ready_item[_key] = module.control;
|
191 |
+
break;
|
192 |
+
case 'module' :
|
193 |
+
api_ready_item[_key] = module;
|
194 |
+
break;
|
195 |
+
case 'is_added_by_user' :
|
196 |
+
api_ready_item[_key] = _.isBoolean( _candidate_val ) ? _candidate_val : false;
|
197 |
+
break;
|
198 |
+
}//switch
|
199 |
+
});
|
200 |
+
|
201 |
+
//if we don't have an id at this stage, let's generate it.
|
202 |
+
if ( ! _.has( api_ready_item, 'id' ) ) {
|
203 |
+
api_ready_item.id = module.generateItemId( module.module_type );
|
204 |
+
}
|
205 |
+
|
206 |
+
//Now amend the initial_item_model with the generated id
|
207 |
+
api_ready_item.initial_item_model.id = api_ready_item.id;
|
208 |
+
|
209 |
+
return module.validateItemBeforeInstantiation( api_ready_item );
|
210 |
+
},
|
211 |
+
|
212 |
+
|
213 |
+
// Designed to be overriden in modules
|
214 |
+
validateItemBeforeInstantiation : function( api_ready_item ) {
|
215 |
+
return api_ready_item;
|
216 |
+
},
|
217 |
+
|
218 |
+
|
219 |
+
// recursive
|
220 |
+
// will generate a unique id with the provided prefix
|
221 |
+
generateItemId : function( prefix, key, i ) {
|
222 |
+
//prevent a potential infinite loop
|
223 |
+
i = i || 1;
|
224 |
+
if ( i > 100 ) {
|
225 |
+
throw new Error( 'Infinite loop when generating of a module id.' );
|
226 |
+
}
|
227 |
+
var module = this;
|
228 |
+
key = key || module._getNextItemKeyInCollection();
|
229 |
+
var id_candidate = prefix + '_' + key;
|
230 |
+
|
231 |
+
//do we have a module collection value ?
|
232 |
+
if ( ! _.has( module, 'itemCollection' ) || ! _.isArray( module.itemCollection() ) ) {
|
233 |
+
throw new Error('The item collection does not exist or is not properly set in module : ' + module.id );
|
234 |
+
}
|
235 |
+
|
236 |
+
//make sure the module is not already instantiated
|
237 |
+
if ( module.isItemRegistered( id_candidate ) ) {
|
238 |
+
key++; i++;
|
239 |
+
return module.generateItemId( prefix, key, i );
|
240 |
+
}
|
241 |
+
return id_candidate;
|
242 |
+
},
|
243 |
+
|
244 |
+
|
245 |
+
//helper : return an int
|
246 |
+
//=> the next available id of the item collection
|
247 |
+
_getNextItemKeyInCollection : function() {
|
248 |
+
var module = this,
|
249 |
+
_maxItem = {},
|
250 |
+
_next_key = 0;
|
251 |
+
|
252 |
+
//get the initial key
|
253 |
+
//=> if we already have a collection, extract all keys, select the max and increment it.
|
254 |
+
//else, key is 0
|
255 |
+
if ( _.isEmpty( module.itemCollection() ) )
|
256 |
+
return _next_key;
|
257 |
+
if ( _.isArray( module.itemCollection() ) && 1 === _.size( module.itemCollection() ) ) {
|
258 |
+
_maxItem = module.itemCollection()[0];
|
259 |
+
} else {
|
260 |
+
_maxItem = _.max( module.itemCollection(), function( _item ) {
|
261 |
+
if ( ! _.isNumber( _item.id.replace(/[^\/\d]/g,'') ) )
|
262 |
+
return 0;
|
263 |
+
return parseInt( _item.id.replace( /[^\/\d]/g, '' ), 10 );
|
264 |
+
});
|
265 |
+
}
|
266 |
+
|
267 |
+
//For a single item collection, with an index free id, it might happen that the item is not parsable. Make sure it is. Otherwise, use the default key 0
|
268 |
+
if ( ! _.isUndefined( _maxItem ) && _.isNumber( _maxItem.id.replace(/[^\/\d]/g,'') ) ) {
|
269 |
+
_next_key = parseInt( _maxItem.id.replace(/[^\/\d]/g,''), 10 ) + 1;
|
270 |
+
}
|
271 |
+
return _next_key;
|
272 |
+
},
|
273 |
+
|
274 |
+
|
275 |
+
|
276 |
+
//this helper allows to check if an item has been registered in the collection
|
277 |
+
//no matter if it's not instantiated yet
|
278 |
+
isItemRegistered : function( id_candidate ) {
|
279 |
+
var module = this;
|
280 |
+
return ! _.isUndefined( _.findWhere( module.itemCollection(), { id : id_candidate}) );
|
281 |
+
},
|
282 |
+
|
283 |
+
|
284 |
+
//Fired in module.czr_Item.itemReact
|
285 |
+
//@param args can be
|
286 |
+
//{
|
287 |
+
// collection : [],
|
288 |
+
// params : params {}
|
289 |
+
//},
|
290 |
+
//
|
291 |
+
//or {
|
292 |
+
// item : {}
|
293 |
+
// params : params {}
|
294 |
+
//}
|
295 |
+
//if a collection is provided in the passed args then simply refresh the collection
|
296 |
+
//=> typically used when reordering the collection item with sortable or when a item is removed
|
297 |
+
//
|
298 |
+
//the args.params can typically hold informations passed by the input that has been changed and its specific preview transport (can be PostMessage )
|
299 |
+
//params looks like :
|
300 |
+
//{
|
301 |
+
// module : {}
|
302 |
+
// input_changed : string input.id
|
303 |
+
// input_transport : 'postMessage' or '',
|
304 |
+
// not_preview_sent : bool
|
305 |
+
//}
|
306 |
+
//@return a deferred promise
|
307 |
+
updateItemsCollection : function( args ) {
|
308 |
+
var module = this,
|
309 |
+
_current_collection = module.itemCollection(),
|
310 |
+
_new_collection = _.clone(_current_collection),
|
311 |
+
dfd = $.Deferred();
|
312 |
+
|
313 |
+
//if a collection is provided in the passed args then simply refresh the collection
|
314 |
+
//=> typically used when reordering the collection item with sortable or when a item is removed
|
315 |
+
if ( _.has( args, 'collection' ) ) {
|
316 |
+
//reset the collection
|
317 |
+
module.itemCollection.set( args.collection );
|
318 |
+
return;
|
319 |
+
}
|
320 |
+
|
321 |
+
if ( ! _.has( args, 'item' ) ) {
|
322 |
+
throw new Error('updateItemsCollection, no item provided ' + module.control.id + '. Aborting');
|
323 |
+
}
|
324 |
+
//normalizes with params
|
325 |
+
args = _.extend( { params : {} }, args );
|
326 |
+
|
327 |
+
var item_candidate = _.clone( args.item ),
|
328 |
+
hasMissingProperty = false;
|
329 |
+
|
330 |
+
// Is the item well formed ? Does it have all the properties of the default model ?
|
331 |
+
// Each module has to declare a defaultItemModel which augments the default one : { id : '', title : '' };
|
332 |
+
// Let's loop on the defaultItemModel property and check that none is missing in the candidate
|
333 |
+
_.each( module.defaultItemModel, function( itemData, key ) {
|
334 |
+
if ( ! _.has( item_candidate, key ) ) {
|
335 |
+
throw new Error( 'CZRModuleMths => updateItemsCollection : Missing property "' + key + '" for item candidate' );
|
336 |
+
}
|
337 |
+
});
|
338 |
+
|
339 |
+
if ( hasMissingProperty )
|
340 |
+
return;
|
341 |
+
|
342 |
+
//the item already exist in the collection
|
343 |
+
if ( _.findWhere( _new_collection, { id : item_candidate.id } ) ) {
|
344 |
+
_.each( _current_collection , function( _item, _ind ) {
|
345 |
+
if ( _item.id != item_candidate.id )
|
346 |
+
return;
|
347 |
+
|
348 |
+
//set the new val to the changed property
|
349 |
+
_new_collection[_ind] = item_candidate;
|
350 |
+
});
|
351 |
+
}
|
352 |
+
//the item has to be added
|
353 |
+
else {
|
354 |
+
_new_collection.push( item_candidate );
|
355 |
+
}
|
356 |
+
|
357 |
+
//updates the collection value
|
358 |
+
//=> is listened to by module.itemCollectionReact
|
359 |
+
module.itemCollection.set( _new_collection, args.params );
|
360 |
+
return dfd.resolve( { collection : _new_collection, params : args.params } ).promise();
|
361 |
+
},
|
362 |
+
|
363 |
+
|
364 |
+
|
365 |
+
//fire on sortable() update callback
|
366 |
+
//@returns a sorted collection as an array of item objects
|
367 |
+
_getSortedDOMItemCollection : function( ) {
|
368 |
+
var module = this,
|
369 |
+
_old_collection = _.clone( module.itemCollection() ),
|
370 |
+
_new_collection = [],
|
371 |
+
dfd = $.Deferred();
|
372 |
+
|
373 |
+
//re-build the collection from the DOM
|
374 |
+
$( '.' + module.control.css_attr.single_item, module.container ).each( function( _index ) {
|
375 |
+
var _item = _.findWhere( _old_collection, {id: $(this).attr('data-id') });
|
376 |
+
//do we have a match in the existing collection ?
|
377 |
+
if ( ! _item )
|
378 |
+
return;
|
379 |
+
|
380 |
+
_new_collection[_index] = _item;
|
381 |
+
});
|
382 |
+
|
383 |
+
if ( _old_collection.length != _new_collection.length ) {
|
384 |
+
throw new Error('There was a problem when re-building the item collection from the DOM in module : ' + module.id );
|
385 |
+
}
|
386 |
+
return dfd.resolve( _new_collection ).promise();
|
387 |
+
},
|
388 |
+
|
389 |
+
|
390 |
+
//This method should
|
391 |
+
//1) remove the item views
|
392 |
+
//2) remove the czr_items instances
|
393 |
+
//3) remove the item collection
|
394 |
+
//4) re-initialize items
|
395 |
+
//5) re-setup the item collection
|
396 |
+
//6) re-instantiate the items
|
397 |
+
//7) re-render their views
|
398 |
+
refreshItemCollection : function() {
|
399 |
+
var module = this;
|
400 |
+
//Remove item views and instances
|
401 |
+
module.czr_Item.each( function( _itm ) {
|
402 |
+
if ( module.czr_Item( _itm.id ).container && 0 < module.czr_Item( _itm.id ).container.length ) {
|
403 |
+
$.when( module.czr_Item( _itm.id ).container.remove() ).done( function() {
|
404 |
+
//Remove item instances
|
405 |
+
module.czr_Item.remove( _itm.id );
|
406 |
+
});
|
407 |
+
}
|
408 |
+
});
|
409 |
+
|
410 |
+
// Reset the item collection
|
411 |
+
// => the collection listeners will be setup after populate, on 'items-collection-populated'
|
412 |
+
module.itemCollection = new api.Value( [] );
|
413 |
+
module.populateSavedItemCollection();
|
414 |
+
}
|
415 |
+
});//$.extend//CZRBaseControlMths
|
416 |
+
})( wp.customize , jQuery, _ );
|
assets/czr/fmk/js/base-fmk/1_0_input_item_module_control/1_3_module/_0_0_3_module_2_model.js
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
//MULTI CONTROL CLASS
|
2 |
+
//extends api.CZRBaseControl
|
3 |
+
//
|
4 |
+
//Setup the collection of items
|
5 |
+
//renders the module view
|
6 |
+
//Listen to items collection changes and update the control setting
|
7 |
+
|
8 |
+
var CZRModuleMths = CZRModuleMths || {};
|
9 |
+
( function ( api, $, _ ) {
|
10 |
+
$.extend( CZRModuleMths, {
|
11 |
+
//Returns the default item defined in initialize
|
12 |
+
//Each chid class can override the default item and the following method
|
13 |
+
getDefaultItemModel : function( id ) {
|
14 |
+
var module = this;
|
15 |
+
return $.extend( _.clone( module.defaultItemModel ), { id : id || '' } );
|
16 |
+
},
|
17 |
+
|
18 |
+
//////////////////////////////////
|
19 |
+
///MODEL HELPERS
|
20 |
+
//////////////////////////////////
|
21 |
+
//the job of this function is to return a new item ready to be added to the collection
|
22 |
+
//the new item shall have a unique id
|
23 |
+
//!!recursive
|
24 |
+
_initNewItem : function( _item , _next_key ) {
|
25 |
+
var module = this,
|
26 |
+
_new_item = { id : '' },
|
27 |
+
_id;
|
28 |
+
|
29 |
+
//get the next available key of the collection
|
30 |
+
_next_key = 'undefined' != typeof(_next_key) ? _next_key : _.size( module.itemCollection() );
|
31 |
+
|
32 |
+
if ( _.isNumber(_next_key) ) {
|
33 |
+
_id = module.module_type + '_' + _next_key;
|
34 |
+
}
|
35 |
+
else {
|
36 |
+
_id = _next_key;
|
37 |
+
//reset next key to 0 in case a recursive loop is needed later
|
38 |
+
_next_key = 0;
|
39 |
+
}
|
40 |
+
|
41 |
+
if ( _item && ! _.isEmpty( _item) )
|
42 |
+
_new_item = $.extend( _item, { id : _id } );
|
43 |
+
else
|
44 |
+
_new_item = this.getDefaultItemModel( _id );
|
45 |
+
|
46 |
+
//check the id existence, and its unicity
|
47 |
+
if ( _.has(_new_item, 'id') && module._isItemIdPossible(_id) ) {
|
48 |
+
//make sure that the provided item has all the default properties set
|
49 |
+
_.map( module.getDefaultItemModel() , function( value, property ){
|
50 |
+
if ( ! _.has(_new_item, property) )
|
51 |
+
_new_item[property] = value;
|
52 |
+
});
|
53 |
+
|
54 |
+
return _new_item;
|
55 |
+
}
|
56 |
+
|
57 |
+
//if id already exists, then test a new one
|
58 |
+
return module._initNewItem( _new_item, _next_key + 1);
|
59 |
+
}
|
60 |
+
});//$.extend
|
61 |
+
})( wp.customize , jQuery, _ );
|
assets/czr/fmk/js/base-fmk/1_0_input_item_module_control/1_3_module/_0_0_3_module_3_view.js
ADDED
@@ -0,0 +1,292 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
//MULTI CONTROL CLASS
|
2 |
+
//extends api.CZRBaseControl
|
3 |
+
//
|
4 |
+
//Setup the collection of items
|
5 |
+
//renders the module view
|
6 |
+
//Listen to items collection changes and update the control setting
|
7 |
+
|
8 |
+
var CZRModuleMths = CZRModuleMths || {};
|
9 |
+
( function ( api, $, _ ) {
|
10 |
+
$.extend( CZRModuleMths, {
|
11 |
+
//fired on module.isReady.done()
|
12 |
+
//the module.container is set.
|
13 |
+
renderModuleParts : function() {
|
14 |
+
var module = this,
|
15 |
+
$_moduleContentEl = $( module.container ),
|
16 |
+
dfd = $.Deferred();
|
17 |
+
|
18 |
+
var appendAndResolve = function( _tmpl_ ) {
|
19 |
+
if ( module.isCrud() ) {
|
20 |
+
//do we have an html template ?
|
21 |
+
if ( _.isEmpty( _tmpl_ ) ) {
|
22 |
+
dfd.reject( 'renderModuleParts => Missing html template for module : '+ module.id );
|
23 |
+
}
|
24 |
+
//append the module wrapper to the column
|
25 |
+
$_moduleContentEl.append( _tmpl_ );
|
26 |
+
}
|
27 |
+
|
28 |
+
// Always append this
|
29 |
+
var $_module_items_wrapper = $(
|
30 |
+
'<ul/>',
|
31 |
+
{
|
32 |
+
class : [
|
33 |
+
module.control.css_attr.items_wrapper,
|
34 |
+
module.module_type,
|
35 |
+
module.isMultiItem() ? 'multi-item-mod' : 'mono-item-mod',
|
36 |
+
module.isCrud() ? 'crud-mod' : 'not-crud-mod'
|
37 |
+
].join(' ')
|
38 |
+
}
|
39 |
+
);
|
40 |
+
|
41 |
+
$_moduleContentEl.append( $_module_items_wrapper );
|
42 |
+
|
43 |
+
dfd.resolve( $( $_module_items_wrapper, $_moduleContentEl ) );
|
44 |
+
};//appendAndResolve
|
45 |
+
|
46 |
+
//Crud modules => then let's add the crud module part tmpl
|
47 |
+
if ( module.isCrud() ) {
|
48 |
+
// Do we have view content template script?
|
49 |
+
// if yes, let's use it <= Old way
|
50 |
+
// Otherwise let's fetch the html template from the server
|
51 |
+
if ( ! _.isEmpty( module.crudModulePart ) ) {
|
52 |
+
if ( 1 > $( '#tmpl-' + module.crudModulePart ).length ) {
|
53 |
+
dfd.reject( 'renderModuleParts => no crud Module Part template for module ' + module.id + '. The template script id should be : #tmpl-' + module.crudModulePart );
|
54 |
+
}
|
55 |
+
appendAndResolve( wp.template( module.crudModulePart )( {} ) );
|
56 |
+
} else {
|
57 |
+
api.CZR_Helpers.getModuleTmpl( {
|
58 |
+
tmpl : 'crud-module-part',
|
59 |
+
module_type: 'all_modules',
|
60 |
+
module_id : module.id,
|
61 |
+
control_id : module.control.id
|
62 |
+
} ).done( function( _serverTmpl_ ) {
|
63 |
+
//console.log( 'renderModuleParts => success response =>', module.id, _serverTmpl_);
|
64 |
+
appendAndResolve( api.CZR_Helpers.parseTemplate( _serverTmpl_ )( {} ) );
|
65 |
+
}).fail( function( _r_ ) {
|
66 |
+
api.errare( 'renderModuleParts => fail response =>', _r_);
|
67 |
+
dfd.reject( 'renderModuleParts => Problem when fetching the crud-module-part tmpl from server for module : '+ module.id );
|
68 |
+
});
|
69 |
+
}
|
70 |
+
} else {
|
71 |
+
appendAndResolve();
|
72 |
+
}
|
73 |
+
return dfd.promise();
|
74 |
+
},
|
75 |
+
|
76 |
+
//called before rendering a view. Fired in module::renderItemWrapper()
|
77 |
+
//can be overridden to set a specific view template depending on the model properties
|
78 |
+
//@return string
|
79 |
+
//@type can be
|
80 |
+
//Read Update Delete (rud...)
|
81 |
+
//Read Update (ru)
|
82 |
+
//...
|
83 |
+
//@item_model is an object describing the current item model
|
84 |
+
getTemplateSelectorPart : function( type, item_model ) {
|
85 |
+
var module = this, _el;
|
86 |
+
switch( type ) {
|
87 |
+
case 'rudItemPart' :
|
88 |
+
_el = module.rudItemPart;
|
89 |
+
break;
|
90 |
+
case 'ruItemPart' :
|
91 |
+
_el = module.ruItemPart;
|
92 |
+
break;
|
93 |
+
case 'modOptInputList' :
|
94 |
+
_el = module.modOptInputList;
|
95 |
+
break;
|
96 |
+
case 'itemInputList' :
|
97 |
+
_el = _.isFunction( module.itemInputList ) ? module.itemInputList( item_model ) : module.itemInputList;
|
98 |
+
break;
|
99 |
+
}
|
100 |
+
if ( _.isEmpty(_el) ) {
|
101 |
+
throw new Error('No valid template has been found in getTemplateSelectorPart() ' + module.id + '. Aborting');
|
102 |
+
} else {
|
103 |
+
return _el;
|
104 |
+
}
|
105 |
+
},
|
106 |
+
|
107 |
+
//helper
|
108 |
+
//get the $ view DOM el from the item id
|
109 |
+
getViewEl : function( id ) {
|
110 |
+
var module = this;
|
111 |
+
return $( '[data-id = "' + id + '"]', module.container );
|
112 |
+
},
|
113 |
+
|
114 |
+
|
115 |
+
//fired on add_item
|
116 |
+
//fired on views_sorted
|
117 |
+
closeAllItems : function( id ) {
|
118 |
+
var module = this,
|
119 |
+
_current_collection = _.clone( module.itemCollection() ),
|
120 |
+
_filtered_collection = _.filter( _current_collection , function( mod) { return mod.id != id; } );
|
121 |
+
|
122 |
+
_.each( _filtered_collection, function( _item ) {
|
123 |
+
if ( module.czr_Item.has(_item.id) && 'expanded' == module.czr_Item(_item.id)._getViewState(_item.id) )
|
124 |
+
module.czr_Item( _item.id ).viewState.set( 'closed' ); // => will fire the cb toggleItemExpansion
|
125 |
+
} );
|
126 |
+
|
127 |
+
// 'czr-all-items-closed' has been introduced when coding the Simple Nimble slider module. @see https://github.com/presscustomizr/nimble-builder/issues/82
|
128 |
+
// When using the text editor in the items of in a multi-item module
|
129 |
+
// We need to clear the editor instances each time all items are closed, before opening a new one
|
130 |
+
api.trigger('czr-all-items-closed', { module_id : module.id } );
|
131 |
+
return this;
|
132 |
+
},
|
133 |
+
|
134 |
+
|
135 |
+
//make sure a given jQuery block is fully visible
|
136 |
+
//@param $(el)
|
137 |
+
_adjustScrollExpandedBlock : function( $_block_el, adjust ) {
|
138 |
+
if ( ! $_block_el.length || _.isUndefined( this.getModuleSection() ) )
|
139 |
+
return;
|
140 |
+
var module = this,
|
141 |
+
$_moduleSection = $( '.accordion-section-content', module.section.container ),//was api.section( control.section() )
|
142 |
+
_currentScrollTopVal = $_moduleSection.scrollTop(),
|
143 |
+
_scrollDownVal,
|
144 |
+
_adjust = adjust || 90;
|
145 |
+
|
146 |
+
setTimeout( function() {
|
147 |
+
if ( ( $_block_el.offset().top + $_block_el.height() + _adjust ) > $(window.top).height() ) {
|
148 |
+
_scrollDownVal = $_block_el.offset().top + $_block_el.height() + _adjust - $(window.top).height();
|
149 |
+
if ( _scrollDownVal > 0 ) {
|
150 |
+
$_moduleSection.animate({
|
151 |
+
scrollTop: _currentScrollTopVal + _scrollDownVal
|
152 |
+
}, 500);
|
153 |
+
}
|
154 |
+
}
|
155 |
+
}, 50);
|
156 |
+
},
|
157 |
+
|
158 |
+
|
159 |
+
|
160 |
+
//close alert wrapper
|
161 |
+
//+ deactivate the icon
|
162 |
+
closeRemoveDialogs : function() {
|
163 |
+
var module = this;
|
164 |
+
if ( ! _.isArray( module.itemCollection() ) )
|
165 |
+
return;
|
166 |
+
|
167 |
+
module.czr_Item.each( function( _item_ ) {
|
168 |
+
_item_.removeDialogVisible( false );
|
169 |
+
});
|
170 |
+
|
171 |
+
// $('.' + module.control.css_attr.remove_alert_wrapper, module.container ).each( function() {
|
172 |
+
// if ( $(this).hasClass('open') ) {
|
173 |
+
// $(this).slideToggle( {
|
174 |
+
// duration : 100,
|
175 |
+
// done : function() {
|
176 |
+
// $(this).toggleClass('open' , false );
|
177 |
+
// //deactivate the icons
|
178 |
+
// $(this).siblings().find('.' + module.control.css_attr.display_alert_btn).toggleClass('active' , false );
|
179 |
+
// }
|
180 |
+
// } );
|
181 |
+
// }
|
182 |
+
// });
|
183 |
+
return this;
|
184 |
+
},
|
185 |
+
|
186 |
+
|
187 |
+
// fired when module.isReady.done
|
188 |
+
// if sortable is 'true' on registration
|
189 |
+
// default is false
|
190 |
+
_makeItemsSortable : function(obj) {
|
191 |
+
if ( wp.media.isTouchDevice || ! $.fn.sortable )
|
192 |
+
return;
|
193 |
+
var module = this;
|
194 |
+
$( '.' + module.control.css_attr.items_wrapper, module.container ).sortable( {
|
195 |
+
handle: '.' + module.control.css_attr.item_sort_handle,
|
196 |
+
start: function() {},
|
197 |
+
update: function( event, ui ) {
|
198 |
+
var _sortedCollectionReact = function() {
|
199 |
+
if ( _.has(module, 'preItem') ) {
|
200 |
+
module.preItemExpanded.set(false);
|
201 |
+
}
|
202 |
+
|
203 |
+
module.closeAllItems().closeRemoveDialogs();
|
204 |
+
var refreshPreview = function() {
|
205 |
+
api.previewer.refresh();
|
206 |
+
};
|
207 |
+
//refreshes the preview frame :
|
208 |
+
//1) only needed if transport is postMessage, because is triggered by wp otherwise
|
209 |
+
//2) only needed when : add, remove, sort item(s).
|
210 |
+
//var isItemUpdate = ( _.size(from) == _.size(to) ) && ! _.isEmpty( _.difference(from, to) );
|
211 |
+
if ( 'postMessage' == api(module.control.id).transport && ! api.CZR_Helpers.hasPartRefresh( module.control.id ) ) {
|
212 |
+
refreshPreview = _.debounce( refreshPreview, 500 );//500ms are enough
|
213 |
+
refreshPreview();
|
214 |
+
}
|
215 |
+
|
216 |
+
module.trigger( 'item-collection-sorted' );
|
217 |
+
};
|
218 |
+
module._getSortedDOMItemCollection()
|
219 |
+
.done( function( _collection_ ) {
|
220 |
+
module.itemCollection.set( _collection_ );
|
221 |
+
})
|
222 |
+
.then( function() {
|
223 |
+
_sortedCollectionReact();
|
224 |
+
});
|
225 |
+
//refreshes the preview frame, only if the associated setting is a postMessage transport one, with no partial refresh
|
226 |
+
// if ( 'postMessage' == api( module.control.id ).transport && ! api.CZR_Helpers.hasPartRefresh( module.control.id ) ) {
|
227 |
+
// _.delay( function() { api.previewer.refresh(); }, 100 );
|
228 |
+
// }
|
229 |
+
}//update
|
230 |
+
}
|
231 |
+
);
|
232 |
+
},
|
233 |
+
|
234 |
+
|
235 |
+
|
236 |
+
/*-----------------------------------------------
|
237 |
+
* TABS NAVIGATION IN ITEMS AND MODOPT
|
238 |
+
------------------------------------------------*/
|
239 |
+
//This method is fired on tab click
|
240 |
+
// IMPORTANT : the this is the item or the modopt instance. NOT the module.
|
241 |
+
// =>This method has been added to the module constructor to avoid repeating the code in two places because it is used both in items and modOpts
|
242 |
+
// @return void()
|
243 |
+
toggleTabVisibility : function( tabIdSwitchedTo ) {
|
244 |
+
var inputParent = this,
|
245 |
+
tabs = $( inputParent.container ).find('li'),
|
246 |
+
content_items = $( inputParent.container ).find('section');
|
247 |
+
//tabIdSwitchedTo = $( args.dom_event.currentTarget, args.dom_el ).attr('data-tab-id');
|
248 |
+
|
249 |
+
$( '.tabs nav li', inputParent.container ).each( function() {
|
250 |
+
$(this).removeClass('tab-current').addClass('tab-inactive');
|
251 |
+
});
|
252 |
+
$( inputParent.container ).find('li[data-tab-id="' + tabIdSwitchedTo + '"]').addClass('tab-current').removeClass('tab-inactive');
|
253 |
+
|
254 |
+
$( 'section', inputParent.container ).each( function() {
|
255 |
+
$(this).removeClass('content-current');
|
256 |
+
});
|
257 |
+
$( inputParent.container ).find('section[id="' + tabIdSwitchedTo + '"]').addClass('content-current');
|
258 |
+
},
|
259 |
+
|
260 |
+
// @return void()
|
261 |
+
// the inputParent.container (item or modOpt) is now available ar this stage
|
262 |
+
// Setup the tabs navigation
|
263 |
+
//=> Make sure the first tab is the current visible one
|
264 |
+
setupTabNav : function() {
|
265 |
+
var inputParent = this,
|
266 |
+
preProcessTabs = function() {
|
267 |
+
var dfd = $.Deferred(),
|
268 |
+
$tabs = $( '.tabs nav li', inputParent.container );
|
269 |
+
|
270 |
+
$tabs.each( function() {
|
271 |
+
$(this).removeClass('tab-current').addClass('tab-inactive');
|
272 |
+
});
|
273 |
+
$tabs.first().addClass( 'tab-current' ).removeClass('tab-inactive');
|
274 |
+
$( 'section', inputParent.container ).first().addClass( 'content-current' );
|
275 |
+
//set the layout class based on the number of tabs
|
276 |
+
var _nb = $tabs.length;
|
277 |
+
$tabs.each( function() {
|
278 |
+
$(this).addClass( _nb > 0 ? 'cols-' + _nb : '' );
|
279 |
+
});
|
280 |
+
return dfd.resolve().promise();
|
281 |
+
};
|
282 |
+
setTimeout(
|
283 |
+
function() {
|
284 |
+
preProcessTabs().done( function() {
|
285 |
+
$('.tabs', inputParent.container ).show();
|
286 |
+
});
|
287 |
+
},
|
288 |
+
20//<= introducing a small delay to let jQuery do its preprocessing job
|
289 |
+
);
|
290 |
+
}
|
291 |
+
});//$.extend
|
292 |
+
})( wp.customize , jQuery, _ );
|
assets/czr/fmk/js/base-fmk/1_0_input_item_module_control/1_3_module/_0_0_4_dyn_module_0_init.js
ADDED
@@ -0,0 +1,278 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
//MULTI CONTROL CLASS
|
2 |
+
//extends api.CZRModule
|
3 |
+
//
|
4 |
+
//Setup the collection of items
|
5 |
+
//renders the module view
|
6 |
+
//Listen to items collection changes and update the control setting
|
7 |
+
|
8 |
+
var CZRDynModuleMths = CZRDynModuleMths || {};
|
9 |
+
( function ( api, $, _ ) {
|
10 |
+
$.extend( CZRDynModuleMths, {
|
11 |
+
initialize: function( id, options ) {
|
12 |
+
var module = this;
|
13 |
+
api.CZRModule.prototype.initialize.call( module, id, options );
|
14 |
+
|
15 |
+
//extend the module with new template Selectors
|
16 |
+
$.extend( module, {
|
17 |
+
itemPreAddEl : ''//is specific for each crud module
|
18 |
+
} );
|
19 |
+
|
20 |
+
module.preItemsWrapper = '';//will store the pre items wrapper
|
21 |
+
|
22 |
+
//PRE MODEL VIEW STATE
|
23 |
+
// => will control the rendering / destruction of the DOM view
|
24 |
+
// => the instantiation / destruction of the input Value collection
|
25 |
+
module.preItemExpanded = new api.Value( false );
|
26 |
+
|
27 |
+
//EXTENDS THE DEFAULT MONO MODEL CONSTRUCTOR WITH NEW METHODS
|
28 |
+
//=> like remove item
|
29 |
+
//module.itemConstructor = api.CZRItem.extend( module.CZRItemDynamicMths || {} );
|
30 |
+
|
31 |
+
//default success message when item added
|
32 |
+
module.itemAddedMessage = serverControlParams.i18n.successMessage;
|
33 |
+
|
34 |
+
////////////////////////////////////////////////////
|
35 |
+
/// MODULE DOM EVENT MAP
|
36 |
+
////////////////////////////////////////////////////<
|
37 |
+
// addItem utility
|
38 |
+
// @return void()
|
39 |
+
// @param params : { dom_el : {}, dom_event : {}, event : {}, model {} }
|
40 |
+
var _doAddItem = function( params ) {
|
41 |
+
module.addItem( params ).done( function( item_id ) {
|
42 |
+
module.czr_Item( item_id , function( _item_ ) {
|
43 |
+
_item_.embedded.then( function() {
|
44 |
+
_item_.viewState( 'expanded' );
|
45 |
+
});
|
46 |
+
});
|
47 |
+
})
|
48 |
+
.fail( function( error ) {
|
49 |
+
api.errare( 'module.addItem failed on add_item', error );
|
50 |
+
});
|
51 |
+
};
|
52 |
+
|
53 |
+
module.userEventMap = new api.Value( [
|
54 |
+
//pre add new item : open the dialog box
|
55 |
+
{
|
56 |
+
trigger : 'click keydown',
|
57 |
+
selector : [ '.' + module.control.css_attr.open_pre_add_btn, '.' + module.control.css_attr.cancel_pre_add_btn ].join(','),
|
58 |
+
name : 'pre_add_item',
|
59 |
+
actions : [
|
60 |
+
'closeAllItems',
|
61 |
+
'closeRemoveDialogs',
|
62 |
+
// toggles the visibility of the Remove View Block
|
63 |
+
// => will render or destroy the pre item view
|
64 |
+
// @param : obj = { event : {}, item : {}, view : ${} }
|
65 |
+
function( params ) {
|
66 |
+
var module = this,
|
67 |
+
canWe = { addTheItem : true };
|
68 |
+
// allow remote filtering of the condition for addition
|
69 |
+
module.trigger( 'is-item-addition-possible', canWe );
|
70 |
+
|
71 |
+
// if the module has a pre-item, let's expand it, otherwise, let's add the item right away
|
72 |
+
if ( canWe.addTheItem && module.hasPreItem ) {
|
73 |
+
module.preItemExpanded.set( ! module.preItemExpanded() );
|
74 |
+
} else {
|
75 |
+
_doAddItem( params );
|
76 |
+
}
|
77 |
+
},
|
78 |
+
],
|
79 |
+
},
|
80 |
+
//add new item
|
81 |
+
{
|
82 |
+
trigger : 'click keydown',
|
83 |
+
selector : '.' + module.control.css_attr.add_new_btn, //'.czr-add-new',
|
84 |
+
name : 'add_item',
|
85 |
+
//@param params : { dom_el : {}, dom_event : {}, event : {}, model {} }
|
86 |
+
actions : function( params ) {
|
87 |
+
module.closeRemoveDialogs( params ).closeAllItems( params );
|
88 |
+
_doAddItem( params );
|
89 |
+
}
|
90 |
+
}
|
91 |
+
]);//module.userEventMap
|
92 |
+
},//initialize()
|
93 |
+
|
94 |
+
|
95 |
+
|
96 |
+
//When the control is embedded on the page, this method is fired in api.CZRBaseModuleControl:ready()
|
97 |
+
//=> right after the module is instantiated.
|
98 |
+
ready : function() {
|
99 |
+
var module = this;
|
100 |
+
//Setup the module event listeners
|
101 |
+
module.setupDOMListeners( module.userEventMap() , { dom_el : module.container } );
|
102 |
+
|
103 |
+
// Pre Item Value => used to store the preItem model
|
104 |
+
module.preItem = new api.Value( module.getDefaultItemModel() );
|
105 |
+
|
106 |
+
// Action on pre Item expansion / collapsing
|
107 |
+
module.preItemExpanded.callbacks.add( function( isExpanded ) {
|
108 |
+
if ( isExpanded ) {
|
109 |
+
module.renderPreItemView()
|
110 |
+
.done( function( $preWrapper ) {
|
111 |
+
module.preItemsWrapper = $preWrapper;
|
112 |
+
//Re-initialize the pre item model
|
113 |
+
module.preItem( module.getDefaultItemModel() );
|
114 |
+
|
115 |
+
module.trigger( 'before-pre-item-input-collection-setup' );
|
116 |
+
// Setup the pre item input collection from dom
|
117 |
+
module.setupPreItemInputCollection();
|
118 |
+
|
119 |
+
})
|
120 |
+
.fail( function( message ) {
|
121 |
+
api.errorLog( 'Pre-Item : ' + message );
|
122 |
+
});
|
123 |
+
} else {
|
124 |
+
$.when( module.preItemsWrapper.remove() ).done( function() {
|
125 |
+
module.preItem.czr_Input = {};
|
126 |
+
module.preItemsWrapper = null;
|
127 |
+
module.trigger( 'pre-item-input-collection-destroyed' );
|
128 |
+
});
|
129 |
+
}
|
130 |
+
|
131 |
+
// Expand / Collapse
|
132 |
+
module._togglePreItemViewExpansion( isExpanded );
|
133 |
+
});
|
134 |
+
|
135 |
+
api.CZRModule.prototype.ready.call( module );//fires the parent
|
136 |
+
},//ready()
|
137 |
+
|
138 |
+
|
139 |
+
|
140 |
+
//PRE MODEL INPUTS
|
141 |
+
//fired when preItem is embedded.done()
|
142 |
+
setupPreItemInputCollection : function() {
|
143 |
+
var module = this;
|
144 |
+
|
145 |
+
//Pre item input collection
|
146 |
+
module.preItem.czr_Input = new api.Values();
|
147 |
+
|
148 |
+
//creates the inputs based on the rendered items
|
149 |
+
$('.' + module.control.css_attr.pre_add_wrapper, module.container)
|
150 |
+
.find( '.' + module.control.css_attr.sub_set_wrapper)
|
151 |
+
.each( function( _index ) {
|
152 |
+
var _id = $(this).find('[data-czrtype]').attr('data-czrtype') || 'sub_set_' + _index;
|
153 |
+
//instantiate the input
|
154 |
+
module.preItem.czr_Input.add( _id, new module.inputConstructor( _id, {//api.CZRInput;
|
155 |
+
id : _id,
|
156 |
+
type : $(this).attr('data-input-type'),
|
157 |
+
container : $(this),
|
158 |
+
input_parent : module.preItem,
|
159 |
+
module : module,
|
160 |
+
is_preItemInput : true
|
161 |
+
} ) );
|
162 |
+
|
163 |
+
//fire ready once the input Value() instance is initialized
|
164 |
+
module.preItem.czr_Input( _id ).ready();
|
165 |
+
});//each
|
166 |
+
|
167 |
+
module.trigger( 'pre-item-input-collection-ready' );
|
168 |
+
},
|
169 |
+
|
170 |
+
// Intended to be overriden in a module
|
171 |
+
// introduced in July 2019 to make it simple for a multi-item module to set a default pre-item
|
172 |
+
// typically, in the slider image, this is a way to have a default image when adding an item
|
173 |
+
// @see https://github.com/presscustomizr/nimble-builder/issues/479
|
174 |
+
getPreItem : function() {
|
175 |
+
return this.preItem();
|
176 |
+
},
|
177 |
+
|
178 |
+
|
179 |
+
// overridable method introduced with the flat skope
|
180 |
+
// problem to solve in skope => an item, can't always be instantiated in a given context.
|
181 |
+
itemCanBeInstantiated : function() {
|
182 |
+
return true;
|
183 |
+
},
|
184 |
+
|
185 |
+
//Fired on user Dom action.
|
186 |
+
//the item is manually added.
|
187 |
+
//@return a promise() with the item_id as param
|
188 |
+
//@param params : { dom_el : {}, dom_event : {}, event : {}, model {} }
|
189 |
+
//@param _cloned_item_model = { id : '', title : '', ... }
|
190 |
+
addItem : function( params, _cloned_item_model ) {
|
191 |
+
var dfd = $.Deferred();
|
192 |
+
if ( ! this.itemCanBeInstantiated() ) {
|
193 |
+
return dfd.reject().promise();
|
194 |
+
}
|
195 |
+
var module = this,
|
196 |
+
item_candidate = module.getPreItem(),
|
197 |
+
collapsePreItem = function() {
|
198 |
+
module.preItemExpanded.set( false );
|
199 |
+
//module.toggleSuccessMessage('off');
|
200 |
+
};
|
201 |
+
// June 2021 => introduction of clone item
|
202 |
+
if ( _cloned_item_model && _.has( _cloned_item_model, 'id' ) ) {
|
203 |
+
item_candidate = _cloned_item_model;
|
204 |
+
}
|
205 |
+
if ( _.isEmpty( item_candidate ) || ! _.isObject( item_candidate ) ) {
|
206 |
+
api.errorLog( 'addItem : an item_candidate should be an object and not empty. In : ' + module.id +'. Aborted.' );
|
207 |
+
return dfd.reject().promise();
|
208 |
+
}
|
209 |
+
//display a sucess message if item_candidate is successfully instantiated
|
210 |
+
collapsePreItem = _.debounce( collapsePreItem, 200 );
|
211 |
+
|
212 |
+
//instantiates and fires ready
|
213 |
+
var _doInstantiate_ = function() {
|
214 |
+
var _item_instance_ = module.instantiateItem( item_candidate, true );//true == Added by user
|
215 |
+
if ( _.isFunction( _item_instance_ ) ) {
|
216 |
+
_item_instance_.ready();
|
217 |
+
} else {
|
218 |
+
api.errare( 'populateSavedItemCollection => Could not instantiate item in module ' + module.id , item_candidate );
|
219 |
+
}
|
220 |
+
return _item_instance_;
|
221 |
+
};
|
222 |
+
//adds it to the collection and fire item.ready()
|
223 |
+
if ( serverControlParams.isDevMode ) {
|
224 |
+
_doInstantiate_();
|
225 |
+
} else {
|
226 |
+
try { _doInstantiate_(); } catch( er ) {
|
227 |
+
api.errare( 'populateSavedItemCollection : ' + er );
|
228 |
+
return dfd.reject().promise();
|
229 |
+
}
|
230 |
+
}
|
231 |
+
|
232 |
+
if ( ! module.czr_Item.has( item_candidate.id ) ) {
|
233 |
+
return dfd.reject('populateSavedItemCollection : the item ' + item_candidate.id + ' has not been instantiated in module ' + module.id ).promise();
|
234 |
+
}
|
235 |
+
|
236 |
+
//this iife job is to close the pre item and to maybe refresh the preview
|
237 |
+
//then once done the item view is expanded to start editing it
|
238 |
+
//@return a promise()
|
239 |
+
$.Deferred( function() {
|
240 |
+
var _dfd_ = this;
|
241 |
+
module.czr_Item( item_candidate.id ).isReady.then( function() {
|
242 |
+
//module.toggleSuccessMessage('on');
|
243 |
+
collapsePreItem();
|
244 |
+
|
245 |
+
module.trigger('item-added', item_candidate );
|
246 |
+
|
247 |
+
var resolveWhenPreviewerReady = function() {
|
248 |
+
api.previewer.unbind( 'ready', resolveWhenPreviewerReady );
|
249 |
+
_dfd_.resolve();
|
250 |
+
};
|
251 |
+
//module.doActions( 'item_added_by_user' , module.container, { item : item_candidate , dom_event : params.dom_event } );
|
252 |
+
|
253 |
+
//refresh the preview frame (only needed if transport is postMessage && has no partial refresh set )
|
254 |
+
//must be a dom event not triggered
|
255 |
+
//otherwise we are in the init collection case where the items are fetched and added from the setting in initialize
|
256 |
+
// The property "refresh_on_add_item" is declared when registrating the module to the api.czrModuleMap
|
257 |
+
if ( module.refresh_on_add_item ) {
|
258 |
+
if ( 'postMessage' == api(module.control.id).transport && _.has( params, 'dom_event') && ! _.has( params.dom_event, 'isTrigger' ) && ! api.CZR_Helpers.hasPartRefresh( module.control.id ) ) {
|
259 |
+
// api.previewer.refresh().done( function() {
|
260 |
+
// _dfd_.resolve();
|
261 |
+
// });
|
262 |
+
// It would be better to wait for the refresh promise
|
263 |
+
api.previewer.bind( 'ready', resolveWhenPreviewerReady );
|
264 |
+
api.previewer.refresh();
|
265 |
+
} else {
|
266 |
+
_dfd_.resolve();
|
267 |
+
}
|
268 |
+
} else {
|
269 |
+
_dfd_.resolve();
|
270 |
+
}
|
271 |
+
});
|
272 |
+
}).always( function() {
|
273 |
+
dfd.resolve( item_candidate.id );
|
274 |
+
});
|
275 |
+
return dfd.promise();
|
276 |
+
}
|
277 |
+
});//$.extend
|
278 |
+
})( wp.customize , jQuery, _ );
|
assets/czr/fmk/js/base-fmk/1_0_input_item_module_control/1_3_module/_0_0_4_dyn_module_1_pre_item_views.js
ADDED
@@ -0,0 +1,125 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
//MULTI CONTROL CLASS
|
2 |
+
//extends api.CZRBaseControl
|
3 |
+
//
|
4 |
+
//Setup the collection of items
|
5 |
+
//renders the module view
|
6 |
+
//Listen to items collection changes and update the module setting
|
7 |
+
|
8 |
+
var CZRDynModuleMths = CZRDynModuleMths || {};
|
9 |
+
( function ( api, $, _ ) {
|
10 |
+
$.extend( CZRDynModuleMths, {
|
11 |
+
//////////////////////////////////////////////////
|
12 |
+
/// PRE ADD MODEL DIALOG AND VIEW
|
13 |
+
//////////////////////////////////////////////////
|
14 |
+
renderPreItemView : function( obj ) {
|
15 |
+
var module = this,
|
16 |
+
dfd = $.Deferred(),
|
17 |
+
pre_add_template;
|
18 |
+
|
19 |
+
//is this view already rendered ?
|
20 |
+
if ( _.isObject( module.preItemsWrapper ) && 0 < module.preItemsWrapper.length ) { //was ! _.isEmpty( module.czr_preItem('item_content')() ) )
|
21 |
+
return dfd.resolve( module.preItemsWrapper ).promise();
|
22 |
+
}
|
23 |
+
|
24 |
+
var appendAndResolve = function( _tmpl_ ){
|
25 |
+
//console.log('pre_add_template', _tmpl_ );
|
26 |
+
//do we have an html template and a module container?
|
27 |
+
if ( _.isEmpty( _tmpl_ ) || ! module.container ) {
|
28 |
+
dfd.reject( 'renderPreItemView => Missing html template for module : '+ module.id );
|
29 |
+
}
|
30 |
+
|
31 |
+
var $_pre_add_el = $('.' + module.control.css_attr.pre_add_item_content, module.container );
|
32 |
+
|
33 |
+
$_pre_add_el.prepend( $('<div>', { class : 'pre-item-wrapper'} ) );
|
34 |
+
$_pre_add_el.find('.pre-item-wrapper').append( _tmpl_ );
|
35 |
+
|
36 |
+
//say it
|
37 |
+
dfd.resolve( $_pre_add_el.find('.pre-item-wrapper') ).promise();
|
38 |
+
};
|
39 |
+
|
40 |
+
// do we have view template script ?
|
41 |
+
// if yes, let's use it <= Old way
|
42 |
+
// Otherwise let's fetch the html template from the server
|
43 |
+
if ( ! _.isEmpty( module.itemPreAddEl ) ) {
|
44 |
+
if ( 1 > $( '#tmpl-' + module.itemPreAddEl ).length ) {
|
45 |
+
dfd.reject( 'renderPreItemView => Missing itemPreAddEl or template in module '+ module.id );
|
46 |
+
}
|
47 |
+
// parse the html
|
48 |
+
appendAndResolve( wp.template( module.itemPreAddEl )() );
|
49 |
+
} else {
|
50 |
+
api.CZR_Helpers.getModuleTmpl( {
|
51 |
+
tmpl : 'pre-item',
|
52 |
+
module_type: module.module_type,
|
53 |
+
module_id : module.id,
|
54 |
+
control_id : module.control.id
|
55 |
+
} ).done( function( _serverTmpl_ ) {
|
56 |
+
//console.log( 'success response =>', _serverTmpl_);
|
57 |
+
appendAndResolve( api.CZR_Helpers.parseTemplate( _serverTmpl_ )() );
|
58 |
+
}).fail( function( _r_ ) {
|
59 |
+
//console.log( 'fail response =>', _r_);
|
60 |
+
dfd.reject( [ 'renderPreItemView for module : ', module.id , _r_ ].join(' ') );
|
61 |
+
});
|
62 |
+
}
|
63 |
+
return dfd.promise();
|
64 |
+
},
|
65 |
+
|
66 |
+
//@return $ el of the pre Item view
|
67 |
+
_getPreItemView : function() {
|
68 |
+
var module = this;
|
69 |
+
return $('.' + module.control.css_attr.pre_add_item_content, module.container );
|
70 |
+
},
|
71 |
+
|
72 |
+
|
73 |
+
//callback of module.preItemExpanded
|
74 |
+
//@_is_expanded = boolean.
|
75 |
+
_togglePreItemViewExpansion : function( _is_expanded ) {
|
76 |
+
var module = this,
|
77 |
+
$_pre_add_el = $( '.' + module.control.css_attr.pre_add_item_content, module.container );
|
78 |
+
|
79 |
+
//toggle it
|
80 |
+
$_pre_add_el.slideToggle( {
|
81 |
+
duration : 200,
|
82 |
+
done : function() {
|
83 |
+
var $_btn = $( '.' + module.control.css_attr.open_pre_add_btn, module.container );
|
84 |
+
|
85 |
+
$(this).toggleClass('open' , _is_expanded );
|
86 |
+
//switch icons
|
87 |
+
if ( _is_expanded )
|
88 |
+
$_btn.find('.fas').removeClass('fa-plus-square').addClass('fa-minus-square');
|
89 |
+
else
|
90 |
+
$_btn.find('.fas').removeClass('fa-minus-square').addClass('fa-plus-square');
|
91 |
+
|
92 |
+
//set the active class to the btn
|
93 |
+
$_btn.toggleClass( 'active', _is_expanded );
|
94 |
+
|
95 |
+
//set the adding_new class to the module container wrapper
|
96 |
+
$( module.container ).toggleClass( module.control.css_attr.adding_new, _is_expanded );
|
97 |
+
//make sure it's fully visible
|
98 |
+
module._adjustScrollExpandedBlock( $(this), 120 );
|
99 |
+
}//done
|
100 |
+
} );
|
101 |
+
},
|
102 |
+
|
103 |
+
|
104 |
+
toggleSuccessMessage : function( status ) {
|
105 |
+
var module = this,
|
106 |
+
_message = module.itemAddedMessage,
|
107 |
+
$_pre_add_wrapper = $('.' + module.control.css_attr.pre_add_wrapper, module.container );
|
108 |
+
$_success_wrapper = $('.' + module.control.css_attr.pre_add_success, module.container );
|
109 |
+
|
110 |
+
if ( 'on' == status ) {
|
111 |
+
//write message
|
112 |
+
$_success_wrapper.find('p').text(_message);
|
113 |
+
|
114 |
+
//set various properties
|
115 |
+
$_success_wrapper.css('z-index', 1000001 )
|
116 |
+
.css('height', $_pre_add_wrapper.height() + 'px' )
|
117 |
+
.css('line-height', $_pre_add_wrapper.height() + 'px');
|
118 |
+
} else {
|
119 |
+
$_success_wrapper.attr('style','');
|
120 |
+
}
|
121 |
+
module.container.toggleClass('czr-model-added', 'on' == status );
|
122 |
+
return this;
|
123 |
+
}
|
124 |
+
});//$.extend//CZRBaseControlMths
|
125 |
+
})( wp.customize , jQuery, _ );
|
assets/czr/fmk/js/base-fmk/1_0_input_item_module_control/1_4_control/_0_1_0_base_control.js
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
//BASE CONTROL CLASS
|
2 |
+
//extends api.Control
|
3 |
+
//define a set of methods, mostly helpers, to extend the base WP control class
|
4 |
+
//this will become our base constructor for main complex controls
|
5 |
+
//EARLY SETUP
|
6 |
+
|
7 |
+
var CZRBaseControlMths = CZRBaseControlMths || {};
|
8 |
+
( function ( api, $, _ ) {
|
9 |
+
$.extend( CZRBaseControlMths, {
|
10 |
+
initialize: function( id, options ) {
|
11 |
+
var control = this;
|
12 |
+
//add a shortcut to the css properties declared in the php controls
|
13 |
+
control.css_attr = _.has( serverControlParams , 'css_attr') ? serverControlParams.css_attr : {};
|
14 |
+
api.Control.prototype.initialize.call( control, id, options );
|
15 |
+
|
16 |
+
//When a partial refresh is done we need to send back all postMessage input to the preview
|
17 |
+
//=> makes sure that all post message inputs not yet saved in db are properly applied
|
18 |
+
control.bind( 'czr-partial-refresh-done', function() {
|
19 |
+
if ( _.has( control, 'czr_moduleCollection' ) ) {
|
20 |
+
_.each( control.czr_moduleCollection(), function( _mod_ ) {
|
21 |
+
if ( ! control.czr_Module( _mod_.id ) )
|
22 |
+
return;
|
23 |
+
|
24 |
+
control.czr_Module( _mod_.id ).sendModuleInputsToPreview( { isPartialRefresh : true } );
|
25 |
+
});
|
26 |
+
}
|
27 |
+
});
|
28 |
+
},
|
29 |
+
|
30 |
+
//@return void()
|
31 |
+
refreshPreview : function( obj ) {
|
32 |
+
this.previewer.refresh();
|
33 |
+
}
|
34 |
+
});//$.extend//CZRBaseControlMths
|
35 |
+
})( wp.customize , jQuery, _ );
|
assets/czr/fmk/js/base-fmk/1_0_input_item_module_control/1_4_control/base_module_control/_0_1_0_base_module_control_init.js
ADDED
@@ -0,0 +1,269 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
//BASE CONTROL CLASS
|
3 |
+
//extends api.CZRBaseControl
|
4 |
+
//define a set of methods, mostly helpers, to extend the base WP control class
|
5 |
+
//this will become our base constructor for main complex controls
|
6 |
+
//EARLY SETUP
|
7 |
+
var CZRBaseModuleControlMths = CZRBaseModuleControlMths || {};
|
8 |
+
( function ( api, $, _ ) {
|
9 |
+
$.extend( CZRBaseModuleControlMths, {
|
10 |
+
initialize: function( id, options ) {
|
11 |
+
var control = this;
|
12 |
+
if ( ! api.has( id ) ) {
|
13 |
+
throw new Error( 'Missing a registered setting for control : ' + id );
|
14 |
+
}
|
15 |
+
|
16 |
+
|
17 |
+
control.czr_Module = new api.Values();
|
18 |
+
|
19 |
+
//czr_collection stores the module collection
|
20 |
+
control.czr_moduleCollection = new api.Value();
|
21 |
+
control.czr_moduleCollection.set([]);
|
22 |
+
|
23 |
+
//let's store the state of the initial module collection
|
24 |
+
control.moduleCollectionReady = $.Deferred();
|
25 |
+
//and listen to changes when it's ready
|
26 |
+
control.moduleCollectionReady.done( function( obj ) {
|
27 |
+
//if the module is not registered yet for a single module control
|
28 |
+
//=> push it to the collection now, before listening to the module collection changes
|
29 |
+
// if ( ! control.isModuleRegistered( module.id ) ) {
|
30 |
+
// control.updateModulesCollection( { module : constructorOptions } );
|
31 |
+
// }
|
32 |
+
|
33 |
+
//LISTEN TO MODULE COLLECTION
|
34 |
+
control.czr_moduleCollection.callbacks.add( function() { return control.moduleCollectionReact.apply( control, arguments ); } );
|
35 |
+
|
36 |
+
//control.removeModule( _mod );
|
37 |
+
} );
|
38 |
+
|
39 |
+
api.CZRBaseControl.prototype.initialize.call( control, id, options );
|
40 |
+
|
41 |
+
//close any open item and dialog boxes on section expansion
|
42 |
+
api.section( control.section(), function( _section_ ) {
|
43 |
+
_section_.expanded.bind(function(to) {
|
44 |
+
control.czr_Module.each( function( _mod ){
|
45 |
+
_mod.closeAllItems().closeRemoveDialogs();
|
46 |
+
if ( _.has( _mod, 'preItem' ) ) {
|
47 |
+
_mod.preItemExpanded(false);
|
48 |
+
}
|
49 |
+
});
|
50 |
+
});
|
51 |
+
});
|
52 |
+
|
53 |
+
},
|
54 |
+
|
55 |
+
|
56 |
+
|
57 |
+
|
58 |
+
//////////////////////////////////
|
59 |
+
///READY = CONTROL INSTANTIATED AND DOM ELEMENT EMBEDDED ON THE PAGE
|
60 |
+
///FIRED BEFORE API READY ? still true ?
|
61 |
+
//
|
62 |
+
// WP CORE => After the control is embedded on the page, invoke the "ready" method.
|
63 |
+
// control.deferred.embedded.done( function () {
|
64 |
+
// control.linkElements(); // Link any additional elements after template is rendered by renderContent().
|
65 |
+
// control.setupNotifications();
|
66 |
+
// control.ready();
|
67 |
+
// });
|
68 |
+
//////////////////////////////////
|
69 |
+
ready : function() {
|
70 |
+
var control = this,
|
71 |
+
single_module = {},
|
72 |
+
savedModules;
|
73 |
+
|
74 |
+
// Get the saved module and its initial items, get from the db of when dynamically registrating the setting control.
|
75 |
+
try { savedModules = control.getSavedModules(); } catch( er ) {
|
76 |
+
api.errare( 'api.CZRBaseControl::ready() => error on control.getSavedModules()', er );
|
77 |
+
control.moduleCollectionReady.reject();
|
78 |
+
return;
|
79 |
+
}
|
80 |
+
|
81 |
+
// inits the collection with the saved module => there's only one module to instantiate in this case.
|
82 |
+
// populates the collection with the saved module
|
83 |
+
_.each( control.getSavedModules() , function( _mod, _key ) {
|
84 |
+
//stores it
|
85 |
+
single_module = _mod;
|
86 |
+
|
87 |
+
//adds it to the collection
|
88 |
+
//=> it will be fired ready usually when the control section is expanded
|
89 |
+
if ( serverControlParams.isDevMode ) {
|
90 |
+
control.instantiateModule( _mod, {} );
|
91 |
+
} else {
|
92 |
+
try { control.instantiateModule( _mod, {} ); } catch( er ) {
|
93 |
+
api.errare( 'api.CZRBaseControl::Failed to instantiate module ' + _mod.id , er );
|
94 |
+
return;
|
95 |
+
}
|
96 |
+
}
|
97 |
+
|
98 |
+
//adds the module name to the control container element
|
99 |
+
control.container.attr('data-module', _mod.id );
|
100 |
+
});
|
101 |
+
//the module collection is ready
|
102 |
+
control.moduleCollectionReady.resolve( single_module );
|
103 |
+
},
|
104 |
+
|
105 |
+
|
106 |
+
|
107 |
+
|
108 |
+
|
109 |
+
|
110 |
+
|
111 |
+
|
112 |
+
|
113 |
+
//////////////////////////////////
|
114 |
+
/// VARIOUS HELPERS
|
115 |
+
//////////////////////////////////
|
116 |
+
///
|
117 |
+
//@return the default API model {} needed to instantiate a module
|
118 |
+
getDefaultModuleApiModel : function() {
|
119 |
+
//if embedded in a control, amend the common model with the section id
|
120 |
+
return {
|
121 |
+
id : '',//module.id,
|
122 |
+
module_type : '',//module.module_type,
|
123 |
+
modOpt : {},//the module modOpt property, typically high level properties that area applied to all items of the module
|
124 |
+
items : [],//$.extend( true, {}, module.items ),
|
125 |
+
crud : false,
|
126 |
+
hasPreItem : true,//a crud module has a pre item by default
|
127 |
+
refresh_on_add_item : true,// the preview is refreshed on item add
|
128 |
+
multi_item : false,
|
129 |
+
sortable : false,//<= a module can be multi-item but not necessarily sortable
|
130 |
+
control : {},//control,
|
131 |
+
section : ''
|
132 |
+
};
|
133 |
+
},
|
134 |
+
|
135 |
+
|
136 |
+
// @return the collection [] of saved module(s) to instantiate
|
137 |
+
// This method does not make sure that the module model is ready for API.
|
138 |
+
// => it just returns an array of saved module candidates to instantiate.
|
139 |
+
//
|
140 |
+
// Before instantiation, we will make sure that all required property are defined for the modules with the method control.prepareModuleForAPI()
|
141 |
+
// control : control,
|
142 |
+
// crud : bool
|
143 |
+
// id : '',
|
144 |
+
// items : [], module.items,
|
145 |
+
// modOpt : {}
|
146 |
+
// module_type : module.module_type,
|
147 |
+
// multi_item : bool
|
148 |
+
// section : module.section,
|
149 |
+
getSavedModules : function() {
|
150 |
+
var control = this,
|
151 |
+
_savedModulesCandidates = [],
|
152 |
+
_module_type = control.params.module_type,
|
153 |
+
_raw_saved_module_val = [],
|
154 |
+
_saved_items = [],
|
155 |
+
_saved_modOpt = {};
|
156 |
+
|
157 |
+
// What is the current server saved value for this setting?
|
158 |
+
// in a normal case, it should be an array of saved properties
|
159 |
+
// But it might not be if coming from a previous option system.
|
160 |
+
// => let's normalize it.
|
161 |
+
//
|
162 |
+
// First let's perform a quick check on the current saved db val.
|
163 |
+
// If the module is not multi-item, the saved value should be an object or empty if not set yet
|
164 |
+
if ( ! api.CZR_Helpers.isMultiItemModule( _module_type ) && ! _.isEmpty( api( control.id )() ) && ! _.isObject( api( control.id )() ) ) {
|
165 |
+
api.errare('api.CZRBaseControl::getSavedModules => module Control Init for ' + control.id + ' : a mono item module control value should be an object if not empty.');
|
166 |
+
}
|
167 |
+
|
168 |
+
//SPLIT ITEMS [] and MODOPT {}
|
169 |
+
//In database, items and modOpt are saved in the same option array.
|
170 |
+
//If the module has modOpt ( the slider module for example ), the modOpt are described by an object which is always unshifted at the beginning of the setting value.
|
171 |
+
|
172 |
+
//the raw DB setting value is an array : modOpt {} + the saved items :
|
173 |
+
////META IS THE FIRST ARRAY ELEMENT: A modOpt has no unique id and has the property is_modOpt set to true
|
174 |
+
//[
|
175 |
+
// is_mod_opt : true //<= inform us that this is not an item but a modOpt
|
176 |
+
//],
|
177 |
+
////THEN COME THE ITEMS
|
178 |
+
//[
|
179 |
+
// id : "czr_slide_module_0"
|
180 |
+
// slide-background : 21,
|
181 |
+
// ....
|
182 |
+
// ],
|
183 |
+
// [
|
184 |
+
// id : "czr_slide_module_1"
|
185 |
+
// slide-background : 21,
|
186 |
+
// ....
|
187 |
+
// ]
|
188 |
+
// [...]
|
189 |
+
|
190 |
+
// POPULATE THE ITEMS [] and the MODOPT {} FROM THE RAW DB SAVED SETTING VAL
|
191 |
+
// OR with the value used when registrating the module
|
192 |
+
//
|
193 |
+
// Important note :
|
194 |
+
// The items should be turned into a collection of items [].
|
195 |
+
var settingId = api.CZR_Helpers.getControlSettingId( control.id ),
|
196 |
+
settingVal = api( settingId )();
|
197 |
+
|
198 |
+
// TO FIX
|
199 |
+
if ( _.isEmpty( settingVal ) ) {
|
200 |
+
_raw_saved_module_val = [];
|
201 |
+
} else {
|
202 |
+
_raw_saved_module_val = _.isArray( settingVal ) ? settingVal : [ settingVal ];
|
203 |
+
}
|
204 |
+
|
205 |
+
|
206 |
+
_.each( _raw_saved_module_val, function( item_or_mod_opt_candidate , key ) {
|
207 |
+
if ( ! _.isObject( item_or_mod_opt_candidate ) ) {
|
208 |
+
api.errare( 'api.CZRBaseControl::::getSavedModules => an item must be an object in control ' + control.id + ' => module type => ' + control.params.module_type, _raw_saved_module_val );
|
209 |
+
return;
|
210 |
+
}
|
211 |
+
|
212 |
+
// An item or modOpt can be empty on init
|
213 |
+
// But if not empty, it has to be an associative object, with keys that are string typed
|
214 |
+
// Fixes the case where an item { null } was accepted
|
215 |
+
// https://github.com/presscustomizr/themes-customizer-fmk/issues/46
|
216 |
+
if ( ! _.isEmpty( item_or_mod_opt_candidate ) ) {
|
217 |
+
_.each( item_or_mod_opt_candidate, function( prop, _key_ ) {
|
218 |
+
if ( ! _.isString( _key_ ) ) {
|
219 |
+
api.errare( 'api.CZRBaseControl::::getSavedModules => item not well formed in control : ' + control.id + ' => module type => ' + control.params.module_type, _raw_saved_module_val );
|
220 |
+
return;
|
221 |
+
}
|
222 |
+
});
|
223 |
+
}
|
224 |
+
|
225 |
+
|
226 |
+
// Module options, if enabled, are always saved as first key
|
227 |
+
if ( api.CZR_Helpers.hasModuleModOpt( _module_type ) && 0*0 === key ) {
|
228 |
+
// a saved module mod_opt object should not have an id
|
229 |
+
if ( _.has( item_or_mod_opt_candidate, 'id') ) {
|
230 |
+
api.errare( 'api.CZRBaseControl::getSavedModules : the module ' + _module_type + ' in control ' + control.id + ' has no mod_opt defined while it should.' );
|
231 |
+
} else {
|
232 |
+
_saved_modOpt = item_or_mod_opt_candidate;
|
233 |
+
}
|
234 |
+
}
|
235 |
+
// else {
|
236 |
+
// _saved_items.push( item_or_mod_opt_candidate );
|
237 |
+
// }
|
238 |
+
//Until April 30th 2018, was :
|
239 |
+
//A modOpt has the property is_modOpt set to true
|
240 |
+
if ( ! _.has( item_or_mod_opt_candidate, 'is_mod_opt' ) ) {
|
241 |
+
_saved_items.push( item_or_mod_opt_candidate );
|
242 |
+
}
|
243 |
+
});
|
244 |
+
|
245 |
+
|
246 |
+
// This is a collection with one module
|
247 |
+
// Note : @todo : the fact that the module are saved as a collection is not relevant anymore
|
248 |
+
// This was introduced back in 2016 when building the first version of the section plugin.
|
249 |
+
// With Nimble, a control can have one module only.
|
250 |
+
_savedModulesCandidates.push({
|
251 |
+
id : api.CZR_Helpers.getOptionName( control.id ) + '_' + control.params.type,
|
252 |
+
module_type : control.params.module_type,
|
253 |
+
section : control.section(),
|
254 |
+
modOpt : $.extend( true, {} , _saved_modOpt ),//disconnect with a deep cloning
|
255 |
+
items : $.extend( true, [] , _saved_items )//disconnect with a deep cloning
|
256 |
+
});
|
257 |
+
|
258 |
+
return _savedModulesCandidates;
|
259 |
+
},
|
260 |
+
|
261 |
+
|
262 |
+
//this helper allows to check if a module has been registered in the collection
|
263 |
+
//no matter if it's not instantiated yet
|
264 |
+
isModuleRegistered : function( id_candidate ) {
|
265 |
+
var control = this;
|
266 |
+
return ! _.isUndefined( _.findWhere( control.czr_moduleCollection(), { id : id_candidate}) );
|
267 |
+
}
|
268 |
+
});//$.extend//CZRBaseControlMths
|
269 |
+
})( wp.customize , jQuery, _ );
|
assets/czr/fmk/js/base-fmk/1_0_input_item_module_control/1_4_control/base_module_control/_0_1_1_base_module_control_instantiate.js
ADDED
@@ -0,0 +1,269 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
//BASE CONTROL CLASS
|
3 |
+
//extends api.CZRBaseControl
|
4 |
+
//define a set of methods, mostly helpers, to extend the base WP control class
|
5 |
+
//this will become our base constructor for main complex controls
|
6 |
+
//EARLY SETUP
|
7 |
+
var CZRBaseModuleControlMths = CZRBaseModuleControlMths || {};
|
8 |
+
( function ( api, $, _ ) {
|
9 |
+
$.extend( CZRBaseModuleControlMths, {
|
10 |
+
//@param : module {}
|
11 |
+
//@param : constructor string
|
12 |
+
instantiateModule : function( module, constructor ) {
|
13 |
+
if ( ! _.has( module,'id') ) {
|
14 |
+
throw new Error('CZRModule::instantiateModule() : a module has no id and could not be added in the collection of : ' + this.id +'. Aborted.' );
|
15 |
+
}
|
16 |
+
var control = this;
|
17 |
+
//is a constructor provided ?
|
18 |
+
//if not try to look in the module object if we an find one
|
19 |
+
if ( _.isUndefined(constructor) || _.isEmpty(constructor) ) {
|
20 |
+
constructor = control.getModuleConstructor( module );
|
21 |
+
}
|
22 |
+
//on init, the module collection is populated with module already having an id
|
23 |
+
//For now, let's check if the id is empty and is not already part of the collection.
|
24 |
+
//@todo : improve this.
|
25 |
+
if ( ! _.isEmpty( module.id ) && control.czr_Module.has( module.id ) ) {
|
26 |
+
throw new Error('The module id already exists in the collection in control : ' + control.id );
|
27 |
+
}
|
28 |
+
|
29 |
+
var module_api_ready = control.prepareModuleForAPI( module );
|
30 |
+
|
31 |
+
//instanciate the module with the default constructor
|
32 |
+
control.czr_Module.add( module_api_ready.id, new constructor( module_api_ready.id, module_api_ready ) );
|
33 |
+
|
34 |
+
if ( ! control.czr_Module.has( module_api_ready.id ) ) {
|
35 |
+
throw new Error('instantiateModule() : instantiation failed for module id ' + module_api_ready.id + ' in control ' + control.id );
|
36 |
+
}
|
37 |
+
//return the module instance for chaining
|
38 |
+
return control.czr_Module(module_api_ready.id);
|
39 |
+
},
|
40 |
+
|
41 |
+
|
42 |
+
|
43 |
+
//@return a module constructor object
|
44 |
+
getModuleConstructor : function( module ) {
|
45 |
+
var control = this,
|
46 |
+
parentConstructor = {},
|
47 |
+
constructor = {};
|
48 |
+
|
49 |
+
if ( ! _.has( module, 'module_type' ) ) {
|
50 |
+
throw new Error('CZRModule::getModuleConstructor : no module type found for module ' + module.id );
|
51 |
+
}
|
52 |
+
if ( ! _.has( api.czrModuleMap, module.module_type ) ) {
|
53 |
+
throw new Error('Module type ' + module.module_type + ' is not listed in the module map api.czrModuleMap.' );
|
54 |
+
}
|
55 |
+
|
56 |
+
var _mthds = api.czrModuleMap[ module.module_type ].mthds || {},
|
57 |
+
_is_crud = api.czrModuleMap[ module.module_type ].crud,
|
58 |
+
_base_constructor = _is_crud ? api.CZRDynModule : api.CZRModule;
|
59 |
+
|
60 |
+
// June 2020 : introduced for https://github.com/presscustomizr/nimble-builder-pro/issues/6
|
61 |
+
// so we can remotely extend the module constructor
|
62 |
+
api.trigger('czr_setup_module_contructor', {
|
63 |
+
module_type : module.module_type,
|
64 |
+
methods : _mthds
|
65 |
+
});
|
66 |
+
|
67 |
+
constructor = _base_constructor.extend( _mthds );
|
68 |
+
|
69 |
+
if ( _.isUndefined( constructor ) || _.isEmpty(constructor) || ! constructor ) {
|
70 |
+
throw new Error('CZRModule::getModuleConstructor : no constructor found for module type : ' + module.module_type +'.' );
|
71 |
+
}
|
72 |
+
return constructor;
|
73 |
+
},
|
74 |
+
|
75 |
+
|
76 |
+
|
77 |
+
|
78 |
+
|
79 |
+
//@return an API ready module object
|
80 |
+
//To be instantiated in the API, the module model must have all the required properties defined in the defaultAPIModel properly set
|
81 |
+
prepareModuleForAPI : function( module_candidate ) {
|
82 |
+
if ( ! _.isObject( module_candidate ) ) {
|
83 |
+
throw new Error('prepareModuleForAPI : a module must be an object to be instantiated.');
|
84 |
+
}
|
85 |
+
|
86 |
+
var control = this,
|
87 |
+
api_ready_module = {};
|
88 |
+
|
89 |
+
// Default module model
|
90 |
+
//{
|
91 |
+
// id : '',//module.id,
|
92 |
+
// module_type : '',//module.module_type,
|
93 |
+
// modOpt : {},//the module modOpt property, typically high level properties that area applied to all items of the module
|
94 |
+
// items : [],//$.extend( true, {}, module.items ),
|
95 |
+
// crud : false,
|
96 |
+
// hasPreItem : true,//a crud module has a pre item by default
|
97 |
+
// refresh_on_add_item : true,// the preview is refreshed on item add
|
98 |
+
// multi_item : false,
|
99 |
+
// sortable : false,//<= a module can be multi-item but not necessarily sortable
|
100 |
+
// control : {},//control,
|
101 |
+
// section : ''
|
102 |
+
// };
|
103 |
+
_.each( control.getDefaultModuleApiModel() , function( _defaultValue, _key ) {
|
104 |
+
var _candidate_val = module_candidate[_key];
|
105 |
+
switch( _key ) {
|
106 |
+
//PROPERTIES COMMON TO ALL MODULES IN ALL CONTEXTS
|
107 |
+
case 'id' :
|
108 |
+
if ( _.isEmpty( _candidate_val ) ) {
|
109 |
+
api_ready_module[_key] = control.generateModuleId( module_candidate.module_type );
|
110 |
+
} else {
|
111 |
+
api_ready_module[_key] = _candidate_val;
|
112 |
+
}
|
113 |
+
break;
|
114 |
+
case 'module_type' :
|
115 |
+
if ( ! _.isString( _candidate_val ) || _.isEmpty( _candidate_val ) ) {
|
116 |
+
throw new Error('prepareModuleForAPI : a module type must a string not empty');
|
117 |
+
}
|
118 |
+
api_ready_module[_key] = _candidate_val;
|
119 |
+
break;
|
120 |
+
case 'items' :
|
121 |
+
if ( ! _.isArray( _candidate_val ) ) {
|
122 |
+
throw new Error('prepareModuleForAPI : a module item list must be an array');
|
123 |
+
}
|
124 |
+
api_ready_module[_key] = _candidate_val;
|
125 |
+
break;
|
126 |
+
case 'modOpt' :
|
127 |
+
if ( ! _.isObject( _candidate_val ) ) {
|
128 |
+
throw new Error('prepareModuleForAPI : a module modOpt property must be an object');
|
129 |
+
}
|
130 |
+
api_ready_module[_key] = _candidate_val;
|
131 |
+
break;
|
132 |
+
case 'crud' :
|
133 |
+
//get the value from the czrModuleMap
|
134 |
+
if ( _.has( api.czrModuleMap, module_candidate.module_type ) ) {
|
135 |
+
_candidate_val = api.czrModuleMap[ module_candidate.module_type ].crud;
|
136 |
+
if ( _.isUndefined( _candidate_val ) ) {
|
137 |
+
_candidate_val = _defaultValue;
|
138 |
+
}
|
139 |
+
} else if ( ! _.isUndefined( _candidate_val) && ! _.isBoolean( _candidate_val ) ) {
|
140 |
+
throw new Error('prepareModuleForAPI : the module param "crud" must be a boolean');
|
141 |
+
}
|
142 |
+
api_ready_module[_key] = _candidate_val || false;
|
143 |
+
break;
|
144 |
+
case 'hasPreItem' :
|
145 |
+
//get the value from the czrModuleMap
|
146 |
+
if ( _.has( api.czrModuleMap, module_candidate.module_type ) ) {
|
147 |
+
_candidate_val = api.czrModuleMap[ module_candidate.module_type ].hasPreItem;
|
148 |
+
if ( _.isUndefined( _candidate_val ) ) {
|
149 |
+
_candidate_val = _defaultValue;
|
150 |
+
}
|
151 |
+
} else if ( ! _.isUndefined( _candidate_val) && ! _.isBoolean( _candidate_val ) ) {
|
152 |
+
throw new Error('prepareModuleForAPI : the module param "hasPreItem" must be a boolean');
|
153 |
+
}
|
154 |
+
api_ready_module[_key] = _candidate_val || false;
|
155 |
+
break;
|
156 |
+
case 'refresh_on_add_item' :
|
157 |
+
//get the value from the czrModuleMap
|
158 |
+
if ( _.has( api.czrModuleMap, module_candidate.module_type ) ) {
|
159 |
+
_candidate_val = api.czrModuleMap[ module_candidate.module_type ].refresh_on_add_item;
|
160 |
+
if ( _.isUndefined( _candidate_val ) ) {
|
161 |
+
_candidate_val = _defaultValue;
|
162 |
+
}
|
163 |
+
} else if ( ! _.isUndefined( _candidate_val) && ! _.isBoolean( _candidate_val ) ) {
|
164 |
+
throw new Error('prepareModuleForAPI : the module param "refresh_on_add_item" must be a boolean');
|
165 |
+
}
|
166 |
+
api_ready_module[_key] = _candidate_val || false;
|
167 |
+
break;
|
168 |
+
case 'multi_item' :
|
169 |
+
// get the value from the czrModuleMap
|
170 |
+
// fallback on "crud" param if set
|
171 |
+
if ( _.has( api.czrModuleMap, module_candidate.module_type ) ) {
|
172 |
+
_candidate_val = api.czrModuleMap[ module_candidate.module_type ].multi_item;
|
173 |
+
if ( _.isUndefined( _candidate_val ) ) {
|
174 |
+
_candidate_val = api.czrModuleMap[ module_candidate.module_type ].crud;
|
175 |
+
}
|
176 |
+
} else if ( ! _.isUndefined( _candidate_val) && ! _.isBoolean( _candidate_val ) ) {
|
177 |
+
throw new Error('prepareModuleForAPI : the module param "multi_item" must be a boolean');
|
178 |
+
}
|
179 |
+
api_ready_module[_key] = _candidate_val || false;
|
180 |
+
break;
|
181 |
+
//if the sortable property is not set, then check if crud or multi-item
|
182 |
+
case 'sortable' :
|
183 |
+
//get the value from the czrModuleMap
|
184 |
+
if ( _.has( api.czrModuleMap, module_candidate.module_type ) ) {
|
185 |
+
// if the sortable param is not specified, set it based on the "crud" and "multi_item" params
|
186 |
+
_candidate_val = api.czrModuleMap[ module_candidate.module_type ].sortable;
|
187 |
+
if ( _.isUndefined( _candidate_val ) ) {
|
188 |
+
_candidate_val = api.czrModuleMap[ module_candidate.module_type ].crud;
|
189 |
+
}
|
190 |
+
if ( _.isUndefined( _candidate_val ) ) {
|
191 |
+
_candidate_val = api.czrModuleMap[ module_candidate.module_type ].multi_item;
|
192 |
+
}
|
193 |
+
} else if ( ! _.isUndefined( _candidate_val) && ! _.isBoolean( _candidate_val ) ) {
|
194 |
+
throw new Error('prepareModuleForAPI : the module param "sortable" must be a boolean');
|
195 |
+
}
|
196 |
+
api_ready_module[_key] = _candidate_val || false;
|
197 |
+
break;
|
198 |
+
case 'control' :
|
199 |
+
api_ready_module[_key] = control;//this
|
200 |
+
break;
|
201 |
+
|
202 |
+
|
203 |
+
|
204 |
+
//PROPERTIES FOR MODULE EMBEDDED IN A CONTROL
|
205 |
+
case 'section' :
|
206 |
+
if ( ! _.isString( _candidate_val ) || _.isEmpty( _candidate_val ) ) {
|
207 |
+
throw new Error('prepareModuleForAPI : a module section must be a string not empty');
|
208 |
+
}
|
209 |
+
api_ready_module[_key] = _candidate_val;
|
210 |
+
break;
|
211 |
+
|
212 |
+
|
213 |
+
|
214 |
+
//PROPERTIES FOR MODULE EMBEDDED IN A SEKTION
|
215 |
+
case 'dirty' :
|
216 |
+
api_ready_module[_key] = _candidate_val || false;
|
217 |
+
break;
|
218 |
+
}//switch
|
219 |
+
});
|
220 |
+
return api_ready_module;
|
221 |
+
},
|
222 |
+
|
223 |
+
|
224 |
+
//recursive
|
225 |
+
generateModuleId : function( module_type, key, i ) {
|
226 |
+
//prevent a potential infinite loop
|
227 |
+
i = i || 1;
|
228 |
+
if ( i > 100 ) {
|
229 |
+
throw new Error('Infinite loop when generating of a module id.');
|
230 |
+
}
|
231 |
+
var control = this;
|
232 |
+
key = key || control._getNextModuleKeyInCollection();
|
233 |
+
var id_candidate = module_type + '_' + key;
|
234 |
+
|
235 |
+
//do we have a module collection value ?
|
236 |
+
if ( ! _.has(control, 'czr_moduleCollection') || ! _.isArray( control.czr_moduleCollection() ) ) {
|
237 |
+
throw new Error('The module collection does not exist or is not properly set in control : ' + control.id );
|
238 |
+
}
|
239 |
+
|
240 |
+
//make sure the module is not already instantiated
|
241 |
+
if ( control.isModuleRegistered( id_candidate ) ) {
|
242 |
+
key++; i++;
|
243 |
+
return control.generateModuleId( module_type, key, i );
|
244 |
+
}
|
245 |
+
|
246 |
+
return id_candidate;
|
247 |
+
},
|
248 |
+
|
249 |
+
|
250 |
+
//helper : return an int
|
251 |
+
//=> the next available id of the module collection
|
252 |
+
_getNextModuleKeyInCollection : function() {
|
253 |
+
var control = this,
|
254 |
+
_max_mod_key = {},
|
255 |
+
_next_key = 0;
|
256 |
+
|
257 |
+
//get the initial key
|
258 |
+
//=> if we already have a collection, extract all keys, select the max and increment it.
|
259 |
+
//else, key is 0
|
260 |
+
if ( ! _.isEmpty( control.czr_moduleCollection() ) ) {
|
261 |
+
_max_mod_key = _.max( control.czr_moduleCollection(), function( _mod ) {
|
262 |
+
return parseInt( _mod.id.replace(/[^\/\d]/g,''), 10 );
|
263 |
+
});
|
264 |
+
_next_key = parseInt( _max_mod_key.id.replace(/[^\/\d]/g,''), 10 ) + 1;
|
265 |
+
}
|
266 |
+
return _next_key;
|
267 |
+
}
|
268 |
+
});//$.extend//CZRBaseControlMths
|
269 |
+
})( wp.customize , jQuery, _ );
|
assets/czr/fmk/js/base-fmk/1_0_input_item_module_control/1_4_control/base_module_control/_0_1_2_base_module_control_collection.js
ADDED
@@ -0,0 +1,204 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
//BASE CONTROL CLASS
|
3 |
+
//extends api.CZRBaseControl
|
4 |
+
//define a set of methods, mostly helpers, to extend the base WP control class
|
5 |
+
//this will become our base constructor for main complex controls
|
6 |
+
//EARLY SETUP
|
7 |
+
var CZRBaseModuleControlMths = CZRBaseModuleControlMths || {};
|
8 |
+
( function ( api, $, _ ) {
|
9 |
+
$.extend( CZRBaseModuleControlMths, {
|
10 |
+
//@return void()
|
11 |
+
//@param obj can be { collection : []}, or { module : {} }
|
12 |
+
//Can be called :
|
13 |
+
//- for all modules, in module.isReady.done() if the module is not registered in the collection yet.
|
14 |
+
//- for all modules on moduleReact ( module.callbacks )
|
15 |
+
//
|
16 |
+
//=> sets the setting value through the module collection !
|
17 |
+
updateModulesCollection : function( obj ) {
|
18 |
+
var control = this,
|
19 |
+
_current_collection = control.czr_moduleCollection(),
|
20 |
+
_new_collection = $.extend( true, [], _current_collection);
|
21 |
+
|
22 |
+
//if a collection is provided in the passed obj then simply refresh the collection
|
23 |
+
//=> typically used when reordering the collection module with sortable or when a module is removed
|
24 |
+
if ( _.has( obj, 'collection' ) ) {
|
25 |
+
//reset the collection
|
26 |
+
control.czr_moduleCollection.set( obj.collection, obj.data || {} );
|
27 |
+
return;
|
28 |
+
}
|
29 |
+
|
30 |
+
if ( ! _.has(obj, 'module') ) {
|
31 |
+
throw new Error('updateModulesCollection, no module provided ' + control.id + '. Aborting');
|
32 |
+
}
|
33 |
+
|
34 |
+
//normalizes the module for the API
|
35 |
+
var module_api_ready = control.prepareModuleForAPI( _.clone( obj.module ) );
|
36 |
+
|
37 |
+
//the module already exist in the collection
|
38 |
+
if ( _.findWhere( _new_collection, { id : module_api_ready.id } ) ) {
|
39 |
+
_.each( _current_collection , function( _elt, _ind ) {
|
40 |
+
if ( _elt.id != module_api_ready.id )
|
41 |
+
return;
|
42 |
+
|
43 |
+
//set the new val to the changed property
|
44 |
+
_new_collection[_ind] = module_api_ready;
|
45 |
+
});
|
46 |
+
}
|
47 |
+
//the module has to be added
|
48 |
+
else {
|
49 |
+
_new_collection.push( module_api_ready );
|
50 |
+
}
|
51 |
+
|
52 |
+
//WHAT ARE THE PARAMS WE WANT TO PASS TO THE NEXT ACTIONS
|
53 |
+
var _params = {};
|
54 |
+
//if a data property has been passed,
|
55 |
+
//amend the data property with the changed module
|
56 |
+
if ( _.has( obj, 'data') ) {
|
57 |
+
_params = $.extend( true, {}, obj.data );
|
58 |
+
$.extend( _params, { module : module_api_ready } );
|
59 |
+
}
|
60 |
+
//Inform the collection
|
61 |
+
control.czr_moduleCollection.set( _new_collection, _params );
|
62 |
+
},
|
63 |
+
|
64 |
+
|
65 |
+
|
66 |
+
|
67 |
+
|
68 |
+
|
69 |
+
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
70 |
+
////////////////////////////////////////////////////// WHERE THE STREETS HAVE NO NAMES //////////////////////////////////////////////////////
|
71 |
+
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
72 |
+
// cb of control.czr_moduleCollection.callbacks
|
73 |
+
// @params is an optional object. { silent : true }
|
74 |
+
moduleCollectionReact : function( to, from, params ) {
|
75 |
+
var control = this,
|
76 |
+
is_module_added = _.size(to) > _.size(from),
|
77 |
+
is_module_removed = _.size(from) > _.size(to),
|
78 |
+
is_module_update = _.size(from) == _.size(to);
|
79 |
+
is_collection_sorted = false;
|
80 |
+
|
81 |
+
// MODULE REMOVED
|
82 |
+
// Remove the module instance if needed
|
83 |
+
if ( is_module_removed ) {
|
84 |
+
//find the module to remove
|
85 |
+
var _to_remove = _.filter( from, function( _mod ){
|
86 |
+
return _.isUndefined( _.findWhere( to, { id : _mod.id } ) );
|
87 |
+
});
|
88 |
+
_to_remove = _to_remove[0];
|
89 |
+
control.czr_Module.remove( _to_remove.id );
|
90 |
+
}
|
91 |
+
|
92 |
+
// is there a passed module param ?
|
93 |
+
// if so prepare it for DB
|
94 |
+
// if a module is provided, we also want to pass its id to the preview => can be used to target specific selectors in a partial refresh scenario
|
95 |
+
if ( _.isObject( params ) && _.has( params, 'module' ) ) {
|
96 |
+
params.module_id = params.module.id;
|
97 |
+
params.moduleRegistrationParams = params.module;
|
98 |
+
params.module = control.prepareModuleForDB( $.extend( true, {}, params.module ) );
|
99 |
+
}
|
100 |
+
|
101 |
+
// Inform the the setting if the module is not being added to the collection for the first time,
|
102 |
+
// We don't want to say it to the setting, because it might alter the setting dirtyness for nothing on init.
|
103 |
+
if ( ! is_module_added ) {
|
104 |
+
// control.filterModuleCollectionBeforeAjax( to ) returns an array of items
|
105 |
+
// if the module has modOpt, the modOpt object is always added as the first element of the items array (unshifted)
|
106 |
+
if ( serverControlParams.isDevMode ) {
|
107 |
+
api( this.id ).set( control.filterModuleCollectionBeforeAjax( to ), params );
|
108 |
+
} else {
|
109 |
+
try { api( this.id ).set( control.filterModuleCollectionBeforeAjax( to ), params ); } catch( er ) {
|
110 |
+
api.errare( 'api.CZRBaseControl::moduleCollectionReact => error when firing control.filterModuleCollectionBeforeAjax( to )', er );
|
111 |
+
}
|
112 |
+
}
|
113 |
+
//.done( function( to, from, o ) {});
|
114 |
+
}
|
115 |
+
},
|
116 |
+
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
117 |
+
////////////////////////////////////////////////////// WHERE THE STREETS HAVE NO NAMES //////////////////////////////////////////////////////
|
118 |
+
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
119 |
+
|
120 |
+
|
121 |
+
|
122 |
+
|
123 |
+
|
124 |
+
|
125 |
+
|
126 |
+
|
127 |
+
|
128 |
+
//an overridable method to act on the collection just before it is ajaxed
|
129 |
+
//@return the collection array
|
130 |
+
filterModuleCollectionBeforeAjax : function( collection ) {
|
131 |
+
var control = this,
|
132 |
+
cloned_collection = $.extend( true, [], collection ),
|
133 |
+
_filtered_collection = [],
|
134 |
+
itemsToReturn;
|
135 |
+
|
136 |
+
_.each( cloned_collection , function( _mod, _key ) {
|
137 |
+
var db_ready_mod = $.extend( true, {}, _mod );
|
138 |
+
_filtered_collection[_key] = control.prepareModuleForDB( db_ready_mod );
|
139 |
+
});
|
140 |
+
|
141 |
+
//=> in a control : we save
|
142 |
+
//1) the collection of item(s)
|
143 |
+
//2) the modOpt
|
144 |
+
//at this point we should be in the case of a single module collection, typically use to populate a regular setting
|
145 |
+
if ( _.size( cloned_collection ) > 1 ) {
|
146 |
+
throw new Error('There should not be several modules in the collection of control : ' + control.id );
|
147 |
+
}
|
148 |
+
if ( ! _.isArray( cloned_collection ) || _.isEmpty( cloned_collection ) || ! _.has( cloned_collection[0], 'items' ) ) {
|
149 |
+
throw new Error('The setting value could not be populated in control : ' + control.id );
|
150 |
+
}
|
151 |
+
var module_id = cloned_collection[0].id;
|
152 |
+
|
153 |
+
if ( ! control.czr_Module.has( module_id ) ) {
|
154 |
+
throw new Error('The single module control (' + control.id + ') has no module registered with the id ' + module_id );
|
155 |
+
}
|
156 |
+
var module_instance = control.czr_Module( module_id );
|
157 |
+
if ( ! _.isArray( module_instance().items ) ) {
|
158 |
+
throw new Error('The module ' + module_id + ' should be an array in control : ' + control.id );
|
159 |
+
}
|
160 |
+
|
161 |
+
// items
|
162 |
+
// For a mono-item module, we save the first and unique item object
|
163 |
+
// For example :
|
164 |
+
// {
|
165 |
+
// 'heading_text' : "this is a heading"
|
166 |
+
// 'font_size' : '10px'
|
167 |
+
// ...
|
168 |
+
// }
|
169 |
+
//
|
170 |
+
// For a multi-item module, we save a collection of item objects, which may include a mod_opt item
|
171 |
+
itemsToReturn = module_instance.isMultiItem() ? module_instance().items : ( module_instance().items[0] || [] );
|
172 |
+
itemsToReturn = module_instance.filterItemsBeforeCoreApiSettingValue( itemsToReturn );
|
173 |
+
|
174 |
+
//Add the modOpt if any
|
175 |
+
return module_instance.hasModOpt() ? _.union( [ module_instance().modOpt ] , itemsToReturn ) : itemsToReturn;
|
176 |
+
},
|
177 |
+
|
178 |
+
|
179 |
+
// fired before adding a module to the collection of DB candidates
|
180 |
+
// the module must have the control.getDefaultModuleDBModel structure :
|
181 |
+
prepareModuleForDB : function ( module_db_candidate ) {
|
182 |
+
var control = this;
|
183 |
+
if ( ! _.isObject( module_db_candidate ) ) {
|
184 |
+
throw new Error('::prepareModuleForDB : a module must be an object.');
|
185 |
+
}
|
186 |
+
var db_ready_module = {};
|
187 |
+
|
188 |
+
// The items property should be a collection, even for mono-item modules
|
189 |
+
if ( ! _.isArray( module_db_candidate['items'] ) ) {
|
190 |
+
throw new Error('::prepareModuleForDB : a module item list must be an array');
|
191 |
+
}
|
192 |
+
|
193 |
+
// Let's loop on the item(s) to check if they are well formed
|
194 |
+
_.each( module_db_candidate['items'], function( itm ) {
|
195 |
+
if ( ! _.isObject( itm ) ) {
|
196 |
+
throw new Error('::prepareModuleForDB : a module item must be an object');
|
197 |
+
}
|
198 |
+
});
|
199 |
+
|
200 |
+
db_ready_module['items'] = module_db_candidate['items'];
|
201 |
+
return db_ready_module;
|
202 |
+
}
|
203 |
+
});//$.extend//CZRBaseControlMths
|
204 |
+
})( wp.customize , jQuery, _ );
|
assets/czr/fmk/js/base-fmk/_0_0_pre_previewed_device_event.js
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
( function ( api, $, _ ) {
|
3 |
+
/*****************************************************************************
|
4 |
+
* REACT TO PREVIEW DEVICE SWITCH => send device to preview
|
5 |
+
*****************************************************************************/
|
6 |
+
api.bind( 'ready' , function() {
|
7 |
+
if ( api.previewedDevice ) {
|
8 |
+
api.previewedDevice.bind( function( device ) {
|
9 |
+
api.previewer.send( 'previewed-device', device );
|
10 |
+
});
|
11 |
+
}
|
12 |
+
});
|
13 |
+
})( wp.customize , jQuery, _);
|
assets/czr/fmk/js/base-fmk/_0_1_pre_helpers.js
ADDED
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
//NOT USED YET
|
2 |
+
// var czr_debug = {
|
3 |
+
// log: function(o) {debug.queue.push(['log', arguments, debug.stack.slice(0)]); if (window.console && typeof window.console.log == 'function') {window.console.log(o);}},
|
4 |
+
// error: function(o) {debug.queue.push(['error', arguments, debug.stack.slice(0)]); if (window.console && typeof window.console.error == 'function') {window.console.error(o);}},
|
5 |
+
// queue: [],
|
6 |
+
// stack: []
|
7 |
+
// };
|
8 |
+
//var api = api || wp.customize, $ = $ || jQuery;
|
9 |
+
( function ( api, $, _ ) {
|
10 |
+
//@return [] for console method
|
11 |
+
//@bgCol @textCol are hex colors
|
12 |
+
//@arguments : the original console arguments
|
13 |
+
var _prettyPrintLog = function( args ) {
|
14 |
+
var _defaults = {
|
15 |
+
bgCol : '#5ed1f5',
|
16 |
+
textCol : '#000',
|
17 |
+
consoleArguments : []
|
18 |
+
};
|
19 |
+
args = _.extend( _defaults, args );
|
20 |
+
|
21 |
+
var _toArr = Array.from( args.consoleArguments ),
|
22 |
+
_truncate = function( string ){
|
23 |
+
if ( ! _.isString( string ) )
|
24 |
+
return '';
|
25 |
+
return string.length > 300 ? string.substr( 0, 299 ) + '...' : string;
|
26 |
+
};
|
27 |
+
|
28 |
+
//if the array to print is not composed exclusively of strings, then let's stringify it
|
29 |
+
//else join(' ')
|
30 |
+
if ( ! _.isEmpty( _.filter( _toArr, function( it ) { return ! _.isString( it ); } ) ) ) {
|
31 |
+
_toArr = JSON.stringify( _toArr.join(' ') );
|
32 |
+
} else {
|
33 |
+
_toArr = _toArr.join(' ');
|
34 |
+
}
|
35 |
+
return [
|
36 |
+
'%c ' + _truncate( _toArr ),
|
37 |
+
[ 'background:' + args.bgCol, 'color:' + args.textCol, 'display: block;' ].join(';')
|
38 |
+
];
|
39 |
+
};
|
40 |
+
|
41 |
+
var _wrapLogInsideTags = function( title, msg, bgColor ) {
|
42 |
+
//fix for IE, because console is only defined when in F12 debugging mode in IE
|
43 |
+
if ( ( _.isUndefined( console ) && typeof window.console.log != 'function' ) )
|
44 |
+
return;
|
45 |
+
if ( serverControlParams.isDevMode ) {
|
46 |
+
if ( _.isUndefined( msg ) ) {
|
47 |
+
console.log.apply( console, _prettyPrintLog( { bgCol : bgColor, textCol : '#000', consoleArguments : [ '<' + title + '>' ] } ) );
|
48 |
+
} else {
|
49 |
+
console.log.apply( console, _prettyPrintLog( { bgCol : bgColor, textCol : '#000', consoleArguments : [ '<' + title + '>' ] } ) );
|
50 |
+
console.log( msg );
|
51 |
+
console.log.apply( console, _prettyPrintLog( { bgCol : bgColor, textCol : '#000', consoleArguments : [ '</' + title + '>' ] } ) );
|
52 |
+
}
|
53 |
+
} else {
|
54 |
+
console.log.apply( console, _prettyPrintLog( { bgCol : bgColor, textCol : '#000', consoleArguments : [ title ] } ) );
|
55 |
+
}
|
56 |
+
};
|
57 |
+
//Dev mode aware and IE compatible api.consoleLog()
|
58 |
+
api.consoleLog = function() {
|
59 |
+
if ( ! serverControlParams.isDevMode )
|
60 |
+
return;
|
61 |
+
//fix for IE, because console is only defined when in F12 debugging mode in IE
|
62 |
+
if ( ( _.isUndefined( console ) && typeof window.console.log != 'function' ) )
|
63 |
+
return;
|
64 |
+
console.log.apply( console, _prettyPrintLog( { consoleArguments : arguments } ) );
|
65 |
+
console.log( 'Unstyled console message : ', arguments );
|
66 |
+
};
|
67 |
+
|
68 |
+
api.errorLog = function() {
|
69 |
+
//fix for IE, because console is only defined when in F12 debugging mode in IE
|
70 |
+
if ( ( _.isUndefined( console ) && typeof window.console.log != 'function' ) )
|
71 |
+
return;
|
72 |
+
|
73 |
+
console.log.apply( console, _prettyPrintLog( { bgCol : '#ffd5a0', textCol : '#000', consoleArguments : arguments } ) );
|
74 |
+
// if ( serverControlParams.isDevMode ) {
|
75 |
+
// console.log( 'Unstyled error message : ', arguments );
|
76 |
+
// }
|
77 |
+
};
|
78 |
+
|
79 |
+
api.errare = function( title, msg ) { _wrapLogInsideTags( title, msg, '#ffd5a0' ); };
|
80 |
+
api.infoLog = function( title, msg ) { _wrapLogInsideTags( title, msg, '#5ed1f5' ); };
|
81 |
+
|
82 |
+
api.czr_isChangeSetOn = function() {
|
83 |
+
return serverControlParams.isChangeSetOn && true === true;//&& true === true is just there to hackily cast the returned value as boolean.
|
84 |
+
};
|
85 |
+
})( wp.customize , jQuery, _);
|
assets/czr/fmk/js/base-fmk/_0_2_api_ready_themes_section_visibility.js
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
( function ( api, $, _ ) {
|
3 |
+
//SET THE ACTIVE STATE OF THE THEMES SECTION BASED ON WHAT THE SERVER SENT
|
4 |
+
api.bind('ready', function() {
|
5 |
+
var _do = function() {
|
6 |
+
// the themeServerControlParams global is printed only with Customizr and Hueman
|
7 |
+
if ( _.isUndefined( window.themeServerControlParams ) || _.isUndefined( themeServerControlParams.isThemeSwitchOn ) )
|
8 |
+
return;
|
9 |
+
|
10 |
+
if ( ! themeServerControlParams.isThemeSwitchOn ) {
|
11 |
+
//reset the callbacks
|
12 |
+
api.panel('themes').active.callbacks = $.Callbacks();
|
13 |
+
api.panel('themes').active( themeServerControlParams.isThemeSwitchOn );
|
14 |
+
}
|
15 |
+
};
|
16 |
+
if ( api.panel.has( 'themes') ) {
|
17 |
+
_do();
|
18 |
+
} else {
|
19 |
+
api.panel.when( 'themes', function( _s ) {
|
20 |
+
_do();
|
21 |
+
});
|
22 |
+
}
|
23 |
+
});
|
24 |
+
})( wp.customize , jQuery, _);
|
assets/czr/fmk/js/base-fmk/_0_3_api_ready_watch_section_panel_expansion.js
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
( function ( api, $, _ ) {
|
3 |
+
/*****************************************************************************
|
4 |
+
* OBSERVE SECTIONS AND PANEL EXPANSION
|
5 |
+
* /store the current expanded section and panel
|
6 |
+
*****************************************************************************/
|
7 |
+
api.czr_activeSectionId = api.czr_activeSectionId || new api.Value('');
|
8 |
+
api.czr_activePanelId = api.czr_activePanelId || new api.Value('');
|
9 |
+
|
10 |
+
api.bind('ready', function() {
|
11 |
+
if ( 'function' != typeof api.Section ) {
|
12 |
+
throw new Error( 'Your current version of WordPress does not support the customizer sections needed for this theme. Please upgrade WordPress to the latest version.' );
|
13 |
+
}
|
14 |
+
|
15 |
+
//STORE THE CURRENTLY ACTIVE SECTION AND PANELS IN AN OBSERVABLE VALUE
|
16 |
+
//BIND EXISTING AND FUTURE SECTIONS AND PANELS
|
17 |
+
|
18 |
+
|
19 |
+
var _storeCurrentSection = function( expanded, section_id ) {
|
20 |
+
api.czr_activeSectionId( expanded ? section_id : '' );
|
21 |
+
};
|
22 |
+
api.section.each( function( _sec ) {
|
23 |
+
//<@4.9compat>
|
24 |
+
// Bail if is 'publish_setting' section
|
25 |
+
if ( 'publish_settings' == _sec.id )
|
26 |
+
return;
|
27 |
+
//</@4.9compat>
|
28 |
+
_sec.expanded.bind( function( expanded ) { _storeCurrentSection( expanded, _sec.id ); } );
|
29 |
+
});
|
30 |
+
api.section.bind( 'add', function( section_instance ) {
|
31 |
+
//<@4.9compat>
|
32 |
+
// Bail if is 'publish_setting' section
|
33 |
+
if ( 'publish_settings' == section_instance.id )
|
34 |
+
return;
|
35 |
+
//</@4.9compat>
|
36 |
+
// api.trigger('czr-paint', { active_panel_id : section_instance.panel() } ); <= Deprecated, was used in old skope
|
37 |
+
section_instance.expanded.bind( function( expanded ) { _storeCurrentSection( expanded, section_instance.id ); } );
|
38 |
+
});
|
39 |
+
|
40 |
+
var _storeCurrentPanel = function( expanded, panel_id ) {
|
41 |
+
api.czr_activePanelId( expanded ? panel_id : '' );
|
42 |
+
//if the expanded panel id becomes empty (typically when switching back to the root panel), make sure that no section is set as currently active
|
43 |
+
//=> fixes the problem of add_menu section staying expanded when switching back to another panel
|
44 |
+
if ( _.isEmpty( api.czr_activePanelId() ) ) {
|
45 |
+
api.czr_activeSectionId( '' );
|
46 |
+
}
|
47 |
+
};
|
48 |
+
api.panel.each( function( _panel ) {
|
49 |
+
_panel.expanded.bind( function( expanded ) { _storeCurrentPanel( expanded, _panel.id ); } );
|
50 |
+
});
|
51 |
+
api.panel.bind( 'add', function( panel_instance ) {
|
52 |
+
panel_instance.expanded.bind( function( expanded ) { _storeCurrentPanel( expanded, panel_instance.id ); } );
|
53 |
+
});
|
54 |
+
});
|
55 |
+
})( wp.customize , jQuery, _);
|
assets/czr/fmk/js/base-fmk/_0_4_api_ready_dynamic_registration.js
ADDED
@@ -0,0 +1,129 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
( function ( api, $, _ ) {
|
3 |
+
/*****************************************************************************
|
4 |
+
*
|
5 |
+
*****************************************************************************/
|
6 |
+
api.bind('ready', function() {
|
7 |
+
// do we have dynamic registration candidates
|
8 |
+
var dynRegistrationCandidates = serverControlParams.paramsForDynamicRegistration || [];
|
9 |
+
if ( ! _.isObject( serverControlParams.paramsForDynamicRegistration ) ) {
|
10 |
+
api.errorLog( 'serverControlParams.paramsForDynamicRegistration should be an array');
|
11 |
+
}
|
12 |
+
|
13 |
+
_.each( serverControlParams.paramsForDynamicRegistration, function( dynParams, setId ) {
|
14 |
+
// The dynamic registration should be explicitely set
|
15 |
+
if ( dynParams.module_registration_params && true === dynParams.module_registration_params.dynamic_registration ) {
|
16 |
+
if ( serverControlParams.isDevMode ) {
|
17 |
+
registerDynamicModuleSettingControl( dynParams );
|
18 |
+
} else {
|
19 |
+
try { registerDynamicModuleSettingControl( dynParams ); } catch( er ) {
|
20 |
+
api.errorLog( er );
|
21 |
+
}
|
22 |
+
}
|
23 |
+
}
|
24 |
+
});
|
25 |
+
|
26 |
+
});//api.bind('ready', function()
|
27 |
+
|
28 |
+
|
29 |
+
// Register the relevant setting and control based on the current skope ids
|
30 |
+
// @return the setting id
|
31 |
+
var registerDynamicModuleSettingControl = function( args ) {
|
32 |
+
args = _.extend( {
|
33 |
+
'setting_id' : '',
|
34 |
+
'module_type' : '',
|
35 |
+
'option_value' : [],
|
36 |
+
// 'setting' => array(
|
37 |
+
// 'type' => 'option',
|
38 |
+
// 'default' => array(),
|
39 |
+
// 'transport' => 'refresh',
|
40 |
+
// 'setting_class' => '',//array( 'path' => '', 'name' => '' )
|
41 |
+
// 'sanitize_callback' => '',
|
42 |
+
// 'validate_callback' => '',
|
43 |
+
// ),
|
44 |
+
'setting' : {},
|
45 |
+
'section' : { id : '', title : '' },
|
46 |
+
'control' : {},
|
47 |
+
//'setting_type' : 'option'
|
48 |
+
|
49 |
+
}, args );
|
50 |
+
|
51 |
+
// we must have not empty setting_id, module_type
|
52 |
+
if ( _.isEmpty( args.setting_id ) || _.isEmpty( args.module_type ) ) {
|
53 |
+
api.errare( 'registerDynamicModuleSettingControl => args', args );
|
54 |
+
throw new Error( 'registerDynamicModuleSettingControl => missing params when registrating a setting');
|
55 |
+
}
|
56 |
+
|
57 |
+
// the option value must be an array
|
58 |
+
if ( ! _.isArray( args.option_value ) && ! _.isObject( args.option_value ) ) {
|
59 |
+
throw new Error( 'registerDynamicModuleSettingControl => the module values must be an array or an object');
|
60 |
+
}
|
61 |
+
|
62 |
+
var settingId = args.setting_id,
|
63 |
+
settingArgs = args.setting;
|
64 |
+
|
65 |
+
api.CZR_Helpers.register( {
|
66 |
+
what : 'setting',
|
67 |
+
id : settingId,
|
68 |
+
dirty : ! _.isEmpty( args.option_value ),
|
69 |
+
value : args.option_value,
|
70 |
+
transport : settingArgs.transport || 'refresh',
|
71 |
+
type : settingArgs.type || 'option',
|
72 |
+
track : false// <= don't add it in any registered collection @see Nimble or Contextualizer
|
73 |
+
});
|
74 |
+
|
75 |
+
// MAYBE REGISTER THE SECTION
|
76 |
+
var sectionArgs = args.section;
|
77 |
+
if ( ! _.isEmpty( sectionArgs ) ) {
|
78 |
+
// Check if we have a correct section
|
79 |
+
if ( ! _.has( sectionArgs, 'id' ) ){
|
80 |
+
throw new Error( 'registerDynamicModuleSettingControl => missing section id for the section of setting : ' + settingId );
|
81 |
+
}
|
82 |
+
|
83 |
+
api.CZR_Helpers.register({
|
84 |
+
what : 'section',
|
85 |
+
id : sectionArgs.id,
|
86 |
+
title: sectionArgs.title || sectionArgs.id,
|
87 |
+
panel : _.isEmpty( sectionArgs.panel ) ? '' : sectionArgs.panel,
|
88 |
+
priority : sectionArgs.priority || 10,
|
89 |
+
track : false// <= don't add it in any registered collection @see Nimble or Contextualizer => this will prevent this container to be removed when cleaning the registered
|
90 |
+
});
|
91 |
+
}
|
92 |
+
|
93 |
+
// REGISTER THE CONTROL
|
94 |
+
var controlId = settingId,
|
95 |
+
controlArgs = args.control,
|
96 |
+
ctrlSectionId;
|
97 |
+
|
98 |
+
// Do we have a section ?
|
99 |
+
if ( ! _.isEmpty( args.section ) ) {
|
100 |
+
ctrlSectionId = args.section.id;
|
101 |
+
} else {
|
102 |
+
ctrlSectionId = controlArgs.section;
|
103 |
+
}
|
104 |
+
|
105 |
+
if ( _.isEmpty( ctrlSectionId ) ) {
|
106 |
+
api.errare( 'registerDynamicModuleSettingControl => missing section id for the control', args );
|
107 |
+
throw new Error( 'registerDynamicModuleSettingControl => missing section id for the section of setting : ' + settingId );
|
108 |
+
}
|
109 |
+
api.CZR_Helpers.register({
|
110 |
+
what : 'control',
|
111 |
+
id : controlId,
|
112 |
+
label : controlArgs.label || controlId,
|
113 |
+
type : 'czr_module',
|
114 |
+
module_type : args.module_type,//'czr_background',
|
115 |
+
section : ctrlSectionId,//'contx_body_bg',
|
116 |
+
priority : controlArgs.priority || 10,
|
117 |
+
settings : { default : settingId },
|
118 |
+
track : false// <= don't add it in any registered collection @see Nimble or Contextualizer => this will prevent this container to be removed when cleaning the registered
|
119 |
+
});
|
120 |
+
|
121 |
+
// if the currently expanded section is the one of the dynamic control
|
122 |
+
// Awake the module => fire ready
|
123 |
+
if ( api.section.has( ctrlSectionId ) && api.section( ctrlSectionId ).expanded() ) {
|
124 |
+
api.control( controlId ).trigger( 'set-module-ready' );
|
125 |
+
}
|
126 |
+
|
127 |
+
return settingId;
|
128 |
+
};//registerDynamicModuleSettingControl
|
129 |
+
})( wp.customize , jQuery, _);
|
assets/czr/fmk/js/base-fmk/_0_9_extend_api_base.js
ADDED
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
( function ( api, $, _ ) {
|
3 |
+
// BASE
|
4 |
+
// BASE : Extends some constructors with the events manager
|
5 |
+
$.extend( CZRBaseControlMths, api.Events );
|
6 |
+
$.extend( api.Control.prototype, api.Events );//ensures that the default WP control constructor is extended as well
|
7 |
+
$.extend( CZRModuleMths, api.Events );
|
8 |
+
$.extend( CZRItemMths, api.Events );
|
9 |
+
$.extend( CZRModOptMths, api.Events );
|
10 |
+
|
11 |
+
// BASE : Add the DOM helpers (addAction, ...) to the Control Base Class + Input Base Class
|
12 |
+
$.extend( CZRBaseControlMths, api.CZR_Helpers );
|
13 |
+
$.extend( CZRInputMths, api.CZR_Helpers );
|
14 |
+
$.extend( CZRModuleMths, api.CZR_Helpers );
|
15 |
+
|
16 |
+
// BASE INPUTS => used as constructor when creating the collection of inputs
|
17 |
+
api.CZRInput = api.Value.extend( CZRInputMths );
|
18 |
+
// Declare all available input type as a map
|
19 |
+
api.czrInputMap = api.czrInputMap || {};
|
20 |
+
|
21 |
+
// input_type => callback fn to fire in the Input constructor on initialize
|
22 |
+
// the callback can receive specific params define in each module constructor
|
23 |
+
// For example, a content picker can be given params to display only taxonomies
|
24 |
+
// the default input_event_map can also be overriden in this callback
|
25 |
+
$.extend( api.czrInputMap, {
|
26 |
+
text : '',
|
27 |
+
textarea : '',
|
28 |
+
check : 'setupIcheck',
|
29 |
+
checkbox : 'setupIcheck',
|
30 |
+
//gutencheck : 'setupGutenCheck', // DEPRECATED since april 2nd 2019
|
31 |
+
nimblecheck : '',//setupNimbleCheck',
|
32 |
+
select : 'setupSelect',
|
33 |
+
radio : 'setupRadio',
|
34 |
+
number : 'setupStepper',
|
35 |
+
upload : 'setupImageUploaderSaveAsId',
|
36 |
+
upload_url : 'setupImageUploaderSaveAsUrl',
|
37 |
+
color : 'setupColorPicker',
|
38 |
+
wp_color_alpha : 'setupColorPickerAlpha',
|
39 |
+
wp_color : 'setupWPColorPicker',//not used for the moment
|
40 |
+
content_picker : 'setupContentPicker',
|
41 |
+
password : '',
|
42 |
+
range : 'setupSimpleRange',
|
43 |
+
range_slider : 'setupRangeSlider',
|
44 |
+
hidden : '',
|
45 |
+
h_alignment : 'setupHAlignement',
|
46 |
+
h_text_alignment : 'setupHAlignement',
|
47 |
+
inactive : '' // introduced sept 2020 for https://github.com/presscustomizr/nimble-builder-pro/issues/67
|
48 |
+
});
|
49 |
+
|
50 |
+
|
51 |
+
|
52 |
+
// BASE ITEMS => used as constructor when creating the collection of models
|
53 |
+
api.CZRItem = api.Value.extend( CZRItemMths );
|
54 |
+
|
55 |
+
// BASE MODULE OPTIONS => used as constructor when creating module options
|
56 |
+
api.CZRModOpt = api.Value.extend( CZRModOptMths );
|
57 |
+
|
58 |
+
// BASE MODULES => used as constructor when creating the collection of modules
|
59 |
+
api.CZRModule = api.Value.extend( CZRModuleMths );
|
60 |
+
api.CZRDynModule = api.CZRModule.extend( CZRDynModuleMths );
|
61 |
+
|
62 |
+
// BASE CONTROLS
|
63 |
+
api.CZRBaseControl = api.Control.extend( CZRBaseControlMths );
|
64 |
+
api.CZRBaseModuleControl = api.CZRBaseControl.extend( CZRBaseModuleControlMths );
|
65 |
+
|
66 |
+
$.extend( api.controlConstructor, { czr_module : api.CZRBaseModuleControl });
|
67 |
+
})( wp.customize, jQuery, _ );
|
assets/czr/fmk/js/base-fmk/_7_various_fmk_dom_ready.js
ADDED
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
//DOM READY :
|
3 |
+
//1) FIRE SPECIFIC INPUT PLUGINS
|
4 |
+
//2) ADD SOME COOL STUFFS
|
5 |
+
//3) SPECIFIC CONTROLS ACTIONS
|
6 |
+
( function ( wp, $ ) {
|
7 |
+
$( function($) {
|
8 |
+
var api = wp.customize || api;
|
9 |
+
|
10 |
+
//WHAT IS HAPPENING IN THE MESSENGER
|
11 |
+
// $(window.parent).on( 'message', function(e, o) {
|
12 |
+
// api.consoleLog('SENT STUFFS', JSON.parse( e.originalEvent.data), e );
|
13 |
+
// });
|
14 |
+
// $( window ).on( 'message', function(e, o) {
|
15 |
+
// api.consoleLog('INCOMING MESSAGE', JSON.parse( e.originalEvent.data), e );
|
16 |
+
// });
|
17 |
+
// $(window.document).bind("ajaxSend", function(e, o){
|
18 |
+
// api.consoleLog('AJAX SEND', e, arguments );
|
19 |
+
// }).bind("ajaxComplete", function(e, o){
|
20 |
+
// api.consoleLog('AJAX COMPLETE', e, o);
|
21 |
+
// });
|
22 |
+
|
23 |
+
var fireHeaderButtons = function() {
|
24 |
+
var $header_button;
|
25 |
+
|
26 |
+
// Deactivated for the moment.
|
27 |
+
// The + button has been moved in the Nimble top bar
|
28 |
+
// if ( api.czr_sektions ) {
|
29 |
+
// var _title_ = ( window.sektionsLocalizedData && sektionsLocalizedData.i18n && sektionsLocalizedData.i18n['Drag and drop content'] ) ? sektionsLocalizedData.i18n['Drag and drop content'] : '';
|
30 |
+
// $header_button = $('<span/>', {
|
31 |
+
// class:'customize-controls-home-or-add',
|
32 |
+
// html:'<span class="screen-reader-text">Home</span><span class="material-icons" title="' + _title_ +'">add_circle_outline</span>'
|
33 |
+
// });
|
34 |
+
// } else {
|
35 |
+
// $header_button = $('<span/>', {
|
36 |
+
// class:'customize-controls-home-or-add fas fa-home',
|
37 |
+
// html:'<span class="screen-reader-text">Home</span>'
|
38 |
+
// });
|
39 |
+
// }
|
40 |
+
|
41 |
+
$header_button = $('<span/>', {
|
42 |
+
class:'customize-controls-home-or-add fas fa-home',
|
43 |
+
html:'<span class="screen-reader-text">Home</span>'
|
44 |
+
});
|
45 |
+
|
46 |
+
$.when( $('#customize-header-actions').append( $header_button ) )
|
47 |
+
.done( function() {
|
48 |
+
$('body').addClass('czr-has-home-btn');
|
49 |
+
$header_button
|
50 |
+
.keydown( function( event ) {
|
51 |
+
if ( 9 === event.which ) // tab
|
52 |
+
return;
|
53 |
+
if ( 13 === event.which ) // enter
|
54 |
+
this.trigger('click');
|
55 |
+
event.preventDefault();
|
56 |
+
})
|
57 |
+
.on( 'click.customize-controls-home-or-add', function() {
|
58 |
+
// if ( api.czr_sektions ) {
|
59 |
+
// api.previewer.trigger( 'sek-pick-content', {});
|
60 |
+
// }
|
61 |
+
//event.preventDefault();
|
62 |
+
//close everything
|
63 |
+
if ( api.section.has( api.czr_activeSectionId() ) ) {
|
64 |
+
api.section( api.czr_activeSectionId() ).expanded( false );
|
65 |
+
} else {
|
66 |
+
api.section.each( function( _s ) {
|
67 |
+
_s.expanded( false );
|
68 |
+
});
|
69 |
+
}
|
70 |
+
api.panel.each( function( _p ) {
|
71 |
+
_p.expanded( false );
|
72 |
+
});
|
73 |
+
});
|
74 |
+
// animate on init
|
75 |
+
// @use button-see-mee css class declared in core in /wp-admin/css/customize-controls.css
|
76 |
+
_.delay( function() {
|
77 |
+
if ( $header_button.hasClass( 'button-see-me') )
|
78 |
+
return;
|
79 |
+
var _seeMe = function() {
|
80 |
+
return $.Deferred(function(){
|
81 |
+
var dfd = this;
|
82 |
+
$header_button.addClass('button-see-me');
|
83 |
+
_.delay( function() {
|
84 |
+
$header_button.removeClass('button-see-me');
|
85 |
+
dfd.resolve();
|
86 |
+
}, 800 );
|
87 |
+
});
|
88 |
+
},
|
89 |
+
i = 0,
|
90 |
+
_seeMeLoop = function() {
|
91 |
+
_seeMe().done( function() {
|
92 |
+
i--;
|
93 |
+
if ( i >= 0 ) {
|
94 |
+
_.delay( function() {
|
95 |
+
_seeMeLoop();
|
96 |
+
}, 50 );
|
97 |
+
}
|
98 |
+
});
|
99 |
+
};
|
100 |
+
_seeMeLoop();
|
101 |
+
}, 2000 );
|
102 |
+
});// done()
|
103 |
+
};
|
104 |
+
|
105 |
+
// Nov 2020 => remove home button for users of blocksy theme
|
106 |
+
// https://github.com/presscustomizr/themes-customizer-fmk/issues/53
|
107 |
+
if ( !_.contains(['blocksy'], serverControlParams.activeTheme ) ) {
|
108 |
+
fireHeaderButtons();
|
109 |
+
}
|
110 |
+
|
111 |
+
});//end of $( function($) ) dom ready
|
112 |
+
})( wp, jQuery );
|
assets/czr/fmk/js/base-fmk/lib/czr-alpha-colorpicker.js
ADDED
@@ -0,0 +1,570 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Dependency : wp-color-picker
|
2 |
+
// 1) Fixed : Error: cannot call methods on dialog prior to initialization; attempted to call method 'close' <= occuring when there are several pickers of the color picker at the same time, and some not fully instanciated yet
|
3 |
+
//, the culprit line is $( 'body' ).trigger( 'click.wpcolorpicker' ).on( 'click.wpcolorpicker', this.close );
|
4 |
+
// @see "nikeo addon" in the code
|
5 |
+
// 2) augmented with https://github.com/kallookoo/wp-color-picker-alpha
|
6 |
+
|
7 |
+
|
8 |
+
|
9 |
+
|
10 |
+
/*!
|
11 |
+
* wp-color-picker-alpha
|
12 |
+
*
|
13 |
+
* Overwrite Automattic Iris for enabled Alpha Channel in wpColorPicker
|
14 |
+
* activated when data-alpha is true
|
15 |
+
*
|
16 |
+
* Version: v2.1.4
|
17 |
+
* https://github.com/kallookoo/wp-color-picker-alpha
|
18 |
+
* Licensed under the GPLv2 license.
|
19 |
+
*/
|
20 |
+
/*! wp-color-picker-alpha v2.1.4, https://github.com/kallookoo/wp-color-picker-alpha, GPLv2 Licensed */
|
21 |
+
( function( $ ) {
|
22 |
+
// Prevent double-init.
|
23 |
+
if ( $.wp.wpColorPicker.prototype._hasAlpha ) {
|
24 |
+
return;
|
25 |
+
}
|
26 |
+
|
27 |
+
// Variable for some backgrounds ( grid )
|
28 |
+
var image = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAAHnlligAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNpi+P///4EDBxiAGMgCCCAGFB5AADGCRBgYDh48CCRZIJS9vT2QBAggFBkmBiSAogxFBiCAoHogAKIKAlBUYTELAiAmEtABEECk20G6BOmuIl0CIMBQ/IEMkO0myiSSraaaBhZcbkUOs0HuBwDplz5uFJ3Z4gAAAABJRU5ErkJggg==',
|
29 |
+
// html stuff for wpColorPicker copy of the original color-picker.js
|
30 |
+
_after = '<div class="wp-picker-holder" />',
|
31 |
+
_wrap = '<div class="wp-picker-container" />',
|
32 |
+
_button = '<input type="button" class="button button-small" />',
|
33 |
+
// Prevent CSS issues in < WordPress 4.9
|
34 |
+
_deprecated = ( nb_wpColorPickerL10n.current !== undefined );
|
35 |
+
// Declare some global variables when is deprecated or not
|
36 |
+
var _before;
|
37 |
+
if ( _deprecated ) {
|
38 |
+
_before = '<a tabindex="0" class="wp-color-result" />';
|
39 |
+
} else {
|
40 |
+
_before = '<button type="button" class="button wp-color-result" aria-expanded="false"><span class="wp-color-result-text"></span></button>';
|
41 |
+
var _wrappingLabel = '<label></label>',
|
42 |
+
_wrappingLabelText = '<span class="screen-reader-text"></span>';
|
43 |
+
}
|
44 |
+
/**
|
45 |
+
* Overwrite Color
|
46 |
+
* for enable support rbga
|
47 |
+
*/
|
48 |
+
Color.fn.toString = function() {
|
49 |
+
if ( this._alpha < 1 )
|
50 |
+
return this.toCSS( 'rgba', this._alpha ).replace( /\s+/g, '' );
|
51 |
+
|
52 |
+
var hex = parseInt( this._color, 10 ).toString( 16 );
|
53 |
+
|
54 |
+
if ( this.error )
|
55 |
+
return '';
|
56 |
+
|
57 |
+
if ( hex.length < 6 )
|
58 |
+
hex = ( '00000' + hex ).substr( -6 );
|
59 |
+
|
60 |
+
return '#' + hex;
|
61 |
+
};
|
62 |
+
|
63 |
+
|
64 |
+
|
65 |
+
|
66 |
+
|
67 |
+
|
68 |
+
|
69 |
+
|
70 |
+
/**
|
71 |
+
* Overwrite wpColorPicker
|
72 |
+
*/
|
73 |
+
$.widget( 'wp.wpColorPicker', $.wp.wpColorPicker, {
|
74 |
+
_hasAlpha: true,
|
75 |
+
/**
|
76 |
+
* @summary Creates the color picker.
|
77 |
+
*
|
78 |
+
* Creates the color picker, sets default values, css classes and wraps it all in HTML.
|
79 |
+
*
|
80 |
+
* @since 3.5.0
|
81 |
+
*
|
82 |
+
* @access private
|
83 |
+
*
|
84 |
+
* @returns {void}
|
85 |
+
*/
|
86 |
+
_create: function() {
|
87 |
+
// Return early if Iris support is missing.
|
88 |
+
if ( ! $.support.iris ) {
|
89 |
+
return;
|
90 |
+
}
|
91 |
+
|
92 |
+
var self = this,
|
93 |
+
el = self.element;
|
94 |
+
|
95 |
+
// Override default options with options bound to the element.
|
96 |
+
$.extend( self.options, el.data() );
|
97 |
+
|
98 |
+
// Create a color picker which only allows adjustments to the hue.
|
99 |
+
if ( self.options.type === 'hue' ) {
|
100 |
+
return self._createHueOnly();
|
101 |
+
}
|
102 |
+
|
103 |
+
// Bind the close event.
|
104 |
+
self.close = $.proxy( self.close, self );
|
105 |
+
|
106 |
+
self.initialValue = el.val();
|
107 |
+
|
108 |
+
// Add a CSS class to the input field.
|
109 |
+
el.addClass( 'wp-color-picker' );
|
110 |
+
|
111 |
+
if ( _deprecated ) {
|
112 |
+
el.hide().wrap( _wrap );
|
113 |
+
self.wrap = el.parent();
|
114 |
+
self.toggler = $( _before )
|
115 |
+
.insertBefore( el )
|
116 |
+
.css( { backgroundColor : self.initialValue } )
|
117 |
+
.attr( 'title', nb_wpColorPickerL10n.pick )
|
118 |
+
.attr( 'data-current', nb_wpColorPickerL10n.current );
|
119 |
+
self.pickerContainer = $( _after ).insertAfter( el );
|
120 |
+
self.button = $( _button ).addClass('hidden');
|
121 |
+
} else {
|
122 |
+
/*
|
123 |
+
* Check if there's already a wrapping label, e.g. in the Customizer.
|
124 |
+
* If there's no label, add a default one to match the Customizer template.
|
125 |
+
*/
|
126 |
+
if ( ! el.parent( 'label' ).length ) {
|
127 |
+
// Wrap the input field in the default label.
|
128 |
+
el.wrap( _wrappingLabel );
|
129 |
+
// Insert the default label text.
|
130 |
+
self.wrappingLabelText = $( _wrappingLabelText )
|
131 |
+
.insertBefore( el )
|
132 |
+
.text( nb_wpColorPickerL10n.defaultLabel );
|
133 |
+
}
|
134 |
+
|
135 |
+
/*
|
136 |
+
* At this point, either it's the standalone version or the Customizer
|
137 |
+
* one, we have a wrapping label to use as hook in the DOM, let's store it.
|
138 |
+
*/
|
139 |
+
self.wrappingLabel = el.parent();
|
140 |
+
|
141 |
+
// Wrap the label in the main wrapper.
|
142 |
+
self.wrappingLabel.wrap( _wrap );
|
143 |
+
// Store a reference to the main wrapper.
|
144 |
+
self.wrap = self.wrappingLabel.parent();
|
145 |
+
// Set up the toggle button and insert it before the wrapping label.
|
146 |
+
self.toggler = $( _before )
|
147 |
+
.insertBefore( self.wrappingLabel )
|
148 |
+
.css( { backgroundColor: self.initialValue } );
|
149 |
+
// Set the toggle button span element text.
|
150 |
+
self.toggler.find( '.wp-color-result-text' ).text( nb_wpColorPickerL10n.pick );
|
151 |
+
// Set up the Iris container and insert it after the wrapping label.
|
152 |
+
self.pickerContainer = $( _after ).insertAfter( self.wrappingLabel );
|
153 |
+
// Store a reference to the Clear/Default button.
|
154 |
+
self.button = $( _button );
|
155 |
+
}
|
156 |
+
|
157 |
+
// Set up the Clear/Default button.
|
158 |
+
if ( self.options.defaultColor ) {
|
159 |
+
self.button.addClass( 'wp-picker-default' ).val( nb_wpColorPickerL10n.defaultString );
|
160 |
+
if ( ! _deprecated ) {
|
161 |
+
self.button.attr( 'aria-label', nb_wpColorPickerL10n.defaultAriaLabel );
|
162 |
+
}
|
163 |
+
} else {
|
164 |
+
self.button.addClass( 'wp-picker-clear' ).val( nb_wpColorPickerL10n.clear );
|
165 |
+
if ( ! _deprecated ) {
|
166 |
+
self.button.attr( 'aria-label', nb_wpColorPickerL10n.clearAriaLabel );
|
167 |
+
}
|
168 |
+
}
|
169 |
+
|
170 |
+
if ( _deprecated ) {
|
171 |
+
el.wrap( '<span class="wp-picker-input-wrap" />' ).after( self.button );
|
172 |
+
} else {
|
173 |
+
// Wrap the wrapping label in its wrapper and append the Clear/Default button.
|
174 |
+
self.wrappingLabel
|
175 |
+
.wrap( '<span class="wp-picker-input-wrap hidden" />' )
|
176 |
+
.after( self.button );
|
177 |
+
|
178 |
+
/*
|
179 |
+
* The input wrapper now contains the label+input+Clear/Default button.
|
180 |
+
* Store a reference to the input wrapper: we'll use this to toggle
|
181 |
+
* the controls visibility.
|
182 |
+
*/
|
183 |
+
self.inputWrapper = el.closest( '.wp-picker-input-wrap' );
|
184 |
+
}
|
185 |
+
|
186 |
+
el.iris( {
|
187 |
+
target: self.pickerContainer,
|
188 |
+
hide: self.options.hide,
|
189 |
+
width: self.options.width,
|
190 |
+
mode: self.options.mode,
|
191 |
+
palettes: self.options.palettes,
|
192 |
+
/**
|
193 |
+
* @summary Handles the onChange event if one has been defined in the options.
|
194 |
+
*
|
195 |
+
* Handles the onChange event if one has been defined in the options and additionally
|
196 |
+
* sets the background color for the toggler element.
|
197 |
+
*
|
198 |
+
* @since 3.5.0
|
199 |
+
*
|
200 |
+
* @param {Event} event The event that's being called.
|
201 |
+
* @param {HTMLElement} ui The HTMLElement containing the color picker.
|
202 |
+
*
|
203 |
+
* @returns {void}
|
204 |
+
*/
|
205 |
+
change: function( event, ui ) {
|
206 |
+
if ( self.options.alpha ) {
|
207 |
+
self.toggler.css( { 'background-image' : 'url(' + image + ')' } );
|
208 |
+
if ( _deprecated ) {
|
209 |
+
self.toggler.html( '<span class="color-alpha" />' );
|
210 |
+
} else {
|
211 |
+
self.toggler.css( {
|
212 |
+
'position' : 'relative'
|
213 |
+
} );
|
214 |
+
if ( self.toggler.find('span.color-alpha').length == 0 ) {
|
215 |
+
self.toggler.append('<span class="color-alpha" />');
|
216 |
+
}
|
217 |
+
}
|
218 |
+
|
219 |
+
self.toggler.find( 'span.color-alpha' ).css( {
|
220 |
+
'width' : '30px',
|
221 |
+
'height' : '100%',
|
222 |
+
'position' : 'absolute',
|
223 |
+
'top' : 0,
|
224 |
+
'left' : 0,
|
225 |
+
'border-top-left-radius' : '2px',
|
226 |
+
'border-bottom-left-radius' : '2px',
|
227 |
+
'background' : ui.color.toString()
|
228 |
+
} );
|
229 |
+
} else {
|
230 |
+
self.toggler.css( { backgroundColor : ui.color.toString() } );
|
231 |
+
}
|
232 |
+
|
233 |
+
if ( typeof self.options.change === "function" ) {
|
234 |
+
self.options.change.call( this, event, ui );
|
235 |
+
}
|
236 |
+
}
|
237 |
+
} );
|
238 |
+
|
239 |
+
el.val( self.initialValue );
|
240 |
+
self._addListeners();
|
241 |
+
|
242 |
+
// Force the color picker to always be closed on initial load.
|
243 |
+
if ( ! self.options.hide ) {
|
244 |
+
self.toggler.trigger('click');
|
245 |
+
}
|
246 |
+
|
247 |
+
// @nikeo addon
|
248 |
+
el.on('czr-colorpicker-close', function() {
|
249 |
+
if ( self.toggler.hasClass( 'wp-picker-open' ) ) {
|
250 |
+
self.close();
|
251 |
+
}
|
252 |
+
});
|
253 |
+
},
|
254 |
+
/**
|
255 |
+
* @summary Binds event listeners to the color picker.
|
256 |
+
*
|
257 |
+
* @since 3.5.0
|
258 |
+
*
|
259 |
+
* @access private
|
260 |
+
*
|
261 |
+
* @returns {void}
|
262 |
+
*/
|
263 |
+
_addListeners: function() {
|
264 |
+
var self = this;
|
265 |
+
|
266 |
+
/**
|
267 |
+
* @summary Prevent any clicks inside this widget from leaking to the top and closing it.
|
268 |
+
*
|
269 |
+
* @since 3.5.0
|
270 |
+
*
|
271 |
+
* @param {Event} event The event that's being called.
|
272 |
+
*
|
273 |
+
* @returs {void}
|
274 |
+
*/
|
275 |
+
self.wrap.on( 'click.wpcolorpicker', function( event ) {
|
276 |
+
event.stopPropagation();
|
277 |
+
});
|
278 |
+
|
279 |
+
/**
|
280 |
+
* @summary Open or close the color picker depending on the class.
|
281 |
+
*
|
282 |
+
* @since 3.5
|
283 |
+
*/
|
284 |
+
self.toggler.on('click', function(){
|
285 |
+
if ( self.toggler.hasClass( 'wp-picker-open' ) ) {
|
286 |
+
self.close();
|
287 |
+
} else {
|
288 |
+
self.open();
|
289 |
+
}
|
290 |
+
});
|
291 |
+
|
292 |
+
/**
|
293 |
+
* @summary Checks if value is empty when changing the color in the color picker.
|
294 |
+
*
|
295 |
+
* Checks if value is empty when changing the color in the color picker.
|
296 |
+
* If so, the background color is cleared.
|
297 |
+
*
|
298 |
+
* @since 3.5.0
|
299 |
+
*
|
300 |
+
* @param {Event} event The event that's being called.
|
301 |
+
*
|
302 |
+
* @returns {void}
|
303 |
+
*/
|
304 |
+
self.element.on( 'change', function( event ) {
|
305 |
+
// Empty or Error = clear
|
306 |
+
if ( $( this ).val() === '' || self.element.hasClass( 'iris-error' ) ) {
|
307 |
+
if ( self.options.alpha ) {
|
308 |
+
if ( _deprecated ) {
|
309 |
+
self.toggler.removeAttr( 'style' );
|
310 |
+
}
|
311 |
+
self.toggler.find( 'span.color-alpha' ).css( 'backgroundColor', '' );
|
312 |
+
} else {
|
313 |
+
self.toggler.css( 'backgroundColor', '' );
|
314 |
+
}
|
315 |
+
|
316 |
+
// fire clear callback if we have one
|
317 |
+
if ( typeof self.options.clear === "function" )
|
318 |
+
self.options.clear.call( this, event );
|
319 |
+
}
|
320 |
+
} );
|
321 |
+
|
322 |
+
/**
|
323 |
+
* @summary Enables the user to clear or revert the color in the color picker.
|
324 |
+
*
|
325 |
+
* Enables the user to either clear the color in the color picker or revert back to the default color.
|
326 |
+
*
|
327 |
+
* @since 3.5.0
|
328 |
+
*
|
329 |
+
* @param {Event} event The event that's being called.
|
330 |
+
*
|
331 |
+
* @returns {void}
|
332 |
+
*/
|
333 |
+
self.button.on( 'click', function( event ) {
|
334 |
+
if ( $( this ).hasClass( 'wp-picker-clear' ) ) {
|
335 |
+
self.element.val( '' );
|
336 |
+
if ( self.options.alpha ) {
|
337 |
+
if ( _deprecated ) {
|
338 |
+
self.toggler.removeAttr( 'style' );
|
339 |
+
}
|
340 |
+
self.toggler.find( 'span.color-alpha' ).css( 'backgroundColor', '' );
|
341 |
+
} else {
|
342 |
+
self.toggler.css( 'backgroundColor', '' );
|
343 |
+
}
|
344 |
+
|
345 |
+
if ( typeof self.options.clear === "function" )
|
346 |
+
self.options.clear.call( this, event );
|
347 |
+
|
348 |
+
} else if ( $( this ).hasClass( 'wp-picker-default' ) ) {
|
349 |
+
self.element.val( self.options.defaultColor ).trigger('change');
|
350 |
+
}
|
351 |
+
});
|
352 |
+
},//_addListeners
|
353 |
+
|
354 |
+
/**
|
355 |
+
* @summary Opens the color picker dialog.
|
356 |
+
*
|
357 |
+
* @since 3.5.0
|
358 |
+
*
|
359 |
+
* @returns {void}
|
360 |
+
*/
|
361 |
+
open: function() {
|
362 |
+
var self = this;
|
363 |
+
// @nikeo addon => triggering the click can generate an error when triggered on an element for which iris is not fully instanciated yet
|
364 |
+
// "Error: cannot call methods on dialog prior to initialization; attempted to call method 'close'""
|
365 |
+
//$( 'body' ).trigger( 'click.wpcolorpicker' ).on( 'click.wpcolorpicker', this.close ); <= original
|
366 |
+
// Close any other opened iris instance
|
367 |
+
$( 'body' ).find('.wp-color-picker').not( self.element ).each( function() {
|
368 |
+
$(this).trigger('czr-colorpicker-close');
|
369 |
+
});
|
370 |
+
|
371 |
+
this.element.iris( 'toggle' );
|
372 |
+
this.inputWrapper.removeClass( 'hidden' );
|
373 |
+
this.wrap.addClass( 'wp-picker-active' );
|
374 |
+
this.toggler
|
375 |
+
.addClass( 'wp-picker-open' )
|
376 |
+
.attr( 'aria-expanded', 'true' );
|
377 |
+
},
|
378 |
+
/**
|
379 |
+
* @summary Closes the color picker dialog.
|
380 |
+
*
|
381 |
+
* @since 3.5.0
|
382 |
+
*
|
383 |
+
* @returns {void}
|
384 |
+
*/
|
385 |
+
close: function() {
|
386 |
+
try { this.element.iris( 'toggle' ); } catch( er ) { console.log('color-picker => error on ::close()', er ); }
|
387 |
+
this.inputWrapper.addClass( 'hidden' );
|
388 |
+
this.wrap.removeClass( 'wp-picker-active' );
|
389 |
+
this.toggler
|
390 |
+
.removeClass( 'wp-picker-open' )
|
391 |
+
.attr( 'aria-expanded', 'false' );
|
392 |
+
//@nikeo addon
|
393 |
+
//$( 'body' ).off( 'click.wpcolorpicker', this.close );
|
394 |
+
},
|
395 |
+
});
|
396 |
+
|
397 |
+
|
398 |
+
|
399 |
+
|
400 |
+
|
401 |
+
|
402 |
+
|
403 |
+
|
404 |
+
|
405 |
+
|
406 |
+
|
407 |
+
|
408 |
+
|
409 |
+
/**
|
410 |
+
* Overwrite iris
|
411 |
+
*/
|
412 |
+
$.widget( 'a8c.iris', $.a8c.iris, {
|
413 |
+
_create: function() {
|
414 |
+
this._super();
|
415 |
+
|
416 |
+
// Global option for check is mode rbga is enabled
|
417 |
+
this.options.alpha = this.element.data( 'alpha' ) || false;
|
418 |
+
|
419 |
+
// Is not input disabled
|
420 |
+
if ( ! this.element.is( ':input' ) )
|
421 |
+
this.options.alpha = false;
|
422 |
+
|
423 |
+
if ( typeof this.options.alpha !== 'undefined' && this.options.alpha ) {
|
424 |
+
var self = this,
|
425 |
+
el = self.element,
|
426 |
+
_html = '<div class="iris-strip iris-slider iris-alpha-slider"><div class="iris-slider-offset iris-slider-offset-alpha"></div></div>',
|
427 |
+
aContainer = $( _html ).appendTo( self.picker.find( '.iris-picker-inner' ) ),
|
428 |
+
aSlider = aContainer.find( '.iris-slider-offset-alpha' ),
|
429 |
+
controls = {
|
430 |
+
aContainer : aContainer,
|
431 |
+
aSlider : aSlider
|
432 |
+
};
|
433 |
+
|
434 |
+
if ( typeof el.data( 'custom-width' ) !== 'undefined' ) {
|
435 |
+
self.options.customWidth = parseInt( el.data( 'custom-width' ) ) || 0;
|
436 |
+
} else {
|
437 |
+
self.options.customWidth = 100;
|
438 |
+
}
|
439 |
+
|
440 |
+
// Set default width for input reset
|
441 |
+
self.options.defaultWidth = el.width();
|
442 |
+
|
443 |
+
// Update width for input
|
444 |
+
if ( self._color._alpha < 1 || self._color.toString().indexOf('rgb') != -1 )
|
445 |
+
el.width( parseInt( self.options.defaultWidth + self.options.customWidth ) );
|
446 |
+
|
447 |
+
// Push new controls
|
448 |
+
$.each( controls, function( k, v ) {
|
449 |
+
self.controls[k] = v;
|
450 |
+
} );
|
451 |
+
|
452 |
+
// Change size strip and add margin for sliders
|
453 |
+
self.controls.square.css( { 'margin-right': '0' } );
|
454 |
+
var emptyWidth = ( self.picker.width() - self.controls.square.width() - 20 ),
|
455 |
+
stripsMargin = ( emptyWidth / 6 ),
|
456 |
+
stripsWidth = ( ( emptyWidth / 2 ) - stripsMargin );
|
457 |
+
|
458 |
+
$.each( [ 'aContainer', 'strip' ], function( k, v ) {
|
459 |
+
self.controls[v].width( stripsWidth ).css( { 'margin-left' : stripsMargin + 'px' } );
|
460 |
+
} );
|
461 |
+
|
462 |
+
// Add new slider
|
463 |
+
self._initControls();
|
464 |
+
|
465 |
+
// For updated widget
|
466 |
+
self._change();
|
467 |
+
}
|
468 |
+
},
|
469 |
+
_initControls: function() {
|
470 |
+
this._super();
|
471 |
+
|
472 |
+
if ( this.options.alpha ) {
|
473 |
+
var self = this,
|
474 |
+
controls = self.controls;
|
475 |
+
|
476 |
+
controls.aSlider.slider({
|
477 |
+
orientation : 'vertical',
|
478 |
+
min : 0,
|
479 |
+
max : 100,
|
480 |
+
step : 1,
|
481 |
+
value : parseInt( self._color._alpha * 100 ),
|
482 |
+
slide : function( event, ui ) {
|
483 |
+
// Update alpha value
|
484 |
+
self._color._alpha = parseFloat( ui.value / 100 );
|
485 |
+
self._change.apply( self, arguments );
|
486 |
+
}
|
487 |
+
});
|
488 |
+
}
|
489 |
+
},
|
490 |
+
_change: function() {
|
491 |
+
this._super();
|
492 |
+
|
493 |
+
var self = this,
|
494 |
+
el = self.element;
|
495 |
+
|
496 |
+
if ( this.options.alpha ) {
|
497 |
+
var controls = self.controls,
|
498 |
+
alpha = parseInt( self._color._alpha * 100 ),
|
499 |
+
color = self._color.toRgb(),
|
500 |
+
gradient = [
|
501 |
+
'rgb(' + color.r + ',' + color.g + ',' + color.b + ') 0%',
|
502 |
+
'rgba(' + color.r + ',' + color.g + ',' + color.b + ', 0) 100%'
|
503 |
+
],
|
504 |
+
defaultWidth = self.options.defaultWidth,
|
505 |
+
customWidth = self.options.customWidth,
|
506 |
+
target = self.picker.closest( '.wp-picker-container' ).find( '.wp-color-result' );
|
507 |
+
|
508 |
+
// Generate background slider alpha, only for CSS3 old browser fuck!! :)
|
509 |
+
controls.aContainer.css( { 'background' : 'linear-gradient(to bottom, ' + gradient.join( ', ' ) + '), url(' + image + ')' } );
|
510 |
+
|
511 |
+
if ( target.hasClass( 'wp-picker-open' ) ) {
|
512 |
+
// Update alpha value
|
513 |
+
controls.aSlider.slider( 'value', alpha );
|
514 |
+
|
515 |
+
/**
|
516 |
+
* Disabled change opacity in default slider Saturation ( only is alpha enabled )
|
517 |
+
* and change input width for view all value
|
518 |
+
*/
|
519 |
+
if ( self._color._alpha < 1 ) {
|
520 |
+
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)' ) );
|
521 |
+
el.width( parseInt( defaultWidth + customWidth ) );
|
522 |
+
} else {
|
523 |
+
el.width( defaultWidth );
|
524 |
+
}
|
525 |
+
}
|
526 |
+
}
|
527 |
+
|
528 |
+
var reset = el.data( 'reset-alpha' ) || false;
|
529 |
+
|
530 |
+
if ( reset ) {
|
531 |
+
self.picker.find( '.iris-palette-container' ).on( 'click.palette', '.iris-palette', function() {
|
532 |
+
self._color._alpha = 1;
|
533 |
+
self.active = 'external';
|
534 |
+
self._change();
|
535 |
+
} );
|
536 |
+
}
|
537 |
+
},
|
538 |
+
_addInputListeners: function( input ) {
|
539 |
+
var self = this,
|
540 |
+
debounceTimeout = 100,
|
541 |
+
callback = function( event ) {
|
542 |
+
var color = new Color( input.val() ),
|
543 |
+
val = input.val();
|
544 |
+
|
545 |
+
input.removeClass( 'iris-error' );
|
546 |
+
// we gave a bad color
|
547 |
+
if ( color.error ) {
|
548 |
+
// don't error on an empty input
|
549 |
+
if ( val !== '' )
|
550 |
+
input.addClass( 'iris-error' );
|
551 |
+
} else {
|
552 |
+
if ( color.toString() !== self._color.toString() ) {
|
553 |
+
// let's not do this on keyup for hex shortcodes
|
554 |
+
if ( ! ( event.type === 'keyup' && val.match( /^[0-9a-fA-F]{3}$/ ) ) )
|
555 |
+
self._setOption( 'color', color.toString() );
|
556 |
+
}
|
557 |
+
}
|
558 |
+
};
|
559 |
+
|
560 |
+
input.on( 'change', callback ).on( 'keyup', self._debounce( callback, debounceTimeout ) );
|
561 |
+
|
562 |
+
// If we initialized hidden, show on first focus. The rest is up to you.
|
563 |
+
if ( self.options.hide ) {
|
564 |
+
input.on( 'focus', function() {
|
565 |
+
self.show();
|
566 |
+
} );
|
567 |
+
}
|
568 |
+
}
|
569 |
+
} );
|
570 |
+
}( jQuery ) );
|
assets/czr/fmk/js/base-fmk/lib/czr-alpha-colorpicker.min.js
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
* wp-color-picker-alpha
|
3 |
+
*
|
4 |
+
* Overwrite Automattic Iris for enabled Alpha Channel in wpColorPicker
|
5 |
+
* activated when data-alpha is true
|
6 |
+
*
|
7 |
+
* Version: v2.1.4
|
8 |
+
* https://github.com/kallookoo/wp-color-picker-alpha
|
9 |
+
* Licensed under the GPLv2 license.
|
10 |
+
*/
|
11 |
+
/*! wp-color-picker-alpha v2.1.4, https://github.com/kallookoo/wp-color-picker-alpha, GPLv2 Licensed */
|
12 |
+
!function(t){if(!t.wp.wpColorPicker.prototype._hasAlpha){var e,o="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAAHnlligAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNpi+P///4EDBxiAGMgCCCAGFB5AADGCRBgYDh48CCRZIJS9vT2QBAggFBkmBiSAogxFBiCAoHogAKIKAlBUYTELAiAmEtABEECk20G6BOmuIl0CIMBQ/IEMkO0myiSSraaaBhZcbkUOs0HuBwDplz5uFJ3Z4gAAAABJRU5ErkJggg==",r='<div class="wp-picker-holder" />',i='<div class="wp-picker-container" />',a='<input type="button" class="button button-small" />',n=void 0!==nb_wpColorPickerL10n.current;if(n)e='<a tabindex="0" class="wp-color-result" />';else{e='<button type="button" class="button wp-color-result" aria-expanded="false"><span class="wp-color-result-text"></span></button>';var l="<label></label>",s='<span class="screen-reader-text"></span>'}Color.fn.toString=function(){if(this._alpha<1)return this.toCSS("rgba",this._alpha).replace(/\s+/g,"");var t=parseInt(this._color,10).toString(16);return this.error?"":(t.length<6&&(t=("00000"+t).substr(-6)),"#"+t)},t.widget("wp.wpColorPicker",t.wp.wpColorPicker,{_hasAlpha:!0,_create:function(){if(t.support.iris){var p=this,c=p.element;if(t.extend(p.options,c.data()),"hue"===p.options.type)return p._createHueOnly();p.close=t.proxy(p.close,p),p.initialValue=c.val(),c.addClass("wp-color-picker"),n?(c.hide().wrap(i),p.wrap=c.parent(),p.toggler=t(e).insertBefore(c).css({backgroundColor:p.initialValue}).attr("title",nb_wpColorPickerL10n.pick).attr("data-current",nb_wpColorPickerL10n.current),p.pickerContainer=t(r).insertAfter(c),p.button=t(a).addClass("hidden")):(c.parent("label").length||(c.wrap(l),p.wrappingLabelText=t(s).insertBefore(c).text(nb_wpColorPickerL10n.defaultLabel)),p.wrappingLabel=c.parent(),p.wrappingLabel.wrap(i),p.wrap=p.wrappingLabel.parent(),p.toggler=t(e).insertBefore(p.wrappingLabel).css({backgroundColor:p.initialValue}),p.toggler.find(".wp-color-result-text").text(nb_wpColorPickerL10n.pick),p.pickerContainer=t(r).insertAfter(p.wrappingLabel),p.button=t(a)),p.options.defaultColor?(p.button.addClass("wp-picker-default").val(nb_wpColorPickerL10n.defaultString),n||p.button.attr("aria-label",nb_wpColorPickerL10n.defaultAriaLabel)):(p.button.addClass("wp-picker-clear").val(nb_wpColorPickerL10n.clear),n||p.button.attr("aria-label",nb_wpColorPickerL10n.clearAriaLabel)),n?c.wrap('<span class="wp-picker-input-wrap" />').after(p.button):(p.wrappingLabel.wrap('<span class="wp-picker-input-wrap hidden" />').after(p.button),p.inputWrapper=c.closest(".wp-picker-input-wrap")),c.iris({target:p.pickerContainer,hide:p.options.hide,width:p.options.width,mode:p.options.mode,palettes:p.options.palettes,change:function(t,e){p.options.alpha?(p.toggler.css({"background-image":"url("+o+")"}),n?p.toggler.html('<span class="color-alpha" />'):(p.toggler.css({position:"relative"}),0==p.toggler.find("span.color-alpha").length&&p.toggler.append('<span class="color-alpha" />')),p.toggler.find("span.color-alpha").css({width:"30px",height:"100%",position:"absolute",top:0,left:0,"border-top-left-radius":"2px","border-bottom-left-radius":"2px",background:e.color.toString()})):p.toggler.css({backgroundColor:e.color.toString()}),"function"==typeof p.options.change&&p.options.change.call(this,t,e)}}),c.val(p.initialValue),p._addListeners(),p.options.hide||p.toggler.trigger("click"),c.on("czr-colorpicker-close",function(){p.toggler.hasClass("wp-picker-open")&&p.close()})}},_addListeners:function(){var e=this;e.wrap.on("click.wpcolorpicker",function(t){t.stopPropagation()}),e.toggler.on("click",function(){e.toggler.hasClass("wp-picker-open")?e.close():e.open()}),e.element.on("change",function(o){(""===t(this).val()||e.element.hasClass("iris-error"))&&(e.options.alpha?(n&&e.toggler.removeAttr("style"),e.toggler.find("span.color-alpha").css("backgroundColor","")):e.toggler.css("backgroundColor",""),"function"==typeof e.options.clear&&e.options.clear.call(this,o))}),e.button.on("click",function(o){t(this).hasClass("wp-picker-clear")?(e.element.val(""),e.options.alpha?(n&&e.toggler.removeAttr("style"),e.toggler.find("span.color-alpha").css("backgroundColor","")):e.toggler.css("backgroundColor",""),"function"==typeof e.options.clear&&e.options.clear.call(this,o)):t(this).hasClass("wp-picker-default")&&e.element.val(e.options.defaultColor).trigger("change")})},open:function(){t("body").find(".wp-color-picker").not(this.element).each(function(){t(this).trigger("czr-colorpicker-close")}),this.element.iris("toggle"),this.inputWrapper.removeClass("hidden"),this.wrap.addClass("wp-picker-active"),this.toggler.addClass("wp-picker-open").attr("aria-expanded","true")},close:function(){try{this.element.iris("toggle")}catch(t){console.log("color-picker => error on ::close()",t)}this.inputWrapper.addClass("hidden"),this.wrap.removeClass("wp-picker-active"),this.toggler.removeClass("wp-picker-open").attr("aria-expanded","false")}}),t.widget("a8c.iris",t.a8c.iris,{_create:function(){if(this._super(),this.options.alpha=this.element.data("alpha")||!1,this.element.is(":input")||(this.options.alpha=!1),void 0!==this.options.alpha&&this.options.alpha){var e=this,o=e.element,r=t('<div class="iris-strip iris-slider iris-alpha-slider"><div class="iris-slider-offset iris-slider-offset-alpha"></div></div>').appendTo(e.picker.find(".iris-picker-inner")),i={aContainer:r,aSlider:r.find(".iris-slider-offset-alpha")};void 0!==o.data("custom-width")?e.options.customWidth=parseInt(o.data("custom-width"))||0:e.options.customWidth=100,e.options.defaultWidth=o.width(),(e._color._alpha<1||-1!=e._color.toString().indexOf("rgb"))&&o.width(parseInt(e.options.defaultWidth+e.options.customWidth)),t.each(i,function(t,o){e.controls[t]=o}),e.controls.square.css({"margin-right":"0"});var a=e.picker.width()-e.controls.square.width()-20,n=a/6,l=a/2-n;t.each(["aContainer","strip"],function(t,o){e.controls[o].width(l).css({"margin-left":n+"px"})}),e._initControls(),e._change()}},_initControls:function(){if(this._super(),this.options.alpha){var t=this;t.controls.aSlider.slider({orientation:"vertical",min:0,max:100,step:1,value:parseInt(100*t._color._alpha),slide:function(e,o){t._color._alpha=parseFloat(o.value/100),t._change.apply(t,arguments)}})}},_change:function(){this._super();var t=this,e=t.element;if(this.options.alpha){var r=t.controls,i=parseInt(100*t._color._alpha),a=t._color.toRgb(),n=["rgb("+a.r+","+a.g+","+a.b+") 0%","rgba("+a.r+","+a.g+","+a.b+", 0) 100%"],l=t.options.defaultWidth,s=t.options.customWidth,p=t.picker.closest(".wp-picker-container").find(".wp-color-result");r.aContainer.css({background:"linear-gradient(to bottom, "+n.join(", ")+"), url("+o+")"}),p.hasClass("wp-picker-open")&&(r.aSlider.slider("value",i),t._color._alpha<1?(r.strip.attr("style",r.strip.attr("style").replace(/rgba\(([0-9]+,)(\s+)?([0-9]+,)(\s+)?([0-9]+)(,(\s+)?[0-9\.]+)\)/g,"rgb($1$3$5)")),e.width(parseInt(l+s))):e.width(l))}(e.data("reset-alpha")||!1)&&t.picker.find(".iris-palette-container").on("click.palette",".iris-palette",function(){t._color._alpha=1,t.active="external",t._change()})},_addInputListeners:function(t){var e=this,o=function(o){var r=new Color(t.val()),i=t.val();t.removeClass("iris-error"),r.error?""!==i&&t.addClass("iris-error"):r.toString()!==e._color.toString()&&("keyup"===o.type&&i.match(/^[0-9a-fA-F]{3}$/)||e._setOption("color",r.toString()))};t.on("change",o).on("keyup",e._debounce(o,100)),e.options.hide&&t.on("focus",function(){e.show()})}})}}(jQuery);
|
assets/czr/fmk/js/base-fmk/lib/czrSelect2.js
ADDED
@@ -0,0 +1,5725 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
* CzrSelect2 namespaced version of Select2 4.0.3
|
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 exports === 'object') {
|
13 |
+
// Node/CommonJS
|
14 |
+
factory(require('jquery'));
|
15 |
+
} else {
|
16 |
+
// Browser globals
|
17 |
+
factory(jQuery);
|
18 |
+
}
|
19 |
+
}(function (jQuery) {
|
20 |
+
// This is needed so we can catch the AMD loader configuration and use it
|
21 |
+
// The inner file should be wrapped (by `banner.start.js`) in a function that
|
22 |
+
// returns the AMD loader references.
|
23 |
+
var S2 =
|
24 |
+
(function () {
|
25 |
+
// Restore the CzrSelect2 AMD loader so it can be used
|
26 |
+
// Needed mostly in the language files, where the loader is not inserted
|
27 |
+
if (jQuery && jQuery.fn && jQuery.fn.czrSelect2 && jQuery.fn.czrSelect2.amd) {
|
28 |
+
var S2 = jQuery.fn.czrSelect2.amd;
|
29 |
+
}
|
30 |
+
var S2;(function () { if (!S2 || !S2.requirejs) {
|
31 |
+
if (!S2) { S2 = {}; } else { require = S2; }
|
32 |
+
/**
|
33 |
+
* @license almond 0.3.1 Copyright (c) 2011-2014, The Dojo Foundation All Rights Reserved.
|
34 |
+
* Available via the MIT or new BSD license.
|
35 |
+
* see: http://github.com/jrburke/almond for details
|
36 |
+
*/
|
37 |
+
//Going sloppy to avoid 'use strict' string cost, but strict practices should
|
38 |
+
//be followed.
|
39 |
+
/*jslint sloppy: true */
|
40 |
+
/*global setTimeout: false */
|
41 |
+
|
42 |
+
var requirejs, require, define;
|
43 |
+
(function (undef) {
|
44 |
+
var main, req, makeMap, handlers,
|
45 |
+
defined = {},
|
46 |
+
waiting = {},
|
47 |
+
config = {},
|
48 |
+
defining = {},
|
49 |
+
hasOwn = Object.prototype.hasOwnProperty,
|
50 |
+
aps = [].slice,
|
51 |
+
jsSuffixRegExp = /\.js$/;
|
52 |
+
|
53 |
+
function hasProp(obj, prop) {
|
54 |
+
return hasOwn.call(obj, prop);
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Given a relative module name, like ./something, normalize it to
|
59 |
+
* a real name that can be mapped to a path.
|
60 |
+
* @param {String} name the relative name
|
61 |
+
* @param {String} baseName a real name that the name arg is relative
|
62 |
+
* to.
|
63 |
+
* @returns {String} normalized name
|
64 |
+
*/
|
65 |
+
function normalize(name, baseName) {
|
66 |
+
var nameParts, nameSegment, mapValue, foundMap, lastIndex,
|
67 |
+
foundI, foundStarMap, starI, i, j, part,
|
68 |
+
baseParts = baseName && baseName.split("/"),
|
69 |
+
map = config.map,
|
70 |
+
starMap = (map && map['*']) || {};
|
71 |
+
|
72 |
+
//Adjust any relative paths.
|
73 |
+
if (name && name.charAt(0) === ".") {
|
74 |
+
//If have a base name, try to normalize against it,
|
75 |
+
//otherwise, assume it is a top-level require that will
|
76 |
+
//be relative to baseUrl in the end.
|
77 |
+
if (baseName) {
|
78 |
+
name = name.split('/');
|
79 |
+
lastIndex = name.length - 1;
|
80 |
+
|
81 |
+
// Node .js allowance:
|
82 |
+
if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) {
|
83 |
+
name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, '');
|
84 |
+
}
|
85 |
+
|
86 |
+
//Lop off the last part of baseParts, so that . matches the
|
87 |
+
//"directory" and not name of the baseName's module. For instance,
|
88 |
+
//baseName of "one/two/three", maps to "one/two/three.js", but we
|
89 |
+
//want the directory, "one/two" for this normalization.
|
90 |
+
name = baseParts.slice(0, baseParts.length - 1).concat(name);
|
91 |
+
|
92 |
+
//start trimDots
|
93 |
+
for (i = 0; i < name.length; i += 1) {
|
94 |
+
part = name[i];
|
95 |
+
if (part === ".") {
|
96 |
+
name.splice(i, 1);
|
97 |
+
i -= 1;
|
98 |
+
} else if (part === "..") {
|
99 |
+
if (i === 1 && (name[2] === '..' || name[0] === '..')) {
|
100 |
+
//End of the line. Keep at least one non-dot
|
101 |
+
//path segment at the front so it can be mapped
|
102 |
+
//correctly to disk. Otherwise, there is likely
|
103 |
+
//no path mapping for a path starting with '..'.
|
104 |
+
//This can still fail, but catches the most reasonable
|
105 |
+
//uses of ..
|
106 |
+
break;
|
107 |
+
} else if (i > 0) {
|
108 |
+
name.splice(i - 1, 2);
|
109 |
+
i -= 2;
|
110 |
+
}
|
111 |
+
}
|
112 |
+
}
|
113 |
+
//end trimDots
|
114 |
+
|
115 |
+
name = name.join("/");
|
116 |
+
} else if (name.indexOf('./') === 0) {
|
117 |
+
// No baseName, so this is ID is resolved relative
|
118 |
+
// to baseUrl, pull off the leading dot.
|
119 |
+
name = name.substring(2);
|
120 |
+
}
|
121 |
+
}
|
122 |
+
|
123 |
+
//Apply map config if available.
|
124 |
+
if ((baseParts || starMap) && map) {
|
125 |
+
nameParts = name.split('/');
|
126 |
+
|
127 |
+
for (i = nameParts.length; i > 0; i -= 1) {
|
128 |
+
nameSegment = nameParts.slice(0, i).join("/");
|
129 |
+
|
130 |
+
if (baseParts) {
|
131 |
+
//Find the longest baseName segment match in the config.
|
132 |
+
//So, do joins on the biggest to smallest lengths of baseParts.
|
133 |
+
for (j = baseParts.length; j > 0; j -= 1) {
|
134 |
+
mapValue = map[baseParts.slice(0, j).join('/')];
|
135 |
+
|
136 |
+
//baseName segment has config, find if it has one for
|
137 |
+
//this name.
|
138 |
+
if (mapValue) {
|
139 |
+
mapValue = mapValue[nameSegment];
|
140 |
+
if (mapValue) {
|
141 |
+
//Match, update name to the new value.
|
142 |
+
foundMap = mapValue;
|
143 |
+
foundI = i;
|
144 |
+
break;
|
145 |
+
}
|
146 |
+
}
|
147 |
+
}
|
148 |
+
}
|
149 |
+
|
150 |
+
if (foundMap) {
|
151 |
+
break;
|
152 |
+
}
|
153 |
+
|
154 |
+
//Check for a star map match, but just hold on to it,
|
155 |
+
//if there is a shorter segment match later in a matching
|
156 |
+
//config, then favor over this star map.
|
157 |
+
if (!foundStarMap && starMap && starMap[nameSegment]) {
|
158 |
+
foundStarMap = starMap[nameSegment];
|
159 |
+
starI = i;
|
160 |
+
}
|
161 |
+
}
|
162 |
+
|
163 |
+
if (!foundMap && foundStarMap) {
|
164 |
+
foundMap = foundStarMap;
|
165 |
+
foundI = starI;
|
166 |
+
}
|
167 |
+
|
168 |
+
if (foundMap) {
|
169 |
+
nameParts.splice(0, foundI, foundMap);
|
170 |
+
name = nameParts.join('/');
|
171 |
+
}
|
172 |
+
}
|
173 |
+
|
174 |
+
return name;
|
175 |
+
}
|
176 |
+
|
177 |
+
function makeRequire(relName, forceSync) {
|
178 |
+
return function () {
|
179 |
+
//A version of a require function that passes a moduleName
|
180 |
+
//value for items that may need to
|
181 |
+
//look up paths relative to the moduleName
|
182 |
+
var args = aps.call(arguments, 0);
|
183 |
+
|
184 |
+
//If first arg is not require('string'), and there is only
|
185 |
+
//one arg, it is the array form without a callback. Insert
|
186 |
+
//a null so that the following concat is correct.
|
187 |
+
if (typeof args[0] !== 'string' && args.length === 1) {
|
188 |
+
args.push(null);
|
189 |
+
}
|
190 |
+
return req.apply(undef, args.concat([relName, forceSync]));
|
191 |
+
};
|
192 |
+
}
|
193 |
+
|
194 |
+
function makeNormalize(relName) {
|
195 |
+
return function (name) {
|
196 |
+
return normalize(name, relName);
|
197 |
+
};
|
198 |
+
}
|
199 |
+
|
200 |
+
function makeLoad(depName) {
|
201 |
+
return function (value) {
|
202 |
+
defined[depName] = value;
|
203 |
+
};
|
204 |
+
}
|
205 |
+
|
206 |
+
function callDep(name) {
|
207 |
+
if (hasProp(waiting, name)) {
|
208 |
+
var args = waiting[name];
|
209 |
+
delete waiting[name];
|
210 |
+
defining[name] = true;
|
211 |
+
main.apply(undef, args);
|
212 |
+
}
|
213 |
+
|
214 |
+
if (!hasProp(defined, name) && !hasProp(defining, name)) {
|
215 |
+
throw new Error('No ' + name);
|
216 |
+
}
|
217 |
+
return defined[name];
|
218 |
+
}
|
219 |
+
|
220 |
+
//Turns a plugin!resource to [plugin, resource]
|
221 |
+
//with the plugin being undefined if the name
|
222 |
+
//did not have a plugin prefix.
|
223 |
+
function splitPrefix(name) {
|
224 |
+
var prefix,
|
225 |
+
index = name ? name.indexOf('!') : -1;
|
226 |
+
if (index > -1) {
|
227 |
+
prefix = name.substring(0, index);
|
228 |
+
name = name.substring(index + 1, name.length);
|
229 |
+
}
|
230 |
+
return [prefix, name];
|
231 |
+
}
|
232 |
+
|
233 |
+
/**
|
234 |
+
* Makes a name map, normalizing the name, and using a plugin
|
235 |
+
* for normalization if necessary. Grabs a ref to plugin
|
236 |
+
* too, as an optimization.
|
237 |
+
*/
|
238 |
+
makeMap = function (name, relName) {
|
239 |
+
var plugin,
|
240 |
+
parts = splitPrefix(name),
|
241 |
+
prefix = parts[0];
|
242 |
+
|
243 |
+
name = parts[1];
|
244 |
+
|
245 |
+
if (prefix) {
|
246 |
+
prefix = normalize(prefix, relName);
|
247 |
+
plugin = callDep(prefix);
|
248 |
+
}
|
249 |
+
|
250 |
+
//Normalize according
|
251 |
+
if (prefix) {
|
252 |
+
if (plugin && plugin.normalize) {
|
253 |
+
name = plugin.normalize(name, makeNormalize(relName));
|
254 |
+
} else {
|
255 |
+
name = normalize(name, relName);
|
256 |
+
}
|
257 |
+
} else {
|
258 |
+
name = normalize(name, relName);
|
259 |
+
parts = splitPrefix(name);
|
260 |
+
prefix = parts[0];
|
261 |
+
name = parts[1];
|
262 |
+
if (prefix) {
|
263 |
+
plugin = callDep(prefix);
|
264 |
+
}
|
265 |
+
}
|
266 |
+
|
267 |
+
//Using ridiculous property names for space reasons
|
268 |
+
return {
|
269 |
+
f: prefix ? prefix + '!' + name : name, //fullName
|
270 |
+
n: name,
|
271 |
+
pr: prefix,
|
272 |
+
p: plugin
|
273 |
+
};
|
274 |
+
};
|
275 |
+
|
276 |
+
function makeConfig(name) {
|
277 |
+
return function () {
|
278 |
+
return (config && config.config && config.config[name]) || {};
|
279 |
+
};
|
280 |
+
}
|
281 |
+
|
282 |
+
handlers = {
|
283 |
+
require: function (name) {
|
284 |
+
return makeRequire(name);
|
285 |
+
},
|
286 |
+
exports: function (name) {
|
287 |
+
var e = defined[name];
|
288 |
+
if (typeof e !== 'undefined') {
|
289 |
+
return e;
|
290 |
+
} else {
|
291 |
+
return (defined[name] = {});
|
292 |
+
}
|
293 |
+
},
|
294 |
+
module: function (name) {
|
295 |
+
return {
|
296 |
+
id: name,
|
297 |
+
uri: '',
|
298 |
+
exports: defined[name],
|
299 |
+
config: makeConfig(name)
|
300 |
+
};
|
301 |
+
}
|
302 |
+
};
|
303 |
+
|
304 |
+
main = function (name, deps, callback, relName) {
|
305 |
+
var cjsModule, depName, ret, map, i,
|
306 |
+
args = [],
|
307 |
+
callbackType = typeof callback,
|
308 |
+
usingExports;
|
309 |
+
|
310 |
+
//Use name if no relName
|
311 |
+
relName = relName || name;
|
312 |
+
|
313 |
+
//Call the callback to define the module, if necessary.
|
314 |
+
if (callbackType === 'undefined' || callbackType === 'function') {
|
315 |
+
//Pull out the defined dependencies and pass the ordered
|
316 |
+
//values to the callback.
|
317 |
+
//Default to [require, exports, module] if no deps
|
318 |
+
deps = !deps.length && callback.length ? ['require', 'exports', 'module'] : deps;
|
319 |
+
for (i = 0; i < deps.length; i += 1) {
|
320 |
+
map = makeMap(deps[i], relName);
|
321 |
+
depName = map.f;
|
322 |
+
|
323 |
+
//Fast path CommonJS standard dependencies.
|
324 |
+
if (depName === "require") {
|
325 |
+
args[i] = handlers.require(name);
|
326 |
+
} else if (depName === "exports") {
|
327 |
+
//CommonJS module spec 1.1
|
328 |
+
args[i] = handlers.exports(name);
|
329 |
+
usingExports = true;
|
330 |
+
} else if (depName === "module") {
|
331 |
+
//CommonJS module spec 1.1
|
332 |
+
cjsModule = args[i] = handlers.module(name);
|
333 |
+
} else if (hasProp(defined, depName) ||
|
334 |
+
hasProp(waiting, depName) ||
|
335 |
+
hasProp(defining, depName)) {
|
336 |
+
args[i] = callDep(depName);
|
337 |
+
} else if (map.p) {
|
338 |
+
map.p.load(map.n, makeRequire(relName, true), makeLoad(depName), {});
|
339 |
+
args[i] = defined[depName];
|
340 |
+
} else {
|
341 |
+
throw new Error(name + ' missing ' + depName);
|
342 |
+
}
|
343 |
+
}
|
344 |
+
|
345 |
+
ret = callback ? callback.apply(defined[name], args) : undefined;
|
346 |
+
|
347 |
+
if (name) {
|
348 |
+
//If setting exports via "module" is in play,
|
349 |
+
//favor that over return value and exports. After that,
|
350 |
+
//favor a non-undefined return value over exports use.
|
351 |
+
if (cjsModule && cjsModule.exports !== undef &&
|
352 |
+
cjsModule.exports !== defined[name]) {
|
353 |
+
defined[name] = cjsModule.exports;
|
354 |
+
} else if (ret !== undef || !usingExports) {
|
355 |
+
//Use the return value from the function.
|
356 |
+
defined[name] = ret;
|
357 |
+
}
|
358 |
+
}
|
359 |
+
} else if (name) {
|
360 |
+
//May just be an object definition for the module. Only
|
361 |
+
//worry about defining if have a module name.
|
362 |
+
defined[name] = callback;
|
363 |
+
}
|
364 |
+
};
|
365 |
+
|
366 |
+
requirejs = require = req = function (deps, callback, relName, forceSync, alt) {
|
367 |
+
if (typeof deps === "string") {
|
368 |
+
if (handlers[deps]) {
|
369 |
+
//callback in this case is really relName
|
370 |
+
return handlers[deps](callback);
|
371 |
+
}
|
372 |
+
//Just return the module wanted. In this scenario, the
|
373 |
+
//deps arg is the module name, and second arg (if passed)
|
374 |
+
//is just the relName.
|
375 |
+
//Normalize module name, if it contains . or ..
|
376 |
+
return callDep(makeMap(deps, callback).f);
|
377 |
+
} else if (!deps.splice) {
|
378 |
+
//deps is a config object, not an array.
|
379 |
+
config = deps;
|
380 |
+
if (config.deps) {
|
381 |
+
req(config.deps, config.callback);
|
382 |
+
}
|
383 |
+
if (!callback) {
|
384 |
+
return;
|
385 |
+
}
|
386 |
+
|
387 |
+
if (callback.splice) {
|
388 |
+
//callback is an array, which means it is a dependency list.
|
389 |
+
//Adjust args if there are dependencies
|
390 |
+
deps = callback;
|
391 |
+
callback = relName;
|
392 |
+
relName = null;
|
393 |
+
} else {
|
394 |
+
deps = undef;
|
395 |
+
}
|
396 |
+
}
|
397 |
+
|
398 |
+
//Support require(['a'])
|
399 |
+
callback = callback || function () {};
|
400 |
+
|
401 |
+
//If relName is a function, it is an errback handler,
|
402 |
+
//so remove it.
|
403 |
+
if (typeof relName === 'function') {
|
404 |
+
relName = forceSync;
|
405 |
+
forceSync = alt;
|
406 |
+
}
|
407 |
+
|
408 |
+
//Simulate async callback;
|
409 |
+
if (forceSync) {
|
410 |
+
main(undef, deps, callback, relName);
|
411 |
+
} else {
|
412 |
+
//Using a non-zero value because of concern for what old browsers
|
413 |
+
//do, and latest browsers "upgrade" to 4 if lower value is used:
|
414 |
+
//http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#dom-windowtimers-settimeout:
|
415 |
+
//If want a value immediately, use require('id') instead -- something
|
416 |
+
//that works in almond on the global level, but not guaranteed and
|
417 |
+
//unlikely to work in other AMD implementations.
|
418 |
+
setTimeout(function () {
|
419 |
+
main(undef, deps, callback, relName);
|
420 |
+
}, 4);
|
421 |
+
}
|
422 |
+
|
423 |
+
return req;
|
424 |
+
};
|
425 |
+
|
426 |
+
/**
|
427 |
+
* Just drops the config on the floor, but returns req in case
|
428 |
+
* the config return value is used.
|
429 |
+
*/
|
430 |
+
req.config = function (cfg) {
|
431 |
+
return req(cfg);
|
432 |
+
};
|
433 |
+
|
434 |
+
/**
|
435 |
+
* Expose module registry for debugging and tooling
|
436 |
+
*/
|
437 |
+
requirejs._defined = defined;
|
438 |
+
|
439 |
+
define = function (name, deps, callback) {
|
440 |
+
if (typeof name !== 'string') {
|
441 |
+
throw new Error('See almond README: incorrect module build, no module name');
|
442 |
+
}
|
443 |
+
|
444 |
+
//This module may not have dependencies
|
445 |
+
if (!deps.splice) {
|
446 |
+
//deps is not an array, so probably means
|
447 |
+
//an object literal or factory function for
|
448 |
+
//the value. Adjust args.
|
449 |
+
callback = deps;
|
450 |
+
deps = [];
|
451 |
+
}
|
452 |
+
|
453 |
+
if (!hasProp(defined, name) && !hasProp(waiting, name)) {
|
454 |
+
waiting[name] = [name, deps, callback];
|
455 |
+
}
|
456 |
+
};
|
457 |
+
|
458 |
+
define.amd = {
|
459 |
+
jQuery: true
|
460 |
+
};
|
461 |
+
}());
|
462 |
+
|
463 |
+
S2.requirejs = requirejs;S2.require = require;S2.define = define;
|
464 |
+
}
|
465 |
+
}());
|
466 |
+
S2.define("almond", function(){});
|
467 |
+
|
468 |
+
/* global jQuery:false, $:false */
|
469 |
+
S2.define('jquery',[],function () {
|
470 |
+
var _$ = jQuery || $;
|
471 |
+
|
472 |
+
if (_$ == null && console && console.error) {
|
473 |
+
console.error(
|
474 |
+
'CzrSelect2: An instance of jQuery or a jQuery-compatible library was not ' +
|
475 |
+
'found. Make sure that you are including jQuery before CzrSelect2 on your ' +
|
476 |
+
'web page.'
|
477 |
+
);
|
478 |
+
}
|
479 |
+
|
480 |
+
return _$;
|
481 |
+
});
|
482 |
+
|
483 |
+
S2.define('czrSelect2/utils',[
|
484 |
+
'jquery'
|
485 |
+
], function ($) {
|
486 |
+
var Utils = {};
|
487 |
+
|
488 |
+
Utils.Extend = function (ChildClass, SuperClass) {
|
489 |
+
var __hasProp = {}.hasOwnProperty;
|
490 |
+
|
491 |
+
function BaseConstructor () {
|
492 |
+
this.constructor = ChildClass;
|
493 |
+
}
|
494 |
+
|
495 |
+
for (var key in SuperClass) {
|
496 |
+
if (__hasProp.call(SuperClass, key)) {
|
497 |
+
ChildClass[key] = SuperClass[key];
|
498 |
+
}
|
499 |
+
}
|
500 |
+
|
501 |
+
BaseConstructor.prototype = SuperClass.prototype;
|
502 |
+
ChildClass.prototype = new BaseConstructor();
|
503 |
+
ChildClass.__super__ = SuperClass.prototype;
|
504 |
+
|
505 |
+
return ChildClass;
|
506 |
+
};
|
507 |
+
|
508 |
+
function getMethods (theClass) {
|
509 |
+
var proto = theClass.prototype;
|
510 |
+
|
511 |
+
var methods = [];
|
512 |
+
|
513 |
+
for (var methodName in proto) {
|
514 |
+
var m = proto[methodName];
|
515 |
+
|
516 |
+
if (typeof m !== 'function') {
|
517 |
+
continue;
|
518 |
+
}
|
519 |
+
|
520 |
+
if (methodName === 'constructor') {
|
521 |
+
continue;
|
522 |
+
}
|
523 |
+
|
524 |
+
methods.push(methodName);
|
525 |
+
}
|
526 |
+
|
527 |
+
return methods;
|
528 |
+
}
|
529 |
+
|
530 |
+
Utils.Decorate = function (SuperClass, DecoratorClass) {
|
531 |
+
var decoratedMethods = getMethods(DecoratorClass);
|
532 |
+
var superMethods = getMethods(SuperClass);
|
533 |
+
|
534 |
+
function DecoratedClass () {
|
535 |
+
var unshift = Array.prototype.unshift;
|
536 |
+
|
537 |
+
var argCount = DecoratorClass.prototype.constructor.length;
|
538 |
+
|
539 |
+
var calledConstructor = SuperClass.prototype.constructor;
|
540 |
+
|
541 |
+
if (argCount > 0) {
|
542 |
+
unshift.call(arguments, SuperClass.prototype.constructor);
|
543 |
+
|
544 |
+
calledConstructor = DecoratorClass.prototype.constructor;
|
545 |
+
}
|
546 |
+
|
547 |
+
calledConstructor.apply(this, arguments);
|
548 |
+
}
|
549 |
+
|
550 |
+
DecoratorClass.displayName = SuperClass.displayName;
|
551 |
+
|
552 |
+
function ctr () {
|
553 |
+
this.constructor = DecoratedClass;
|
554 |
+
}
|
555 |
+
|
556 |
+
DecoratedClass.prototype = new ctr();
|
557 |
+
|
558 |
+
for (var m = 0; m < superMethods.length; m++) {
|
559 |
+
var superMethod = superMethods[m];
|
560 |
+
|
561 |
+
DecoratedClass.prototype[superMethod] =
|
562 |
+
SuperClass.prototype[superMethod];
|
563 |
+
}
|
564 |
+
|
565 |
+
var calledMethod = function (methodName) {
|
566 |
+
// Stub out the original method if it's not decorating an actual method
|
567 |
+
var originalMethod = function () {};
|
568 |
+
|
569 |
+
if (methodName in DecoratedClass.prototype) {
|
570 |
+
originalMethod = DecoratedClass.prototype[methodName];
|
571 |
+
}
|
572 |
+
|
573 |
+
var decoratedMethod = DecoratorClass.prototype[methodName];
|
574 |
+
|
575 |
+
return function () {
|
576 |
+
var unshift = Array.prototype.unshift;
|
577 |
+
|
578 |
+
unshift.call(arguments, originalMethod);
|
579 |
+
|
580 |
+
return decoratedMethod.apply(this, arguments);
|
581 |
+
};
|
582 |
+
};
|
583 |
+
|
584 |
+
for (var d = 0; d < decoratedMethods.length; d++) {
|
585 |
+
var decoratedMethod = decoratedMethods[d];
|
586 |
+
|
587 |
+
DecoratedClass.prototype[decoratedMethod] = calledMethod(decoratedMethod);
|
588 |
+
}
|
589 |
+
|
590 |
+
return DecoratedClass;
|
591 |
+
};
|
592 |
+
|
593 |
+
var Observable = function () {
|
594 |
+
this.listeners = {};
|
595 |
+
};
|
596 |
+
|
597 |
+
Observable.prototype.on = function (event, callback) {
|
598 |
+
this.listeners = this.listeners || {};
|
599 |
+
|
600 |
+
if (event in this.listeners) {
|
601 |
+
this.listeners[event].push(callback);
|
602 |
+
} else {
|
603 |
+
this.listeners[event] = [callback];
|
604 |
+
}
|
605 |
+
};
|
606 |
+
|
607 |
+
Observable.prototype.trigger = function (event) {
|
608 |
+
var slice = Array.prototype.slice;
|
609 |
+
var params = slice.call(arguments, 1);
|
610 |
+
|
611 |
+
this.listeners = this.listeners || {};
|
612 |
+
|
613 |
+
// Params should always come in as an array
|
614 |
+
if (params == null) {
|
615 |
+
params = [];
|
616 |
+
}
|
617 |
+
|
618 |
+
// If there are no arguments to the event, use a temporary object
|
619 |
+
if (params.length === 0) {
|
620 |
+
params.push({});
|
621 |
+
}
|
622 |
+
|
623 |
+
// Set the `_type` of the first object to the event
|
624 |
+
params[0]._type = event;
|
625 |
+
|
626 |
+
if (event in this.listeners) {
|
627 |
+
this.invoke(this.listeners[event], slice.call(arguments, 1));
|
628 |
+
}
|
629 |
+
|
630 |
+
if ('*' in this.listeners) {
|
631 |
+
this.invoke(this.listeners['*'], arguments);
|
632 |
+
}
|
633 |
+
};
|
634 |
+
|
635 |
+
Observable.prototype.invoke = function (listeners, params) {
|
636 |
+
for (var i = 0, len = listeners.length; i < len; i++) {
|
637 |
+
listeners[i].apply(this, params);
|
638 |
+
}
|
639 |
+
};
|
640 |
+
|
641 |
+
Utils.Observable = Observable;
|
642 |
+
|
643 |
+
Utils.generateChars = function (length) {
|
644 |
+
var chars = '';
|
645 |
+
|
646 |
+
for (var i = 0; i < length; i++) {
|
647 |
+
var randomChar = Math.floor(Math.random() * 36);
|
648 |
+
chars += randomChar.toString(36);
|
649 |
+
}
|
650 |
+
|
651 |
+
return chars;
|
652 |
+
};
|
653 |
+
|
654 |
+
Utils.bind = function (func, context) {
|
655 |
+
return function () {
|
656 |
+
func.apply(context, arguments);
|
657 |
+
};
|
658 |
+
};
|
659 |
+
|
660 |
+
Utils._convertData = function (data) {
|
661 |
+
for (var originalKey in data) {
|
662 |
+
var keys = originalKey.split('-');
|
663 |
+
|
664 |
+
var dataLevel = data;
|
665 |
+
|
666 |
+
if (keys.length === 1) {
|
667 |
+
continue;
|
668 |
+
}
|
669 |
+
|
670 |
+
for (var k = 0; k < keys.length; k++) {
|
671 |
+
var key = keys[k];
|
672 |
+
|
673 |
+
// Lowercase the first letter
|
674 |
+
// By default, dash-separated becomes camelCase
|
675 |
+
key = key.substring(0, 1).toLowerCase() + key.substring(1);
|
676 |
+
|
677 |
+
if (!(key in dataLevel)) {
|
678 |
+
dataLevel[key] = {};
|
679 |
+
}
|
680 |
+
|
681 |
+
if (k == keys.length - 1) {
|
682 |
+
dataLevel[key] = data[originalKey];
|
683 |
+
}
|
684 |
+
|
685 |
+
dataLevel = dataLevel[key];
|
686 |
+
}
|
687 |
+
|
688 |
+
delete data[originalKey];
|
689 |
+
}
|
690 |
+
|
691 |
+
return data;
|
692 |
+
};
|
693 |
+
|
694 |
+
Utils.hasScroll = function (index, el) {
|
695 |
+
// Adapted from the function created by @ShadowScripter
|
696 |
+
// and adapted by @BillBarry on the Stack Exchange Code Review website.
|
697 |
+
// The original code can be found at
|
698 |
+
// http://codereview.stackexchange.com/q/13338
|
699 |
+
// and was designed to be used with the Sizzle selector engine.
|
700 |
+
|
701 |
+
var $el = $(el);
|
702 |
+
var overflowX = el.style.overflowX;
|
703 |
+
var overflowY = el.style.overflowY;
|
704 |
+
|
705 |
+
//Check both x and y declarations
|
706 |
+
if (overflowX === overflowY &&
|
707 |
+
(overflowY === 'hidden' || overflowY === 'visible')) {
|
708 |
+
return false;
|
709 |
+
}
|
710 |
+
|
711 |
+
if (overflowX === 'scroll' || overflowY === 'scroll') {
|
712 |
+
return true;
|
713 |
+
}
|
714 |
+
|
715 |
+
return ($el.innerHeight() < el.scrollHeight ||
|
716 |
+
$el.innerWidth() < el.scrollWidth);
|
717 |
+
};
|
718 |
+
|
719 |
+
Utils.escapeMarkup = function (markup) {
|
720 |
+
var replaceMap = {
|
721 |
+
'\\': '\',
|
722 |
+
'&': '&',
|
723 |
+
'<': '<',
|
724 |
+
'>': '>',
|
725 |
+
'"': '"',
|
726 |
+
'\'': ''',
|
727 |
+
'/': '/'
|
728 |
+
};
|
729 |
+
|
730 |
+
// Do not try to escape the markup if it's not a string
|
731 |
+
if (typeof markup !== 'string') {
|
732 |
+
return markup;
|
733 |
+
}
|
734 |
+
|
735 |
+
return String(markup).replace(/[&<>"'\/\\]/g, function (match) {
|
736 |
+
return replaceMap[match];
|
737 |
+
});
|
738 |
+
};
|
739 |
+
|
740 |
+
// Append an array of jQuery nodes to a given element.
|
741 |
+
Utils.appendMany = function ($element, $nodes) {
|
742 |
+
// jQuery 1.7.x does not support $.fn.append() with an array
|
743 |
+
// Fall back to a jQuery object collection using $.fn.add()
|
744 |
+
if ($.fn.jquery.substr(0, 3) === '1.7') {
|
745 |
+
var $jqNodes = $();
|
746 |
+
|
747 |
+
$.map($nodes, function (node) {
|
748 |
+
$jqNodes = $jqNodes.add(node);
|
749 |
+
});
|
750 |
+
|
751 |
+
$nodes = $jqNodes;
|
752 |
+
}
|
753 |
+
|
754 |
+
$element.append($nodes);
|
755 |
+
};
|
756 |
+
|
757 |
+
return Utils;
|
758 |
+
});
|
759 |
+
|
760 |
+
S2.define('czrSelect2/results',[
|
761 |
+
'jquery',
|
762 |
+
'./utils'
|
763 |
+
], function ($, Utils) {
|
764 |
+
function Results ($element, options, dataAdapter) {
|
765 |
+
this.$element = $element;
|
766 |
+
this.data = dataAdapter;
|
767 |
+
this.options = options;
|
768 |
+
|
769 |
+
Results.__super__.constructor.call(this);
|
770 |
+
}
|
771 |
+
|
772 |
+
Utils.Extend(Results, Utils.Observable);
|
773 |
+
|
774 |
+
Results.prototype.render = function () {
|
775 |
+
var $results = $(
|
776 |
+
'<ul class="czrSelect2-results__options" role="tree"></ul>'
|
777 |
+
);
|
778 |
+
|
779 |
+
if (this.options.get('multiple')) {
|
780 |
+
$results.attr('aria-multiselectable', 'true');
|
781 |
+
}
|
782 |
+
|
783 |
+
this.$results = $results;
|
784 |
+
|
785 |
+
return $results;
|
786 |
+
};
|
787 |
+
|
788 |
+
Results.prototype.clear = function () {
|
789 |
+
this.$results.empty();
|
790 |
+
};
|
791 |
+
|
792 |
+
Results.prototype.displayMessage = function (params) {
|
793 |
+
var escapeMarkup = this.options.get('escapeMarkup');
|
794 |
+
|
795 |
+
this.clear();
|
796 |
+
this.hideLoading();
|
797 |
+
|
798 |
+
var $message = $(
|
799 |
+
'<li role="treeitem" aria-live="assertive"' +
|
800 |
+
' class="czrSelect2-results__option"></li>'
|
801 |
+
);
|
802 |
+
|
803 |
+
var message = this.options.get('translations').get(params.message);
|
804 |
+
|
805 |
+
$message.append(
|
806 |
+
escapeMarkup(
|
807 |
+
message(params.args)
|
808 |
+
)
|
809 |
+
);
|
810 |
+
|
811 |
+
$message[0].className += ' czrSelect2-results__message';
|
812 |
+
|
813 |
+
this.$results.append($message);
|
814 |
+
};
|
815 |
+
|
816 |
+
Results.prototype.hideMessages = function () {
|
817 |
+
this.$results.find('.czrSelect2-results__message').remove();
|
818 |
+
};
|
819 |
+
|
820 |
+
Results.prototype.append = function (data) {
|
821 |
+
this.hideLoading();
|
822 |
+
|
823 |
+
var $options = [];
|
824 |
+
|
825 |
+
if (data.results == null || data.results.length === 0) {
|
826 |
+
if (this.$results.children().length === 0) {
|
827 |
+
this.trigger('results:message', {
|
828 |
+
message: 'noResults'
|
829 |
+
});
|
830 |
+
}
|
831 |
+
|
832 |
+
return;
|
833 |
+
}
|
834 |
+
|
835 |
+
data.results = this.sort(data.results);
|
836 |
+
|
837 |
+
for (var d = 0; d < data.results.length; d++) {
|
838 |
+
var item = data.results[d];
|
839 |
+
|
840 |
+
var $option = this.option(item);
|
841 |
+
|
842 |
+
$options.push($option);
|
843 |
+
}
|
844 |
+
|
845 |
+
this.$results.append($options);
|
846 |
+
};
|
847 |
+
|
848 |
+
Results.prototype.position = function ($results, $dropdown) {
|
849 |
+
var $resultsContainer = $dropdown.find('.czrSelect2-results');
|
850 |
+
$resultsContainer.append($results);
|
851 |
+
};
|
852 |
+
|
853 |
+
Results.prototype.sort = function (data) {
|
854 |
+
var sorter = this.options.get('sorter');
|
855 |
+
|
856 |
+
return sorter(data);
|
857 |
+
};
|
858 |
+
|
859 |
+
Results.prototype.highlightFirstItem = function () {
|
860 |
+
var $options = this.$results
|
861 |
+
.find('.czrSelect2-results__option[aria-selected]');
|
862 |
+
|
863 |
+
var $selected = $options.filter('[aria-selected=true]');
|
864 |
+
|
865 |
+
// Check if there are any selected options
|
866 |
+
if ($selected.length > 0) {
|
867 |
+
// If there are selected options, highlight the first
|
868 |
+
$selected.first().trigger('mouseenter');
|
869 |
+
} else {
|
870 |
+
// If there are no selected options, highlight the first option
|
871 |
+
// in the dropdown
|
872 |
+
$options.first().trigger('mouseenter');
|
873 |
+
}
|
874 |
+
|
875 |
+
this.ensureHighlightVisible();
|
876 |
+
};
|
877 |
+
|
878 |
+
Results.prototype.setClasses = function () {
|
879 |
+
var self = this;
|
880 |
+
|
881 |
+
this.data.current(function (selected) {
|
882 |
+
var selectedIds = $.map(selected, function (s) {
|
883 |
+
return s.id.toString();
|
884 |
+
});
|
885 |
+
|
886 |
+
var $options = self.$results
|
887 |
+
.find('.czrSelect2-results__option[aria-selected]');
|
888 |
+
|
889 |
+
$options.each(function () {
|
890 |
+
var $option = $(this);
|
891 |
+
|
892 |
+
var item = $.data(this, 'data');
|
893 |
+
|
894 |
+
// id needs to be converted to a string when comparing
|
895 |
+
var id = '' + item.id;
|
896 |
+
|
897 |
+
if ((item.element != null && item.element.selected) ||
|
898 |
+
(item.element == null && $.inArray(id, selectedIds) > -1)) {
|
899 |
+
$option.attr('aria-selected', 'true');
|
900 |
+
} else {
|
901 |
+
$option.attr('aria-selected', 'false');
|
902 |
+
}
|
903 |
+
});
|
904 |
+
|
905 |
+
});
|
906 |
+
};
|
907 |
+
|
908 |
+
Results.prototype.showLoading = function (params) {
|
909 |
+
this.hideLoading();
|
910 |
+
|
911 |
+
var loadingMore = this.options.get('translations').get('searching');
|
912 |
+
|
913 |
+
var loading = {
|
914 |
+
disabled: true,
|
915 |
+
loading: true,
|
916 |
+
text: loadingMore(params)
|
917 |
+
};
|
918 |
+
var $loading = this.option(loading);
|
919 |
+
$loading.className += ' loading-results';
|
920 |
+
|
921 |
+
this.$results.prepend($loading);
|
922 |
+
};
|
923 |
+
|
924 |
+
Results.prototype.hideLoading = function () {
|
925 |
+
this.$results.find('.loading-results').remove();
|
926 |
+
};
|
927 |
+
|
928 |
+
Results.prototype.option = function (data) {
|
929 |
+
var option = document.createElement('li');
|
930 |
+
option.className = 'czrSelect2-results__option';
|
931 |
+
|
932 |
+
var attrs = {
|
933 |
+
'role': 'treeitem',
|
934 |
+
'aria-selected': 'false'
|
935 |
+
};
|
936 |
+
|
937 |
+
if (data.disabled) {
|
938 |
+
delete attrs['aria-selected'];
|
939 |
+
attrs['aria-disabled'] = 'true';
|
940 |
+
}
|
941 |
+
|
942 |
+
if (data.id == null) {
|
943 |
+
delete attrs['aria-selected'];
|
944 |
+
}
|
945 |
+
|
946 |
+
if (data._resultId != null) {
|
947 |
+
option.id = data._resultId;
|
948 |
+
}
|
949 |
+
|
950 |
+
if (data.title) {
|
951 |
+
option.title = data.title;
|
952 |
+
}
|
953 |
+
|
954 |
+
if (data.children) {
|
955 |
+
attrs.role = 'group';
|
956 |
+
attrs['aria-label'] = data.text;
|
957 |
+
delete attrs['aria-selected'];
|
958 |
+
}
|
959 |
+
|
960 |
+
for (var attr in attrs) {
|
961 |
+
var val = attrs[attr];
|
962 |
+
|
963 |
+
option.setAttribute(attr, val);
|
964 |
+
}
|
965 |
+
|
966 |
+
if (data.children) {
|
967 |
+
var $option = $(option);
|
968 |
+
|
969 |
+
var label = document.createElement('strong');
|
970 |
+
label.className = 'czrSelect2-results__group';
|
971 |
+
|
972 |
+
var $label = $(label);
|
973 |
+
this.template(data, label);
|
974 |
+
|
975 |
+
var $children = [];
|
976 |
+
|
977 |
+
for (var c = 0; c < data.children.length; c++) {
|
978 |
+
var child = data.children[c];
|
979 |
+
|
980 |
+
var $child = this.option(child);
|
981 |
+
|
982 |
+
$children.push($child);
|
983 |
+
}
|
984 |
+
|
985 |
+
var $childrenContainer = $('<ul></ul>', {
|
986 |
+
'class': 'czrSelect2-results__options czrSelect2-results__options--nested'
|
987 |
+
});
|
988 |
+
|
989 |
+
$childrenContainer.append($children);
|
990 |
+
|
991 |
+
$option.append(label);
|
992 |
+
$option.append($childrenContainer);
|
993 |
+
} else {
|
994 |
+
this.template(data, option);
|
995 |
+
}
|
996 |
+
|
997 |
+
$.data(option, 'data', data);
|
998 |
+
|
999 |
+
return option;
|
1000 |
+
};
|
1001 |
+
|
1002 |
+
Results.prototype.bind = function (container, $container) {
|
1003 |
+
var self = this;
|
1004 |
+
|
1005 |
+
var id = container.id + '-results';
|
1006 |
+
|
1007 |
+
this.$results.attr('id', id);
|
1008 |
+
|
1009 |
+
container.on('results:all', function (params) {
|
1010 |
+
self.clear();
|
1011 |
+
self.append(params.data);
|
1012 |
+
|
1013 |
+
if (container.isOpen()) {
|
1014 |
+
self.setClasses();
|
1015 |
+
self.highlightFirstItem();
|
1016 |
+
}
|
1017 |
+
});
|
1018 |
+
|
1019 |
+
container.on('results:append', function (params) {
|
1020 |
+
self.append(params.data);
|
1021 |
+
|
1022 |
+
if (container.isOpen()) {
|
1023 |
+
self.setClasses();
|
1024 |
+
}
|
1025 |
+
});
|
1026 |
+
|
1027 |
+
container.on('query', function (params) {
|
1028 |
+
self.hideMessages();
|
1029 |
+
self.showLoading(params);
|
1030 |
+
});
|
1031 |
+
|
1032 |
+
container.on('select', function () {
|
1033 |
+
if (!container.isOpen()) {
|
1034 |
+
return;
|
1035 |
+
}
|
1036 |
+
|
1037 |
+
self.setClasses();
|
1038 |
+
self.highlightFirstItem();
|
1039 |
+
});
|
1040 |
+
|
1041 |
+
container.on('unselect', function () {
|
1042 |
+
if (!container.isOpen()) {
|
1043 |
+
return;
|
1044 |
+
}
|
1045 |
+
|
1046 |
+
self.setClasses();
|
1047 |
+
self.highlightFirstItem();
|
1048 |
+
});
|
1049 |
+
|
1050 |
+
container.on('open', function () {
|
1051 |
+
// When the dropdown is open, aria-expended="true"
|
1052 |
+
self.$results.attr('aria-expanded', 'true');
|
1053 |
+
self.$results.attr('aria-hidden', 'false');
|
1054 |
+
|
1055 |
+
self.setClasses();
|
1056 |
+
self.ensureHighlightVisible();
|
1057 |
+
});
|
1058 |
+
|
1059 |
+
container.on('close', function () {
|
1060 |
+
// When the dropdown is closed, aria-expended="false"
|
1061 |
+
self.$results.attr('aria-expanded', 'false');
|
1062 |
+
self.$results.attr('aria-hidden', 'true');
|
1063 |
+
self.$results.removeAttr('aria-activedescendant');
|
1064 |
+
});
|
1065 |
+
|
1066 |
+
container.on('results:toggle', function () {
|
1067 |
+
var $highlighted = self.getHighlightedResults();
|
1068 |
+
|
1069 |
+
if ($highlighted.length === 0) {
|
1070 |
+
return;
|
1071 |
+
}
|
1072 |
+
|
1073 |
+
$highlighted.trigger('mouseup');
|
1074 |
+
});
|
1075 |
+
|
1076 |
+
container.on('results:select', function () {
|
1077 |
+
var $highlighted = self.getHighlightedResults();
|
1078 |
+
|
1079 |
+
if ($highlighted.length === 0) {
|
1080 |
+
return;
|
1081 |
+
}
|
1082 |
+
|
1083 |
+
var data = $highlighted.data('data');
|
1084 |
+
|
1085 |
+
if ($highlighted.attr('aria-selected') == 'true') {
|
1086 |
+
self.trigger('close', {});
|
1087 |
+
} else {
|
1088 |
+
self.trigger('select', {
|
1089 |
+
data: data
|
1090 |
+
});
|
1091 |
+
}
|
1092 |
+
});
|
1093 |
+
|
1094 |
+
container.on('results:previous', function () {
|
1095 |
+
var $highlighted = self.getHighlightedResults();
|
1096 |
+
|
1097 |
+
var $options = self.$results.find('[aria-selected]');
|
1098 |
+
|
1099 |
+
var currentIndex = $options.index($highlighted);
|
1100 |
+
|
1101 |
+
// If we are already at te top, don't move further
|
1102 |
+
if (currentIndex === 0) {
|
1103 |
+
return;
|
1104 |
+
}
|
1105 |
+
|
1106 |
+
var nextIndex = currentIndex - 1;
|
1107 |
+
|
1108 |
+
// If none are highlighted, highlight the first
|
1109 |
+
if ($highlighted.length === 0) {
|
1110 |
+
nextIndex = 0;
|
1111 |
+
}
|
1112 |
+
|
1113 |
+
var $next = $options.eq(nextIndex);
|
1114 |
+
|
1115 |
+
$next.trigger('mouseenter');
|
1116 |
+
|
1117 |
+
var currentOffset = self.$results.offset().top;
|
1118 |
+
var nextTop = $next.offset().top;
|
1119 |
+
var nextOffset = self.$results.scrollTop() + (nextTop - currentOffset);
|
1120 |
+
|
1121 |
+
if (nextIndex === 0) {
|
1122 |
+
self.$results.scrollTop(0);
|
1123 |
+
} else if (nextTop - currentOffset < 0) {
|
1124 |
+
self.$results.scrollTop(nextOffset);
|
1125 |
+
}
|
1126 |
+
});
|
1127 |
+
|
1128 |
+
container.on('results:next', function () {
|
1129 |
+
var $highlighted = self.getHighlightedResults();
|
1130 |
+
|
1131 |
+
var $options = self.$results.find('[aria-selected]');
|
1132 |
+
|
1133 |
+
var currentIndex = $options.index($highlighted);
|
1134 |
+
|
1135 |
+
var nextIndex = currentIndex + 1;
|
1136 |
+
|
1137 |
+
// If we are at the last option, stay there
|
1138 |
+
if (nextIndex >= $options.length) {
|
1139 |
+
return;
|
1140 |
+
}
|
1141 |
+
|
1142 |
+
var $next = $options.eq(nextIndex);
|
1143 |
+
|
1144 |
+
$next.trigger('mouseenter');
|
1145 |
+
|
1146 |
+
var currentOffset = self.$results.offset().top +
|
1147 |
+
self.$results.outerHeight(false);
|
1148 |
+
var nextBottom = $next.offset().top + $next.outerHeight(false);
|
1149 |
+
var nextOffset = self.$results.scrollTop() + nextBottom - currentOffset;
|
1150 |
+
|
1151 |
+
if (nextIndex === 0) {
|
1152 |
+
self.$results.scrollTop(0);
|
1153 |
+
} else if (nextBottom > currentOffset) {
|
1154 |
+
self.$results.scrollTop(nextOffset);
|
1155 |
+
}
|
1156 |
+
});
|
1157 |
+
|
1158 |
+
container.on('results:focus', function (params) {
|
1159 |
+
params.element.addClass('czrSelect2-results__option--highlighted');
|
1160 |
+
});
|
1161 |
+
|
1162 |
+
container.on('results:message', function (params) {
|
1163 |
+
self.displayMessage(params);
|
1164 |
+
});
|
1165 |
+
|
1166 |
+
if ($.fn.mousewheel) {
|
1167 |
+
this.$results.on('mousewheel', function (e) {
|
1168 |
+
var top = self.$results.scrollTop();
|
1169 |
+
|
1170 |
+
var bottom = self.$results.get(0).scrollHeight - top + e.deltaY;
|
1171 |
+
|
1172 |
+
var isAtTop = e.deltaY > 0 && top - e.deltaY <= 0;
|
1173 |
+
var isAtBottom = e.deltaY < 0 && bottom <= self.$results.height();
|
1174 |
+
|
1175 |
+
if (isAtTop) {
|
1176 |
+
self.$results.scrollTop(0);
|
1177 |
+
|
1178 |
+
e.preventDefault();
|
1179 |
+
e.stopPropagation();
|
1180 |
+
} else if (isAtBottom) {
|
1181 |
+
self.$results.scrollTop(
|
1182 |
+
self.$results.get(0).scrollHeight - self.$results.height()
|
1183 |
+
);
|
1184 |
+
|
1185 |
+
e.preventDefault();
|
1186 |
+
e.stopPropagation();
|
1187 |
+
}
|
1188 |
+
});
|
1189 |
+
}
|
1190 |
+
|
1191 |
+
this.$results.on('mouseup', '.czrSelect2-results__option[aria-selected]',
|
1192 |
+
function (evt) {
|
1193 |
+
var $this = $(this);
|
1194 |
+
|
1195 |
+
var data = $this.data('data');
|
1196 |
+
|
1197 |
+
if ($this.attr('aria-selected') === 'true') {
|
1198 |
+
if (self.options.get('multiple')) {
|
1199 |
+
self.trigger('unselect', {
|
1200 |
+
originalEvent: evt,
|
1201 |
+
data: data
|
1202 |
+
});
|
1203 |
+
} else {
|
1204 |
+
self.trigger('close', {});
|
1205 |
+
}
|
1206 |
+
|
1207 |
+
return;
|
1208 |
+
}
|
1209 |
+
|
1210 |
+
self.trigger('select', {
|
1211 |
+
originalEvent: evt,
|
1212 |
+
data: data
|
1213 |
+
});
|
1214 |
+
});
|
1215 |
+
|
1216 |
+
this.$results.on('mouseenter', '.czrSelect2-results__option[aria-selected]',
|
1217 |
+
function (evt) {
|
1218 |
+
var data = $(this).data('data');
|
1219 |
+
|
1220 |
+
self.getHighlightedResults()
|
1221 |
+
.removeClass('czrSelect2-results__option--highlighted');
|
1222 |
+
|
1223 |
+
self.trigger('results:focus', {
|
1224 |
+
data: data,
|
1225 |
+
element: $(this)
|
1226 |
+
});
|
1227 |
+
});
|
1228 |
+
};
|
1229 |
+
|
1230 |
+
Results.prototype.getHighlightedResults = function () {
|
1231 |
+
var $highlighted = this.$results
|
1232 |
+
.find('.czrSelect2-results__option--highlighted');
|
1233 |
+
|
1234 |
+
return $highlighted;
|
1235 |
+
};
|
1236 |
+
|
1237 |
+
Results.prototype.destroy = function () {
|
1238 |
+
this.$results.remove();
|
1239 |
+
};
|
1240 |
+
|
1241 |
+
Results.prototype.ensureHighlightVisible = function () {
|
1242 |
+
var $highlighted = this.getHighlightedResults();
|
1243 |
+
|
1244 |
+
if ($highlighted.length === 0) {
|
1245 |
+
return;
|
1246 |
+
}
|
1247 |
+
|
1248 |
+
var $options = this.$results.find('[aria-selected]');
|
1249 |
+
|
1250 |
+
var currentIndex = $options.index($highlighted);
|
1251 |
+
|
1252 |
+
var currentOffset = this.$results.offset().top;
|
1253 |
+
var nextTop = $highlighted.offset().top;
|
1254 |
+
var nextOffset = this.$results.scrollTop() + (nextTop - currentOffset);
|
1255 |
+
|
1256 |
+
var offsetDelta = nextTop - currentOffset;
|
1257 |
+
nextOffset -= $highlighted.outerHeight(false) * 2;
|
1258 |
+
|
1259 |
+
if (currentIndex <= 2) {
|
1260 |
+
this.$results.scrollTop(0);
|
1261 |
+
} else if (offsetDelta > this.$results.outerHeight() || offsetDelta < 0) {
|
1262 |
+
this.$results.scrollTop(nextOffset);
|
1263 |
+
}
|
1264 |
+
};
|
1265 |
+
|
1266 |
+
Results.prototype.template = function (result, container) {
|
1267 |
+
var template = this.options.get('templateResult');
|
1268 |
+
var escapeMarkup = this.options.get('escapeMarkup');
|
1269 |
+
|
1270 |
+
var content = template(result, container);
|
1271 |
+
|
1272 |
+
if (content == null) {
|
1273 |
+
container.style.display = 'none';
|
1274 |
+
} else if (typeof content === 'string') {
|
1275 |
+
container.innerHTML = escapeMarkup(content);
|
1276 |
+
} else {
|
1277 |
+
$(container).append(content);
|
1278 |
+
}
|
1279 |
+
};
|
1280 |
+
|
1281 |
+
return Results;
|
1282 |
+
});
|
1283 |
+
|
1284 |
+
S2.define('czrSelect2/keys',[
|
1285 |
+
|
1286 |
+
], function () {
|
1287 |
+
var KEYS = {
|
1288 |
+
BACKSPACE: 8,
|
1289 |
+
TAB: 9,
|
1290 |
+
ENTER: 13,
|
1291 |
+
SHIFT: 16,
|
1292 |
+
CTRL: 17,
|
1293 |
+
ALT: 18,
|
1294 |
+
ESC: 27,
|
1295 |
+
SPACE: 32,
|
1296 |
+
PAGE_UP: 33,
|
1297 |
+
PAGE_DOWN: 34,
|
1298 |
+
END: 35,
|
1299 |
+
HOME: 36,
|
1300 |
+
LEFT: 37,
|
1301 |
+
UP: 38,
|
1302 |
+
RIGHT: 39,
|
1303 |
+
DOWN: 40,
|
1304 |
+
DELETE: 46
|
1305 |
+
};
|
1306 |
+
|
1307 |
+
return KEYS;
|
1308 |
+
});
|
1309 |
+
|
1310 |
+
S2.define('czrSelect2/selection/base',[
|
1311 |
+
'jquery',
|
1312 |
+
'../utils',
|
1313 |
+
'../keys'
|
1314 |
+
], function ($, Utils, KEYS) {
|
1315 |
+
function BaseSelection ($element, options) {
|
1316 |
+
this.$element = $element;
|
1317 |
+
this.options = options;
|
1318 |
+
|
1319 |
+
BaseSelection.__super__.constructor.call(this);
|
1320 |
+
}
|
1321 |
+
|
1322 |
+
Utils.Extend(BaseSelection, Utils.Observable);
|
1323 |
+
|
1324 |
+
BaseSelection.prototype.render = function () {
|
1325 |
+
var $selection = $(
|
1326 |
+
'<span class="czrSelect2-selection" role="combobox" ' +
|
1327 |
+
' aria-haspopup="true" aria-expanded="false">' +
|
1328 |
+
'</span>'
|
1329 |
+
);
|
1330 |
+
|
1331 |
+
this._tabindex = 0;
|
1332 |
+
|
1333 |
+
if (this.$element.data('old-tabindex') != null) {
|
1334 |
+
this._tabindex = this.$element.data('old-tabindex');
|
1335 |
+
} else if (this.$element.attr('tabindex') != null) {
|
1336 |
+
this._tabindex = this.$element.attr('tabindex');
|
1337 |
+
}
|
1338 |
+
|
1339 |
+
$selection.attr('title', this.$element.attr('title'));
|
1340 |
+
$selection.attr('tabindex', this._tabindex);
|
1341 |
+
|
1342 |
+
this.$selection = $selection;
|
1343 |
+
|
1344 |
+
return $selection;
|
1345 |
+
};
|
1346 |
+
|
1347 |
+
BaseSelection.prototype.bind = function (container, $container) {
|
1348 |
+
var self = this;
|
1349 |
+
|
1350 |
+
var id = container.id + '-container';
|
1351 |
+
var resultsId = container.id + '-results';
|
1352 |
+
|
1353 |
+
this.container = container;
|
1354 |
+
|
1355 |
+
this.$selection.on('focus', function (evt) {
|
1356 |
+
self.trigger('focus', evt);
|
1357 |
+
});
|
1358 |
+
|
1359 |
+
this.$selection.on('blur', function (evt) {
|
1360 |
+
self._handleBlur(evt);
|
1361 |
+
});
|
1362 |
+
|
1363 |
+
this.$selection.on('keydown', function (evt) {
|
1364 |
+
self.trigger('keypress', evt);
|
1365 |
+
|
1366 |
+
if (evt.which === KEYS.SPACE) {
|
1367 |
+
evt.preventDefault();
|
1368 |
+
}
|
1369 |
+
});
|
1370 |
+
|
1371 |
+
container.on('results:focus', function (params) {
|
1372 |
+
self.$selection.attr('aria-activedescendant', params.data._resultId);
|
1373 |
+
});
|
1374 |
+
|
1375 |
+
container.on('selection:update', function (params) {
|
1376 |
+
self.update(params.data);
|
1377 |
+
});
|
1378 |
+
|
1379 |
+
container.on('open', function () {
|
1380 |
+
// When the dropdown is open, aria-expanded="true"
|
1381 |
+
self.$selection.attr('aria-expanded', 'true');
|
1382 |
+
self.$selection.attr('aria-owns', resultsId);
|
1383 |
+
|
1384 |
+
self._attachCloseHandler(container);
|
1385 |
+
});
|
1386 |
+
|
1387 |
+
container.on('close', function () {
|
1388 |
+
// When the dropdown is closed, aria-expanded="false"
|
1389 |
+
self.$selection.attr('aria-expanded', 'false');
|
1390 |
+
self.$selection.removeAttr('aria-activedescendant');
|
1391 |
+
self.$selection.removeAttr('aria-owns');
|
1392 |
+
|
1393 |
+
self.$selection.focus();
|
1394 |
+
|
1395 |
+
self._detachCloseHandler(container);
|
1396 |
+
});
|
1397 |
+
|
1398 |
+
container.on('enable', function () {
|
1399 |
+
self.$selection.attr('tabindex', self._tabindex);
|
1400 |
+
});
|
1401 |
+
|
1402 |
+
container.on('disable', function () {
|
1403 |
+
self.$selection.attr('tabindex', '-1');
|
1404 |
+
});
|
1405 |
+
};
|
1406 |
+
|
1407 |
+
BaseSelection.prototype._handleBlur = function (evt) {
|
1408 |
+
var self = this;
|
1409 |
+
|
1410 |
+
// This needs to be delayed as the active element is the body when the tab
|
1411 |
+
// key is pressed, possibly along with others.
|
1412 |
+
window.setTimeout(function () {
|
1413 |
+
// Don't trigger `blur` if the focus is still in the selection
|
1414 |
+
if (
|
1415 |
+
(document.activeElement == self.$selection[0]) ||
|
1416 |
+
($.contains(self.$selection[0], document.activeElement))
|
1417 |
+
) {
|
1418 |
+
return;
|
1419 |
+
}
|
1420 |
+
|
1421 |
+
self.trigger('blur', evt);
|
1422 |
+
}, 1);
|
1423 |
+
};
|
1424 |
+
|
1425 |
+
BaseSelection.prototype._attachCloseHandler = function (container) {
|
1426 |
+
var self = this;
|
1427 |
+
|
1428 |
+
$(document.body).on('mousedown.czrSelect2.' + container.id, function (e) {
|
1429 |
+
var $target = $(e.target);
|
1430 |
+
|
1431 |
+
var $select = $target.closest('.czrSelect2');
|
1432 |
+
|
1433 |
+
var $all = $('.czrSelect2.czrSelect2-container--open');
|
1434 |
+
|
1435 |
+
$all.each(function () {
|
1436 |
+
var $this = $(this);
|
1437 |
+
|
1438 |
+
if (this == $select[0]) {
|
1439 |
+
return;
|
1440 |
+
}
|
1441 |
+
|
1442 |
+
var $element = $this.data('element');
|
1443 |
+
|
1444 |
+
$element.czrSelect2('close');
|
1445 |
+
});
|
1446 |
+
});
|
1447 |
+
};
|
1448 |
+
|
1449 |
+
BaseSelection.prototype._detachCloseHandler = function (container) {
|
1450 |
+
$(document.body).off('mousedown.czrSelect2.' + container.id);
|
1451 |
+
};
|
1452 |
+
|
1453 |
+
BaseSelection.prototype.position = function ($selection, $container) {
|
1454 |
+
var $selectionContainer = $container.find('.selection');
|
1455 |
+
$selectionContainer.append($selection);
|
1456 |
+
};
|
1457 |
+
|
1458 |
+
BaseSelection.prototype.destroy = function () {
|
1459 |
+
this._detachCloseHandler(this.container);
|
1460 |
+
};
|
1461 |
+
|
1462 |
+
BaseSelection.prototype.update = function (data) {
|
1463 |
+
throw new Error('The `update` method must be defined in child classes.');
|
1464 |
+
};
|
1465 |
+
|
1466 |
+
return BaseSelection;
|
1467 |
+
});
|
1468 |
+
|
1469 |
+
S2.define('czrSelect2/selection/single',[
|
1470 |
+
'jquery',
|
1471 |
+
'./base',
|
1472 |
+
'../utils',
|
1473 |
+
'../keys'
|
1474 |
+
], function ($, BaseSelection, Utils, KEYS) {
|
1475 |
+
function SingleSelection () {
|
1476 |
+
SingleSelection.__super__.constructor.apply(this, arguments);
|
1477 |
+
}
|
1478 |
+
|
1479 |
+
Utils.Extend(SingleSelection, BaseSelection);
|
1480 |
+
|
1481 |
+
SingleSelection.prototype.render = function () {
|
1482 |
+
var $selection = SingleSelection.__super__.render.call(this);
|
1483 |
+
|
1484 |
+
$selection.addClass('czrSelect2-selection--single');
|
1485 |
+
|
1486 |
+
$selection.html(
|
1487 |
+
'<span class="czrSelect2-selection__rendered"></span>' +
|
1488 |
+
'<span class="czrSelect2-selection__arrow" role="presentation">' +
|
1489 |
+
'<b role="presentation"></b>' +
|
1490 |
+
'</span>'
|
1491 |
+
);
|
1492 |
+
|
1493 |
+
return $selection;
|
1494 |
+
};
|
1495 |
+
|
1496 |
+
SingleSelection.prototype.bind = function (container, $container) {
|
1497 |
+
var self = this;
|
1498 |
+
|
1499 |
+
SingleSelection.__super__.bind.apply(this, arguments);
|
1500 |
+
|
1501 |
+
var id = container.id + '-container';
|
1502 |
+
|
1503 |
+
this.$selection.find('.czrSelect2-selection__rendered').attr('id', id);
|
1504 |
+
this.$selection.attr('aria-labelledby', id);
|
1505 |
+
|
1506 |
+
this.$selection.on('mousedown', function (evt) {
|
1507 |
+
// Only respond to left clicks
|
1508 |
+
if (evt.which !== 1) {
|
1509 |
+
return;
|
1510 |
+
}
|
1511 |
+
|
1512 |
+
self.trigger('toggle', {
|
1513 |
+
originalEvent: evt
|
1514 |
+
});
|
1515 |
+
});
|
1516 |
+
|
1517 |
+
this.$selection.on('focus', function (evt) {
|
1518 |
+
// User focuses on the container
|
1519 |
+
});
|
1520 |
+
|
1521 |
+
this.$selection.on('blur', function (evt) {
|
1522 |
+
// User exits the container
|
1523 |
+
});
|
1524 |
+
|
1525 |
+
container.on('focus', function (evt) {
|
1526 |
+
if (!container.isOpen()) {
|
1527 |
+
self.$selection.focus();
|
1528 |
+
}
|
1529 |
+
});
|
1530 |
+
|
1531 |
+
container.on('selection:update', function (params) {
|
1532 |
+
self.update(params.data);
|
1533 |
+
});
|
1534 |
+
};
|
1535 |
+
|
1536 |
+
SingleSelection.prototype.clear = function () {
|
1537 |
+
this.$selection.find('.czrSelect2-selection__rendered').empty();
|
1538 |
+
};
|
1539 |
+
|
1540 |
+
SingleSelection.prototype.display = function (data, container) {
|
1541 |
+
var template = this.options.get('templateSelection');
|
1542 |
+
var escapeMarkup = this.options.get('escapeMarkup');
|
1543 |
+
|
1544 |
+
return escapeMarkup(template(data, container));
|
1545 |
+
};
|
1546 |
+
|
1547 |
+
SingleSelection.prototype.selectionContainer = function () {
|
1548 |
+
return $('<span></span>');
|
1549 |
+
};
|
1550 |
+
|
1551 |
+
SingleSelection.prototype.update = function (data) {
|
1552 |
+
if (data.length === 0) {
|
1553 |
+
this.clear();
|
1554 |
+
return;
|
1555 |
+
}
|
1556 |
+
|
1557 |
+
var selection = data[0];
|
1558 |
+
|
1559 |
+
var $rendered = this.$selection.find('.czrSelect2-selection__rendered');
|
1560 |
+
var formatted = this.display(selection, $rendered);
|
1561 |
+
|
1562 |
+
$rendered.empty().append(formatted);
|
1563 |
+
$rendered.prop('title', selection.title || selection.text);
|
1564 |
+
};
|
1565 |
+
|
1566 |
+
return SingleSelection;
|
1567 |
+
});
|
1568 |
+
|
1569 |
+
S2.define('czrSelect2/selection/multiple',[
|
1570 |
+
'jquery',
|
1571 |
+
'./base',
|
1572 |
+
'../utils'
|
1573 |
+
], function ($, BaseSelection, Utils) {
|
1574 |
+
function MultipleSelection ($element, options) {
|
1575 |
+
MultipleSelection.__super__.constructor.apply(this, arguments);
|
1576 |
+
}
|
1577 |
+
|
1578 |
+
Utils.Extend(MultipleSelection, BaseSelection);
|
1579 |
+
|
1580 |
+
MultipleSelection.prototype.render = function () {
|
1581 |
+
var $selection = MultipleSelection.__super__.render.call(this);
|
1582 |
+
|
1583 |
+
$selection.addClass('czrSelect2-selection--multiple');
|
1584 |
+
|
1585 |
+
$selection.html(
|
1586 |
+
'<ul class="czrSelect2-selection__rendered"></ul>'
|
1587 |
+
);
|
1588 |
+
|
1589 |
+
return $selection;
|
1590 |
+
};
|
1591 |
+
|
1592 |
+
MultipleSelection.prototype.bind = function (container, $container) {
|
1593 |
+
var self = this;
|
1594 |
+
|
1595 |
+
MultipleSelection.__super__.bind.apply(this, arguments);
|
1596 |
+
|
1597 |
+
this.$selection.on('click', function (evt) {
|
1598 |
+
self.trigger('toggle', {
|
1599 |
+
originalEvent: evt
|
1600 |
+
});
|
1601 |
+
});
|
1602 |
+
|
1603 |
+
this.$selection.on(
|
1604 |
+
'click',
|
1605 |
+
'.czrSelect2-selection__choice__remove',
|
1606 |
+
function (evt) {
|
1607 |
+
// Ignore the event if it is disabled
|
1608 |
+
if (self.options.get('disabled')) {
|
1609 |
+
return;
|
1610 |
+
}
|
1611 |
+
|
1612 |
+
var $remove = $(this);
|
1613 |
+
var $selection = $remove.parent();
|
1614 |
+
|
1615 |
+
var data = $selection.data('data');
|
1616 |
+
|
1617 |
+
self.trigger('unselect', {
|
1618 |
+
originalEvent: evt,
|
1619 |
+
data: data
|
1620 |
+
});
|
1621 |
+
}
|
1622 |
+
);
|
1623 |
+
};
|
1624 |
+
|
1625 |
+
MultipleSelection.prototype.clear = function () {
|
1626 |
+
this.$selection.find('.czrSelect2-selection__rendered').empty();
|
1627 |
+
};
|
1628 |
+
|
1629 |
+
MultipleSelection.prototype.display = function (data, container) {
|
1630 |
+
var template = this.options.get('templateSelection');
|
1631 |
+
var escapeMarkup = this.options.get('escapeMarkup');
|
1632 |
+
|
1633 |
+
return escapeMarkup(template(data, container));
|
1634 |
+
};
|
1635 |
+
|
1636 |
+
MultipleSelection.prototype.selectionContainer = function () {
|
1637 |
+
var $container = $(
|
1638 |
+
'<li class="czrSelect2-selection__choice">' +
|
1639 |
+
'<span class="czrSelect2-selection__choice__remove" role="presentation">' +
|
1640 |
+
'×' +
|
1641 |
+
'</span>' +
|
1642 |
+
'</li>'
|
1643 |
+
);
|
1644 |
+
|
1645 |
+
return $container;
|
1646 |
+
};
|
1647 |
+
|
1648 |
+
MultipleSelection.prototype.update = function (data) {
|
1649 |
+
this.clear();
|
1650 |
+
|
1651 |
+
if (data.length === 0) {
|
1652 |
+
return;
|
1653 |
+
}
|
1654 |
+
|
1655 |
+
var $selections = [];
|
1656 |
+
|
1657 |
+
for (var d = 0; d < data.length; d++) {
|
1658 |
+
var selection = data[d];
|
1659 |
+
|
1660 |
+
var $selection = this.selectionContainer();
|
1661 |
+
var formatted = this.display(selection, $selection);
|
1662 |
+
|
1663 |
+
$selection.append(formatted);
|
1664 |
+
$selection.prop('title', selection.title || selection.text);
|
1665 |
+
|
1666 |
+
$selection.data('data', selection);
|
1667 |
+
|
1668 |
+
$selections.push($selection);
|
1669 |
+
}
|
1670 |
+
|
1671 |
+
var $rendered = this.$selection.find('.czrSelect2-selection__rendered');
|
1672 |
+
|
1673 |
+
Utils.appendMany($rendered, $selections);
|
1674 |
+
};
|
1675 |
+
|
1676 |
+
return MultipleSelection;
|
1677 |
+
});
|
1678 |
+
|
1679 |
+
S2.define('czrSelect2/selection/placeholder',[
|
1680 |
+
'../utils'
|
1681 |
+
], function (Utils) {
|
1682 |
+
function Placeholder (decorated, $element, options) {
|
1683 |
+
this.placeholder = this.normalizePlaceholder(options.get('placeholder'));
|
1684 |
+
|
1685 |
+
decorated.call(this, $element, options);
|
1686 |
+
}
|
1687 |
+
|
1688 |
+
Placeholder.prototype.normalizePlaceholder = function (_, placeholder) {
|
1689 |
+
if (typeof placeholder === 'string') {
|
1690 |
+
placeholder = {
|
1691 |
+
id: '',
|
1692 |
+
text: placeholder
|
1693 |
+
};
|
1694 |
+
}
|
1695 |
+
|
1696 |
+
return placeholder;
|
1697 |
+
};
|
1698 |
+
|
1699 |
+
Placeholder.prototype.createPlaceholder = function (decorated, placeholder) {
|
1700 |
+
var $placeholder = this.selectionContainer();
|
1701 |
+
|
1702 |
+
$placeholder.html(this.display(placeholder));
|
1703 |
+
$placeholder.addClass('czrSelect2-selection__placeholder')
|
1704 |
+
.removeClass('czrSelect2-selection__choice');
|
1705 |
+
|
1706 |
+
return $placeholder;
|
1707 |
+
};
|
1708 |
+
|
1709 |
+
Placeholder.prototype.update = function (decorated, data) {
|
1710 |
+
var singlePlaceholder = (
|
1711 |
+
data.length == 1 && data[0].id != this.placeholder.id
|
1712 |
+
);
|
1713 |
+
var multipleSelections = data.length > 1;
|
1714 |
+
|
1715 |
+
if (multipleSelections || singlePlaceholder) {
|
1716 |
+
return decorated.call(this, data);
|
1717 |
+
}
|
1718 |
+
|
1719 |
+
this.clear();
|
1720 |
+
|
1721 |
+
var $placeholder = this.createPlaceholder(this.placeholder);
|
1722 |
+
|
1723 |
+
this.$selection.find('.czrSelect2-selection__rendered').append($placeholder);
|
1724 |
+
};
|
1725 |
+
|
1726 |
+
return Placeholder;
|
1727 |
+
});
|
1728 |
+
|
1729 |
+
S2.define('czrSelect2/selection/allowClear',[
|
1730 |
+
'jquery',
|
1731 |
+
'../keys'
|
1732 |
+
], function ($, KEYS) {
|
1733 |
+
function AllowClear () { }
|
1734 |
+
|
1735 |
+
AllowClear.prototype.bind = function (decorated, container, $container) {
|
1736 |
+
var self = this;
|
1737 |
+
|
1738 |
+
decorated.call(this, container, $container);
|
1739 |
+
|
1740 |
+
if (this.placeholder == null) {
|
1741 |
+
if (this.options.get('debug') && window.console && console.error) {
|
1742 |
+
console.error(
|
1743 |
+
'CzrSelect2: The `allowClear` option should be used in combination ' +
|
1744 |
+
'with the `placeholder` option.'
|
1745 |
+
);
|
1746 |
+
}
|
1747 |
+
}
|
1748 |
+
|
1749 |
+
this.$selection.on('mousedown', '.czrSelect2-selection__clear',
|
1750 |
+
function (evt) {
|
1751 |
+
self._handleClear(evt);
|
1752 |
+
});
|
1753 |
+
|
1754 |
+
container.on('keypress', function (evt) {
|
1755 |
+
self._handleKeyboardClear(evt, container);
|
1756 |
+
});
|
1757 |
+
};
|
1758 |
+
|
1759 |
+
AllowClear.prototype._handleClear = function (_, evt) {
|
1760 |
+
// Ignore the event if it is disabled
|
1761 |
+
if (this.options.get('disabled')) {
|
1762 |
+
return;
|
1763 |
+
}
|
1764 |
+
|
1765 |
+
var $clear = this.$selection.find('.czrSelect2-selection__clear');
|
1766 |
+
|
1767 |
+
// Ignore the event if nothing has been selected
|
1768 |
+
if ($clear.length === 0) {
|
1769 |
+
return;
|
1770 |
+
}
|
1771 |
+
|
1772 |
+
evt.stopPropagation();
|
1773 |
+
|
1774 |
+
var data = $clear.data('data');
|
1775 |
+
|
1776 |
+
for (var d = 0; d < data.length; d++) {
|
1777 |
+
var unselectData = {
|
1778 |
+
data: data[d]
|
1779 |
+
};
|
1780 |
+
|
1781 |
+
// Trigger the `unselect` event, so people can prevent it from being
|
1782 |
+
// cleared.
|
1783 |
+
this.trigger('unselect', unselectData);
|
1784 |
+
|
1785 |
+
// If the event was prevented, don't clear it out.
|
1786 |
+
if (unselectData.prevented) {
|
1787 |
+
return;
|
1788 |
+
}
|
1789 |
+
}
|
1790 |
+
|
1791 |
+
this.$element.val(this.placeholder.id).trigger('change');
|
1792 |
+
|
1793 |
+
this.trigger('toggle', {});
|
1794 |
+
};
|
1795 |
+
|
1796 |
+
AllowClear.prototype._handleKeyboardClear = function (_, evt, container) {
|
1797 |
+
if (container.isOpen()) {
|
1798 |
+
return;
|
1799 |
+
}
|
1800 |
+
|
1801 |
+
if (evt.which == KEYS.DELETE || evt.which == KEYS.BACKSPACE) {
|
1802 |
+
this._handleClear(evt);
|
1803 |
+
}
|
1804 |
+
};
|
1805 |
+
|
1806 |
+
AllowClear.prototype.update = function (decorated, data) {
|
1807 |
+
decorated.call(this, data);
|
1808 |
+
|
1809 |
+
if (this.$selection.find('.czrSelect2-selection__placeholder').length > 0 ||
|
1810 |
+
data.length === 0) {
|
1811 |
+
return;
|
1812 |
+
}
|
1813 |
+
|
1814 |
+
var $remove = $(
|
1815 |
+
'<span class="czrSelect2-selection__clear">' +
|
1816 |
+
'×' +
|
1817 |
+
'</span>'
|
1818 |
+
);
|
1819 |
+
$remove.data('data', data);
|
1820 |
+
|
1821 |
+
this.$selection.find('.czrSelect2-selection__rendered').prepend($remove);
|
1822 |
+
};
|
1823 |
+
|
1824 |
+
return AllowClear;
|
1825 |
+
});
|
1826 |
+
|
1827 |
+
S2.define('czrSelect2/selection/search',[
|
1828 |
+
'jquery',
|
1829 |
+
'../utils',
|
1830 |
+
'../keys'
|
1831 |
+
], function ($, Utils, KEYS) {
|
1832 |
+
function Search (decorated, $element, options) {
|
1833 |
+
decorated.call(this, $element, options);
|
1834 |
+
}
|
1835 |
+
|
1836 |
+
Search.prototype.render = function (decorated) {
|
1837 |
+
var $search = $(
|
1838 |
+
'<li class="czrSelect2-search czrSelect2-search--inline">' +
|
1839 |
+
'<input class="czrSelect2-search__field" type="search" tabindex="-1"' +
|
1840 |
+
' autocomplete="off" autocorrect="off" autocapitalize="off"' +
|
1841 |
+
' spellcheck="false" role="textbox" aria-autocomplete="list" />' +
|
1842 |
+
'</li>'
|
1843 |
+
);
|
1844 |
+
|
1845 |
+
this.$searchContainer = $search;
|
1846 |
+
this.$search = $search.find('input');
|
1847 |
+
|
1848 |
+
var $rendered = decorated.call(this);
|
1849 |
+
|
1850 |
+
this._transferTabIndex();
|
1851 |
+
|
1852 |
+
return $rendered;
|
1853 |
+
};
|
1854 |
+
|
1855 |
+
Search.prototype.bind = function (decorated, container, $container) {
|
1856 |
+
var self = this;
|
1857 |
+
|
1858 |
+
decorated.call(this, container, $container);
|
1859 |
+
|
1860 |
+
container.on('open', function () {
|
1861 |
+
self.$search.trigger('focus');
|
1862 |
+
});
|
1863 |
+
|
1864 |
+
container.on('close', function () {
|
1865 |
+
self.$search.val('');
|
1866 |
+
self.$search.removeAttr('aria-activedescendant');
|
1867 |
+
self.$search.trigger('focus');
|
1868 |
+
});
|
1869 |
+
|
1870 |
+
container.on('enable', function () {
|
1871 |
+
self.$search.prop('disabled', false);
|
1872 |
+
|
1873 |
+
self._transferTabIndex();
|
1874 |
+
});
|
1875 |
+
|
1876 |
+
container.on('disable', function () {
|
1877 |
+
self.$search.prop('disabled', true);
|
1878 |
+
});
|
1879 |
+
|
1880 |
+
container.on('focus', function (evt) {
|
1881 |
+
self.$search.trigger('focus');
|
1882 |
+
});
|
1883 |
+
|
1884 |
+
container.on('results:focus', function (params) {
|
1885 |
+
self.$search.attr('aria-activedescendant', params.id);
|
1886 |
+
});
|
1887 |
+
|
1888 |
+
this.$selection.on('focusin', '.czrSelect2-search--inline', function (evt) {
|
1889 |
+
self.trigger('focus', evt);
|
1890 |
+
});
|
1891 |
+
|
1892 |
+
this.$selection.on('focusout', '.czrSelect2-search--inline', function (evt) {
|
1893 |
+
self._handleBlur(evt);
|
1894 |
+
});
|
1895 |
+
|
1896 |
+
this.$selection.on('keydown', '.czrSelect2-search--inline', function (evt) {
|
1897 |
+
evt.stopPropagation();
|
1898 |
+
|
1899 |
+
self.trigger('keypress', evt);
|
1900 |
+
|
1901 |
+
self._keyUpPrevented = evt.isDefaultPrevented();
|
1902 |
+
|
1903 |
+
var key = evt.which;
|
1904 |
+
|
1905 |
+
if (key === KEYS.BACKSPACE && self.$search.val() === '') {
|
1906 |
+
var $previousChoice = self.$searchContainer
|
1907 |
+
.prev('.czrSelect2-selection__choice');
|
1908 |
+
|
1909 |
+
if ($previousChoice.length > 0) {
|
1910 |
+
var item = $previousChoice.data('data');
|
1911 |
+
|
1912 |
+
self.searchRemoveChoice(item);
|
1913 |
+
|
1914 |
+
evt.preventDefault();
|
1915 |
+
}
|
1916 |
+
}
|
1917 |
+
});
|
1918 |
+
|
1919 |
+
// Try to detect the IE version should the `documentMode` property that
|
1920 |
+
// is stored on the document. This is only implemented in IE and is
|
1921 |
+
// slightly cleaner than doing a user agent check.
|
1922 |
+
// This property is not available in Edge, but Edge also doesn't have
|
1923 |
+
// this bug.
|
1924 |
+
var msie = document.documentMode;
|
1925 |
+
var disableInputEvents = msie && msie <= 11;
|
1926 |
+
|
1927 |
+
// Workaround for browsers which do not support the `input` event
|
1928 |
+
// This will prevent double-triggering of events for browsers which support
|
1929 |
+
// both the `keyup` and `input` events.
|
1930 |
+
this.$selection.on(
|
1931 |
+
'input.searchcheck',
|
1932 |
+
'.czrSelect2-search--inline',
|
1933 |
+
function (evt) {
|
1934 |
+
// IE will trigger the `input` event when a placeholder is used on a
|
1935 |
+
// search box. To get around this issue, we are forced to ignore all
|
1936 |
+
// `input` events in IE and keep using `keyup`.
|
1937 |
+
if (disableInputEvents) {
|
1938 |
+
self.$selection.off('input.search input.searchcheck');
|
1939 |
+
return;
|
1940 |
+
}
|
1941 |
+
|
1942 |
+
// Unbind the duplicated `keyup` event
|
1943 |
+
self.$selection.off('keyup.search');
|
1944 |
+
}
|
1945 |
+
);
|
1946 |
+
|
1947 |
+
this.$selection.on(
|
1948 |
+
'keyup.search input.search',
|
1949 |
+
'.czrSelect2-search--inline',
|
1950 |
+
function (evt) {
|
1951 |
+
// IE will trigger the `input` event when a placeholder is used on a
|
1952 |
+
// search box. To get around this issue, we are forced to ignore all
|
1953 |
+
// `input` events in IE and keep using `keyup`.
|
1954 |
+
if (disableInputEvents && evt.type === 'input') {
|
1955 |
+
self.$selection.off('input.search input.searchcheck');
|
1956 |
+
return;
|
1957 |
+
}
|
1958 |
+
|
1959 |
+
var key = evt.which;
|
1960 |
+
|
1961 |
+
// We can freely ignore events from modifier keys
|
1962 |
+
if (key == KEYS.SHIFT || key == KEYS.CTRL || key == KEYS.ALT) {
|
1963 |
+
return;
|
1964 |
+
}
|
1965 |
+
|
1966 |
+
// Tabbing will be handled during the `keydown` phase
|
1967 |
+
if (key == KEYS.TAB) {
|
1968 |
+
return;
|
1969 |
+
}
|
1970 |
+
|
1971 |
+
self.handleSearch(evt);
|
1972 |
+
}
|
1973 |
+
);
|
1974 |
+
};
|
1975 |
+
|
1976 |
+
/**
|
1977 |
+
* This method will transfer the tabindex attribute from the rendered
|
1978 |
+
* selection to the search box. This allows for the search box to be used as
|
1979 |
+
* the primary focus instead of the selection container.
|
1980 |
+
*
|
1981 |
+
* @private
|
1982 |
+
*/
|
1983 |
+
Search.prototype._transferTabIndex = function (decorated) {
|
1984 |
+
this.$search.attr('tabindex', this.$selection.attr('tabindex'));
|
1985 |
+
this.$selection.attr('tabindex', '-1');
|
1986 |
+
};
|
1987 |
+
|
1988 |
+
Search.prototype.createPlaceholder = function (decorated, placeholder) {
|
1989 |
+
this.$search.attr('placeholder', placeholder.text);
|
1990 |
+
};
|
1991 |
+
|
1992 |
+
Search.prototype.update = function (decorated, data) {
|
1993 |
+
var searchHadFocus = this.$search[0] == document.activeElement;
|
1994 |
+
|
1995 |
+
this.$search.attr('placeholder', '');
|
1996 |
+
|
1997 |
+
decorated.call(this, data);
|
1998 |
+
|
1999 |
+
this.$selection.find('.czrSelect2-selection__rendered')
|
2000 |
+
.append(this.$searchContainer);
|
2001 |
+
|
2002 |
+
this.resizeSearch();
|
2003 |
+
if (searchHadFocus) {
|
2004 |
+
this.$search.focus();
|
2005 |
+
}
|
2006 |
+
};
|
2007 |
+
|
2008 |
+
Search.prototype.handleSearch = function () {
|
2009 |
+
this.resizeSearch();
|
2010 |
+
|
2011 |
+
if (!this._keyUpPrevented) {
|
2012 |
+
var input = this.$search.val();
|
2013 |
+
|
2014 |
+
this.trigger('query', {
|
2015 |
+
term: input
|
2016 |
+
});
|
2017 |
+
}
|
2018 |
+
|
2019 |
+
this._keyUpPrevented = false;
|
2020 |
+
};
|
2021 |
+
|
2022 |
+
Search.prototype.searchRemoveChoice = function (decorated, item) {
|
2023 |
+
this.trigger('unselect', {
|
2024 |
+
data: item
|
2025 |
+
});
|
2026 |
+
|
2027 |
+
this.$search.val(item.text);
|
2028 |
+
this.handleSearch();
|
2029 |
+
};
|
2030 |
+
|
2031 |
+
Search.prototype.resizeSearch = function () {
|
2032 |
+
this.$search.css('width', '25px');
|
2033 |
+
|
2034 |
+
var width = '';
|
2035 |
+
|
2036 |
+
if (this.$search.attr('placeholder') !== '') {
|
2037 |
+
width = this.$selection.find('.czrSelect2-selection__rendered').innerWidth();
|
2038 |
+
} else {
|
2039 |
+
var minimumWidth = this.$search.val().length + 1;
|
2040 |
+
|
2041 |
+
width = (minimumWidth * 0.75) + 'em';
|
2042 |
+
}
|
2043 |
+
|
2044 |
+
this.$search.css('width', width);
|
2045 |
+
};
|
2046 |
+
|
2047 |
+
return Search;
|
2048 |
+
});
|
2049 |
+
|
2050 |
+
S2.define('czrSelect2/selection/eventRelay',[
|
2051 |
+
'jquery'
|
2052 |
+
], function ($) {
|
2053 |
+
function EventRelay () { }
|
2054 |
+
|
2055 |
+
EventRelay.prototype.bind = function (decorated, container, $container) {
|
2056 |
+
var self = this;
|
2057 |
+
var relayEvents = [
|
2058 |
+
'open', 'opening',
|
2059 |
+
'close', 'closing',
|
2060 |
+
'select', 'selecting',
|
2061 |
+
'unselect', 'unselecting'
|
2062 |
+
];
|
2063 |
+
|
2064 |
+
var preventableEvents = ['opening', 'closing', 'selecting', 'unselecting'];
|
2065 |
+
|
2066 |
+
decorated.call(this, container, $container);
|
2067 |
+
|
2068 |
+
container.on('*', function (name, params) {
|
2069 |
+
// Ignore events that should not be relayed
|
2070 |
+
if ($.inArray(name, relayEvents) === -1) {
|
2071 |
+
return;
|
2072 |
+
}
|
2073 |
+
|
2074 |
+
// The parameters should always be an object
|
2075 |
+
params = params || {};
|
2076 |
+
|
2077 |
+
// Generate the jQuery event for the CzrSelect2 event
|
2078 |
+
var evt = $.Event('czrSelect2:' + name, {
|
2079 |
+
params: params
|
2080 |
+
});
|
2081 |
+
|
2082 |
+
self.$element.trigger(evt);
|
2083 |
+
|
2084 |
+
// Only handle preventable events if it was one
|
2085 |
+
if ($.inArray(name, preventableEvents) === -1) {
|
2086 |
+
return;
|
2087 |
+
}
|
2088 |
+
|
2089 |
+
params.prevented = evt.isDefaultPrevented();
|
2090 |
+
});
|
2091 |
+
};
|
2092 |
+
|
2093 |
+
return EventRelay;
|
2094 |
+
});
|
2095 |
+
|
2096 |
+
S2.define('czrSelect2/translation',[
|
2097 |
+
'jquery',
|
2098 |
+
'require'
|
2099 |
+
], function ($, require) {
|
2100 |
+
function Translation (dict) {
|
2101 |
+
this.dict = dict || {};
|
2102 |
+
}
|
2103 |
+
|
2104 |
+
Translation.prototype.all = function () {
|
2105 |
+
return this.dict;
|
2106 |
+
};
|
2107 |
+
|
2108 |
+
Translation.prototype.get = function (key) {
|
2109 |
+
return this.dict[key];
|
2110 |
+
};
|
2111 |
+
|
2112 |
+
Translation.prototype.extend = function (translation) {
|
2113 |
+
this.dict = $.extend({}, translation.all(), this.dict);
|
2114 |
+
};
|
2115 |
+
|
2116 |
+
// Static functions
|
2117 |
+
|
2118 |
+
Translation._cache = {};
|
2119 |
+
|
2120 |
+
Translation.loadPath = function (path) {
|
2121 |
+
if (!(path in Translation._cache)) {
|
2122 |
+
var translations = require(path);
|
2123 |
+
|
2124 |
+
Translation._cache[path] = translations;
|
2125 |
+
}
|
2126 |
+
|
2127 |
+
return new Translation(Translation._cache[path]);
|
2128 |
+
};
|
2129 |
+
|
2130 |
+
return Translation;
|
2131 |
+
});
|
2132 |
+
|
2133 |
+
S2.define('czrSelect2/diacritics',[
|
2134 |
+
|
2135 |
+
], function () {
|
2136 |
+
var diacritics = {
|
2137 |
+
'\u24B6': 'A',
|
2138 |
+
'\uFF21': 'A',
|
2139 |
+
'\u00C0': 'A',
|
2140 |
+
'\u00C1': 'A',
|
2141 |
+
'\u00C2': 'A',
|
2142 |
+
'\u1EA6': 'A',
|
2143 |
+
'\u1EA4': 'A',
|
2144 |
+
'\u1EAA': 'A',
|
2145 |
+
'\u1EA8': 'A',
|
2146 |
+
'\u00C3': 'A',
|
2147 |
+
'\u0100': 'A',
|
2148 |
+
'\u0102': 'A',
|
2149 |
+
'\u1EB0': 'A',
|
2150 |
+
'\u1EAE': 'A',
|
2151 |
+
'\u1EB4': 'A',
|
2152 |
+
'\u1EB2': 'A',
|
2153 |
+
'\u0226': 'A',
|
2154 |
+
'\u01E0': 'A',
|
2155 |
+
'\u00C4': 'A',
|
2156 |
+
'\u01DE': 'A',
|
2157 |
+
'\u1EA2': 'A',
|
2158 |
+
'\u00C5': 'A',
|
2159 |
+
'\u01FA': 'A',
|
2160 |
+
'\u01CD': 'A',
|
2161 |
+
'\u0200': 'A',
|
2162 |
+
'\u0202': 'A',
|
2163 |
+
'\u1EA0': 'A',
|
2164 |
+
'\u1EAC': 'A',
|
2165 |
+
'\u1EB6': 'A',
|
2166 |
+
'\u1E00': 'A',
|
2167 |
+
'\u0104': 'A',
|
2168 |
+
'\u023A': 'A',
|
2169 |
+
'\u2C6F': 'A',
|
2170 |
+
'\uA732': 'AA',
|
2171 |
+
'\u00C6': 'AE',
|
2172 |
+
'\u01FC': 'AE',
|
2173 |
+
'\u01E2': 'AE',
|
2174 |
+
'\uA734': 'AO',
|
2175 |
+
'\uA736': 'AU',
|
2176 |
+
'\uA738': 'AV',
|
2177 |
+
'\uA73A': 'AV',
|
2178 |
+
'\uA73C': 'AY',
|
2179 |
+
'\u24B7': 'B',
|
2180 |
+
'\uFF22': 'B',
|
2181 |
+
'\u1E02': 'B',
|
2182 |
+
'\u1E04': 'B',
|
2183 |
+
'\u1E06': 'B',
|
2184 |
+
'\u0243': 'B',
|
2185 |
+
'\u0182': 'B',
|
2186 |
+
'\u0181': 'B',
|
2187 |
+
'\u24B8': 'C',
|
2188 |
+
'\uFF23': 'C',
|
2189 |
+
'\u0106': 'C',
|
2190 |
+
'\u0108': 'C',
|
2191 |
+
'\u010A': 'C',
|
2192 |
+
'\u010C': 'C',
|
2193 |
+
'\u00C7': 'C',
|
2194 |
+
'\u1E08': 'C',
|
2195 |
+
'\u0187': 'C',
|
2196 |
+
'\u023B': 'C',
|
2197 |
+
'\uA73E': 'C',
|
2198 |
+
'\u24B9': 'D',
|
2199 |
+
'\uFF24': 'D',
|
2200 |
+
'\u1E0A': 'D',
|
2201 |
+
'\u010E': 'D',
|
2202 |
+
'\u1E0C': 'D',
|
2203 |
+
'\u1E10': 'D',
|
2204 |
+
'\u1E12': 'D',
|
2205 |
+
'\u1E0E': 'D',
|
2206 |
+
'\u0110': 'D',
|
2207 |
+
'\u018B': 'D',
|
2208 |
+
'\u018A': 'D',
|
2209 |
+
'\u0189': 'D',
|
2210 |
+
'\uA779': 'D',
|
2211 |
+
'\u01F1': 'DZ',
|
2212 |
+
'\u01C4': 'DZ',
|
2213 |
+
'\u01F2': 'Dz',
|
2214 |
+
'\u01C5': 'Dz',
|
2215 |
+
'\u24BA': 'E',
|
2216 |
+
'\uFF25': 'E',
|
2217 |
+
'\u00C8': 'E',
|
2218 |
+
'\u00C9': 'E',
|
2219 |
+
'\u00CA': 'E',
|
2220 |
+
'\u1EC0': 'E',
|
2221 |
+
'\u1EBE': 'E',
|
2222 |
+
'\u1EC4': 'E',
|
2223 |
+
'\u1EC2': 'E',
|
2224 |
+
'\u1EBC': 'E',
|
2225 |
+
'\u0112': 'E',
|
2226 |
+
'\u1E14': 'E',
|
2227 |
+
'\u1E16': 'E',
|
2228 |
+
'\u0114': 'E',
|
2229 |
+
'\u0116': 'E',
|
2230 |
+
'\u00CB': 'E',
|
2231 |
+
'\u1EBA': 'E',
|
2232 |
+
'\u011A': 'E',
|
2233 |
+
'\u0204': 'E',
|
2234 |
+
'\u0206': 'E',
|
2235 |
+
'\u1EB8': 'E',
|
2236 |
+
'\u1EC6': 'E',
|
2237 |
+
'\u0228': 'E',
|
2238 |
+
'\u1E1C': 'E',
|
2239 |
+
'\u0118': 'E',
|
2240 |
+
'\u1E18': 'E',
|
2241 |
+
'\u1E1A': 'E',
|
2242 |
+
'\u0190': 'E',
|
2243 |
+
'\u018E': 'E',
|
2244 |
+
'\u24BB': 'F',
|
2245 |
+
'\uFF26': 'F',
|
2246 |
+
'\u1E1E': 'F',
|
2247 |
+
'\u0191': 'F',
|
2248 |
+
'\uA77B': 'F',
|
2249 |
+
'\u24BC': 'G',
|
2250 |
+
'\uFF27': 'G',
|
2251 |
+
'\u01F4': 'G',
|
2252 |
+
'\u011C': 'G',
|
2253 |
+
'\u1E20': 'G',
|
2254 |
+
'\u011E': 'G',
|
2255 |
+
'\u0120': 'G',
|
2256 |
+
'\u01E6': 'G',
|
2257 |
+
'\u0122': 'G',
|
2258 |
+
'\u01E4': 'G',
|
2259 |
+
'\u0193': 'G',
|
2260 |
+
'\uA7A0': 'G',
|
2261 |
+
'\uA77D': 'G',
|
2262 |
+
'\uA77E': 'G',
|
2263 |
+
'\u24BD': 'H',
|
2264 |
+
'\uFF28': 'H',
|
2265 |
+
'\u0124': 'H',
|
2266 |
+
'\u1E22': 'H',
|
2267 |
+
'\u1E26': 'H',
|
2268 |
+
'\u021E': 'H',
|
2269 |
+
'\u1E24': 'H',
|
2270 |
+
'\u1E28': 'H',
|
2271 |
+
'\u1E2A': 'H',
|
2272 |
+
'\u0126': 'H',
|
2273 |
+
'\u2C67': 'H',
|
2274 |
+
'\u2C75': 'H',
|
2275 |
+
'\uA78D': 'H',
|
2276 |
+
'\u24BE': 'I',
|
2277 |
+
'\uFF29': 'I',
|
2278 |
+
'\u00CC': 'I',
|
2279 |
+
'\u00CD': 'I',
|
2280 |
+
'\u00CE': 'I',
|
2281 |
+
'\u0128': 'I',
|
2282 |
+
'\u012A': 'I',
|
2283 |
+
'\u012C': 'I',
|
2284 |
+
'\u0130': 'I',
|
2285 |
+
'\u00CF': 'I',
|
2286 |
+
'\u1E2E': 'I',
|
2287 |
+
'\u1EC8': 'I',
|
2288 |
+
'\u01CF': 'I',
|
2289 |
+
'\u0208': 'I',
|
2290 |
+
'\u020A': 'I',
|
2291 |
+
'\u1ECA': 'I',
|
2292 |
+
'\u012E': 'I',
|
2293 |
+
'\u1E2C': 'I',
|
2294 |
+
'\u0197': 'I',
|
2295 |
+
'\u24BF': 'J',
|
2296 |
+
'\uFF2A': 'J',
|
2297 |
+
'\u0134': 'J',
|
2298 |
+
'\u0248': 'J',
|
2299 |
+
'\u24C0': 'K',
|
2300 |
+
'\uFF2B': 'K',
|
2301 |
+
'\u1E30': 'K',
|
2302 |
+
'\u01E8': 'K',
|
2303 |
+
'\u1E32': 'K',
|
2304 |
+
'\u0136': 'K',
|
2305 |
+
'\u1E34': 'K',
|
2306 |
+
'\u0198': 'K',
|
2307 |
+
'\u2C69': 'K',
|
2308 |
+
'\uA740': 'K',
|
2309 |
+
'\uA742': 'K',
|
2310 |
+
'\uA744': 'K',
|
2311 |
+
'\uA7A2': 'K',
|
2312 |
+
'\u24C1': 'L',
|
2313 |
+
'\uFF2C': 'L',
|
2314 |
+
'\u013F': 'L',
|
2315 |
+
'\u0139': 'L',
|
2316 |
+
'\u013D': 'L',
|
2317 |
+
'\u1E36': 'L',
|
2318 |
+
'\u1E38': 'L',
|
2319 |
+
'\u013B': 'L',
|
2320 |
+
'\u1E3C': 'L',
|
2321 |
+
'\u1E3A': 'L',
|
2322 |
+
'\u0141': 'L',
|
2323 |
+
'\u023D': 'L',
|
2324 |
+
'\u2C62': 'L',
|
2325 |
+
'\u2C60': 'L',
|
2326 |
+
'\uA748': 'L',
|
2327 |
+
'\uA746': 'L',
|
2328 |
+
'\uA780': 'L',
|
2329 |
+
'\u01C7': 'LJ',
|
2330 |
+
'\u01C8': 'Lj',
|
2331 |
+
'\u24C2': 'M',
|
2332 |
+
'\uFF2D': 'M',
|
2333 |
+
'\u1E3E': 'M',
|
2334 |
+
'\u1E40': 'M',
|
2335 |
+
'\u1E42': 'M',
|
2336 |
+
'\u2C6E': 'M',
|
2337 |
+
'\u019C': 'M',
|
2338 |
+
'\u24C3': 'N',
|
2339 |
+
'\uFF2E': 'N',
|
2340 |
+
'\u01F8': 'N',
|
2341 |
+
'\u0143': 'N',
|
2342 |
+
'\u00D1': 'N',
|
2343 |
+
'\u1E44': 'N',
|
2344 |
+
'\u0147': 'N',
|
2345 |
+
'\u1E46': 'N',
|
2346 |
+
'\u0145': 'N',
|
2347 |
+
'\u1E4A': 'N',
|
2348 |
+
'\u1E48': 'N',
|
2349 |
+
'\u0220': 'N',
|
2350 |
+
'\u019D': 'N',
|
2351 |
+
'\uA790': 'N',
|
2352 |
+
'\uA7A4': 'N',
|
2353 |
+
'\u01CA': 'NJ',
|
2354 |
+
'\u01CB': 'Nj',
|
2355 |
+
'\u24C4': 'O',
|
2356 |
+
'\uFF2F': 'O',
|
2357 |
+
'\u00D2': 'O',
|
2358 |
+
'\u00D3': 'O',
|
2359 |
+
'\u00D4': 'O',
|
2360 |
+
'\u1ED2': 'O',
|
2361 |
+
'\u1ED0': 'O',
|
2362 |
+
'\u1ED6': 'O',
|
2363 |
+
'\u1ED4': 'O',
|
2364 |
+
'\u00D5': 'O',
|
2365 |
+
'\u1E4C': 'O',
|
2366 |
+
'\u022C': 'O',
|
2367 |
+
'\u1E4E': 'O',
|
2368 |
+
'\u014C': 'O',
|
2369 |
+
'\u1E50': 'O',
|
2370 |
+
'\u1E52': 'O',
|
2371 |
+
'\u014E': 'O',
|
2372 |
+
'\u022E': 'O',
|
2373 |
+
'\u0230': 'O',
|
2374 |
+
'\u00D6': 'O',
|
2375 |
+
'\u022A': 'O',
|
2376 |
+
'\u1ECE': 'O',
|
2377 |
+
'\u0150': 'O',
|
2378 |
+
'\u01D1': 'O',
|
2379 |
+
'\u020C': 'O',
|
2380 |
+
'\u020E': 'O',
|
2381 |
+
'\u01A0': 'O',
|
2382 |
+
'\u1EDC': 'O',
|
2383 |
+
'\u1EDA': 'O',
|
2384 |
+
'\u1EE0': 'O',
|
2385 |
+
'\u1EDE': 'O',
|
2386 |
+
'\u1EE2': 'O',
|
2387 |
+
'\u1ECC': 'O',
|
2388 |
+
'\u1ED8': 'O',
|
2389 |
+
'\u01EA': 'O',
|
2390 |
+
'\u01EC': 'O',
|
2391 |
+
'\u00D8': 'O',
|
2392 |
+
'\u01FE': 'O',
|
2393 |
+
'\u0186': 'O',
|
2394 |
+
'\u019F': 'O',
|
2395 |
+
'\uA74A': 'O',
|
2396 |
+
'\uA74C': 'O',
|
2397 |
+
'\u01A2': 'OI',
|
2398 |
+
'\uA74E': 'OO',
|
2399 |
+
'\u0222': 'OU',
|
2400 |
+
'\u24C5': 'P',
|
2401 |
+
'\uFF30': 'P',
|
2402 |
+
'\u1E54': 'P',
|
2403 |
+
'\u1E56': 'P',
|
2404 |
+
'\u01A4': 'P',
|
2405 |
+
'\u2C63': 'P',
|
2406 |
+
'\uA750': 'P',
|
2407 |
+
'\uA752': 'P',
|
2408 |
+
'\uA754': 'P',
|
2409 |
+
'\u24C6': 'Q',
|
2410 |
+
'\uFF31': 'Q',
|
2411 |
+
'\uA756': 'Q',
|
2412 |
+
'\uA758': 'Q',
|
2413 |
+
'\u024A': 'Q',
|
2414 |
+
'\u24C7': 'R',
|
2415 |
+
'\uFF32': 'R',
|
2416 |
+
'\u0154': 'R',
|
2417 |
+
'\u1E58': 'R',
|
2418 |
+
'\u0158': 'R',
|
2419 |
+
'\u0210': 'R',
|
2420 |
+
'\u0212': 'R',
|
2421 |
+
'\u1E5A': 'R',
|
2422 |
+
'\u1E5C': 'R',
|
2423 |
+
'\u0156': 'R',
|
2424 |
+
'\u1E5E': 'R',
|
2425 |
+
'\u024C': 'R',
|
2426 |
+
'\u2C64': 'R',
|
2427 |
+
'\uA75A': 'R',
|
2428 |
+
'\uA7A6': 'R',
|
2429 |
+
'\uA782': 'R',
|
2430 |
+
'\u24C8': 'S',
|
2431 |
+
'\uFF33': 'S',
|
2432 |
+
'\u1E9E': 'S',
|
2433 |
+
'\u015A': 'S',
|
2434 |
+
'\u1E64': 'S',
|
2435 |
+
'\u015C': 'S',
|
2436 |
+
'\u1E60': 'S',
|
2437 |
+
'\u0160': 'S',
|
2438 |
+
'\u1E66': 'S',
|
2439 |
+
'\u1E62': 'S',
|
2440 |
+
'\u1E68': 'S',
|
2441 |
+
'\u0218': 'S',
|
2442 |
+
'\u015E': 'S',
|
2443 |
+
'\u2C7E': 'S',
|
2444 |
+
'\uA7A8': 'S',
|
2445 |
+
'\uA784': 'S',
|
2446 |
+
'\u24C9': 'T',
|
2447 |
+
'\uFF34': 'T',
|
2448 |
+
'\u1E6A': 'T',
|
2449 |
+
'\u0164': 'T',
|
2450 |
+
'\u1E6C': 'T',
|
2451 |
+
'\u021A': 'T',
|
2452 |
+
'\u0162': 'T',
|
2453 |
+
'\u1E70': 'T',
|
2454 |
+
'\u1E6E': 'T',
|
2455 |
+
'\u0166': 'T',
|
2456 |
+
'\u01AC': 'T',
|
2457 |
+
'\u01AE': 'T',
|
2458 |
+
'\u023E': 'T',
|
2459 |
+
'\uA786': 'T',
|
2460 |
+
'\uA728': 'TZ',
|
2461 |
+
'\u24CA': 'U',
|
2462 |
+
'\uFF35': 'U',
|
2463 |
+
'\u00D9': 'U',
|
2464 |
+
'\u00DA': 'U',
|
2465 |
+
'\u00DB': 'U',
|
2466 |
+
'\u0168': 'U',
|
2467 |
+
'\u1E78': 'U',
|
2468 |
+
'\u016A': 'U',
|
2469 |
+
'\u1E7A': 'U',
|
2470 |
+
'\u016C': 'U',
|
2471 |
+
'\u00DC': 'U',
|
2472 |
+
'\u01DB': 'U',
|
2473 |
+
'\u01D7': 'U',
|
2474 |
+
'\u01D5': 'U',
|
2475 |
+
'\u01D9': 'U',
|
2476 |
+
'\u1EE6': 'U',
|
2477 |
+
'\u016E': 'U',
|
2478 |
+
'\u0170': 'U',
|
2479 |
+
'\u01D3': 'U',
|
2480 |
+
'\u0214': 'U',
|
2481 |
+
'\u0216': 'U',
|
2482 |
+
'\u01AF': 'U',
|
2483 |
+
'\u1EEA': 'U',
|
2484 |
+
'\u1EE8': 'U',
|
2485 |
+
'\u1EEE': 'U',
|
2486 |
+
'\u1EEC': 'U',
|
2487 |
+
'\u1EF0': 'U',
|
2488 |
+
'\u1EE4': 'U',
|
2489 |
+
'\u1E72': 'U',
|
2490 |
+
'\u0172': 'U',
|
2491 |
+
'\u1E76': 'U',
|
2492 |
+
'\u1E74': 'U',
|
2493 |
+
'\u0244': 'U',
|
2494 |
+
'\u24CB': 'V',
|
2495 |
+
'\uFF36': 'V',
|
2496 |
+
'\u1E7C': 'V',
|
2497 |
+
'\u1E7E': 'V',
|
2498 |
+
'\u01B2': 'V',
|
2499 |
+
'\uA75E': 'V',
|
2500 |
+
'\u0245': 'V',
|
2501 |
+
'\uA760': 'VY',
|
2502 |
+
'\u24CC': 'W',
|
2503 |
+
'\uFF37': 'W',
|
2504 |
+
'\u1E80': 'W',
|
2505 |
+
'\u1E82': 'W',
|
2506 |
+
'\u0174': 'W',
|
2507 |
+
'\u1E86': 'W',
|
2508 |
+
'\u1E84': 'W',
|
2509 |
+
'\u1E88': 'W',
|
2510 |
+
'\u2C72': 'W',
|
2511 |
+
'\u24CD': 'X',
|
2512 |
+
'\uFF38': 'X',
|
2513 |
+
'\u1E8A': 'X',
|
2514 |
+
'\u1E8C': 'X',
|
2515 |
+
'\u24CE': 'Y',
|
2516 |
+
'\uFF39': 'Y',
|
2517 |
+
'\u1EF2': 'Y',
|
2518 |
+
'\u00DD': 'Y',
|
2519 |
+
'\u0176': 'Y',
|
2520 |
+
'\u1EF8': 'Y',
|
2521 |
+
'\u0232': 'Y',
|
2522 |
+
'\u1E8E': 'Y',
|
2523 |
+
'\u0178': 'Y',
|
2524 |
+
'\u1EF6': 'Y',
|
2525 |
+
'\u1EF4': 'Y',
|
2526 |
+
'\u01B3': 'Y',
|
2527 |
+
'\u024E': 'Y',
|
2528 |
+
'\u1EFE': 'Y',
|
2529 |
+
'\u24CF': 'Z',
|
2530 |
+
'\uFF3A': 'Z',
|
2531 |
+
'\u0179': 'Z',
|
2532 |
+
'\u1E90': 'Z',
|
2533 |
+
'\u017B': 'Z',
|
2534 |
+
'\u017D': 'Z',
|
2535 |
+
'\u1E92': 'Z',
|
2536 |
+
'\u1E94': 'Z',
|
2537 |
+
'\u01B5': 'Z',
|
2538 |
+
'\u0224': 'Z',
|
2539 |
+
'\u2C7F': 'Z',
|
2540 |
+
'\u2C6B': 'Z',
|
2541 |
+
'\uA762': 'Z',
|
2542 |
+
'\u24D0': 'a',
|
2543 |
+
'\uFF41': 'a',
|
2544 |
+
'\u1E9A': 'a',
|
2545 |
+
'\u00E0': 'a',
|
2546 |
+
'\u00E1': 'a',
|
2547 |
+
'\u00E2': 'a',
|
2548 |
+
'\u1EA7': 'a',
|
2549 |
+
'\u1EA5': 'a',
|
2550 |
+
'\u1EAB': 'a',
|
2551 |
+
'\u1EA9': 'a',
|
2552 |
+
'\u00E3': 'a',
|
2553 |
+
'\u0101': 'a',
|
2554 |
+
'\u0103': 'a',
|
2555 |
+
'\u1EB1': 'a',
|
2556 |
+
'\u1EAF': 'a',
|
2557 |
+
'\u1EB5': 'a',
|
2558 |
+
'\u1EB3': 'a',
|
2559 |
+
'\u0227': 'a',
|
2560 |
+
'\u01E1': 'a',
|
2561 |
+
'\u00E4': 'a',
|
2562 |
+
'\u01DF': 'a',
|
2563 |
+
'\u1EA3': 'a',
|
2564 |
+
'\u00E5': 'a',
|
2565 |
+
'\u01FB': 'a',
|
2566 |
+
'\u01CE': 'a',
|
2567 |
+
'\u0201': 'a',
|
2568 |
+
'\u0203': 'a',
|
2569 |
+
'\u1EA1': 'a',
|
2570 |
+
'\u1EAD': 'a',
|
2571 |
+
'\u1EB7': 'a',
|
2572 |
+
'\u1E01': 'a',
|
2573 |
+
'\u0105': 'a',
|
2574 |
+
'\u2C65': 'a',
|
2575 |
+
'\u0250': 'a',
|
2576 |
+
'\uA733': 'aa',
|
2577 |
+
'\u00E6': 'ae',
|
2578 |
+
'\u01FD': 'ae',
|
2579 |
+
'\u01E3': 'ae',
|
2580 |
+
'\uA735': 'ao',
|
2581 |
+
'\uA737': 'au',
|
2582 |
+
'\uA739': 'av',
|
2583 |
+
'\uA73B': 'av',
|
2584 |
+
'\uA73D': 'ay',
|
2585 |
+
'\u24D1': 'b',
|
2586 |
+
'\uFF42': 'b',
|
2587 |
+
'\u1E03': 'b',
|
2588 |
+
'\u1E05': 'b',
|
2589 |
+
'\u1E07': 'b',
|
2590 |
+
'\u0180': 'b',
|
2591 |
+
'\u0183': 'b',
|
2592 |
+
'\u0253': 'b',
|
2593 |
+
'\u24D2': 'c',
|
2594 |
+
'\uFF43': 'c',
|
2595 |
+
'\u0107': 'c',
|
2596 |
+
'\u0109': 'c',
|
2597 |
+
'\u010B': 'c',
|
2598 |
+
'\u010D': 'c',
|
2599 |
+
'\u00E7': 'c',
|
2600 |
+
'\u1E09': 'c',
|
2601 |
+
'\u0188': 'c',
|
2602 |
+
'\u023C': 'c',
|
2603 |
+
'\uA73F': 'c',
|
2604 |
+
'\u2184': 'c',
|
2605 |
+
'\u24D3': 'd',
|
2606 |
+
'\uFF44': 'd',
|
2607 |
+
'\u1E0B': 'd',
|
2608 |
+
'\u010F': 'd',
|
2609 |
+
'\u1E0D': 'd',
|
2610 |
+
'\u1E11': 'd',
|
2611 |
+
'\u1E13': 'd',
|
2612 |
+
'\u1E0F': 'd',
|
2613 |
+
'\u0111': 'd',
|
2614 |
+
'\u018C': 'd',
|
2615 |
+
'\u0256': 'd',
|
2616 |
+
'\u0257': 'd',
|
2617 |
+
'\uA77A': 'd',
|
2618 |
+
'\u01F3': 'dz',
|
2619 |
+
'\u01C6': 'dz',
|
2620 |
+
'\u24D4': 'e',
|
2621 |
+
'\uFF45': 'e',
|
2622 |
+
'\u00E8': 'e',
|
2623 |
+
'\u00E9': 'e',
|
2624 |
+
'\u00EA': 'e',
|
2625 |
+
'\u1EC1': 'e',
|
2626 |
+
'\u1EBF': 'e',
|
2627 |
+
'\u1EC5': 'e',
|
2628 |
+
'\u1EC3': 'e',
|
2629 |
+
'\u1EBD': 'e',
|
2630 |
+
'\u0113': 'e',
|
2631 |
+
'\u1E15': 'e',
|
2632 |
+
'\u1E17': 'e',
|
2633 |
+
'\u0115': 'e',
|
2634 |
+
'\u0117': 'e',
|
2635 |
+
'\u00EB': 'e',
|
2636 |
+
'\u1EBB': 'e',
|
2637 |
+
'\u011B': 'e',
|
2638 |
+
'\u0205': 'e',
|
2639 |
+
'\u0207': 'e',
|
2640 |
+
'\u1EB9': 'e',
|
2641 |
+
'\u1EC7': 'e',
|
2642 |
+
'\u0229': 'e',
|
2643 |
+
'\u1E1D': 'e',
|
2644 |
+
'\u0119': 'e',
|
2645 |
+
'\u1E19': 'e',
|
2646 |
+
'\u1E1B': 'e',
|
2647 |
+
'\u0247': 'e',
|
2648 |
+
'\u025B': 'e',
|
2649 |
+
'\u01DD': 'e',
|
2650 |
+
'\u24D5': 'f',
|
2651 |
+
'\uFF46': 'f',
|
2652 |
+
'\u1E1F': 'f',
|
2653 |
+
'\u0192': 'f',
|
2654 |
+
'\uA77C': 'f',
|
2655 |
+
'\u24D6': 'g',
|
2656 |
+
'\uFF47': 'g',
|
2657 |
+
'\u01F5': 'g',
|
2658 |
+
'\u011D': 'g',
|
2659 |
+
'\u1E21': 'g',
|
2660 |
+
'\u011F': 'g',
|
2661 |
+
'\u0121': 'g',
|
2662 |
+
'\u01E7': 'g',
|
2663 |
+
'\u0123': 'g',
|
2664 |
+
'\u01E5': 'g',
|
2665 |
+
'\u0260': 'g',
|
2666 |
+
'\uA7A1': 'g',
|
2667 |
+
'\u1D79': 'g',
|
2668 |
+
'\uA77F': 'g',
|
2669 |
+
'\u24D7': 'h',
|
2670 |
+
'\uFF48': 'h',
|
2671 |
+
'\u0125': 'h',
|
2672 |
+
'\u1E23': 'h',
|
2673 |
+
'\u1E27': 'h',
|
2674 |
+
'\u021F': 'h',
|
2675 |
+
'\u1E25': 'h',
|
2676 |
+
'\u1E29': 'h',
|
2677 |
+
'\u1E2B': 'h',
|
2678 |
+
'\u1E96': 'h',
|
2679 |
+
'\u0127': 'h',
|
2680 |
+
'\u2C68': 'h',
|
2681 |
+
'\u2C76': 'h',
|
2682 |
+
'\u0265': 'h',
|
2683 |
+
'\u0195': 'hv',
|
2684 |
+
'\u24D8': 'i',
|
2685 |
+
'\uFF49': 'i',
|
2686 |
+
'\u00EC': 'i',
|
2687 |
+
'\u00ED': 'i',
|
2688 |
+
'\u00EE': 'i',
|
2689 |
+
'\u0129': 'i',
|
2690 |
+
'\u012B': 'i',
|
2691 |
+
'\u012D': 'i',
|
2692 |
+
'\u00EF': 'i',
|
2693 |
+
'\u1E2F': 'i',
|
2694 |
+
'\u1EC9': 'i',
|
2695 |
+
'\u01D0': 'i',
|
2696 |
+
'\u0209': 'i',
|
2697 |
+
'\u020B': 'i',
|
2698 |
+
'\u1ECB': 'i',
|
2699 |
+
'\u012F': 'i',
|
2700 |
+
'\u1E2D': 'i',
|
2701 |
+
'\u0268': 'i',
|
2702 |
+
'\u0131': 'i',
|
2703 |
+
'\u24D9': 'j',
|
2704 |
+
'\uFF4A': 'j',
|
2705 |
+
'\u0135': 'j',
|
2706 |
+
'\u01F0': 'j',
|
2707 |
+
'\u0249': 'j',
|
2708 |
+
'\u24DA': 'k',
|
2709 |
+
'\uFF4B': 'k',
|
2710 |
+
'\u1E31': 'k',
|
2711 |
+
'\u01E9': 'k',
|
2712 |
+
'\u1E33': 'k',
|
2713 |
+
'\u0137': 'k',
|
2714 |
+
'\u1E35': 'k',
|
2715 |
+
'\u0199': 'k',
|
2716 |
+
'\u2C6A': 'k',
|
2717 |
+
'\uA741': 'k',
|
2718 |
+
'\uA743': 'k',
|
2719 |
+
'\uA745': 'k',
|
2720 |
+
'\uA7A3': 'k',
|
2721 |
+
'\u24DB': 'l',
|
2722 |
+
'\uFF4C': 'l',
|
2723 |
+
'\u0140': 'l',
|
2724 |
+
'\u013A': 'l',
|
2725 |
+
'\u013E': 'l',
|
2726 |
+
'\u1E37': 'l',
|
2727 |
+
'\u1E39': 'l',
|
2728 |
+
'\u013C': 'l',
|
2729 |
+
'\u1E3D': 'l',
|
2730 |
+
'\u1E3B': 'l',
|
2731 |
+
'\u017F': 'l',
|
2732 |
+
'\u0142': 'l',
|
2733 |
+
'\u019A': 'l',
|
2734 |
+
'\u026B': 'l',
|
2735 |
+
'\u2C61': 'l',
|
2736 |
+
'\uA749': 'l',
|
2737 |
+
'\uA781': 'l',
|
2738 |
+
'\uA747': 'l',
|
2739 |
+
'\u01C9': 'lj',
|
2740 |
+
'\u24DC': 'm',
|
2741 |
+
'\uFF4D': 'm',
|
2742 |
+
'\u1E3F': 'm',
|
2743 |
+
'\u1E41': 'm',
|
2744 |
+
'\u1E43': 'm',
|
2745 |
+
'\u0271': 'm',
|
2746 |
+
'\u026F': 'm',
|
2747 |
+
'\u24DD': 'n',
|
2748 |
+
'\uFF4E': 'n',
|
2749 |
+
'\u01F9': 'n',
|
2750 |
+
'\u0144': 'n',
|
2751 |
+
'\u00F1': 'n',
|
2752 |
+
'\u1E45': 'n',
|
2753 |
+
'\u0148': 'n',
|
2754 |
+
'\u1E47': 'n',
|
2755 |
+
'\u0146': 'n',
|
2756 |
+
'\u1E4B': 'n',
|
2757 |
+
'\u1E49': 'n',
|
2758 |
+
'\u019E': 'n',
|
2759 |
+
'\u0272': 'n',
|
2760 |
+
'\u0149': 'n',
|
2761 |
+
'\uA791': 'n',
|
2762 |
+
'\uA7A5': 'n',
|
2763 |
+
'\u01CC': 'nj',
|
2764 |
+
'\u24DE': 'o',
|
2765 |
+
'\uFF4F': 'o',
|
2766 |
+
'\u00F2': 'o',
|
2767 |
+
'\u00F3': 'o',
|
2768 |
+
'\u00F4': 'o',
|
2769 |
+
'\u1ED3': 'o',
|
2770 |
+
'\u1ED1': 'o',
|
2771 |
+
'\u1ED7': 'o',
|
2772 |
+
'\u1ED5': 'o',
|
2773 |
+
'\u00F5': 'o',
|
2774 |
+
'\u1E4D': 'o',
|
2775 |
+
'\u022D': 'o',
|
2776 |
+
'\u1E4F': 'o',
|
2777 |
+
'\u014D': 'o',
|
2778 |
+
'\u1E51': 'o',
|
2779 |
+
'\u1E53': 'o',
|
2780 |
+
'\u014F': 'o',
|
2781 |
+
'\u022F': 'o',
|
2782 |
+
'\u0231': 'o',
|
2783 |
+
'\u00F6': 'o',
|
2784 |
+
'\u022B': 'o',
|
2785 |
+
'\u1ECF': 'o',
|
2786 |
+
'\u0151': 'o',
|
2787 |
+
'\u01D2': 'o',
|
2788 |
+
'\u020D': 'o',
|
2789 |
+
'\u020F': 'o',
|
2790 |
+
'\u01A1': 'o',
|
2791 |
+
'\u1EDD': 'o',
|
2792 |
+
'\u1EDB': 'o',
|
2793 |
+
'\u1EE1': 'o',
|
2794 |
+
'\u1EDF': 'o',
|
2795 |
+
'\u1EE3': 'o',
|
2796 |
+
'\u1ECD': 'o',
|
2797 |
+
'\u1ED9': 'o',
|
2798 |
+
'\u01EB': 'o',
|
2799 |
+
'\u01ED': 'o',
|
2800 |
+
'\u00F8': 'o',
|
2801 |
+
'\u01FF': 'o',
|
2802 |
+
'\u0254': 'o',
|
2803 |
+
'\uA74B': 'o',
|
2804 |
+
'\uA74D': 'o',
|
2805 |
+
'\u0275': 'o',
|
2806 |
+
'\u01A3': 'oi',
|
2807 |
+
'\u0223': 'ou',
|
2808 |
+
'\uA74F': 'oo',
|
2809 |
+
'\u24DF': 'p',
|
2810 |
+
'\uFF50': 'p',
|
2811 |
+
'\u1E55': 'p',
|
2812 |
+
'\u1E57': 'p',
|
2813 |
+
'\u01A5': 'p',
|
2814 |
+
'\u1D7D': 'p',
|
2815 |
+
'\uA751': 'p',
|
2816 |
+
'\uA753': 'p',
|
2817 |
+
'\uA755': 'p',
|
2818 |
+
'\u24E0': 'q',
|
2819 |
+
'\uFF51': 'q',
|
2820 |
+
'\u024B': 'q',
|
2821 |
+
'\uA757': 'q',
|
2822 |
+
'\uA759': 'q',
|
2823 |
+
'\u24E1': 'r',
|
2824 |
+
'\uFF52': 'r',
|
2825 |
+
'\u0155': 'r',
|
2826 |
+
'\u1E59': 'r',
|
2827 |
+
'\u0159': 'r',
|
2828 |
+
'\u0211': 'r',
|
2829 |
+
'\u0213': 'r',
|
2830 |
+
'\u1E5B': 'r',
|
2831 |
+
'\u1E5D': 'r',
|
2832 |
+
'\u0157': 'r',
|
2833 |
+
'\u1E5F': 'r',
|
2834 |
+
'\u024D': 'r',
|
2835 |
+
'\u027D': 'r',
|
2836 |
+
'\uA75B': 'r',
|
2837 |
+
'\uA7A7': 'r',
|
2838 |
+
'\uA783': 'r',
|
2839 |
+
'\u24E2': 's',
|
2840 |
+
'\uFF53': 's',
|
2841 |
+
'\u00DF': 's',
|
2842 |
+
'\u015B': 's',
|
2843 |
+
'\u1E65': 's',
|
2844 |
+
'\u015D': 's',
|
2845 |
+
'\u1E61': 's',
|
2846 |
+
'\u0161': 's',
|
2847 |
+
'\u1E67': 's',
|
2848 |
+
'\u1E63': 's',
|
2849 |
+
'\u1E69': 's',
|
2850 |
+
'\u0219': 's',
|
2851 |
+
'\u015F': 's',
|
2852 |
+
'\u023F': 's',
|
2853 |
+
'\uA7A9': 's',
|
2854 |
+
'\uA785': 's',
|
2855 |
+
'\u1E9B': 's',
|
2856 |
+
'\u24E3': 't',
|
2857 |
+
'\uFF54': 't',
|
2858 |
+
'\u1E6B': 't',
|
2859 |
+
'\u1E97': 't',
|
2860 |
+
'\u0165': 't',
|
2861 |
+
'\u1E6D': 't',
|
2862 |
+
'\u021B': 't',
|
2863 |
+
'\u0163': 't',
|
2864 |
+
'\u1E71': 't',
|
2865 |
+
'\u1E6F': 't',
|
2866 |
+
'\u0167': 't',
|
2867 |
+
'\u01AD': 't',
|
2868 |
+
'\u0288': 't',
|
2869 |
+
'\u2C66': 't',
|
2870 |
+
'\uA787': 't',
|
2871 |
+
'\uA729': 'tz',
|
2872 |
+
'\u24E4': 'u',
|
2873 |
+
'\uFF55': 'u',
|
2874 |
+
'\u00F9': 'u',
|
2875 |
+
'\u00FA': 'u',
|
2876 |
+
'\u00FB': 'u',
|
2877 |
+
'\u0169': 'u',
|
2878 |
+
'\u1E79': 'u',
|
2879 |
+
'\u016B': 'u',
|
2880 |
+
'\u1E7B': 'u',
|
2881 |
+
'\u016D': 'u',
|
2882 |
+
'\u00FC': 'u',
|
2883 |
+
'\u01DC': 'u',
|
2884 |
+
'\u01D8': 'u',
|
2885 |
+
'\u01D6': 'u',
|
2886 |
+
'\u01DA': 'u',
|
2887 |
+
'\u1EE7': 'u',
|
2888 |
+
'\u016F': 'u',
|
2889 |
+
'\u0171': 'u',
|
2890 |
+
'\u01D4': 'u',
|
2891 |
+
'\u0215': 'u',
|
2892 |
+
'\u0217': 'u',
|
2893 |
+
'\u01B0': 'u',
|
2894 |
+
'\u1EEB': 'u',
|
2895 |
+
'\u1EE9': 'u',
|
2896 |
+
'\u1EEF': 'u',
|
2897 |
+
'\u1EED': 'u',
|
2898 |
+
'\u1EF1': 'u',
|
2899 |
+
'\u1EE5': 'u',
|
2900 |
+
'\u1E73': 'u',
|
2901 |
+
'\u0173': 'u',
|
2902 |
+
'\u1E77': 'u',
|
2903 |
+
'\u1E75': 'u',
|
2904 |
+
'\u0289': 'u',
|
2905 |
+
'\u24E5': 'v',
|
2906 |
+
'\uFF56': 'v',
|
2907 |
+
'\u1E7D': 'v',
|
2908 |
+
'\u1E7F': 'v',
|
2909 |
+
'\u028B': 'v',
|
2910 |
+
'\uA75F': 'v',
|
2911 |
+
'\u028C': 'v',
|
2912 |
+
'\uA761': 'vy',
|
2913 |
+
'\u24E6': 'w',
|
2914 |
+
'\uFF57': 'w',
|
2915 |
+
'\u1E81': 'w',
|
2916 |
+
'\u1E83': 'w',
|
2917 |
+
'\u0175': 'w',
|
2918 |
+
'\u1E87': 'w',
|
2919 |
+
'\u1E85': 'w',
|
2920 |
+
'\u1E98': 'w',
|
2921 |
+
'\u1E89': 'w',
|
2922 |
+
'\u2C73': 'w',
|
2923 |
+
'\u24E7': 'x',
|
2924 |
+
'\uFF58': 'x',
|
2925 |
+
'\u1E8B': 'x',
|
2926 |
+
'\u1E8D': 'x',
|
2927 |
+
'\u24E8': 'y',
|
2928 |
+
'\uFF59': 'y',
|
2929 |
+
'\u1EF3': 'y',
|
2930 |
+
'\u00FD': 'y',
|
2931 |
+
'\u0177': 'y',
|
2932 |
+
'\u1EF9': 'y',
|
2933 |
+
'\u0233': 'y',
|
2934 |
+
'\u1E8F': 'y',
|
2935 |
+
'\u00FF': 'y',
|
2936 |
+
'\u1EF7': 'y',
|
2937 |
+
'\u1E99': 'y',
|
2938 |
+
'\u1EF5': 'y',
|
2939 |
+
'\u01B4': 'y',
|
2940 |
+
'\u024F': 'y',
|
2941 |
+
'\u1EFF': 'y',
|
2942 |
+
'\u24E9': 'z',
|
2943 |
+
'\uFF5A': 'z',
|
2944 |
+
'\u017A': 'z',
|
2945 |
+
'\u1E91': 'z',
|
2946 |
+
'\u017C': 'z',
|
2947 |
+
'\u017E': 'z',
|
2948 |
+
'\u1E93': 'z',
|
2949 |
+
'\u1E95': 'z',
|
2950 |
+
'\u01B6': 'z',
|
2951 |
+
'\u0225': 'z',
|
2952 |
+
'\u0240': 'z',
|
2953 |
+
'\u2C6C': 'z',
|
2954 |
+
'\uA763': 'z',
|
2955 |
+
'\u0386': '\u0391',
|
2956 |
+
'\u0388': '\u0395',
|
2957 |
+
'\u0389': '\u0397',
|
2958 |
+
'\u038A': '\u0399',
|
2959 |
+
'\u03AA': '\u0399',
|
2960 |
+
'\u038C': '\u039F',
|
2961 |
+
'\u038E': '\u03A5',
|
2962 |
+
'\u03AB': '\u03A5',
|
2963 |
+
'\u038F': '\u03A9',
|
2964 |
+
'\u03AC': '\u03B1',
|
2965 |
+
'\u03AD': '\u03B5',
|
2966 |
+
'\u03AE': '\u03B7',
|
2967 |
+
'\u03AF': '\u03B9',
|
2968 |
+
'\u03CA': '\u03B9',
|
2969 |
+
'\u0390': '\u03B9',
|
2970 |
+
'\u03CC': '\u03BF',
|
2971 |
+
'\u03CD': '\u03C5',
|
2972 |
+
'\u03CB': '\u03C5',
|
2973 |
+
'\u03B0': '\u03C5',
|
2974 |
+
'\u03C9': '\u03C9',
|
2975 |
+
'\u03C2': '\u03C3'
|
2976 |
+
};
|
2977 |
+
|
2978 |
+
return diacritics;
|
2979 |
+
});
|
2980 |
+
|
2981 |
+
S2.define('czrSelect2/data/base',[
|
2982 |
+
'../utils'
|
2983 |
+
], function (Utils) {
|
2984 |
+
function BaseAdapter ($element, options) {
|
2985 |
+
BaseAdapter.__super__.constructor.call(this);
|
2986 |
+
}
|
2987 |
+
|
2988 |
+
Utils.Extend(BaseAdapter, Utils.Observable);
|
2989 |
+
|
2990 |
+
BaseAdapter.prototype.current = function (callback) {
|
2991 |
+
throw new Error('The `current` method must be defined in child classes.');
|
2992 |
+
};
|
2993 |
+
|
2994 |
+
BaseAdapter.prototype.query = function (params, callback) {
|
2995 |
+
throw new Error('The `query` method must be defined in child classes.');
|
2996 |
+
};
|
2997 |
+
|
2998 |
+
BaseAdapter.prototype.bind = function (container, $container) {
|
2999 |
+
// Can be implemented in subclasses
|
3000 |
+
};
|
3001 |
+
|
3002 |
+
BaseAdapter.prototype.destroy = function () {
|
3003 |
+
// Can be implemented in subclasses
|
3004 |
+
};
|
3005 |
+
|
3006 |
+
BaseAdapter.prototype.generateResultId = function (container, data) {
|
3007 |
+
var id = container.id + '-result-';
|
3008 |
+
|
3009 |
+
id += Utils.generateChars(4);
|
3010 |
+
|
3011 |
+
if (data.id != null) {
|
3012 |
+
id += '-' + data.id.toString();
|
3013 |
+
} else {
|
3014 |
+
id += '-' + Utils.generateChars(4);
|
3015 |
+
}
|
3016 |
+
return id;
|
3017 |
+
};
|
3018 |
+
|
3019 |
+
return BaseAdapter;
|
3020 |
+
});
|
3021 |
+
|
3022 |
+
S2.define('czrSelect2/data/select',[
|
3023 |
+
'./base',
|
3024 |
+
'../utils',
|
3025 |
+
'jquery'
|
3026 |
+
], function (BaseAdapter, Utils, $) {
|
3027 |
+
function SelectAdapter ($element, options) {
|
3028 |
+
this.$element = $element;
|
3029 |
+
this.options = options;
|
3030 |
+
|
3031 |
+
SelectAdapter.__super__.constructor.call(this);
|
3032 |
+
}
|
3033 |
+
|
3034 |
+
Utils.Extend(SelectAdapter, BaseAdapter);
|
3035 |
+
|
3036 |
+
SelectAdapter.prototype.current = function (callback) {
|
3037 |
+
var data = [];
|
3038 |
+
var self = this;
|
3039 |
+
|
3040 |
+
this.$element.find(':selected').each(function () {
|
3041 |
+
var $option = $(this);
|
3042 |
+
|
3043 |
+
var option = self.item($option);
|
3044 |
+
|
3045 |
+
data.push(option);
|
3046 |
+
});
|
3047 |
+
|
3048 |
+
callback(data);
|
3049 |
+
};
|
3050 |
+
|
3051 |
+
SelectAdapter.prototype.select = function (data) {
|
3052 |
+
var self = this;
|
3053 |
+
|
3054 |
+
data.selected = true;
|
3055 |
+
|
3056 |
+
// If data.element is a DOM node, use it instead
|
3057 |
+
if ($(data.element).is('option')) {
|
3058 |
+
data.element.selected = true;
|
3059 |
+
|
3060 |
+
this.$element.trigger('change');
|
3061 |
+
|
3062 |
+
return;
|
3063 |
+
}
|
3064 |
+
|
3065 |
+
if (this.$element.prop('multiple')) {
|
3066 |
+
this.current(function (currentData) {
|
3067 |
+
var val = [];
|
3068 |
+
|
3069 |
+
data = [data];
|
3070 |
+
data.push.apply(data, currentData);
|
3071 |
+
|
3072 |
+
for (var d = 0; d < data.length; d++) {
|
3073 |
+
var id = data[d].id;
|
3074 |
+
|
3075 |
+
if ($.inArray(id, val) === -1) {
|
3076 |
+
val.push(id);
|
3077 |
+
}
|
3078 |
+
}
|
3079 |
+
|
3080 |
+
self.$element.val(val);
|
3081 |
+
self.$element.trigger('change');
|
3082 |
+
});
|
3083 |
+
} else {
|
3084 |
+
var val = data.id;
|
3085 |
+
|
3086 |
+
this.$element.val(val);
|
3087 |
+
this.$element.trigger('change');
|
3088 |
+
}
|
3089 |
+
};
|
3090 |
+
|
3091 |
+
SelectAdapter.prototype.unselect = function (data) {
|
3092 |
+
var self = this;
|
3093 |
+
|
3094 |
+
if (!this.$element.prop('multiple')) {
|
3095 |
+
return;
|
3096 |
+
}
|
3097 |
+
|
3098 |
+
data.selected = false;
|
3099 |
+
|
3100 |
+
if ($(data.element).is('option')) {
|
3101 |
+
data.element.selected = false;
|
3102 |
+
|
3103 |
+
this.$element.trigger('change');
|
3104 |
+
|
3105 |
+
return;
|
3106 |
+
}
|
3107 |
+
|
3108 |
+
this.current(function (currentData) {
|
3109 |
+
var val = [];
|
3110 |
+
|
3111 |
+
for (var d = 0; d < currentData.length; d++) {
|
3112 |
+
var id = currentData[d].id;
|
3113 |
+
|
3114 |
+
if (id !== data.id && $.inArray(id, val) === -1) {
|
3115 |
+
val.push(id);
|
3116 |
+
}
|
3117 |
+
}
|
3118 |
+
|
3119 |
+
self.$element.val(val);
|
3120 |
+
|
3121 |
+
self.$element.trigger('change');
|
3122 |
+
});
|
3123 |
+
};
|
3124 |
+
|
3125 |
+
SelectAdapter.prototype.bind = function (container, $container) {
|
3126 |
+
var self = this;
|
3127 |
+
|
3128 |
+
this.container = container;
|
3129 |
+
|
3130 |
+
container.on('select', function (params) {
|
3131 |
+
self.select(params.data);
|
3132 |
+
});
|
3133 |
+
|
3134 |
+
container.on('unselect', function (params) {
|
3135 |
+
self.unselect(params.data);
|
3136 |
+
});
|
3137 |
+
};
|
3138 |
+
|
3139 |
+
SelectAdapter.prototype.destroy = function () {
|
3140 |
+
// Remove anything added to child elements
|
3141 |
+
this.$element.find('*').each(function () {
|
3142 |
+
// Remove any custom data set by CzrSelect2
|
3143 |
+
$.removeData(this, 'data');
|
3144 |
+
});
|
3145 |
+
};
|
3146 |
+
|
3147 |
+
SelectAdapter.prototype.query = function (params, callback) {
|
3148 |
+
var data = [];
|
3149 |
+
var self = this;
|
3150 |
+
|
3151 |
+
var $options = this.$element.children();
|
3152 |
+
|
3153 |
+
$options.each(function () {
|
3154 |
+
var $option = $(this);
|
3155 |
+
|
3156 |
+
if (!$option.is('option') && !$option.is('optgroup')) {
|
3157 |
+
return;
|
3158 |
+
}
|
3159 |
+
|
3160 |
+
var option = self.item($option);
|
3161 |
+
|
3162 |
+
var matches = self.matches(params, option);
|
3163 |
+
|
3164 |
+
if (matches !== null) {
|
3165 |
+
data.push(matches);
|
3166 |
+
}
|
3167 |
+
});
|
3168 |
+
|
3169 |
+
callback({
|
3170 |
+
results: data
|
3171 |
+
});
|
3172 |
+
};
|
3173 |
+
|
3174 |
+
SelectAdapter.prototype.addOptions = function ($options) {
|
3175 |
+
Utils.appendMany(this.$element, $options);
|
3176 |
+
};
|
3177 |
+
|
3178 |
+
SelectAdapter.prototype.option = function (data) {
|
3179 |
+
var option;
|
3180 |
+
|
3181 |
+
if (data.children) {
|
3182 |
+
option = document.createElement('optgroup');
|
3183 |
+
option.label = data.text;
|
3184 |
+
} else {
|
3185 |
+
option = document.createElement('option');
|
3186 |
+
|
3187 |
+
if (option.textContent !== undefined) {
|
3188 |
+
option.textContent = data.text;
|
3189 |
+
} else {
|
3190 |
+
option.innerText = data.text;
|
3191 |
+
}
|
3192 |
+
}
|
3193 |
+
|
3194 |
+
if (data.id) {
|
3195 |
+
option.value = data.id;
|
3196 |
+
}
|
3197 |
+
|
3198 |
+
if (data.disabled) {
|
3199 |
+
option.disabled = true;
|
3200 |
+
}
|
3201 |
+
|
3202 |
+
if (data.selected) {
|
3203 |
+
option.selected = true;
|
3204 |
+
}
|
3205 |
+
|
3206 |
+
if (data.title) {
|
3207 |
+
option.title = data.title;
|
3208 |
+
}
|
3209 |
+
|
3210 |
+
var $option = $(option);
|
3211 |
+
|
3212 |
+
var normalizedData = this._normalizeItem(data);
|
3213 |
+
normalizedData.element = option;
|
3214 |
+
|
3215 |
+
// Override the option's data with the combined data
|
3216 |
+
$.data(option, 'data', normalizedData);
|
3217 |
+
|
3218 |
+
return $option;
|
3219 |
+
};
|
3220 |
+
|
3221 |
+
SelectAdapter.prototype.item = function ($option) {
|
3222 |
+
var data = {};
|
3223 |
+
|
3224 |
+
data = $.data($option[0], 'data');
|
3225 |
+
|
3226 |
+
if (data != null) {
|
3227 |
+
return data;
|
3228 |
+
}
|
3229 |
+
|
3230 |
+
if ($option.is('option')) {
|
3231 |
+
data = {
|
3232 |
+
id: $option.val(),
|
3233 |
+
text: $option.text(),
|
3234 |
+
disabled: $option.prop('disabled'),
|
3235 |
+
selected: $option.prop('selected'),
|
3236 |
+
title: $option.prop('title')
|
3237 |
+
};
|
3238 |
+
} else if ($option.is('optgroup')) {
|
3239 |
+
data = {
|
3240 |
+
text: $option.prop('label'),
|
3241 |
+
children: [],
|
3242 |
+
title: $option.prop('title')
|
3243 |
+
};
|
3244 |
+
|
3245 |
+
var $children = $option.children('option');
|
3246 |
+
var children = [];
|
3247 |
+
|
3248 |
+
for (var c = 0; c < $children.length; c++) {
|
3249 |
+
var $child = $($children[c]);
|
3250 |
+
|
3251 |
+
var child = this.item($child);
|
3252 |
+
|
3253 |
+
children.push(child);
|
3254 |
+
}
|
3255 |
+
|
3256 |
+
data.children = children;
|
3257 |
+
}
|
3258 |
+
|
3259 |
+
data = this._normalizeItem(data);
|
3260 |
+
data.element = $option[0];
|
3261 |
+
|
3262 |
+
$.data($option[0], 'data', data);
|
3263 |
+
|
3264 |
+
return data;
|
3265 |
+
};
|
3266 |
+
|
3267 |
+
SelectAdapter.prototype._normalizeItem = function (item) {
|
3268 |
+
if (!$.isPlainObject(item)) {
|
3269 |
+
item = {
|
3270 |
+
id: item,
|
3271 |
+
text: item
|
3272 |
+
};
|
3273 |
+
}
|
3274 |
+
|
3275 |
+
item = $.extend({}, {
|
3276 |
+
text: ''
|
3277 |
+
}, item);
|
3278 |
+
|
3279 |
+
var defaults = {
|
3280 |
+
selected: false,
|
3281 |
+
disabled: false
|
3282 |
+
};
|
3283 |
+
|
3284 |
+
if (item.id != null) {
|
3285 |
+
item.id = item.id.toString();
|
3286 |
+
}
|
3287 |
+
|
3288 |
+
if (item.text != null) {
|
3289 |
+
item.text = item.text.toString();
|
3290 |
+
}
|
3291 |
+
|
3292 |
+
if (item._resultId == null && item.id && this.container != null) {
|
3293 |
+
item._resultId = this.generateResultId(this.container, item);
|
3294 |
+
}
|
3295 |
+
|
3296 |
+
return $.extend({}, defaults, item);
|
3297 |
+
};
|
3298 |
+
|
3299 |
+
SelectAdapter.prototype.matches = function (params, data) {
|
3300 |
+
var matcher = this.options.get('matcher');
|
3301 |
+
|
3302 |
+
return matcher(params, data);
|
3303 |
+
};
|
3304 |
+
|
3305 |
+
return SelectAdapter;
|
3306 |
+
});
|
3307 |
+
|
3308 |
+
S2.define('czrSelect2/data/array',[
|
3309 |
+
'./select',
|
3310 |
+
'../utils',
|
3311 |
+
'jquery'
|
3312 |
+
], function (SelectAdapter, Utils, $) {
|
3313 |
+
function ArrayAdapter ($element, options) {
|
3314 |
+
var data = options.get('data') || [];
|
3315 |
+
|
3316 |
+
ArrayAdapter.__super__.constructor.call(this, $element, options);
|
3317 |
+
|
3318 |
+
this.addOptions(this.convertToOptions(data));
|
3319 |
+
}
|
3320 |
+
|
3321 |
+
Utils.Extend(ArrayAdapter, SelectAdapter);
|
3322 |
+
|
3323 |
+
ArrayAdapter.prototype.select = function (data) {
|
3324 |
+
var $option = this.$element.find('option').filter(function (i, elm) {
|
3325 |
+
return elm.value == data.id.toString();
|
3326 |
+
});
|
3327 |
+
|
3328 |
+
if ($option.length === 0) {
|
3329 |
+
$option = this.option(data);
|
3330 |
+
|
3331 |
+
this.addOptions($option);
|
3332 |
+
}
|
3333 |
+
|
3334 |
+
ArrayAdapter.__super__.select.call(this, data);
|
3335 |
+
};
|
3336 |
+
|
3337 |
+
ArrayAdapter.prototype.convertToOptions = function (data) {
|
3338 |
+
var self = this;
|
3339 |
+
|
3340 |
+
var $existing = this.$element.find('option');
|
3341 |
+
var existingIds = $existing.map(function () {
|
3342 |
+
return self.item($(this)).id;
|
3343 |
+
}).get();
|
3344 |
+
|
3345 |
+
var $options = [];
|
3346 |
+
|
3347 |
+
// Filter out all items except for the one passed in the argument
|
3348 |
+
function onlyItem (item) {
|
3349 |
+
return function () {
|
3350 |
+
return $(this).val() == item.id;
|
3351 |
+
};
|
3352 |
+
}
|
3353 |
+
|
3354 |
+
for (var d = 0; d < data.length; d++) {
|
3355 |
+
var item = this._normalizeItem(data[d]);
|
3356 |
+
|
3357 |
+
// Skip items which were pre-loaded, only merge the data
|
3358 |
+
if ($.inArray(item.id, existingIds) >= 0) {
|
3359 |
+
var $existingOption = $existing.filter(onlyItem(item));
|
3360 |
+
|
3361 |
+
var existingData = this.item($existingOption);
|
3362 |
+
var newData = $.extend(true, {}, item, existingData);
|
3363 |
+
|
3364 |
+
var $newOption = this.option(newData);
|
3365 |
+
|
3366 |
+
$existingOption.replaceWith($newOption);
|
3367 |
+
|
3368 |
+
continue;
|
3369 |
+
}
|
3370 |
+
|
3371 |
+
var $option = this.option(item);
|
3372 |
+
|
3373 |
+
if (item.children) {
|
3374 |
+
var $children = this.convertToOptions(item.children);
|
3375 |
+
|
3376 |
+
Utils.appendMany($option, $children);
|
3377 |
+
}
|
3378 |
+
|
3379 |
+
$options.push($option);
|
3380 |
+
}
|
3381 |
+
|
3382 |
+
return $options;
|
3383 |
+
};
|
3384 |
+
|
3385 |
+
return ArrayAdapter;
|
3386 |
+
});
|
3387 |
+
|
3388 |
+
S2.define('czrSelect2/data/ajax',[
|
3389 |
+
'./array',
|
3390 |
+
'../utils',
|
3391 |
+
'jquery'
|
3392 |
+
], function (ArrayAdapter, Utils, $) {
|
3393 |
+
function AjaxAdapter ($element, options) {
|
3394 |
+
this.ajaxOptions = this._applyDefaults(options.get('ajax'));
|
3395 |
+
|
3396 |
+
if (this.ajaxOptions.processResults != null) {
|
3397 |
+
this.processResults = this.ajaxOptions.processResults;
|
3398 |
+
}
|
3399 |
+
|
3400 |
+
AjaxAdapter.__super__.constructor.call(this, $element, options);
|
3401 |
+
}
|
3402 |
+
|
3403 |
+
Utils.Extend(AjaxAdapter, ArrayAdapter);
|
3404 |
+
|
3405 |
+
AjaxAdapter.prototype._applyDefaults = function (options) {
|
3406 |
+
var defaults = {
|
3407 |
+
data: function (params) {
|
3408 |
+
return $.extend({}, params, {
|
3409 |
+
q: params.term
|
3410 |
+
});
|
3411 |
+
},
|
3412 |
+
transport: function (params, success, failure) {
|
3413 |
+
var $request = $.ajax(params);
|
3414 |
+
|
3415 |
+
$request.then(success);
|
3416 |
+
$request.fail(failure);
|
3417 |
+
|
3418 |
+
return $request;
|
3419 |
+
}
|
3420 |
+
};
|
3421 |
+
|
3422 |
+
return $.extend({}, defaults, options, true);
|
3423 |
+
};
|
3424 |
+
|
3425 |
+
AjaxAdapter.prototype.processResults = function (results) {
|
3426 |
+
return results;
|
3427 |
+
};
|
3428 |
+
|
3429 |
+
AjaxAdapter.prototype.query = function (params, callback) {
|
3430 |
+
var matches = [];
|
3431 |
+
var self = this;
|
3432 |
+
|
3433 |
+
if (this._request != null) {
|
3434 |
+
// JSONP requests cannot always be aborted
|
3435 |
+
if ( typeof this._request.abort === 'function' ) {
|
3436 |
+
this._request.abort();
|
3437 |
+
}
|
3438 |
+
|
3439 |
+
this._request = null;
|
3440 |
+
}
|
3441 |
+
|
3442 |
+
var options = $.extend({
|
3443 |
+
type: 'GET'
|
3444 |
+
}, this.ajaxOptions);
|
3445 |
+
|
3446 |
+
if (typeof options.url === 'function') {
|
3447 |
+
options.url = options.url.call(this.$element, params);
|
3448 |
+
}
|
3449 |
+
|
3450 |
+
if (typeof options.data === 'function') {
|
3451 |
+
options.data = options.data.call(this.$element, params);
|
3452 |
+
}
|
3453 |
+
|
3454 |
+
function request () {
|
3455 |
+
var $request = options.transport(options, function (data) {
|
3456 |
+
var results = self.processResults(data, params);
|
3457 |
+
|
3458 |
+
if (self.options.get('debug') && window.console && console.error) {
|
3459 |
+
// Check to make sure that the response included a `results` key.
|
3460 |
+
if (!results || !results.results || !$.isArray(results.results)) {
|
3461 |
+
console.error(
|
3462 |
+
'CzrSelect2: The AJAX results did not return an array in the ' +
|
3463 |
+
'`results` key of the response.'
|
3464 |
+
);
|
3465 |
+
}
|
3466 |
+
}
|
3467 |
+
|
3468 |
+
callback(results);
|
3469 |
+
}, function () {
|
3470 |
+
// Attempt to detect if a request was aborted
|
3471 |
+
// Only works if the transport exposes a status property
|
3472 |
+
if ($request.status && $request.status === '0') {
|
3473 |
+
return;
|
3474 |
+
}
|
3475 |
+
|
3476 |
+
self.trigger('results:message', {
|
3477 |
+
message: 'errorLoading'
|
3478 |
+
});
|
3479 |
+
});
|
3480 |
+
|
3481 |
+
self._request = $request;
|
3482 |
+
}
|
3483 |
+
|
3484 |
+
if (this.ajaxOptions.delay && params.term != null) {
|
3485 |
+
if (this._queryTimeout) {
|
3486 |
+
window.clearTimeout(this._queryTimeout);
|
3487 |
+
}
|
3488 |
+
|
3489 |
+
this._queryTimeout = window.setTimeout(request, this.ajaxOptions.delay);
|
3490 |
+
} else {
|
3491 |
+
request();
|
3492 |
+
}
|
3493 |
+
};
|
3494 |
+
|
3495 |
+
return AjaxAdapter;
|
3496 |
+
});
|
3497 |
+
|
3498 |
+
S2.define('czrSelect2/data/tags',[
|
3499 |
+
'jquery'
|
3500 |
+
], function ($) {
|
3501 |
+
function Tags (decorated, $element, options) {
|
3502 |
+
var tags = options.get('tags');
|
3503 |
+
|
3504 |
+
var createTag = options.get('createTag');
|
3505 |
+
|
3506 |
+
if (createTag !== undefined) {
|
3507 |
+
this.createTag = createTag;
|
3508 |
+
}
|
3509 |
+
|
3510 |
+
var insertTag = options.get('insertTag');
|
3511 |
+
|
3512 |
+
if (insertTag !== undefined) {
|
3513 |
+
this.insertTag = insertTag;
|
3514 |
+
}
|
3515 |
+
|
3516 |
+
decorated.call(this, $element, options);
|
3517 |
+
|
3518 |
+
if ($.isArray(tags)) {
|
3519 |
+
for (var t = 0; t < tags.length; t++) {
|
3520 |
+
var tag = tags[t];
|
3521 |
+
var item = this._normalizeItem(tag);
|
3522 |
+
|
3523 |
+
var $option = this.option(item);
|
3524 |
+
|
3525 |
+
this.$element.append($option);
|
3526 |
+
}
|
3527 |
+
}
|
3528 |
+
}
|
3529 |
+
|
3530 |
+
Tags.prototype.query = function (decorated, params, callback) {
|
3531 |
+
var self = this;
|
3532 |
+
|
3533 |
+
this._removeOldTags();
|
3534 |
+
|
3535 |
+
if (params.term == null || params.page != null) {
|
3536 |
+
decorated.call(this, params, callback);
|
3537 |
+
return;
|
3538 |
+
}
|
3539 |
+
|
3540 |
+
function wrapper (obj, child) {
|
3541 |
+
var data = obj.results;
|
3542 |
+
|
3543 |
+
for (var i = 0; i < data.length; i++) {
|
3544 |
+
var option = data[i];
|
3545 |
+
|
3546 |
+
var checkChildren = (
|
3547 |
+
option.children != null &&
|
3548 |
+
!wrapper({
|
3549 |
+
results: option.children
|
3550 |
+
}, true)
|
3551 |
+
);
|
3552 |
+
|
3553 |
+
var checkText = option.text === params.term;
|
3554 |
+
|
3555 |
+
if (checkText || checkChildren) {
|
3556 |
+
if (child) {
|
3557 |
+
return false;
|
3558 |
+
}
|
3559 |
+
|
3560 |
+
obj.data = data;
|
3561 |
+
callback(obj);
|
3562 |
+
|
3563 |
+
return;
|
3564 |
+
}
|
3565 |
+
}
|
3566 |
+
|
3567 |
+
if (child) {
|
3568 |
+
return true;
|
3569 |
+
}
|
3570 |
+
|
3571 |
+
var tag = self.createTag(params);
|
3572 |
+
|
3573 |
+
if (tag != null) {
|
3574 |
+
var $option = self.option(tag);
|
3575 |
+
$option.attr('data-czrSelect2-tag', true);
|
3576 |
+
|
3577 |
+
self.addOptions([$option]);
|
3578 |
+
|
3579 |
+
self.insertTag(data, tag);
|
3580 |
+
}
|
3581 |
+
|
3582 |
+
obj.results = data;
|
3583 |
+
|
3584 |
+
callback(obj);
|
3585 |
+
}
|
3586 |
+
|
3587 |
+
decorated.call(this, params, wrapper);
|
3588 |
+
};
|
3589 |
+
|
3590 |
+
Tags.prototype.createTag = function (decorated, params) {
|
3591 |
+
var term = ( 'string' === typeof(params.term) ) ? params.term.trim() : '';
|
3592 |
+
|
3593 |
+
if (term === '') {
|
3594 |
+
return null;
|
3595 |
+
}
|
3596 |
+
|
3597 |
+
return {
|
3598 |
+
id: term,
|
3599 |
+
text: term
|
3600 |
+
};
|
3601 |
+
};
|
3602 |
+
|
3603 |
+
Tags.prototype.insertTag = function (_, data, tag) {
|
3604 |
+
data.unshift(tag);
|
3605 |
+
};
|
3606 |
+
|
3607 |
+
Tags.prototype._removeOldTags = function (_) {
|
3608 |
+
var tag = this._lastTag;
|
3609 |
+
|
3610 |
+
var $options = this.$element.find('option[data-czrSelect2-tag]');
|
3611 |
+
|
3612 |
+
$options.each(function () {
|
3613 |
+
if (this.selected) {
|
3614 |
+
return;
|
3615 |
+
}
|
3616 |
+
|
3617 |
+
$(this).remove();
|
3618 |
+
});
|
3619 |
+
};
|
3620 |
+
|
3621 |
+
return Tags;
|
3622 |
+
});
|
3623 |
+
|
3624 |
+
S2.define('czrSelect2/data/tokenizer',[
|
3625 |
+
'jquery'
|
3626 |
+
], function ($) {
|
3627 |
+
function Tokenizer (decorated, $element, options) {
|
3628 |
+
var tokenizer = options.get('tokenizer');
|
3629 |
+
|
3630 |
+
if (tokenizer !== undefined) {
|
3631 |
+
this.tokenizer = tokenizer;
|
3632 |
+
}
|
3633 |
+
|
3634 |
+
decorated.call(this, $element, options);
|
3635 |
+
}
|
3636 |
+
|
3637 |
+
Tokenizer.prototype.bind = function (decorated, container, $container) {
|
3638 |
+
decorated.call(this, container, $container);
|
3639 |
+
|
3640 |
+
this.$search = container.dropdown.$search || container.selection.$search ||
|
3641 |
+
$container.find('.czrSelect2-search__field');
|
3642 |
+
};
|
3643 |
+
|
3644 |
+
Tokenizer.prototype.query = function (decorated, params, callback) {
|
3645 |
+
var self = this;
|
3646 |
+
|
3647 |
+
function createAndSelect (data) {
|
3648 |
+
// Normalize the data object so we can use it for checks
|
3649 |
+
var item = self._normalizeItem(data);
|
3650 |
+
|
3651 |
+
// Check if the data object already exists as a tag
|
3652 |
+
// Select it if it doesn't
|
3653 |
+
var $existingOptions = self.$element.find('option').filter(function () {
|
3654 |
+
return $(this).val() === item.id;
|
3655 |
+
});
|
3656 |
+
|
3657 |
+
// If an existing option wasn't found for it, create the option
|
3658 |
+
if (!$existingOptions.length) {
|
3659 |
+
var $option = self.option(item);
|
3660 |
+
$option.attr('data-czrSelect2-tag', true);
|
3661 |
+
|
3662 |
+
self._removeOldTags();
|
3663 |
+
self.addOptions([$option]);
|
3664 |
+
}
|
3665 |
+
|
3666 |
+
// Select the item, now that we know there is an option for it
|
3667 |
+
select(item);
|
3668 |
+
}
|
3669 |
+
|
3670 |
+
function select (data) {
|
3671 |
+
self.trigger('select', {
|
3672 |
+
data: data
|
3673 |
+
});
|
3674 |
+
}
|
3675 |
+
|
3676 |
+
params.term = params.term || '';
|
3677 |
+
|
3678 |
+
var tokenData = this.tokenizer(params, this.options, createAndSelect);
|
3679 |
+
|
3680 |
+
if (tokenData.term !== params.term) {
|
3681 |
+
// Replace the search term if we have the search box
|
3682 |
+
if (this.$search.length) {
|
3683 |
+
this.$search.val(tokenData.term);
|
3684 |
+
this.$search.focus();
|
3685 |
+
}
|
3686 |
+
|
3687 |
+
params.term = tokenData.term;
|
3688 |
+
}
|
3689 |
+
|
3690 |
+
decorated.call(this, params, callback);
|
3691 |
+
};
|
3692 |
+
|
3693 |
+
Tokenizer.prototype.tokenizer = function (_, params, options, callback) {
|
3694 |
+
var separators = options.get('tokenSeparators') || [];
|
3695 |
+
var term = params.term;
|
3696 |
+
var i = 0;
|
3697 |
+
|
3698 |
+
var createTag = this.createTag || function (params) {
|
3699 |
+
return {
|
3700 |
+
id: params.term,
|
3701 |
+
text: params.term
|
3702 |
+
};
|
3703 |
+
};
|
3704 |
+
|
3705 |
+
while (i < term.length) {
|
3706 |
+
var termChar = term[i];
|
3707 |
+
|
3708 |
+
if ($.inArray(termChar, separators) === -1) {
|
3709 |
+
i++;
|
3710 |
+
|
3711 |
+
continue;
|
3712 |
+
}
|
3713 |
+
|
3714 |
+
var part = term.substr(0, i);
|
3715 |
+
var partParams = $.extend({}, params, {
|
3716 |
+
term: part
|
3717 |
+
});
|
3718 |
+
|
3719 |
+
var data = createTag(partParams);
|
3720 |
+
|
3721 |
+
if (data == null) {
|
3722 |
+
i++;
|
3723 |
+
continue;
|
3724 |
+
}
|
3725 |
+
|
3726 |
+
callback(data);
|
3727 |
+
|
3728 |
+
// Reset the term to not include the tokenized portion
|
3729 |
+
term = term.substr(i + 1) || '';
|
3730 |
+
i = 0;
|
3731 |
+
}
|
3732 |
+
|
3733 |
+
return {
|
3734 |
+
term: term
|
3735 |
+
};
|
3736 |
+
};
|
3737 |
+
|
3738 |
+
return Tokenizer;
|
3739 |
+
});
|
3740 |
+
|
3741 |
+
S2.define('czrSelect2/data/minimumInputLength',[
|
3742 |
+
|
3743 |
+
], function () {
|
3744 |
+
function MinimumInputLength (decorated, $e, options) {
|
3745 |
+
this.minimumInputLength = options.get('minimumInputLength');
|
3746 |
+
|
3747 |
+
decorated.call(this, $e, options);
|
3748 |
+
}
|
3749 |
+
|
3750 |
+
MinimumInputLength.prototype.query = function (decorated, params, callback) {
|
3751 |
+
params.term = params.term || '';
|
3752 |
+
|
3753 |
+
if (params.term.length < this.minimumInputLength) {
|
3754 |
+
this.trigger('results:message', {
|
3755 |
+
message: 'inputTooShort',
|
3756 |
+
args: {
|
3757 |
+
minimum: this.minimumInputLength,
|
3758 |
+
input: params.term,
|
3759 |
+
params: params
|
3760 |
+
}
|
3761 |
+
});
|
3762 |
+
|
3763 |
+
return;
|
3764 |
+
}
|
3765 |
+
|
3766 |
+
decorated.call(this, params, callback);
|
3767 |
+
};
|
3768 |
+
|
3769 |
+
return MinimumInputLength;
|
3770 |
+
});
|
3771 |
+
|
3772 |
+
S2.define('czrSelect2/data/maximumInputLength',[
|
3773 |
+
|
3774 |
+
], function () {
|
3775 |
+
function MaximumInputLength (decorated, $e, options) {
|
3776 |
+
this.maximumInputLength = options.get('maximumInputLength');
|
3777 |
+
|
3778 |
+
decorated.call(this, $e, options);
|
3779 |
+
}
|
3780 |
+
|
3781 |
+
MaximumInputLength.prototype.query = function (decorated, params, callback) {
|
3782 |
+
params.term = params.term || '';
|
3783 |
+
|
3784 |
+
if (this.maximumInputLength > 0 &&
|
3785 |
+
params.term.length > this.maximumInputLength) {
|
3786 |
+
this.trigger('results:message', {
|
3787 |
+
message: 'inputTooLong',
|
3788 |
+
args: {
|
3789 |
+
maximum: this.maximumInputLength,
|
3790 |
+
input: params.term,
|
3791 |
+
params: params
|
3792 |
+
}
|
3793 |
+
});
|
3794 |
+
|
3795 |
+
return;
|
3796 |
+
}
|
3797 |
+
|
3798 |
+
decorated.call(this, params, callback);
|
3799 |
+
};
|
3800 |
+
|
3801 |
+
return MaximumInputLength;
|
3802 |
+
});
|
3803 |
+
|
3804 |
+
S2.define('czrSelect2/data/maximumSelectionLength',[
|
3805 |
+
|
3806 |
+
], function (){
|
3807 |
+
function MaximumSelectionLength (decorated, $e, options) {
|
3808 |
+
this.maximumSelectionLength = options.get('maximumSelectionLength');
|
3809 |
+
|
3810 |
+
decorated.call(this, $e, options);
|
3811 |
+
}
|
3812 |
+
|
3813 |
+
MaximumSelectionLength.prototype.query =
|
3814 |
+
function (decorated, params, callback) {
|
3815 |
+
var self = this;
|
3816 |
+
|
3817 |
+
this.current(function (currentData) {
|
3818 |
+
var count = currentData != null ? currentData.length : 0;
|
3819 |
+
if (self.maximumSelectionLength > 0 &&
|
3820 |
+
count >= self.maximumSelectionLength) {
|
3821 |
+
self.trigger('results:message', {
|
3822 |
+
message: 'maximumSelected',
|
3823 |
+
args: {
|
3824 |
+
maximum: self.maximumSelectionLength
|
3825 |
+
}
|
3826 |
+
});
|
3827 |
+
return;
|
3828 |
+
}
|
3829 |
+
decorated.call(self, params, callback);
|
3830 |
+
});
|
3831 |
+
};
|
3832 |
+
|
3833 |
+
return MaximumSelectionLength;
|
3834 |
+
});
|
3835 |
+
|
3836 |
+
S2.define('czrSelect2/dropdown',[
|
3837 |
+
'jquery',
|
3838 |
+
'./utils'
|
3839 |
+
], function ($, Utils) {
|
3840 |
+
function Dropdown ($element, options) {
|
3841 |
+
this.$element = $element;
|
3842 |
+
this.options = options;
|
3843 |
+
|
3844 |
+
Dropdown.__super__.constructor.call(this);
|
3845 |
+
}
|
3846 |
+
|
3847 |
+
Utils.Extend(Dropdown, Utils.Observable);
|
3848 |
+
|
3849 |
+
Dropdown.prototype.render = function () {
|
3850 |
+
var $dropdown = $(
|
3851 |
+
'<span class="czrSelect2-dropdown">' +
|
3852 |
+
'<span class="czrSelect2-results"></span>' +
|
3853 |
+
'</span>'
|
3854 |
+
);
|
3855 |
+
|
3856 |
+
$dropdown.attr('dir', this.options.get('dir'));
|
3857 |
+
|
3858 |
+
this.$dropdown = $dropdown;
|
3859 |
+
|
3860 |
+
return $dropdown;
|
3861 |
+
};
|
3862 |
+
|
3863 |
+
Dropdown.prototype.bind = function () {
|
3864 |
+
// Should be implemented in subclasses
|
3865 |
+
};
|
3866 |
+
|
3867 |
+
Dropdown.prototype.position = function ($dropdown, $container) {
|
3868 |
+
// Should be implmented in subclasses
|
3869 |
+
};
|
3870 |
+
|
3871 |
+
Dropdown.prototype.destroy = function () {
|
3872 |
+
// Remove the dropdown from the DOM
|
3873 |
+
this.$dropdown.remove();
|
3874 |
+
};
|
3875 |
+
|
3876 |
+
return Dropdown;
|
3877 |
+
});
|
3878 |
+
|
3879 |
+
S2.define('czrSelect2/dropdown/search',[
|
3880 |
+
'jquery',
|
3881 |
+
'../utils'
|
3882 |
+
], function ($, Utils) {
|
3883 |
+
function Search () { }
|
3884 |
+
|
3885 |
+
Search.prototype.render = function (decorated) {
|
3886 |
+
var $rendered = decorated.call(this);
|
3887 |
+
|
3888 |
+
var $search = $(
|
3889 |
+
'<span class="czrSelect2-search czrSelect2-search--dropdown">' +
|
3890 |
+
'<input class="czrSelect2-search__field" type="search" tabindex="-1"' +
|
3891 |
+
' autocomplete="off" autocorrect="off" autocapitalize="off"' +
|
3892 |
+
' spellcheck="false" role="textbox" />' +
|
3893 |
+
'</span>'
|
3894 |
+
);
|
3895 |
+
|
3896 |
+
this.$searchContainer = $search;
|
3897 |
+
this.$search = $search.find('input');
|
3898 |
+
|
3899 |
+
$rendered.prepend($search);
|
3900 |
+
|
3901 |
+
return $rendered;
|
3902 |
+
};
|
3903 |
+
|
3904 |
+
Search.prototype.bind = function (decorated, container, $container) {
|
3905 |
+
var self = this;
|
3906 |
+
|
3907 |
+
decorated.call(this, container, $container);
|
3908 |
+
|
3909 |
+
this.$search.on('keydown', function (evt) {
|
3910 |
+
self.trigger('keypress', evt);
|
3911 |
+
|
3912 |
+
self._keyUpPrevented = evt.isDefaultPrevented();
|
3913 |
+
});
|
3914 |
+
|
3915 |
+
// Workaround for browsers which do not support the `input` event
|
3916 |
+
// This will prevent double-triggering of events for browsers which support
|
3917 |
+
// both the `keyup` and `input` events.
|
3918 |
+
this.$search.on('input', function (evt) {
|
3919 |
+
// Unbind the duplicated `keyup` event
|
3920 |
+
$(this).off('keyup');
|
3921 |
+
});
|
3922 |
+
|
3923 |
+
this.$search.on('keyup input', function (evt) {
|
3924 |
+
self.handleSearch(evt);
|
3925 |
+
});
|
3926 |
+
|
3927 |
+
container.on('open', function () {
|
3928 |
+
self.$search.attr('tabindex', 0);
|
3929 |
+
|
3930 |
+
self.$search.focus();
|
3931 |
+
|
3932 |
+
window.setTimeout(function () {
|
3933 |
+
self.$search.focus();
|
3934 |
+
}, 0);
|
3935 |
+
});
|
3936 |
+
|
3937 |
+
container.on('close', function () {
|
3938 |
+
self.$search.attr('tabindex', -1);
|
3939 |
+
|
3940 |
+
self.$search.val('');
|
3941 |
+
});
|
3942 |
+
|
3943 |
+
container.on('focus', function () {
|
3944 |
+
if (container.isOpen()) {
|
3945 |
+
self.$search.focus();
|
3946 |
+
}
|
3947 |
+
});
|
3948 |
+
|
3949 |
+
container.on('results:all', function (params) {
|
3950 |
+
if (params.query.term == null || params.query.term === '') {
|
3951 |
+
var showSearch = self.showSearch(params);
|
3952 |
+
|
3953 |
+
if (showSearch) {
|
3954 |
+
self.$searchContainer.removeClass('czrSelect2-search--hide');
|
3955 |
+
} else {
|
3956 |
+
self.$searchContainer.addClass('czrSelect2-search--hide');
|
3957 |
+
}
|
3958 |
+
}
|
3959 |
+
});
|
3960 |
+
};
|
3961 |
+
|
3962 |
+
Search.prototype.handleSearch = function (evt) {
|
3963 |
+
if (!this._keyUpPrevented) {
|
3964 |
+
var input = this.$search.val();
|
3965 |
+
|
3966 |
+
this.trigger('query', {
|
3967 |
+
term: input
|
3968 |
+
});
|
3969 |
+
}
|
3970 |
+
|
3971 |
+
this._keyUpPrevented = false;
|
3972 |
+
};
|
3973 |
+
|
3974 |
+
Search.prototype.showSearch = function (_, params) {
|
3975 |
+
return true;
|
3976 |
+
};
|
3977 |
+
|
3978 |
+
return Search;
|
3979 |
+
});
|
3980 |
+
|
3981 |
+
S2.define('czrSelect2/dropdown/hidePlaceholder',[
|
3982 |
+
|
3983 |
+
], function () {
|
3984 |
+
function HidePlaceholder (decorated, $element, options, dataAdapter) {
|
3985 |
+
this.placeholder = this.normalizePlaceholder(options.get('placeholder'));
|
3986 |
+
|
3987 |
+
decorated.call(this, $element, options, dataAdapter);
|
3988 |
+
}
|
3989 |
+
|
3990 |
+
HidePlaceholder.prototype.append = function (decorated, data) {
|
3991 |
+
data.results = this.removePlaceholder(data.results);
|
3992 |
+
|
3993 |
+
decorated.call(this, data);
|
3994 |
+
};
|
3995 |
+
|
3996 |
+
HidePlaceholder.prototype.normalizePlaceholder = function (_, placeholder) {
|
3997 |
+
if (typeof placeholder === 'string') {
|
3998 |
+
placeholder = {
|
3999 |
+
id: '',
|
4000 |
+
text: placeholder
|
4001 |
+
};
|
4002 |
+
}
|
4003 |
+
|
4004 |
+
return placeholder;
|
4005 |
+
};
|
4006 |
+
|
4007 |
+
HidePlaceholder.prototype.removePlaceholder = function (_, data) {
|
4008 |
+
var modifiedData = data.slice(0);
|
4009 |
+
|
4010 |
+
for (var d = data.length - 1; d >= 0; d--) {
|
4011 |
+
var item = data[d];
|
4012 |
+
|
4013 |
+
if (this.placeholder.id === item.id) {
|
4014 |
+
modifiedData.splice(d, 1);
|
4015 |
+
}
|
4016 |
+
}
|
4017 |
+
|
4018 |
+
return modifiedData;
|
4019 |
+
};
|
4020 |
+
|
4021 |
+
return HidePlaceholder;
|
4022 |
+
});
|
4023 |
+
|
4024 |
+
S2.define('czrSelect2/dropdown/infiniteScroll',[
|
4025 |
+
'jquery'
|
4026 |
+
], function ($) {
|
4027 |
+
function InfiniteScroll (decorated, $element, options, dataAdapter) {
|
4028 |
+
this.lastParams = {};
|
4029 |
+
|
4030 |
+
decorated.call(this, $element, options, dataAdapter);
|
4031 |
+
|
4032 |
+
this.$loadingMore = this.createLoadingMore();
|
4033 |
+
this.loading = false;
|
4034 |
+
}
|
4035 |
+
|
4036 |
+
InfiniteScroll.prototype.append = function (decorated, data) {
|
4037 |
+
this.$loadingMore.remove();
|
4038 |
+
this.loading = false;
|
4039 |
+
|
4040 |
+
decorated.call(this, data);
|
4041 |
+
|
4042 |
+
if (this.showLoadingMore(data)) {
|
4043 |
+
this.$results.append(this.$loadingMore);
|
4044 |
+
}
|
4045 |
+
};
|
4046 |
+
|
4047 |
+
InfiniteScroll.prototype.bind = function (decorated, container, $container) {
|
4048 |
+
var self = this;
|
4049 |
+
|
4050 |
+
decorated.call(this, container, $container);
|
4051 |
+
|
4052 |
+
container.on('query', function (params) {
|
4053 |
+
self.lastParams = params;
|
4054 |
+
self.loading = true;
|
4055 |
+
});
|
4056 |
+
|
4057 |
+
container.on('query:append', function (params) {
|
4058 |
+
self.lastParams = params;
|
4059 |
+
self.loading = true;
|
4060 |
+
});
|
4061 |
+
|
4062 |
+
this.$results.on('scroll', function () {
|
4063 |
+
var isLoadMoreVisible = $.contains(
|
4064 |
+
document.documentElement,
|
4065 |
+
self.$loadingMore[0]
|
4066 |
+
);
|
4067 |
+
|
4068 |
+
if (self.loading || !isLoadMoreVisible) {
|
4069 |
+
return;
|
4070 |
+
}
|
4071 |
+
|
4072 |
+
var currentOffset = self.$results.offset().top +
|
4073 |
+
self.$results.outerHeight(false);
|
4074 |
+
var loadingMoreOffset = self.$loadingMore.offset().top +
|
4075 |
+
self.$loadingMore.outerHeight(false);
|
4076 |
+
|
4077 |
+
if (currentOffset + 50 >= loadingMoreOffset) {
|
4078 |
+
self.loadMore();
|
4079 |
+
}
|
4080 |
+
});
|
4081 |
+
};
|
4082 |
+
|
4083 |
+
InfiniteScroll.prototype.loadMore = function () {
|
4084 |
+
this.loading = true;
|
4085 |
+
|
4086 |
+
var params = $.extend({}, {page: 1}, this.lastParams);
|
4087 |
+
|
4088 |
+
params.page++;
|
4089 |
+
|
4090 |
+
this.trigger('query:append', params);
|
4091 |
+
};
|
4092 |
+
|
4093 |
+
InfiniteScroll.prototype.showLoadingMore = function (_, data) {
|
4094 |
+
return data.pagination && data.pagination.more;
|
4095 |
+
};
|
4096 |
+
|
4097 |
+
InfiniteScroll.prototype.createLoadingMore = function () {
|
4098 |
+
var $option = $(
|
4099 |
+
'<li ' +
|
4100 |
+
'class="czrSelect2-results__option czrSelect2-results__option--load-more"' +
|
4101 |
+
'role="treeitem" aria-disabled="true"></li>'
|
4102 |
+
);
|
4103 |
+
|
4104 |
+
var message = this.options.get('translations').get('loadingMore');
|
4105 |
+
|
4106 |
+
$option.html(message(this.lastParams));
|
4107 |
+
|
4108 |
+
return $option;
|
4109 |
+
};
|
4110 |
+
|
4111 |
+
return InfiniteScroll;
|
4112 |
+
});
|
4113 |
+
|
4114 |
+
S2.define('czrSelect2/dropdown/attachBody',[
|
4115 |
+
'jquery',
|
4116 |
+
'../utils'
|
4117 |
+
], function ($, Utils) {
|
4118 |
+
function AttachBody (decorated, $element, options) {
|
4119 |
+
this.$dropdownParent = options.get('dropdownParent') || $(document.body);
|
4120 |
+
|
4121 |
+
decorated.call(this, $element, options);
|
4122 |
+
}
|
4123 |
+
|
4124 |
+
AttachBody.prototype.bind = function (decorated, container, $container) {
|
4125 |
+
var self = this;
|
4126 |
+
|
4127 |
+
var setupResultsEvents = false;
|
4128 |
+
|
4129 |
+
decorated.call(this, container, $container);
|
4130 |
+
|
4131 |
+
container.on('open', function () {
|
4132 |
+
self._showDropdown();
|
4133 |
+
self._attachPositioningHandler(container);
|
4134 |
+
|
4135 |
+
if (!setupResultsEvents) {
|
4136 |
+
setupResultsEvents = true;
|
4137 |
+
|
4138 |
+
container.on('results:all', function () {
|
4139 |
+
self._positionDropdown();
|
4140 |
+
self._resizeDropdown();
|
4141 |
+
});
|
4142 |
+
|
4143 |
+
container.on('results:append', function () {
|
4144 |
+
self._positionDropdown();
|
4145 |
+
self._resizeDropdown();
|
4146 |
+
});
|
4147 |
+
}
|
4148 |
+
});
|
4149 |
+
|
4150 |
+
container.on('close', function () {
|
4151 |
+
self._hideDropdown();
|
4152 |
+
self._detachPositioningHandler(container);
|
4153 |
+
});
|
4154 |
+
|
4155 |
+
this.$dropdownContainer.on('mousedown', function (evt) {
|
4156 |
+
evt.stopPropagation();
|
4157 |
+
});
|
4158 |
+
};
|
4159 |
+
|
4160 |
+
AttachBody.prototype.destroy = function (decorated) {
|
4161 |
+
decorated.call(this);
|
4162 |
+
|
4163 |
+
this.$dropdownContainer.remove();
|
4164 |
+
};
|
4165 |
+
|
4166 |
+
AttachBody.prototype.position = function (decorated, $dropdown, $container) {
|
4167 |
+
// Clone all of the container classes
|
4168 |
+
$dropdown.attr('class', $container.attr('class'));
|
4169 |
+
|
4170 |
+
$dropdown.removeClass('czrSelect2');
|
4171 |
+
$dropdown.addClass('czrSelect2-container--open');
|
4172 |
+
|
4173 |
+
$dropdown.css({
|
4174 |
+
position: 'absolute',
|
4175 |
+
top: -999999
|
4176 |
+
});
|
4177 |
+
|
4178 |
+
this.$container = $container;
|
4179 |
+
};
|
4180 |
+
|
4181 |
+
AttachBody.prototype.render = function (decorated) {
|
4182 |
+
var $container = $('<span></span>');
|
4183 |
+
|
4184 |
+
var $dropdown = decorated.call(this);
|
4185 |
+
$container.append($dropdown);
|
4186 |
+
|
4187 |
+
this.$dropdownContainer = $container;
|
4188 |
+
|
4189 |
+
return $container;
|
4190 |
+
};
|
4191 |
+
|
4192 |
+
AttachBody.prototype._hideDropdown = function (decorated) {
|
4193 |
+
this.$dropdownContainer.detach();
|
4194 |
+
};
|
4195 |
+
|
4196 |
+
AttachBody.prototype._attachPositioningHandler =
|
4197 |
+
function (decorated, container) {
|
4198 |
+
var self = this;
|
4199 |
+
|
4200 |
+
var scrollEvent = 'scroll.czrSelect2.' + container.id;
|
4201 |
+
var resizeEvent = 'resize.czrSelect2.' + container.id;
|
4202 |
+
var orientationEvent = 'orientationchange.czrSelect2.' + container.id;
|
4203 |
+
|
4204 |
+
var $watchers = this.$container.parents().filter(Utils.hasScroll);
|
4205 |
+
$watchers.each(function () {
|
4206 |
+
$(this).data('czrSelect2-scroll-position', {
|
4207 |
+
x: $(this).scrollLeft(),
|
4208 |
+
y: $(this).scrollTop()
|
4209 |
+
});
|
4210 |
+
});
|
4211 |
+
|
4212 |
+
$watchers.on(scrollEvent, function (ev) {
|
4213 |
+
var position = $(this).data('czrSelect2-scroll-position');
|
4214 |
+
$(this).scrollTop(position.y);
|
4215 |
+
});
|
4216 |
+
|
4217 |
+
$(window).on(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent,
|
4218 |
+
function (e) {
|
4219 |
+
self._positionDropdown();
|
4220 |
+
self._resizeDropdown();
|
4221 |
+
});
|
4222 |
+
};
|
4223 |
+
|
4224 |
+
AttachBody.prototype._detachPositioningHandler =
|
4225 |
+
function (decorated, container) {
|
4226 |
+
var scrollEvent = 'scroll.czrSelect2.' + container.id;
|
4227 |
+
var resizeEvent = 'resize.czrSelect2.' + container.id;
|
4228 |
+
var orientationEvent = 'orientationchange.czrSelect2.' + container.id;
|
4229 |
+
|
4230 |
+
var $watchers = this.$container.parents().filter(Utils.hasScroll);
|
4231 |
+
$watchers.off(scrollEvent);
|
4232 |
+
|
4233 |
+
$(window).off(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent);
|
4234 |
+
};
|
4235 |
+
|
4236 |
+
AttachBody.prototype._positionDropdown = function () {
|
4237 |
+
var $window = $(window);
|
4238 |
+
|
4239 |
+
var isCurrentlyAbove = this.$dropdown.hasClass('czrSelect2-dropdown--above');
|
4240 |
+
var isCurrentlyBelow = this.$dropdown.hasClass('czrSelect2-dropdown--below');
|
4241 |
+
|
4242 |
+
var newDirection = null;
|
4243 |
+
|
4244 |
+
var offset = this.$container.offset();
|
4245 |
+
|
4246 |
+
offset.bottom = offset.top + this.$container.outerHeight(false);
|
4247 |
+
|
4248 |
+
var container = {
|
4249 |
+
height: this.$container.outerHeight(false)
|
4250 |
+
};
|
4251 |
+
|
4252 |
+
container.top = offset.top;
|
4253 |
+
container.bottom = offset.top + container.height;
|
4254 |
+
|
4255 |
+
var dropdown = {
|
4256 |
+
height: this.$dropdown.outerHeight(false)
|
4257 |
+
};
|
4258 |
+
|
4259 |
+
var viewport = {
|
4260 |
+
top: $window.scrollTop(),
|
4261 |
+
bottom: $window.scrollTop() + $window.height()
|
4262 |
+
};
|
4263 |
+
|
4264 |
+
var enoughRoomAbove = viewport.top < (offset.top - dropdown.height);
|
4265 |
+
var enoughRoomBelow = viewport.bottom > (offset.bottom + dropdown.height);
|
4266 |
+
|
4267 |
+
var css = {
|
4268 |
+
left: offset.left,
|
4269 |
+
top: container.bottom
|
4270 |
+
};
|
4271 |
+
|
4272 |
+
// Determine what the parent element is to use for calciulating the offset
|
4273 |
+
var $offsetParent = this.$dropdownParent;
|
4274 |
+
|
4275 |
+
// For statically positoned elements, we need to get the element
|
4276 |
+
// that is determining the offset
|
4277 |
+
if ($offsetParent.css('position') === 'static') {
|
4278 |
+
$offsetParent = $offsetParent.offsetParent();
|
4279 |
+
}
|
4280 |
+
|
4281 |
+
var parentOffset = $offsetParent.offset();
|
4282 |
+
|
4283 |
+
css.top -= parentOffset.top;
|
4284 |
+
css.left -= parentOffset.left;
|
4285 |
+
|
4286 |
+
if (!isCurrentlyAbove && !isCurrentlyBelow) {
|
4287 |
+
newDirection = 'below';
|
4288 |
+
}
|
4289 |
+
|
4290 |
+
if (!enoughRoomBelow && enoughRoomAbove && !isCurrentlyAbove) {
|
4291 |
+
newDirection = 'above';
|
4292 |
+
} else if (!enoughRoomAbove && enoughRoomBelow && isCurrentlyAbove) {
|
4293 |
+
newDirection = 'below';
|
4294 |
+
}
|
4295 |
+
|
4296 |
+
if (newDirection == 'above' ||
|
4297 |
+
(isCurrentlyAbove && newDirection !== 'below')) {
|
4298 |
+
css.top = container.top - parentOffset.top - dropdown.height;
|
4299 |
+
}
|
4300 |
+
|
4301 |
+
if (newDirection != null) {
|
4302 |
+
this.$dropdown
|
4303 |
+
.removeClass('czrSelect2-dropdown--below czrSelect2-dropdown--above')
|
4304 |
+
.addClass('czrSelect2-dropdown--' + newDirection);
|
4305 |
+
this.$container
|
4306 |
+
.removeClass('czrSelect2-container--below czrSelect2-container--above')
|
4307 |
+
.addClass('czrSelect2-container--' + newDirection);
|
4308 |
+
}
|
4309 |
+
|
4310 |
+
this.$dropdownContainer.css(css);
|
4311 |
+
};
|
4312 |
+
|
4313 |
+
AttachBody.prototype._resizeDropdown = function () {
|
4314 |
+
var css = {
|
4315 |
+
width: this.$container.outerWidth(false) + 'px'
|
4316 |
+
};
|
4317 |
+
|
4318 |
+
if (this.options.get('dropdownAutoWidth')) {
|
4319 |
+
css.minWidth = css.width;
|
4320 |
+
css.position = 'relative';
|
4321 |
+
css.width = 'auto';
|
4322 |
+
}
|
4323 |
+
|
4324 |
+
this.$dropdown.css(css);
|
4325 |
+
};
|
4326 |
+
|
4327 |
+
AttachBody.prototype._showDropdown = function (decorated) {
|
4328 |
+
this.$dropdownContainer.appendTo(this.$dropdownParent);
|
4329 |
+
|
4330 |
+
this._positionDropdown();
|
4331 |
+
this._resizeDropdown();
|
4332 |
+
};
|
4333 |
+
|
4334 |
+
return AttachBody;
|
4335 |
+
});
|
4336 |
+
|
4337 |
+
S2.define('czrSelect2/dropdown/minimumResultsForSearch',[
|
4338 |
+
|
4339 |
+
], function () {
|
4340 |
+
function countResults (data) {
|
4341 |
+
var count = 0;
|
4342 |
+
|
4343 |
+
for (var d = 0; d < data.length; d++) {
|
4344 |
+
var item = data[d];
|
4345 |
+
|
4346 |
+
if (item.children) {
|
4347 |
+
count += countResults(item.children);
|
4348 |
+
} else {
|
4349 |
+
count++;
|
4350 |
+
}
|
4351 |
+
}
|
4352 |
+
|
4353 |
+
return count;
|
4354 |
+
}
|
4355 |
+
|
4356 |
+
function MinimumResultsForSearch (decorated, $element, options, dataAdapter) {
|
4357 |
+
this.minimumResultsForSearch = options.get('minimumResultsForSearch');
|
4358 |
+
|
4359 |
+
if (this.minimumResultsForSearch < 0) {
|
4360 |
+
this.minimumResultsForSearch = Infinity;
|
4361 |
+
}
|
4362 |
+
|
4363 |
+
decorated.call(this, $element, options, dataAdapter);
|
4364 |
+
}
|
4365 |
+
|
4366 |
+
MinimumResultsForSearch.prototype.showSearch = function (decorated, params) {
|
4367 |
+
if (countResults(params.data.results) < this.minimumResultsForSearch) {
|
4368 |
+
return false;
|
4369 |
+
}
|
4370 |
+
|
4371 |
+
return decorated.call(this, params);
|
4372 |
+
};
|
4373 |
+
|
4374 |
+
return MinimumResultsForSearch;
|
4375 |
+
});
|
4376 |
+
|
4377 |
+
S2.define('czrSelect2/dropdown/selectOnClose',[
|
4378 |
+
|
4379 |
+
], function () {
|
4380 |
+
function SelectOnClose () { }
|
4381 |
+
|
4382 |
+
SelectOnClose.prototype.bind = function (decorated, container, $container) {
|
4383 |
+
var self = this;
|
4384 |
+
|
4385 |
+
decorated.call(this, container, $container);
|
4386 |
+
|
4387 |
+
container.on('close', function (params) {
|
4388 |
+
self._handleSelectOnClose(params);
|
4389 |
+
});
|
4390 |
+
};
|
4391 |
+
|
4392 |
+
SelectOnClose.prototype._handleSelectOnClose = function (_, params) {
|
4393 |
+
if (params && params.originalCzrSelect2Event != null) {
|
4394 |
+
var event = params.originalCzrSelect2Event;
|
4395 |
+
|
4396 |
+
// Don't select an item if the close event was triggered from a select or
|
4397 |
+
// unselect event
|
4398 |
+
if (event._type === 'select' || event._type === 'unselect') {
|
4399 |
+
return;
|
4400 |
+
}
|
4401 |
+
}
|
4402 |
+
|
4403 |
+
var $highlightedResults = this.getHighlightedResults();
|
4404 |
+
|
4405 |
+
// Only select highlighted results
|
4406 |
+
if ($highlightedResults.length < 1) {
|
4407 |
+
return;
|
4408 |
+
}
|
4409 |
+
|
4410 |
+
var data = $highlightedResults.data('data');
|
4411 |
+
|
4412 |
+
// Don't re-select already selected resulte
|
4413 |
+
if (
|
4414 |
+
(data.element != null && data.element.selected) ||
|
4415 |
+
(data.element == null && data.selected)
|
4416 |
+
) {
|
4417 |
+
return;
|
4418 |
+
}
|
4419 |
+
|
4420 |
+
this.trigger('select', {
|
4421 |
+
data: data
|
4422 |
+
});
|
4423 |
+
};
|
4424 |
+
|
4425 |
+
return SelectOnClose;
|
4426 |
+
});
|
4427 |
+
|
4428 |
+
S2.define('czrSelect2/dropdown/closeOnSelect',[
|
4429 |
+
|
4430 |
+
], function () {
|
4431 |
+
function CloseOnSelect () { }
|
4432 |
+
|
4433 |
+
CloseOnSelect.prototype.bind = function (decorated, container, $container) {
|
4434 |
+
var self = this;
|
4435 |
+
|
4436 |
+
decorated.call(this, container, $container);
|
4437 |
+
|
4438 |
+
container.on('select', function (evt) {
|
4439 |
+
self._selectTriggered(evt);
|
4440 |
+
});
|
4441 |
+
|
4442 |
+
container.on('unselect', function (evt) {
|
4443 |
+
self._selectTriggered(evt);
|
4444 |
+
});
|
4445 |
+
};
|
4446 |
+
|
4447 |
+
CloseOnSelect.prototype._selectTriggered = function (_, evt) {
|
4448 |
+
var originalEvent = evt.originalEvent;
|
4449 |
+
|
4450 |
+
// Don't close if the control key is being held
|
4451 |
+
if (originalEvent && originalEvent.ctrlKey) {
|
4452 |
+
return;
|
4453 |
+
}
|
4454 |
+
|
4455 |
+
this.trigger('close', {
|
4456 |
+
originalEvent: originalEvent,
|
4457 |
+
originalCzrSelect2Event: evt
|
4458 |
+
});
|
4459 |
+
};
|
4460 |
+
|
4461 |
+
return CloseOnSelect;
|
4462 |
+
});
|
4463 |
+
|
4464 |
+
S2.define('czrSelect2/i18n/en',[],function () {
|
4465 |
+
// English
|
4466 |
+
return {
|
4467 |
+
errorLoading: function () {
|
4468 |
+
return 'The results could not be loaded.';
|
4469 |
+
},
|
4470 |
+
inputTooLong: function (args) {
|
4471 |
+
var overChars = args.input.length - args.maximum;
|
4472 |
+
|
4473 |
+
var message = 'Please delete ' + overChars + ' character';
|
4474 |
+
|
4475 |
+
if (overChars != 1) {
|
4476 |
+
message += 's';
|
4477 |
+
}
|
4478 |
+
|
4479 |
+
return message;
|
4480 |
+
},
|
4481 |
+
inputTooShort: function (args) {
|
4482 |
+
var remainingChars = args.minimum - args.input.length;
|
4483 |
+
|
4484 |
+
var message = 'Please enter ' + remainingChars + ' or more characters';
|
4485 |
+
|
4486 |
+
return message;
|
4487 |
+
},
|
4488 |
+
loadingMore: function () {
|
4489 |
+
return 'Loading more results…';
|
4490 |
+
},
|
4491 |
+
maximumSelected: function (args) {
|
4492 |
+
var message = 'You can only select ' + args.maximum + ' item';
|
4493 |
+
|
4494 |
+
if (args.maximum != 1) {
|
4495 |
+
message += 's';
|
4496 |
+
}
|
4497 |
+
|
4498 |
+
return message;
|
4499 |
+
},
|
4500 |
+
noResults: function () {
|
4501 |
+
return 'No results found';
|
4502 |
+
},
|
4503 |
+
searching: function () {
|
4504 |
+
return 'Searching…';
|
4505 |
+
}
|
4506 |
+
};
|
4507 |
+
});
|
4508 |
+
|
4509 |
+
S2.define('czrSelect2/defaults',[
|
4510 |
+
'jquery',
|
4511 |
+
'require',
|
4512 |
+
|
4513 |
+
'./results',
|
4514 |
+
|
4515 |
+
'./selection/single',
|
4516 |
+
'./selection/multiple',
|
4517 |
+
'./selection/placeholder',
|
4518 |
+
'./selection/allowClear',
|
4519 |
+
'./selection/search',
|
4520 |
+
'./selection/eventRelay',
|
4521 |
+
|
4522 |
+
'./utils',
|
4523 |
+
'./translation',
|
4524 |
+
'./diacritics',
|
4525 |
+
|
4526 |
+
'./data/select',
|
4527 |
+
'./data/array',
|
4528 |
+
'./data/ajax',
|
4529 |
+
'./data/tags',
|
4530 |
+
'./data/tokenizer',
|
4531 |
+
'./data/minimumInputLength',
|
4532 |
+
'./data/maximumInputLength',
|
4533 |
+
'./data/maximumSelectionLength',
|
4534 |
+
|
4535 |
+
'./dropdown',
|
4536 |
+
'./dropdown/search',
|
4537 |
+
'./dropdown/hidePlaceholder',
|
4538 |
+
'./dropdown/infiniteScroll',
|
4539 |
+
'./dropdown/attachBody',
|
4540 |
+
'./dropdown/minimumResultsForSearch',
|
4541 |
+
'./dropdown/selectOnClose',
|
4542 |
+
'./dropdown/closeOnSelect',
|
4543 |
+
|
4544 |
+
'./i18n/en'
|
4545 |
+
], function ($, require,
|
4546 |
+
|
4547 |
+
ResultsList,
|
4548 |
+
|
4549 |
+
SingleSelection, MultipleSelection, Placeholder, AllowClear,
|
4550 |
+
SelectionSearch, EventRelay,
|
4551 |
+
|
4552 |
+
Utils, Translation, DIACRITICS,
|
4553 |
+
|
4554 |
+
SelectData, ArrayData, AjaxData, Tags, Tokenizer,
|
4555 |
+
MinimumInputLength, MaximumInputLength, MaximumSelectionLength,
|
4556 |
+
|
4557 |
+
Dropdown, DropdownSearch, HidePlaceholder, InfiniteScroll,
|
4558 |
+
AttachBody, MinimumResultsForSearch, SelectOnClose, CloseOnSelect,
|
4559 |
+
|
4560 |
+
EnglishTranslation) {
|
4561 |
+
function Defaults () {
|
4562 |
+
this.reset();
|
4563 |
+
}
|
4564 |
+
|
4565 |
+
Defaults.prototype.apply = function (options) {
|
4566 |
+
options = $.extend(true, {}, this.defaults, options);
|
4567 |
+
|
4568 |
+
if (options.dataAdapter == null) {
|
4569 |
+
if (options.ajax != null) {
|
4570 |
+
options.dataAdapter = AjaxData;
|
4571 |
+
} else if (options.data != null) {
|
4572 |
+
options.dataAdapter = ArrayData;
|
4573 |
+
} else {
|
4574 |
+
options.dataAdapter = SelectData;
|
4575 |
+
}
|
4576 |
+
|
4577 |
+
if (options.minimumInputLength > 0) {
|
4578 |
+
options.dataAdapter = Utils.Decorate(
|
4579 |
+
options.dataAdapter,
|
4580 |
+
MinimumInputLength
|
4581 |
+
);
|
4582 |
+
}
|
4583 |
+
|
4584 |
+
if (options.maximumInputLength > 0) {
|
4585 |
+
options.dataAdapter = Utils.Decorate(
|
4586 |
+
options.dataAdapter,
|
4587 |
+
MaximumInputLength
|
4588 |
+
);
|
4589 |
+
}
|
4590 |
+
|
4591 |
+
if (options.maximumSelectionLength > 0) {
|
4592 |
+
options.dataAdapter = Utils.Decorate(
|
4593 |
+
options.dataAdapter,
|
4594 |
+
MaximumSelectionLength
|
4595 |
+
);
|
4596 |
+
}
|
4597 |
+
|
4598 |
+
if (options.tags) {
|
4599 |
+
options.dataAdapter = Utils.Decorate(options.dataAdapter, Tags);
|
4600 |
+
}
|
4601 |
+
|
4602 |
+
if (options.tokenSeparators != null || options.tokenizer != null) {
|
4603 |
+
options.dataAdapter = Utils.Decorate(
|
4604 |
+
options.dataAdapter,
|
4605 |
+
Tokenizer
|
4606 |
+
);
|
4607 |
+
}
|
4608 |
+
|
4609 |
+
if (options.query != null) {
|
4610 |
+
var Query = require(options.amdBase + 'compat/query');
|
4611 |
+
|
4612 |
+
options.dataAdapter = Utils.Decorate(
|
4613 |
+
options.dataAdapter,
|
4614 |
+
Query
|
4615 |
+
);
|
4616 |
+
}
|
4617 |
+
|
4618 |
+
if (options.initSelection != null) {
|
4619 |
+
var InitSelection = require(options.amdBase + 'compat/initSelection');
|
4620 |
+
|
4621 |
+
options.dataAdapter = Utils.Decorate(
|
4622 |
+
options.dataAdapter,
|
4623 |
+
InitSelection
|
4624 |
+
);
|
4625 |
+
}
|
4626 |
+
}
|
4627 |
+
|
4628 |
+
if (options.resultsAdapter == null) {
|
4629 |
+
options.resultsAdapter = ResultsList;
|
4630 |
+
|
4631 |
+
if (options.ajax != null) {
|
4632 |
+
options.resultsAdapter = Utils.Decorate(
|
4633 |
+
options.resultsAdapter,
|
4634 |
+
InfiniteScroll
|
4635 |
+
);
|
4636 |
+
}
|
4637 |
+
|
4638 |
+
if (options.placeholder != null) {
|
4639 |
+
options.resultsAdapter = Utils.Decorate(
|
4640 |
+
options.resultsAdapter,
|
4641 |
+
HidePlaceholder
|
4642 |
+
);
|
4643 |
+
}
|
4644 |
+
|
4645 |
+
if (options.selectOnClose) {
|
4646 |
+
options.resultsAdapter = Utils.Decorate(
|
4647 |
+
options.resultsAdapter,
|
4648 |
+
SelectOnClose
|
4649 |
+
);
|
4650 |
+
}
|
4651 |
+
}
|
4652 |
+
|
4653 |
+
if (options.dropdownAdapter == null) {
|
4654 |
+
if (options.multiple) {
|
4655 |
+
options.dropdownAdapter = Dropdown;
|
4656 |
+
} else {
|
4657 |
+
var SearchableDropdown = Utils.Decorate(Dropdown, DropdownSearch);
|
4658 |
+
|
4659 |
+
options.dropdownAdapter = SearchableDropdown;
|
4660 |
+
}
|
4661 |
+
|
4662 |
+
if (options.minimumResultsForSearch !== 0) {
|
4663 |
+
options.dropdownAdapter = Utils.Decorate(
|
4664 |
+
options.dropdownAdapter,
|
4665 |
+
MinimumResultsForSearch
|
4666 |
+
);
|
4667 |
+
}
|
4668 |
+
|
4669 |
+
if (options.closeOnSelect) {
|
4670 |
+
options.dropdownAdapter = Utils.Decorate(
|
4671 |
+
options.dropdownAdapter,
|
4672 |
+
CloseOnSelect
|
4673 |
+
);
|
4674 |
+
}
|
4675 |
+
|
4676 |
+
if (
|
4677 |
+
options.dropdownCssClass != null ||
|
4678 |
+
options.dropdownCss != null ||
|
4679 |
+
options.adaptDropdownCssClass != null
|
4680 |
+
) {
|
4681 |
+
var DropdownCSS = require(options.amdBase + 'compat/dropdownCss');
|
4682 |
+
|
4683 |
+
options.dropdownAdapter = Utils.Decorate(
|
4684 |
+
options.dropdownAdapter,
|
4685 |
+
DropdownCSS
|
4686 |
+
);
|
4687 |
+
}
|
4688 |
+
|
4689 |
+
options.dropdownAdapter = Utils.Decorate(
|
4690 |
+
options.dropdownAdapter,
|
4691 |
+
AttachBody
|
4692 |
+
);
|
4693 |
+
}
|
4694 |
+
|
4695 |
+
if (options.selectionAdapter == null) {
|
4696 |
+
if (options.multiple) {
|
4697 |
+
options.selectionAdapter = MultipleSelection;
|
4698 |
+
} else {
|
4699 |
+
options.selectionAdapter = SingleSelection;
|
4700 |
+
}
|
4701 |
+
|
4702 |
+
// Add the placeholder mixin if a placeholder was specified
|
4703 |
+
if (options.placeholder != null) {
|
4704 |
+
options.selectionAdapter = Utils.Decorate(
|
4705 |
+
options.selectionAdapter,
|
4706 |
+
Placeholder
|
4707 |
+
);
|
4708 |
+
}
|
4709 |
+
|
4710 |
+
if (options.allowClear) {
|
4711 |
+
options.selectionAdapter = Utils.Decorate(
|
4712 |
+
options.selectionAdapter,
|
4713 |
+
AllowClear
|
4714 |
+
);
|
4715 |
+
}
|
4716 |
+
|
4717 |
+
if (options.multiple) {
|
4718 |
+
options.selectionAdapter = Utils.Decorate(
|
4719 |
+
options.selectionAdapter,
|
4720 |
+
SelectionSearch
|
4721 |
+
);
|
4722 |
+
}
|
4723 |
+
|
4724 |
+
if (
|
4725 |
+
options.containerCssClass != null ||
|
4726 |
+
options.containerCss != null ||
|
4727 |
+
options.adaptContainerCssClass != null
|
4728 |
+
) {
|
4729 |
+
var ContainerCSS = require(options.amdBase + 'compat/containerCss');
|
4730 |
+
|
4731 |
+
options.selectionAdapter = Utils.Decorate(
|
4732 |
+
options.selectionAdapter,
|
4733 |
+
ContainerCSS
|
4734 |
+
);
|
4735 |
+
}
|
4736 |
+
|
4737 |
+
options.selectionAdapter = Utils.Decorate(
|
4738 |
+
options.selectionAdapter,
|
4739 |
+
EventRelay
|
4740 |
+
);
|
4741 |
+
}
|
4742 |
+
|
4743 |
+
if (typeof options.language === 'string') {
|
4744 |
+
// Check if the language is specified with a region
|
4745 |
+
if (options.language.indexOf('-') > 0) {
|
4746 |
+
// Extract the region information if it is included
|
4747 |
+
var languageParts = options.language.split('-');
|
4748 |
+
var baseLanguage = languageParts[0];
|
4749 |
+
|
4750 |
+
options.language = [options.language, baseLanguage];
|
4751 |
+
} else {
|
4752 |
+
options.language = [options.language];
|
4753 |
+
}
|
4754 |
+
}
|
4755 |
+
|
4756 |
+
if ($.isArray(options.language)) {
|
4757 |
+
var languages = new Translation();
|
4758 |
+
options.language.push('en');
|
4759 |
+
|
4760 |
+
var languageNames = options.language;
|
4761 |
+
|
4762 |
+
for (var l = 0; l < languageNames.length; l++) {
|
4763 |
+
var name = languageNames[l];
|
4764 |
+
var language = {};
|
4765 |
+
|
4766 |
+
try {
|
4767 |
+
// Try to load it with the original name
|
4768 |
+
language = Translation.loadPath(name);
|
4769 |
+
} catch (e) {
|
4770 |
+
try {
|
4771 |
+
// If we couldn't load it, check if it wasn't the full path
|
4772 |
+
name = this.defaults.amdLanguageBase + name;
|
4773 |
+
language = Translation.loadPath(name);
|
4774 |
+
} catch (ex) {
|
4775 |
+
// The translation could not be loaded at all. Sometimes this is
|
4776 |
+
// because of a configuration problem, other times this can be
|
4777 |
+
// because of how CzrSelect2 helps load all possible translation files.
|
4778 |
+
if (options.debug && window.console && console.warn) {
|
4779 |
+
console.warn(
|
4780 |
+
'CzrSelect2: The language file for "' + name + '" could not be ' +
|
4781 |
+
'automatically loaded. A fallback will be used instead.'
|
4782 |
+
);
|
4783 |
+
}
|
4784 |
+
|
4785 |
+
continue;
|
4786 |
+
}
|
4787 |
+
}
|
4788 |
+
|
4789 |
+
languages.extend(language);
|
4790 |
+
}
|
4791 |
+
|
4792 |
+
options.translations = languages;
|
4793 |
+
} else {
|
4794 |
+
var baseTranslation = Translation.loadPath(
|
4795 |
+
this.defaults.amdLanguageBase + 'en'
|
4796 |
+
);
|
4797 |
+
var customTranslation = new Translation(options.language);
|
4798 |
+
|
4799 |
+
customTranslation.extend(baseTranslation);
|
4800 |
+
|
4801 |
+
options.translations = customTranslation;
|
4802 |
+
}
|
4803 |
+
|
4804 |
+
return options;
|
4805 |
+
};
|
4806 |
+
|
4807 |
+
Defaults.prototype.reset = function () {
|
4808 |
+
function stripDiacritics (text) {
|
4809 |
+
// Used 'uni range + named function' from http://jsperf.com/diacritics/18
|
4810 |
+
function match(a) {
|
4811 |
+
return DIACRITICS[a] || a;
|
4812 |
+
}
|
4813 |
+
|
4814 |
+
return text.replace(/[^\u0000-\u007E]/g, match);
|
4815 |
+
}
|
4816 |
+
|
4817 |
+
function matcher (params, data) {
|
4818 |
+
// Always return the object if there is nothing to compare
|
4819 |
+
if ( 'string' !== typeof(params.term) || params.term.trim() === '' ) {
|
4820 |
+
return data;
|
4821 |
+
}
|
4822 |
+
|
4823 |
+
// Do a recursive check for options with children
|
4824 |
+
if (data.children && data.children.length > 0) {
|
4825 |
+
// Clone the data object if there are children
|
4826 |
+
// This is required as we modify the object to remove any non-matches
|
4827 |
+
var match = $.extend(true, {}, data);
|
4828 |
+
|
4829 |
+
// Check each child of the option
|
4830 |
+
for (var c = data.children.length - 1; c >= 0; c--) {
|
4831 |
+
var child = data.children[c];
|
4832 |
+
|
4833 |
+
var matches = matcher(params, child);
|
4834 |
+
|
4835 |
+
// If there wasn't a match, remove the object in the array
|
4836 |
+
if (matches == null) {
|
4837 |
+
match.children.splice(c, 1);
|
4838 |
+
}
|
4839 |
+
}
|
4840 |
+
|
4841 |
+
// If any children matched, return the new object
|
4842 |
+
if (match.children.length > 0) {
|
4843 |
+
return match;
|
4844 |
+
}
|
4845 |
+
|
4846 |
+
// If there were no matching children, check just the plain object
|
4847 |
+
return matcher(params, match);
|
4848 |
+
}
|
4849 |
+
|
4850 |
+
var original = stripDiacritics(data.text).toUpperCase();
|
4851 |
+
var term = stripDiacritics(params.term).toUpperCase();
|
4852 |
+
|
4853 |
+
// Check if the text contains the term
|
4854 |
+
if (original.indexOf(term) > -1) {
|
4855 |
+
return data;
|
4856 |
+
}
|
4857 |
+
|
4858 |
+
// If it doesn't contain the term, don't return anything
|
4859 |
+
return null;
|
4860 |
+
}
|
4861 |
+
|
4862 |
+
this.defaults = {
|
4863 |
+
amdBase: './',
|
4864 |
+
amdLanguageBase: './i18n/',
|
4865 |
+
closeOnSelect: true,
|
4866 |
+
debug: false,
|
4867 |
+
dropdownAutoWidth: false,
|
4868 |
+
escapeMarkup: Utils.escapeMarkup,
|
4869 |
+
language: EnglishTranslation,
|
4870 |
+
matcher: matcher,
|
4871 |
+
minimumInputLength: 0,
|
4872 |
+
maximumInputLength: 0,
|
4873 |
+
maximumSelectionLength: 0,
|
4874 |
+
minimumResultsForSearch: 0,
|
4875 |
+
selectOnClose: false,
|
4876 |
+
sorter: function (data) {
|
4877 |
+
return data;
|
4878 |
+
},
|
4879 |
+
templateResult: function (result) {
|
4880 |
+
return result.text;
|
4881 |
+
},
|
4882 |
+
templateSelection: function (selection) {
|
4883 |
+
return selection.text;
|
4884 |
+
},
|
4885 |
+
theme: 'default',
|
4886 |
+
width: 'resolve'
|
4887 |
+
};
|
4888 |
+
};
|
4889 |
+
|
4890 |
+
Defaults.prototype.set = function (key, value) {
|
4891 |
+
var camelKey = $.camelCase(key);
|
4892 |
+
|
4893 |
+
var data = {};
|
4894 |
+
data[camelKey] = value;
|
4895 |
+
|
4896 |
+
var convertedData = Utils._convertData(data);
|
4897 |
+
|
4898 |
+
$.extend(this.defaults, convertedData);
|
4899 |
+
};
|
4900 |
+
|
4901 |
+
var defaults = new Defaults();
|
4902 |
+
|
4903 |
+
return defaults;
|
4904 |
+
});
|
4905 |
+
|
4906 |
+
S2.define('czrSelect2/options',[
|
4907 |
+
'require',
|
4908 |
+
'jquery',
|
4909 |
+
'./defaults',
|
4910 |
+
'./utils'
|
4911 |
+
], function (require, $, Defaults, Utils) {
|
4912 |
+
function Options (options, $element) {
|
4913 |
+
this.options = options;
|
4914 |
+
|
4915 |
+
if ($element != null) {
|
4916 |
+
this.fromElement($element);
|
4917 |
+
}
|
4918 |
+
|
4919 |
+
this.options = Defaults.apply(this.options);
|
4920 |
+
|
4921 |
+
if ($element && $element.is('input')) {
|
4922 |
+
var InputCompat = require(this.get('amdBase') + 'compat/inputData');
|
4923 |
+
|
4924 |
+
this.options.dataAdapter = Utils.Decorate(
|
4925 |
+
this.options.dataAdapter,
|
4926 |
+
InputCompat
|
4927 |
+
);
|
4928 |
+
}
|
4929 |
+
}
|
4930 |
+
|
4931 |
+
Options.prototype.fromElement = function ($e) {
|
4932 |
+
var excludedData = ['czrSelect2'];
|
4933 |
+
|
4934 |
+
if (this.options.multiple == null) {
|
4935 |
+
this.options.multiple = $e.prop('multiple');
|
4936 |
+
}
|
4937 |
+
|
4938 |
+
if (this.options.disabled == null) {
|
4939 |
+
this.options.disabled = $e.prop('disabled');
|
4940 |
+
}
|
4941 |
+
|
4942 |
+
if (this.options.language == null) {
|
4943 |
+
if ($e.prop('lang')) {
|
4944 |
+
this.options.language = $e.prop('lang').toLowerCase();
|
4945 |
+
} else if ($e.closest('[lang]').prop('lang')) {
|
4946 |
+
this.options.language = $e.closest('[lang]').prop('lang');
|
4947 |
+
}
|
4948 |
+
}
|
4949 |
+
|
4950 |
+
if (this.options.dir == null) {
|
4951 |
+
if ($e.prop('dir')) {
|
4952 |
+
this.options.dir = $e.prop('dir');
|
4953 |
+
} else if ($e.closest('[dir]').prop('dir')) {
|
4954 |
+
this.options.dir = $e.closest('[dir]').prop('dir');
|
4955 |
+
} else {
|
4956 |
+
this.options.dir = 'ltr';
|
4957 |
+
}
|
4958 |
+
}
|
4959 |
+
|
4960 |
+
$e.prop('disabled', this.options.disabled);
|
4961 |
+
$e.prop('multiple', this.options.multiple);
|
4962 |
+
|
4963 |
+
if ($e.data('czrSelect2Tags')) {
|
4964 |
+
if (this.options.debug && window.console && console.warn) {
|
4965 |
+
console.warn(
|
4966 |
+
'CzrSelect2: The `data-czrSelect2-tags` attribute has been changed to ' +
|
4967 |
+
'use the `data-data` and `data-tags="true"` attributes and will be ' +
|
4968 |
+
'removed in future versions of CzrSelect2.'
|
4969 |
+
);
|
4970 |
+
}
|
4971 |
+
|
4972 |
+
$e.data('data', $e.data('czrSelect2Tags'));
|
4973 |
+
$e.data('tags', true);
|
4974 |
+
}
|
4975 |
+
|
4976 |
+
if ($e.data('ajaxUrl')) {
|
4977 |
+
if (this.options.debug && window.console && console.warn) {
|
4978 |
+
console.warn(
|
4979 |
+
'CzrSelect2: The `data-ajax-url` attribute has been changed to ' +
|
4980 |
+
'`data-ajax--url` and support for the old attribute will be removed' +
|
4981 |
+
' in future versions of CzrSelect2.'
|
4982 |
+
);
|
4983 |
+
}
|
4984 |
+
|
4985 |
+
$e.attr('ajax--url', $e.data('ajaxUrl'));
|
4986 |
+
$e.data('ajax--url', $e.data('ajaxUrl'));
|
4987 |
+
}
|
4988 |
+
|
4989 |
+
var dataset = {};
|
4990 |
+
|
4991 |
+
// Prefer the element's `dataset` attribute if it exists
|
4992 |
+
// jQuery 1.x does not correctly handle data attributes with multiple dashes
|
4993 |
+
if ($.fn.jquery && $.fn.jquery.substr(0, 2) == '1.' && $e[0].dataset) {
|
4994 |
+
dataset = $.extend(true, {}, $e[0].dataset, $e.data());
|
4995 |
+
} else {
|
4996 |
+
dataset = $e.data();
|
4997 |
+
}
|
4998 |
+
|
4999 |
+
var data = $.extend(true, {}, dataset);
|
5000 |
+
|
5001 |
+
data = Utils._convertData(data);
|
5002 |
+
|
5003 |
+
for (var key in data) {
|
5004 |
+
if ($.inArray(key, excludedData) > -1) {
|
5005 |
+
continue;
|
5006 |
+
}
|
5007 |
+
|
5008 |
+
if ($.isPlainObject(this.options[key])) {
|
5009 |
+
$.extend(this.options[key], data[key]);
|
5010 |
+
} else {
|
5011 |
+
this.options[key] = data[key];
|
5012 |
+
}
|
5013 |
+
}
|
5014 |
+
|
5015 |
+
return this;
|
5016 |
+
};
|
5017 |
+
|
5018 |
+
Options.prototype.get = function (key) {
|
5019 |
+
return this.options[key];
|
5020 |
+
};
|
5021 |
+
|
5022 |
+
Options.prototype.set = function (key, val) {
|
5023 |
+
this.options[key] = val;
|
5024 |
+
};
|
5025 |
+
|
5026 |
+
return Options;
|
5027 |
+
});
|
5028 |
+
|
5029 |
+
S2.define('czrSelect2/core',[
|
5030 |
+
'jquery',
|
5031 |
+
'./options',
|
5032 |
+
'./utils',
|
5033 |
+
'./keys'
|
5034 |
+
], function ($, Options, Utils, KEYS) {
|
5035 |
+
var CzrSelect2 = function ($element, options) {
|
5036 |
+
if ($element.data('czrSelect2') != null) {
|
5037 |
+
$element.data('czrSelect2').destroy();
|
5038 |
+
}
|
5039 |
+
|
5040 |
+
this.$element = $element;
|
5041 |
+
|
5042 |
+
this.id = this._generateId($element);
|
5043 |
+
|
5044 |
+
options = options || {};
|
5045 |
+
|
5046 |
+
this.options = new Options(options, $element);
|
5047 |
+
|
5048 |
+
CzrSelect2.__super__.constructor.call(this);
|
5049 |
+
|
5050 |
+
// Set up the tabindex
|
5051 |
+
|
5052 |
+
var tabindex = $element.attr('tabindex') || 0;
|
5053 |
+
$element.data('old-tabindex', tabindex);
|
5054 |
+
$element.attr('tabindex', '-1');
|
5055 |
+
|
5056 |
+
// Set up containers and adapters
|
5057 |
+
|
5058 |
+
var DataAdapter = this.options.get('dataAdapter');
|
5059 |
+
this.dataAdapter = new DataAdapter($element, this.options);
|
5060 |
+
|
5061 |
+
var $container = this.render();
|
5062 |
+
|
5063 |
+
this._placeContainer($container);
|
5064 |
+
|
5065 |
+
var SelectionAdapter = this.options.get('selectionAdapter');
|
5066 |
+
this.selection = new SelectionAdapter($element, this.options);
|
5067 |
+
this.$selection = this.selection.render();
|
5068 |
+
|
5069 |
+
this.selection.position(this.$selection, $container);
|
5070 |
+
|
5071 |
+
var DropdownAdapter = this.options.get('dropdownAdapter');
|
5072 |
+
this.dropdown = new DropdownAdapter($element, this.options);
|
5073 |
+
this.$dropdown = this.dropdown.render();
|
5074 |
+
|
5075 |
+
this.dropdown.position(this.$dropdown, $container);
|
5076 |
+
|
5077 |
+
var ResultsAdapter = this.options.get('resultsAdapter');
|
5078 |
+
this.results = new ResultsAdapter($element, this.options, this.dataAdapter);
|
5079 |
+
this.$results = this.results.render();
|
5080 |
+
|
5081 |
+
this.results.position(this.$results, this.$dropdown);
|
5082 |
+
|
5083 |
+
// Bind events
|
5084 |
+
|
5085 |
+
var self = this;
|
5086 |
+
|
5087 |
+
// Bind the container to all of the adapters
|
5088 |
+
this._bindAdapters();
|
5089 |
+
|
5090 |
+
// Register any DOM event handlers
|
5091 |
+
this._registerDomEvents();
|
5092 |
+
|
5093 |
+
// Register any internal event handlers
|
5094 |
+
this._registerDataEvents();
|
5095 |
+
this._registerSelectionEvents();
|
5096 |
+
this._registerDropdownEvents();
|
5097 |
+
this._registerResultsEvents();
|
5098 |
+
this._registerEvents();
|
5099 |
+
|
5100 |
+
// Set the initial state
|
5101 |
+
this.dataAdapter.current(function (initialData) {
|
5102 |
+
self.trigger('selection:update', {
|
5103 |
+
data: initialData
|
5104 |
+
});
|
5105 |
+
});
|
5106 |
+
|
5107 |
+
// Hide the original select
|
5108 |
+
$element.addClass('czrSelect2-hidden-accessible');
|
5109 |
+
$element.attr('aria-hidden', 'true');
|
5110 |
+
|
5111 |
+
// Synchronize any monitored attributes
|
5112 |
+
this._syncAttributes();
|
5113 |
+
|
5114 |
+
$element.data('czrSelect2', this);
|
5115 |
+
};
|
5116 |
+
|
5117 |
+
Utils.Extend(CzrSelect2, Utils.Observable);
|
5118 |
+
|
5119 |
+
CzrSelect2.prototype._generateId = function ($element) {
|
5120 |
+
var id = '';
|
5121 |
+
|
5122 |
+
if ($element.attr('id') != null) {
|
5123 |
+
id = $element.attr('id');
|
5124 |
+
} else if ($element.attr('name') != null) {
|
5125 |
+
id = $element.attr('name') + '-' + Utils.generateChars(2);
|
5126 |
+
} else {
|
5127 |
+
id = Utils.generateChars(4);
|
5128 |
+
}
|
5129 |
+
|
5130 |
+
id = id.replace(/(:|\.|\[|\]|,)/g, '');
|
5131 |
+
id = 'czrSelect2-' + id;
|
5132 |
+
|
5133 |
+
return id;
|
5134 |
+
};
|
5135 |
+
|
5136 |
+
CzrSelect2.prototype._placeContainer = function ($container) {
|
5137 |
+
$container.insertAfter(this.$element);
|
5138 |
+
|
5139 |
+
var width = this._resolveWidth(this.$element, this.options.get('width'));
|
5140 |
+
|
5141 |
+
if (width != null) {
|
5142 |
+
$container.css('width', width);
|
5143 |
+
}
|
5144 |
+
};
|
5145 |
+
|
5146 |
+
CzrSelect2.prototype._resolveWidth = function ($element, method) {
|
5147 |
+
var WIDTH = /^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;
|
5148 |
+
|
5149 |
+
if (method == 'resolve') {
|
5150 |
+
var styleWidth = this._resolveWidth($element, 'style');
|
5151 |
+
|
5152 |
+
if (styleWidth != null) {
|
5153 |
+
return styleWidth;
|
5154 |
+
}
|
5155 |
+
|
5156 |
+
return this._resolveWidth($element, 'element');
|
5157 |
+
}
|
5158 |
+
|
5159 |
+
if (method == 'element') {
|
5160 |
+
var elementWidth = $element.outerWidth(false);
|
5161 |
+
|
5162 |
+
if (elementWidth <= 0) {
|
5163 |
+
return 'auto';
|
5164 |
+
}
|
5165 |
+
|
5166 |
+
return elementWidth + 'px';
|
5167 |
+
}
|
5168 |
+
|
5169 |
+
if (method == 'style') {
|
5170 |
+
var style = $element.attr('style');
|
5171 |
+
|
5172 |
+
if (typeof(style) !== 'string') {
|
5173 |
+
return null;
|
5174 |
+
}
|
5175 |
+
|
5176 |
+
var attrs = style.split(';');
|
5177 |
+
|
5178 |
+
for (var i = 0, l = attrs.length; i < l; i = i + 1) {
|
5179 |
+
var attr = attrs[i].replace(/\s/g, '');
|
5180 |
+
var matches = attr.match(WIDTH);
|
5181 |
+
|
5182 |
+
if (matches !== null && matches.length >= 1) {
|
5183 |
+
return matches[1];
|
5184 |
+
}
|
5185 |
+
}
|
5186 |
+
|
5187 |
+
return null;
|
5188 |
+
}
|
5189 |
+
|
5190 |
+
return method;
|
5191 |
+
};
|
5192 |
+
|
5193 |
+
CzrSelect2.prototype._bindAdapters = function () {
|
5194 |
+
this.dataAdapter.bind(this, this.$container);
|
5195 |
+
this.selection.bind(this, this.$container);
|
5196 |
+
|
5197 |
+
this.dropdown.bind(this, this.$container);
|
5198 |
+
this.results.bind(this, this.$container);
|
5199 |
+
};
|
5200 |
+
|
5201 |
+
CzrSelect2.prototype._registerDomEvents = function () {
|
5202 |
+
var self = this;
|
5203 |
+
|
5204 |
+
this.$element.on('change.czrSelect2', function () {
|
5205 |
+
self.dataAdapter.current(function (data) {
|
5206 |
+
self.trigger('selection:update', {
|
5207 |
+
data: data
|
5208 |
+
});
|
5209 |
+
});
|
5210 |
+
});
|
5211 |
+
|
5212 |
+
this.$element.on('focus.czrSelect2', function (evt) {
|
5213 |
+
self.trigger('focus', evt);
|
5214 |
+
});
|
5215 |
+
|
5216 |
+
this._syncA = Utils.bind(this._syncAttributes, this);
|
5217 |
+
this._syncS = Utils.bind(this._syncSubtree, this);
|
5218 |
+
|
5219 |
+
if (this.$element[0].attachEvent) {
|
5220 |
+
this.$element[0].attachEvent('onpropertychange', this._syncA);
|
5221 |
+
}
|
5222 |
+
|
5223 |
+
var observer = window.MutationObserver ||
|
5224 |
+
window.WebKitMutationObserver ||
|
5225 |
+
window.MozMutationObserver
|
5226 |
+
;
|
5227 |
+
|
5228 |
+
if (observer != null) {
|
5229 |
+
this._observer = new observer(function (mutations) {
|
5230 |
+
$.each(mutations, self._syncA);
|
5231 |
+
$.each(mutations, self._syncS);
|
5232 |
+
});
|
5233 |
+
this._observer.observe(this.$element[0], {
|
5234 |
+
attributes: true,
|
5235 |
+
childList: true,
|
5236 |
+
subtree: false
|
5237 |
+
});
|
5238 |
+
} else if (this.$element[0].addEventListener) {
|
5239 |
+
this.$element[0].addEventListener(
|
5240 |
+
'DOMAttrModified',
|
5241 |
+
self._syncA,
|
5242 |
+
false
|
5243 |
+
);
|
5244 |
+
this.$element[0].addEventListener(
|
5245 |
+
'DOMNodeInserted',
|
5246 |
+
self._syncS,
|
5247 |
+
false
|
5248 |
+
);
|
5249 |
+
this.$element[0].addEventListener(
|
5250 |
+
'DOMNodeRemoved',
|
5251 |
+
self._syncS,
|
5252 |
+
false
|
5253 |
+
);
|
5254 |
+
}
|
5255 |
+
};
|
5256 |
+
|
5257 |
+
CzrSelect2.prototype._registerDataEvents = function () {
|
5258 |
+
var self = this;
|
5259 |
+
|
5260 |
+
this.dataAdapter.on('*', function (name, params) {
|
5261 |
+
self.trigger(name, params);
|
5262 |
+
});
|
5263 |
+
};
|
5264 |
+
|
5265 |
+
CzrSelect2.prototype._registerSelectionEvents = function () {
|
5266 |
+
var self = this;
|
5267 |
+
var nonRelayEvents = ['toggle', 'focus'];
|
5268 |
+
|
5269 |
+
this.selection.on('toggle', function () {
|
5270 |
+
self.toggleDropdown();
|
5271 |
+
});
|
5272 |
+
|
5273 |
+
this.selection.on('focus', function (params) {
|
5274 |
+
self.focus(params);
|
5275 |
+
});
|
5276 |
+
|
5277 |
+
this.selection.on('*', function (name, params) {
|
5278 |
+
if ($.inArray(name, nonRelayEvents) !== -1) {
|
5279 |
+
return;
|
5280 |
+
}
|
5281 |
+
|
5282 |
+
self.trigger(name, params);
|
5283 |
+
});
|
5284 |
+
};
|
5285 |
+
|
5286 |
+
CzrSelect2.prototype._registerDropdownEvents = function () {
|
5287 |
+
var self = this;
|
5288 |
+
|
5289 |
+
this.dropdown.on('*', function (name, params) {
|
5290 |
+
self.trigger(name, params);
|
5291 |
+
});
|
5292 |
+
};
|
5293 |
+
|
5294 |
+
CzrSelect2.prototype._registerResultsEvents = function () {
|
5295 |
+
var self = this;
|
5296 |
+
|
5297 |
+
this.results.on('*', function (name, params) {
|
5298 |
+
self.trigger(name, params);
|
5299 |
+
});
|
5300 |
+
};
|
5301 |
+
|
5302 |
+
CzrSelect2.prototype._registerEvents = function () {
|
5303 |
+
var self = this;
|
5304 |
+
|
5305 |
+
this.on('open', function () {
|
5306 |
+
self.$container.addClass('czrSelect2-container--open');
|
5307 |
+
});
|
5308 |
+
|
5309 |
+
this.on('close', function () {
|
5310 |
+
self.$container.removeClass('czrSelect2-container--open');
|
5311 |
+
});
|
5312 |
+
|
5313 |
+
this.on('enable', function () {
|
5314 |
+
self.$container.removeClass('czrSelect2-container--disabled');
|
5315 |
+
});
|
5316 |
+
|
5317 |
+
this.on('disable', function () {
|
5318 |
+
self.$container.addClass('czrSelect2-container--disabled');
|
5319 |
+
});
|
5320 |
+
|
5321 |
+
this.on('blur', function () {
|
5322 |
+
self.$container.removeClass('czrSelect2-container--focus');
|
5323 |
+
});
|
5324 |
+
|
5325 |
+
this.on('query', function (params) {
|
5326 |
+
if (!self.isOpen()) {
|
5327 |
+
self.trigger('open', {});
|
5328 |
+
}
|
5329 |
+
|
5330 |
+
this.dataAdapter.query(params, function (data) {
|
5331 |
+
self.trigger('results:all', {
|
5332 |
+
data: data,
|
5333 |
+
query: params
|
5334 |
+
});
|
5335 |
+
});
|
5336 |
+
});
|
5337 |
+
|
5338 |
+
this.on('query:append', function (params) {
|
5339 |
+
this.dataAdapter.query(params, function (data) {
|
5340 |
+
self.trigger('results:append', {
|
5341 |
+
data: data,
|
5342 |
+
query: params
|
5343 |
+
});
|
5344 |
+
});
|
5345 |
+
});
|
5346 |
+
|
5347 |
+
this.on('keypress', function (evt) {
|
5348 |
+
var key = evt.which;
|
5349 |
+
|
5350 |
+
if (self.isOpen()) {
|
5351 |
+
if (key === KEYS.ESC || key === KEYS.TAB ||
|
5352 |
+
(key === KEYS.UP && evt.altKey)) {
|
5353 |
+
self.close();
|
5354 |
+
|
5355 |
+
evt.preventDefault();
|
5356 |
+
} else if (key === KEYS.ENTER) {
|
5357 |
+
self.trigger('results:select', {});
|
5358 |
+
|
5359 |
+
evt.preventDefault();
|
5360 |
+
} else if ((key === KEYS.SPACE && evt.ctrlKey)) {
|
5361 |
+
self.trigger('results:toggle', {});
|
5362 |
+
|
5363 |
+
evt.preventDefault();
|
5364 |
+
} else if (key === KEYS.UP) {
|
5365 |
+
self.trigger('results:previous', {});
|
5366 |
+
|
5367 |
+
evt.preventDefault();
|
5368 |
+
} else if (key === KEYS.DOWN) {
|
5369 |
+
self.trigger('results:next', {});
|
5370 |
+
|
5371 |
+
evt.preventDefault();
|
5372 |
+
}
|
5373 |
+
} else {
|
5374 |
+
if (key === KEYS.ENTER || key === KEYS.SPACE ||
|
5375 |
+
(key === KEYS.DOWN && evt.altKey)) {
|
5376 |
+
self.open();
|
5377 |
+
|
5378 |
+
evt.preventDefault();
|
5379 |
+
}
|
5380 |
+
}
|
5381 |
+
});
|
5382 |
+
};
|
5383 |
+
|
5384 |
+
CzrSelect2.prototype._syncAttributes = function () {
|
5385 |
+
this.options.set('disabled', this.$element.prop('disabled'));
|
5386 |
+
|
5387 |
+
if (this.options.get('disabled')) {
|
5388 |
+
if (this.isOpen()) {
|
5389 |
+
this.close();
|
5390 |
+
}
|
5391 |
+
|
5392 |
+
this.trigger('disable', {});
|
5393 |
+
} else {
|
5394 |
+
this.trigger('enable', {});
|
5395 |
+
}
|
5396 |
+
};
|
5397 |
+
|
5398 |
+
CzrSelect2.prototype._syncSubtree = function (evt, mutations) {
|
5399 |
+
var changed = false;
|
5400 |
+
var self = this;
|
5401 |
+
|
5402 |
+
// Ignore any mutation events raised for elements that aren't options or
|
5403 |
+
// optgroups. This handles the case when the select element is destroyed
|
5404 |
+
if (
|
5405 |
+
evt && evt.target && (
|
5406 |
+
evt.target.nodeName !== 'OPTION' && evt.target.nodeName !== 'OPTGROUP'
|
5407 |
+
)
|
5408 |
+
) {
|
5409 |
+
return;
|
5410 |
+
}
|
5411 |
+
|
5412 |
+
if (!mutations) {
|
5413 |
+
// If mutation events aren't supported, then we can only assume that the
|
5414 |
+
// change affected the selections
|
5415 |
+
changed = true;
|
5416 |
+
} else if (mutations.addedNodes && mutations.addedNodes.length > 0) {
|
5417 |
+
for (var n = 0; n < mutations.addedNodes.length; n++) {
|
5418 |
+
var node = mutations.addedNodes[n];
|
5419 |
+
|
5420 |
+
if (node.selected) {
|
5421 |
+
changed = true;
|
5422 |
+
}
|
5423 |
+
}
|
5424 |
+
} else if (mutations.removedNodes && mutations.removedNodes.length > 0) {
|
5425 |
+
changed = true;
|
5426 |
+
}
|
5427 |
+
|
5428 |
+
// Only re-pull the data if we think there is a change
|
5429 |
+
if (changed) {
|
5430 |
+
this.dataAdapter.current(function (currentData) {
|
5431 |
+
self.trigger('selection:update', {
|
5432 |
+
data: currentData
|
5433 |
+
});
|
5434 |
+
});
|
5435 |
+
}
|
5436 |
+
};
|
5437 |
+
|
5438 |
+
/**
|
5439 |
+
* Override the trigger method to automatically trigger pre-events when
|
5440 |
+
* there are events that can be prevented.
|
5441 |
+
*/
|
5442 |
+
CzrSelect2.prototype.trigger = function (name, args) {
|
5443 |
+
var actualTrigger = CzrSelect2.__super__.trigger;
|
5444 |
+
var preTriggerMap = {
|
5445 |
+
'open': 'opening',
|
5446 |
+
'close': 'closing',
|
5447 |
+
'select': 'selecting',
|
5448 |
+
'unselect': 'unselecting'
|
5449 |
+
};
|
5450 |
+
|
5451 |
+
if (args === undefined) {
|
5452 |
+
args = {};
|
5453 |
+
}
|
5454 |
+
|
5455 |
+
if (name in preTriggerMap) {
|
5456 |
+
var preTriggerName = preTriggerMap[name];
|
5457 |
+
var preTriggerArgs = {
|
5458 |
+
prevented: false,
|
5459 |
+
name: name,
|
5460 |
+
args: args
|
5461 |
+
};
|
5462 |
+
|
5463 |
+
actualTrigger.call(this, preTriggerName, preTriggerArgs);
|
5464 |
+
|
5465 |
+
if (preTriggerArgs.prevented) {
|
5466 |
+
args.prevented = true;
|
5467 |
+
|
5468 |
+
return;
|
5469 |
+
}
|
5470 |
+
}
|
5471 |
+
|
5472 |
+
actualTrigger.call(this, name, args);
|
5473 |
+
};
|
5474 |
+
|
5475 |
+
CzrSelect2.prototype.toggleDropdown = function () {
|
5476 |
+
if (this.options.get('disabled')) {
|
5477 |
+
return;
|
5478 |
+
}
|
5479 |
+
|
5480 |
+
if (this.isOpen()) {
|
5481 |
+
this.close();
|
5482 |
+
} else {
|
5483 |
+
this.open();
|
5484 |
+
}
|
5485 |
+
};
|
5486 |
+
|
5487 |
+
CzrSelect2.prototype.open = function () {
|
5488 |
+
if (this.isOpen()) {
|
5489 |
+
return;
|
5490 |
+
}
|
5491 |
+
|
5492 |
+
this.trigger('query', {});
|
5493 |
+
};
|
5494 |
+
|
5495 |
+
CzrSelect2.prototype.close = function () {
|
5496 |
+
if (!this.isOpen()) {
|
5497 |
+
return;
|
5498 |
+
}
|
5499 |
+
|
5500 |
+
this.trigger('close', {});
|
5501 |
+
};
|
5502 |
+
|
5503 |
+
CzrSelect2.prototype.isOpen = function () {
|
5504 |
+
return this.$container.hasClass('czrSelect2-container--open');
|
5505 |
+
};
|
5506 |
+
|
5507 |
+
CzrSelect2.prototype.hasFocus = function () {
|
5508 |
+
return this.$container.hasClass('czrSelect2-container--focus');
|
5509 |
+
};
|
5510 |
+
|
5511 |
+
CzrSelect2.prototype.focus = function (data) {
|
5512 |
+
// No need to re-trigger focus events if we are already focused
|
5513 |
+
if (this.hasFocus()) {
|
5514 |
+
return;
|
5515 |
+
}
|
5516 |
+
|
5517 |
+
this.$container.addClass('czrSelect2-container--focus');
|
5518 |
+
this.trigger('focus', {});
|
5519 |
+
};
|
5520 |
+
|
5521 |
+
CzrSelect2.prototype.enable = function (args) {
|
5522 |
+
if (this.options.get('debug') && window.console && console.warn) {
|
5523 |
+
console.warn(
|
5524 |
+
'CzrSelect2: The `czrSelect2("enable")` method has been deprecated and will' +
|
5525 |
+
' be removed in later CzrSelect2 versions. Use $element.prop("disabled")' +
|
5526 |
+
' instead.'
|
5527 |
+
);
|
5528 |
+
}
|
5529 |
+
|
5530 |
+
if (args == null || args.length === 0) {
|
5531 |
+
args = [true];
|
5532 |
+
}
|
5533 |
+
|
5534 |
+
var disabled = !args[0];
|
5535 |
+
|
5536 |
+
this.$element.prop('disabled', disabled);
|
5537 |
+
};
|
5538 |
+
|
5539 |
+
CzrSelect2.prototype.data = function () {
|
5540 |
+
if (this.options.get('debug') &&
|
5541 |
+
arguments.length > 0 && window.console && console.warn) {
|
5542 |
+
console.warn(
|
5543 |
+
'CzrSelect2: Data can no longer be set using `czrSelect2("data")`. You ' +
|
5544 |
+
'should consider setting the value instead using `$element.val()`.'
|
5545 |
+
);
|
5546 |
+
}
|
5547 |
+
|
5548 |
+
var data = [];
|
5549 |
+
|
5550 |
+
this.dataAdapter.current(function (currentData) {
|
5551 |
+
data = currentData;
|
5552 |
+
});
|
5553 |
+
|
5554 |
+
return data;
|
5555 |
+
};
|
5556 |
+
|
5557 |
+
CzrSelect2.prototype.val = function (args) {
|
5558 |
+
if (this.options.get('debug') && window.console && console.warn) {
|
5559 |
+
console.warn(
|
5560 |
+
'CzrSelect2: The `czrSelect2("val")` method has been deprecated and will be' +
|
5561 |
+
' removed in later CzrSelect2 versions. Use $element.val() instead.'
|
5562 |
+
);
|
5563 |
+
}
|
5564 |
+
|
5565 |
+
if (args == null || args.length === 0) {
|
5566 |
+
return this.$element.val();
|
5567 |
+
}
|
5568 |
+
|
5569 |
+
var newVal = args[0];
|
5570 |
+
|
5571 |
+
if ($.isArray(newVal)) {
|
5572 |
+
newVal = $.map(newVal, function (obj) {
|
5573 |
+
return obj.toString();
|
5574 |
+
});
|
5575 |
+
}
|
5576 |
+
|
5577 |
+
this.$element.val(newVal).trigger('change');
|
5578 |
+
};
|
5579 |
+
|
5580 |
+
CzrSelect2.prototype.destroy = function () {
|
5581 |
+
this.$container.remove();
|
5582 |
+
|
5583 |
+
if (this.$element[0].detachEvent) {
|
5584 |
+
this.$element[0].detachEvent('onpropertychange', this._syncA);
|
5585 |
+
}
|
5586 |
+
|
5587 |
+
if (this._observer != null) {
|
5588 |
+
this._observer.disconnect();
|
5589 |
+
this._observer = null;
|
5590 |
+
} else if (this.$element[0].removeEventListener) {
|
5591 |
+
this.$element[0]
|
5592 |
+
.removeEventListener('DOMAttrModified', this._syncA, false);
|
5593 |
+
this.$element[0]
|
5594 |
+
.removeEventListener('DOMNodeInserted', this._syncS, false);
|
5595 |
+
this.$element[0]
|
5596 |
+
.removeEventListener('DOMNodeRemoved', this._syncS, false);
|
5597 |
+
}
|
5598 |
+
|
5599 |
+
this._syncA = null;
|
5600 |
+
this._syncS = null;
|
5601 |
+
|
5602 |
+
this.$element.off('.czrSelect2');
|
5603 |
+
this.$element.attr('tabindex', this.$element.data('old-tabindex'));
|
5604 |
+
|
5605 |
+
this.$element.removeClass('czrSelect2-hidden-accessible');
|
5606 |
+
this.$element.attr('aria-hidden', 'false');
|
5607 |
+
this.$element.removeData('czrSelect2');
|
5608 |
+
|
5609 |
+
this.dataAdapter.destroy();
|
5610 |
+
this.selection.destroy();
|
5611 |
+
this.dropdown.destroy();
|
5612 |
+
this.results.destroy();
|
5613 |
+
|
5614 |
+
this.dataAdapter = null;
|
5615 |
+
this.selection = null;
|
5616 |
+
this.dropdown = null;
|
5617 |
+
this.results = null;
|
5618 |
+
};
|
5619 |
+
|
5620 |
+
CzrSelect2.prototype.render = function () {
|
5621 |
+
var $container = $(
|
5622 |
+
'<span class="czrSelect2 czrSelect2-container">' +
|
5623 |
+
'<span class="selection"></span>' +
|
5624 |
+
'<span class="dropdown-wrapper" aria-hidden="true"></span>' +
|
5625 |
+
'</span>'
|
5626 |
+
);
|
5627 |
+
|
5628 |
+
$container.attr('dir', this.options.get('dir'));
|
5629 |
+
|
5630 |
+
this.$container = $container;
|
5631 |
+
|
5632 |
+
this.$container.addClass('czrSelect2-container--' + this.options.get('theme'));
|
5633 |
+
|
5634 |
+
$container.data('element', this.$element);
|
5635 |
+
|
5636 |
+
return $container;
|
5637 |
+
};
|
5638 |
+
|
5639 |
+
return CzrSelect2;
|
5640 |
+
});
|
5641 |
+
|
5642 |
+
S2.define('jquery-mousewheel',[
|
5643 |
+
'jquery'
|
5644 |
+
], function ($) {
|
5645 |
+
// Used to shim jQuery.mousewheel for non-full builds.
|
5646 |
+
return $;
|
5647 |
+
});
|
5648 |
+
|
5649 |
+
S2.define('jquery.czrSelect2',[
|
5650 |
+
'jquery',
|
5651 |
+
'jquery-mousewheel',
|
5652 |
+
|
5653 |
+
'./czrSelect2/core',
|
5654 |
+
'./czrSelect2/defaults'
|
5655 |
+
], function ($, _, CzrSelect2, Defaults) {
|
5656 |
+
if ($.fn.czrSelect2 == null) {
|
5657 |
+
// All methods that should return the element
|
5658 |
+
var thisMethods = ['open', 'close', 'destroy'];
|
5659 |
+
|
5660 |
+
$.fn.czrSelect2 = function (options) {
|
5661 |
+
options = options || {};
|
5662 |
+
|
5663 |
+
if (typeof options === 'object') {
|
5664 |
+
this.each(function () {
|
5665 |
+
var instanceOptions = $.extend(true, {}, options);
|
5666 |
+
|
5667 |
+
var instance = new CzrSelect2($(this), instanceOptions);
|
5668 |
+
});
|
5669 |
+
|
5670 |
+
return this;
|
5671 |
+
} else if (typeof options === 'string') {
|
5672 |
+
var ret;
|
5673 |
+
var args = Array.prototype.slice.call(arguments, 1);
|
5674 |
+
|
5675 |
+
this.each(function () {
|
5676 |
+
var instance = $(this).data('czrSelect2');
|
5677 |
+
|
5678 |
+
if (instance == null && window.console && console.error) {
|
5679 |
+
console.error(
|
5680 |
+
'The czrSelect2(\'' + options + '\') method was called on an ' +
|
5681 |
+
'element that is not using CzrSelect2.'
|
5682 |
+
);
|
5683 |
+
}
|
5684 |
+
|
5685 |
+
ret = instance[options].apply(instance, args);
|
5686 |
+
});
|
5687 |
+
|
5688 |
+
// Check if we should be returning `this`
|
5689 |
+
if ($.inArray(options, thisMethods) > -1) {
|
5690 |
+
return this;
|
5691 |
+
}
|
5692 |
+
|
5693 |
+
return ret;
|
5694 |
+
} else {
|
5695 |
+
throw new Error('Invalid arguments for CzrSelect2: ' + options);
|
5696 |
+
}
|
5697 |
+
};
|
5698 |
+
}
|
5699 |
+
|
5700 |
+
if ($.fn.czrSelect2.defaults == null) {
|
5701 |
+
$.fn.czrSelect2.defaults = Defaults;
|
5702 |
+
}
|
5703 |
+
|
5704 |
+
return CzrSelect2;
|
5705 |
+
});
|
5706 |
+
|
5707 |
+
// Return the AMD loader configuration so it can be used outside of this file
|
5708 |
+
return {
|
5709 |
+
define: S2.define,
|
5710 |
+
require: S2.require
|
5711 |
+
};
|
5712 |
+
}());
|
5713 |
+
|
5714 |
+
// Autoload the jQuery bindings
|
5715 |
+
// We know that all of the modules exist above this, so we're safe
|
5716 |
+
var czrSelect2 = S2.require('jquery.czrSelect2');
|
5717 |
+
|
5718 |
+
// Hold the AMD module references on the jQuery function that was just loaded
|
5719 |
+
// This allows CzrSelect2 to use the internal loader outside of this file, such
|
5720 |
+
// as in the language files.
|
5721 |
+
jQuery.fn.czrSelect2.amd = S2;
|
5722 |
+
|
5723 |
+
// Return the CzrSelect2 instance for anyone who is importing it.
|
5724 |
+
return czrSelect2;
|
5725 |
+
}));
|
assets/czr/fmk/js/base-fmk/lib/czrSelect2.min.js
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
* CzrSelect2 namespaced version of Select2 4.0.3
|
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(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?e(require("jquery")):e(jQuery)}(function(e){var t=function(){if(e&&e.fn&&e.fn.czrSelect2&&e.fn.czrSelect2.amd)var t=e.fn.czrSelect2.amd;var n,r,i;return t&&t.requirejs||(t?r=t:t={},function(e){var t,o,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,r,i,o,s,a,l,c,d,p,h,g=t&&t.split("/"),m=u.map,v=m&&m["*"]||{};if(e&&"."===e.charAt(0))if(t){for(s=(e=e.split("/")).length-1,u.nodeIdCompat&&f.test(e[s])&&(e[s]=e[s].replace(f,"")),e=g.slice(0,g.length-1).concat(e),d=0;d<e.length;d+=1)if("."===(h=e[d]))e.splice(d,1),d-=1;else if(".."===h){if(1===d&&(".."===e[2]||".."===e[0]))break;d>0&&(e.splice(d-1,2),d-=2)}e=e.join("/")}else 0===e.indexOf("./")&&(e=e.substring(2));if((g||v)&&m){for(d=(n=e.split("/")).length;d>0;d-=1){if(r=n.slice(0,d).join("/"),g)for(p=g.length;p>0;p-=1)if((i=m[g.slice(0,p).join("/")])&&(i=i[r])){o=i,a=d;break}if(o)break;!l&&v&&v[r]&&(l=v[r],c=d)}!o&&l&&(o=l,a=c),o&&(n.splice(0,a,o),e=n.join("/"))}return e}function v(t,n){return function(){var r=h.call(arguments,0);return"string"!=typeof r[0]&&1===r.length&&r.push(null),o.apply(e,r.concat([t,n]))}}function y(e){return function(t){l[e]=t}}function _(n){if(g(c,n)){var r=c[n];delete c[n],d[n]=!0,t.apply(e,r)}if(!g(l,n)&&!g(d,n))throw new Error("No "+n);return l[n]}function S(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]}s=function(e,t){var n,r=S(e),i=r[0];return e=r[1],i&&(n=_(i=m(i,t))),i?e=n&&n.normalize?n.normalize(e,function(e){return function(t){return m(t,e)}}(t)):m(e,t):(i=(r=S(e=m(e,t)))[0],e=r[1],i&&(n=_(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:function(e){return function(){return u&&u.config&&u.config[e]||{}}}(e)}}},t=function(t,n,r,i){var o,u,p,h,f,m,S=[],$=typeof r;if(i=i||t,"undefined"===$||"function"===$){for(n=!n.length&&r.length?["require","exports","module"]:n,f=0;f<n.length;f+=1)if("require"===(u=(h=s(n[f],i)).f))S[f]=a.require(t);else if("exports"===u)S[f]=a.exports(t),m=!0;else if("module"===u)o=S[f]=a.module(t);else if(g(l,u)||g(c,u)||g(d,u))S[f]=_(u);else{if(!h.p)throw new Error(t+" missing "+u);h.p.load(h.n,v(i,!0),y(u),{}),S[f]=l[u]}p=r?r.apply(l[t],S):void 0,t&&(o&&o.exports!==e&&o.exports!==l[t]?l[t]=o.exports:p===e&&m||(l[t]=p))}else t&&(l[t]=r)},n=r=o=function(n,r,i,l,c){if("string"==typeof n)return a[n]?a[n](r):_(s(n,r).f);if(!n.splice){if((u=n).deps&&o(u.deps,u.callback),!r)return;r.splice?(n=r,r=i,i=null):n=e}return r=r||function(){},"function"==typeof i&&(i=l,l=c),l?t(e,n,r,i):setTimeout(function(){t(e,n,r,i)},4),o},o.config=function(e){return o(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=r,t.define=i),t.define("almond",function(){}),t.define("jquery",[],function(){var t=e||$;return null==t&&console&&console.error&&console.error("CzrSelect2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before CzrSelect2 on your web page."),t}),t.define("czrSelect2/utils",["jquery"],function(e){var t={};function n(e){var t=e.prototype,n=[];for(var r in t){"function"==typeof t[r]&&("constructor"!==r&&n.push(r))}return n}t.Extend=function(e,t){var n={}.hasOwnProperty;function r(){this.constructor=e}for(var i in t)n.call(t,i)&&(e[i]=t[i]);return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e},t.Decorate=function(e,t){var r=n(t),i=n(e);function o(){var n=Array.prototype.unshift,r=t.prototype.constructor.length,i=e.prototype.constructor;r>0&&(n.call(arguments,e.prototype.constructor),i=t.prototype.constructor),i.apply(this,arguments)}t.displayName=e.displayName,o.prototype=new function(){this.constructor=o};for(var s=0;s<i.length;s++){var a=i[s];o.prototype[a]=e.prototype[a]}for(var l=function(e){var n=function(){};e in o.prototype&&(n=o.prototype[e]);var r=t.prototype[e];return function(){return Array.prototype.unshift.call(arguments,n),r.apply(this,arguments)}},c=0;c<r.length;c++){var u=r[c];o.prototype[u]=l(u)}return o};var r=function(){this.listeners={}};return r.prototype.on=function(e,t){this.listeners=this.listeners||{},e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t]},r.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)},r.prototype.invoke=function(e,t){for(var n=0,r=e.length;n<r;n++)e[n].apply(this,t)},t.Observable=r,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("-"),r=e;if(1!==n.length){for(var i=0;i<n.length;i++){var o=n[i];(o=o.substring(0,1).toLowerCase()+o.substring(1))in r||(r[o]={}),i==n.length-1&&(r[o]=e[t]),r=r[o]}delete e[t]}}return e},t.hasScroll=function(t,n){var r=e(n),i=n.style.overflowX,o=n.style.overflowY;return(i!==o||"hidden"!==o&&"visible"!==o)&&("scroll"===i||"scroll"===o||(r.innerHeight()<n.scrollHeight||r.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 r=e();e.map(n,function(e){r=r.add(e)}),n=r}t.append(n)},t}),t.define("czrSelect2/results",["jquery","./utils"],function(e,t){function n(e,t,r){this.$element=e,this.data=r,this.options=t,n.__super__.constructor.call(this)}return t.Extend(n,t.Observable),n.prototype.render=function(){var t=e('<ul class="czrSelect2-results__options" role="tree"></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 r=e('<li role="treeitem" aria-live="assertive" class="czrSelect2-results__option"></li>'),i=this.options.get("translations").get(t.message);r.append(n(i(t.args))),r[0].className+=" czrSelect2-results__message",this.$results.append(r)},n.prototype.hideMessages=function(){this.$results.find(".czrSelect2-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 r=e.results[n],i=this.option(r);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(".czrSelect2-results").append(e)},n.prototype.sort=function(e){return this.options.get("sorter")(e)},n.prototype.highlightFirstItem=function(){var e=this.$results.find(".czrSelect2-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 t=this;this.data.current(function(n){var r=e.map(n,function(e){return e.id.toString()});t.$results.find(".czrSelect2-results__option[aria-selected]").each(function(){var t=e(this),n=e.data(this,"data"),i=""+n.id;null!=n.element&&n.element.selected||null==n.element&&e.inArray(i,r)>-1?t.attr("aria-selected","true"):t.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(t){var n=document.createElement("li");n.className="czrSelect2-results__option";var r={role:"treeitem","aria-selected":"false"};for(var i in t.disabled&&(delete r["aria-selected"],r["aria-disabled"]="true"),null==t.id&&delete r["aria-selected"],null!=t._resultId&&(n.id=t._resultId),t.title&&(n.title=t.title),t.children&&(r.role="group",r["aria-label"]=t.text,delete r["aria-selected"]),r){var o=r[i];n.setAttribute(i,o)}if(t.children){var s=e(n),a=document.createElement("strong");a.className="czrSelect2-results__group";e(a);this.template(t,a);for(var l=[],c=0;c<t.children.length;c++){var u=t.children[c],d=this.option(u);l.push(d)}var p=e("<ul></ul>",{class:"czrSelect2-results__options czrSelect2-results__options--nested"});p.append(l),s.append(a),s.append(p)}else this.template(t,n);return e.data(n,"data",t),n},n.prototype.bind=function(t,n){var r=this,i=t.id+"-results";this.$results.attr("id",i),t.on("results:all",function(e){r.clear(),r.append(e.data),t.isOpen()&&(r.setClasses(),r.highlightFirstItem())}),t.on("results:append",function(e){r.append(e.data),t.isOpen()&&r.setClasses()}),t.on("query",function(e){r.hideMessages(),r.showLoading(e)}),t.on("select",function(){t.isOpen()&&(r.setClasses(),r.highlightFirstItem())}),t.on("unselect",function(){t.isOpen()&&(r.setClasses(),r.highlightFirstItem())}),t.on("open",function(){r.$results.attr("aria-expanded","true"),r.$results.attr("aria-hidden","false"),r.setClasses(),r.ensureHighlightVisible()}),t.on("close",function(){r.$results.attr("aria-expanded","false"),r.$results.attr("aria-hidden","true"),r.$results.removeAttr("aria-activedescendant")}),t.on("results:toggle",function(){var e=r.getHighlightedResults();0!==e.length&&e.trigger("mouseup")}),t.on("results:select",function(){var e=r.getHighlightedResults();if(0!==e.length){var t=e.data("data");"true"==e.attr("aria-selected")?r.trigger("close",{}):r.trigger("select",{data:t})}}),t.on("results:previous",function(){var e=r.getHighlightedResults(),t=r.$results.find("[aria-selected]"),n=t.index(e);if(0!==n){var i=n-1;0===e.length&&(i=0);var o=t.eq(i);o.trigger("mouseenter");var s=r.$results.offset().top,a=o.offset().top,l=r.$results.scrollTop()+(a-s);0===i?r.$results.scrollTop(0):a-s<0&&r.$results.scrollTop(l)}}),t.on("results:next",function(){var e=r.getHighlightedResults(),t=r.$results.find("[aria-selected]"),n=t.index(e)+1;if(!(n>=t.length)){var i=t.eq(n);i.trigger("mouseenter");var o=r.$results.offset().top+r.$results.outerHeight(!1),s=i.offset().top+i.outerHeight(!1),a=r.$results.scrollTop()+s-o;0===n?r.$results.scrollTop(0):s>o&&r.$results.scrollTop(a)}}),t.on("results:focus",function(e){e.element.addClass("czrSelect2-results__option--highlighted")}),t.on("results:message",function(e){r.displayMessage(e)}),e.fn.mousewheel&&this.$results.on("mousewheel",function(e){var t=r.$results.scrollTop(),n=r.$results.get(0).scrollHeight-t+e.deltaY,i=e.deltaY>0&&t-e.deltaY<=0,o=e.deltaY<0&&n<=r.$results.height();i?(r.$results.scrollTop(0),e.preventDefault(),e.stopPropagation()):o&&(r.$results.scrollTop(r.$results.get(0).scrollHeight-r.$results.height()),e.preventDefault(),e.stopPropagation())}),this.$results.on("mouseup",".czrSelect2-results__option[aria-selected]",function(t){var n=e(this),i=n.data("data");"true"!==n.attr("aria-selected")?r.trigger("select",{originalEvent:t,data:i}):r.options.get("multiple")?r.trigger("unselect",{originalEvent:t,data:i}):r.trigger("close",{})}),this.$results.on("mouseenter",".czrSelect2-results__option[aria-selected]",function(t){var n=e(this).data("data");r.getHighlightedResults().removeClass("czrSelect2-results__option--highlighted"),r.trigger("results:focus",{data:n,element:e(this)})})},n.prototype.getHighlightedResults=function(){return this.$results.find(".czrSelect2-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,r=e.offset().top,i=this.$results.scrollTop()+(r-n),o=r-n;i-=2*e.outerHeight(!1),t<=2?this.$results.scrollTop(0):(o>this.$results.outerHeight()||o<0)&&this.$results.scrollTop(i)}},n.prototype.template=function(t,n){var r=this.options.get("templateResult"),i=this.options.get("escapeMarkup"),o=r(t,n);null==o?n.style.display="none":"string"==typeof o?n.innerHTML=i(o):e(n).append(o)},n}),t.define("czrSelect2/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("czrSelect2/selection/base",["jquery","../utils","../keys"],function(e,t,n){function r(e,t){this.$element=e,this.options=t,r.__super__.constructor.call(this)}return t.Extend(r,t.Observable),r.prototype.render=function(){var t=e('<span class="czrSelect2-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")),t.attr("title",this.$element.attr("title")),t.attr("tabindex",this._tabindex),this.$selection=t,t},r.prototype.bind=function(e,t){var r=this,i=(e.id,e.id+"-results");this.container=e,this.$selection.on("focus",function(e){r.trigger("focus",e)}),this.$selection.on("blur",function(e){r._handleBlur(e)}),this.$selection.on("keydown",function(e){r.trigger("keypress",e),e.which===n.SPACE&&e.preventDefault()}),e.on("results:focus",function(e){r.$selection.attr("aria-activedescendant",e.data._resultId)}),e.on("selection:update",function(e){r.update(e.data)}),e.on("open",function(){r.$selection.attr("aria-expanded","true"),r.$selection.attr("aria-owns",i),r._attachCloseHandler(e)}),e.on("close",function(){r.$selection.attr("aria-expanded","false"),r.$selection.removeAttr("aria-activedescendant"),r.$selection.removeAttr("aria-owns"),r.$selection.focus(),r._detachCloseHandler(e)}),e.on("enable",function(){r.$selection.attr("tabindex",r._tabindex)}),e.on("disable",function(){r.$selection.attr("tabindex","-1")})},r.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)},r.prototype._attachCloseHandler=function(t){e(document.body).on("mousedown.czrSelect2."+t.id,function(t){var n=e(t.target).closest(".czrSelect2");e(".czrSelect2.czrSelect2-container--open").each(function(){var t=e(this);this!=n[0]&&t.data("element").czrSelect2("close")})})},r.prototype._detachCloseHandler=function(t){e(document.body).off("mousedown.czrSelect2."+t.id)},r.prototype.position=function(e,t){t.find(".selection").append(e)},r.prototype.destroy=function(){this._detachCloseHandler(this.container)},r.prototype.update=function(e){throw new Error("The `update` method must be defined in child classes.")},r}),t.define("czrSelect2/selection/single",["jquery","./base","../utils","../keys"],function(e,t,n,r){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("czrSelect2-selection--single"),e.html('<span class="czrSelect2-selection__rendered"></span><span class="czrSelect2-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 r=e.id+"-container";this.$selection.find(".czrSelect2-selection__rendered").attr("id",r),this.$selection.attr("aria-labelledby",r),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.focus()}),e.on("selection:update",function(e){n.update(e.data)})},i.prototype.clear=function(){this.$selection.find(".czrSelect2-selection__rendered").empty()},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(".czrSelect2-selection__rendered"),r=this.display(t,n);n.empty().append(r),n.prop("title",t.title||t.text)}else this.clear()},i}),t.define("czrSelect2/selection/multiple",["jquery","./base","../utils"],function(e,t,n){function r(e,t){r.__super__.constructor.apply(this,arguments)}return n.Extend(r,t),r.prototype.render=function(){var e=r.__super__.render.call(this);return e.addClass("czrSelect2-selection--multiple"),e.html('<ul class="czrSelect2-selection__rendered"></ul>'),e},r.prototype.bind=function(t,n){var i=this;r.__super__.bind.apply(this,arguments),this.$selection.on("click",function(e){i.trigger("toggle",{originalEvent:e})}),this.$selection.on("click",".czrSelect2-selection__choice__remove",function(t){if(!i.options.get("disabled")){var n=e(this).parent().data("data");i.trigger("unselect",{originalEvent:t,data:n})}})},r.prototype.clear=function(){this.$selection.find(".czrSelect2-selection__rendered").empty()},r.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},r.prototype.selectionContainer=function(){return e('<li class="czrSelect2-selection__choice"><span class="czrSelect2-selection__choice__remove" role="presentation">×</span></li>')},r.prototype.update=function(e){if(this.clear(),0!==e.length){for(var t=[],r=0;r<e.length;r++){var i=e[r],o=this.selectionContainer(),s=this.display(i,o);o.append(s),o.prop("title",i.title||i.text),o.data("data",i),t.push(o)}var a=this.$selection.find(".czrSelect2-selection__rendered");n.appendMany(a,t)}},r}),t.define("czrSelect2/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("czrSelect2-selection__placeholder").removeClass("czrSelect2-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 r=this.createPlaceholder(this.placeholder);this.$selection.find(".czrSelect2-selection__rendered").append(r)},t}),t.define("czrSelect2/selection/allowClear",["jquery","../keys"],function(e,t){function n(){}return n.prototype.bind=function(e,t,n){var r=this;e.call(this,t,n),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("CzrSelect2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".czrSelect2-selection__clear",function(e){r._handleClear(e)}),t.on("keypress",function(e){r._handleKeyboardClear(e,t)})},n.prototype._handleClear=function(e,t){if(!this.options.get("disabled")){var n=this.$selection.find(".czrSelect2-selection__clear");if(0!==n.length){t.stopPropagation();for(var r=n.data("data"),i=0;i<r.length;i++){var o={data:r[i]};if(this.trigger("unselect",o),o.prevented)return}this.$element.val(this.placeholder.id).trigger("change"),this.trigger("toggle",{})}}},n.prototype._handleKeyboardClear=function(e,n,r){r.isOpen()||n.which!=t.DELETE&&n.which!=t.BACKSPACE||this._handleClear(n)},n.prototype.update=function(t,n){if(t.call(this,n),!(this.$selection.find(".czrSelect2-selection__placeholder").length>0||0===n.length)){var r=e('<span class="czrSelect2-selection__clear">×</span>');r.data("data",n),this.$selection.find(".czrSelect2-selection__rendered").prepend(r)}},n}),t.define("czrSelect2/selection/search",["jquery","../utils","../keys"],function(e,t,n){function r(e,t,n){e.call(this,t,n)}return r.prototype.render=function(t){var n=e('<li class="czrSelect2-search czrSelect2-search--inline"><input class="czrSelect2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" aria-autocomplete="list" /></li>');this.$searchContainer=n,this.$search=n.find("input");var r=t.call(this);return this._transferTabIndex(),r},r.prototype.bind=function(e,t,r){var i=this;e.call(this,t,r),t.on("open",function(){i.$search.trigger("focus")}),t.on("close",function(){i.$search.val(""),i.$search.removeAttr("aria-activedescendant"),i.$search.trigger("focus")}),t.on("enable",function(){i.$search.prop("disabled",!1),i._transferTabIndex()}),t.on("disable",function(){i.$search.prop("disabled",!0)}),t.on("focus",function(e){i.$search.trigger("focus")}),t.on("results:focus",function(e){i.$search.attr("aria-activedescendant",e.id)}),this.$selection.on("focusin",".czrSelect2-search--inline",function(e){i.trigger("focus",e)}),this.$selection.on("focusout",".czrSelect2-search--inline",function(e){i._handleBlur(e)}),this.$selection.on("keydown",".czrSelect2-search--inline",function(e){if(e.stopPropagation(),i.trigger("keypress",e),i._keyUpPrevented=e.isDefaultPrevented(),e.which===n.BACKSPACE&&""===i.$search.val()){var t=i.$searchContainer.prev(".czrSelect2-selection__choice");if(t.length>0){var r=t.data("data");i.searchRemoveChoice(r),e.preventDefault()}}});var o=document.documentMode,s=o&&o<=11;this.$selection.on("input.searchcheck",".czrSelect2-search--inline",function(e){s?i.$selection.off("input.search input.searchcheck"):i.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".czrSelect2-search--inline",function(e){if(s&&"input"===e.type)i.$selection.off("input.search input.searchcheck");else{var t=e.which;t!=n.SHIFT&&t!=n.CTRL&&t!=n.ALT&&t!=n.TAB&&i.handleSearch(e)}})},r.prototype._transferTabIndex=function(e){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},r.prototype.createPlaceholder=function(e,t){this.$search.attr("placeholder",t.text)},r.prototype.update=function(e,t){var n=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),e.call(this,t),this.$selection.find(".czrSelect2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),n&&this.$search.focus()},r.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var e=this.$search.val();this.trigger("query",{term:e})}this._keyUpPrevented=!1},r.prototype.searchRemoveChoice=function(e,t){this.trigger("unselect",{data:t}),this.$search.val(t.text),this.handleSearch()},r.prototype.resizeSearch=function(){this.$search.css("width","25px");var e="";""!==this.$search.attr("placeholder")?e=this.$selection.find(".czrSelect2-selection__rendered").innerWidth():e=.75*(this.$search.val().length+1)+"em";this.$search.css("width",e)},r}),t.define("czrSelect2/selection/eventRelay",["jquery"],function(e){function t(){}return t.prototype.bind=function(t,n,r){var i=this,o=["open","opening","close","closing","select","selecting","unselect","unselecting"],s=["opening","closing","selecting","unselecting"];t.call(this,n,r),n.on("*",function(t,n){if(-1!==e.inArray(t,o)){n=n||{};var r=e.Event("czrSelect2:"+t,{params:n});i.$element.trigger(r),-1!==e.inArray(t,s)&&(n.prevented=r.isDefaultPrevented())}})},t}),t.define("czrSelect2/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 r=t(e);n._cache[e]=r}return new n(n._cache[e])},n}),t.define("czrSelect2/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","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"}}),t.define("czrSelect2/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 r=t.id+"-result-";return r+=e.generateChars(4),null!=n.id?r+="-"+n.id.toString():r+="-"+e.generateChars(4),r},t}),t.define("czrSelect2/data/select",["./base","../utils","jquery"],function(e,t,n){function r(e,t){this.$element=e,this.options=t,r.__super__.constructor.call(this)}return t.Extend(r,e),r.prototype.current=function(e){var t=[],r=this;this.$element.find(":selected").each(function(){var e=n(this),i=r.item(e);t.push(i)}),e(t)},r.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("change");if(this.$element.prop("multiple"))this.current(function(r){var i=[];(e=[e]).push.apply(e,r);for(var o=0;o<e.length;o++){var s=e[o].id;-1===n.inArray(s,i)&&i.push(s)}t.$element.val(i),t.$element.trigger("change")});else{var r=e.id;this.$element.val(r),this.$element.trigger("change")}},r.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("change");this.current(function(r){for(var i=[],o=0;o<r.length;o++){var s=r[o].id;s!==e.id&&-1===n.inArray(s,i)&&i.push(s)}t.$element.val(i),t.$element.trigger("change")})}},r.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)})},r.prototype.destroy=function(){this.$element.find("*").each(function(){n.removeData(this,"data")})},r.prototype.query=function(e,t){var r=[],i=this;this.$element.children().each(function(){var t=n(this);if(t.is("option")||t.is("optgroup")){var o=i.item(t),s=i.matches(e,o);null!==s&&r.push(s)}}),t({results:r})},r.prototype.addOptions=function(e){t.appendMany(this.$element,e)},r.prototype.option=function(e){var t;e.children?(t=document.createElement("optgroup")).label=e.text:void 0!==(t=document.createElement("option")).textContent?t.textContent=e.text:t.innerText=e.text,e.id&&(t.value=e.id),e.disabled&&(t.disabled=!0),e.selected&&(t.selected=!0),e.title&&(t.title=e.title);var r=n(t),i=this._normalizeItem(e);return i.element=t,n.data(t,"data",i),r},r.prototype.item=function(e){var t={};if(null!=(t=n.data(e[0],"data")))return t;if(e.is("option"))t={id:e.val(),text:e.text(),disabled:e.prop("disabled"),selected:e.prop("selected"),title:e.prop("title")};else if(e.is("optgroup")){t={text:e.prop("label"),children:[],title:e.prop("title")};for(var r=e.children("option"),i=[],o=0;o<r.length;o++){var s=n(r[o]),a=this.item(s);i.push(a)}t.children=i}return(t=this._normalizeItem(t)).element=e[0],n.data(e[0],"data",t),t},r.prototype._normalizeItem=function(e){n.isPlainObject(e)||(e={id:e,text:e});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({},{selected:!1,disabled:!1},e)},r.prototype.matches=function(e,t){return this.options.get("matcher")(e,t)},r}),t.define("czrSelect2/data/array",["./select","../utils","jquery"],function(e,t,n){function r(e,t){var n=t.get("data")||[];r.__super__.constructor.call(this,e,t),this.addOptions(this.convertToOptions(n))}return t.Extend(r,e),r.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)),r.__super__.select.call(this,e)},r.prototype.convertToOptions=function(e){var r=this,i=this.$element.find("option"),o=i.map(function(){return r.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,o)>=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},r}),t.define("czrSelect2/data/ajax",["./array","../utils","jquery"],function(e,t,n){function r(e,t){this.ajaxOptions=this._applyDefaults(t.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),r.__super__.constructor.call(this,e,t)}return t.Extend(r,e),r.prototype._applyDefaults=function(e){var t={data:function(e){return n.extend({},e,{q:e.term})},transport:function(e,t,r){var i=n.ajax(e);return i.then(t),i.fail(r),i}};return n.extend({},t,e,!0)},r.prototype.processResults=function(e){return e},r.prototype.query=function(e,t){var r=this;null!=this._request&&("function"==typeof this._request.abort&&this._request.abort(),this._request=null);var i=n.extend({type:"GET"},this.ajaxOptions);function o(){var o=i.transport(i,function(i){var o=r.processResults(i,e);r.options.get("debug")&&window.console&&console.error&&(o&&o.results&&n.isArray(o.results)||console.error("CzrSelect2: The AJAX results did not return an array in the `results` key of the response.")),t(o)},function(){o.status&&"0"===o.status||r.trigger("results:message",{message:"errorLoading"})});r._request=o}"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(o,this.ajaxOptions.delay)):o()},r}),t.define("czrSelect2/data/tags",["jquery"],function(e){function t(t,n,r){var i=r.get("tags"),o=r.get("createTag");void 0!==o&&(this.createTag=o);var s=r.get("insertTag");if(void 0!==s&&(this.insertTag=s),t.call(this,n,r),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 r=this;this._removeOldTags(),null!=t.term&&null==t.page?e.call(this,t,function e(i,o){for(var s=i.results,a=0;a<s.length;a++){var l=s[a],c=null!=l.children&&!e({results:l.children},!0);if(l.text===t.term||c)return!o&&(i.data=s,void n(i))}if(o)return!0;var u=r.createTag(t);if(null!=u){var d=r.option(u);d.attr("data-czrSelect2-tag",!0),r.addOptions([d]),r.insertTag(s,u)}i.results=s,n(i)}):e.call(this,t,n)},t.prototype.createTag=function(e,t){var n="string"==typeof t.term?t.term.trim():"";return""===n?null:{id:n,text:n}},t.prototype.insertTag=function(e,t,n){t.unshift(n)},t.prototype._removeOldTags=function(t){this._lastTag;this.$element.find("option[data-czrSelect2-tag]").each(function(){this.selected||e(this).remove()})},t}),t.define("czrSelect2/data/tokenizer",["jquery"],function(e){function t(e,t,n){var r=n.get("tokenizer");void 0!==r&&(this.tokenizer=r),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(".czrSelect2-search__field")},t.prototype.query=function(t,n,r){var i=this;n.term=n.term||"";var o=this.tokenizer(n,this.options,function(t){var n=i._normalizeItem(t);if(!i.$element.find("option").filter(function(){return e(this).val()===n.id}).length){var r=i.option(n);r.attr("data-czrSelect2-tag",!0),i._removeOldTags(),i.addOptions([r])}!function(e){i.trigger("select",{data:e})}(n)});o.term!==n.term&&(this.$search.length&&(this.$search.val(o.term),this.$search.focus()),n.term=o.term),t.call(this,n,r)},t.prototype.tokenizer=function(t,n,r,i){for(var o=r.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,o)){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("czrSelect2/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("czrSelect2/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("czrSelect2/data/maximumSelectionLength",[],function(){function e(e,t,n){this.maximumSelectionLength=n.get("maximumSelectionLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){var r=this;this.current(function(i){var o=null!=i?i.length:0;r.maximumSelectionLength>0&&o>=r.maximumSelectionLength?r.trigger("results:message",{message:"maximumSelected",args:{maximum:r.maximumSelectionLength}}):e.call(r,t,n)})},e}),t.define("czrSelect2/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="czrSelect2-dropdown"><span class="czrSelect2-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("czrSelect2/dropdown/search",["jquery","../utils"],function(e,t){function n(){}return n.prototype.render=function(t){var n=t.call(this),r=e('<span class="czrSelect2-search czrSelect2-search--dropdown"><input class="czrSelect2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" /></span>');return this.$searchContainer=r,this.$search=r.find("input"),n.prepend(r),n},n.prototype.bind=function(t,n,r){var i=this;t.call(this,n,r),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.focus(),window.setTimeout(function(){i.$search.focus()},0)}),n.on("close",function(){i.$search.attr("tabindex",-1),i.$search.val("")}),n.on("focus",function(){n.isOpen()&&i.$search.focus()}),n.on("results:all",function(e){null!=e.query.term&&""!==e.query.term||(i.showSearch(e)?i.$searchContainer.removeClass("czrSelect2-search--hide"):i.$searchContainer.addClass("czrSelect2-search--hide"))})},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("czrSelect2/dropdown/hidePlaceholder",[],function(){function e(e,t,n,r){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n,r)}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),r=t.length-1;r>=0;r--){var i=t[r];this.placeholder.id===i.id&&n.splice(r,1)}return n},e}),t.define("czrSelect2/dropdown/infiniteScroll",["jquery"],function(e){function t(e,t,n,r){this.lastParams={},e.call(this,t,n,r),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)},t.prototype.bind=function(t,n,r){var i=this;t.call(this,n,r),n.on("query",function(e){i.lastParams=e,i.loading=!0}),n.on("query:append",function(e){i.lastParams=e,i.loading=!0}),this.$results.on("scroll",function(){var t=e.contains(document.documentElement,i.$loadingMore[0]);!i.loading&&t&&(i.$results.offset().top+i.$results.outerHeight(!1)+50>=i.$loadingMore.offset().top+i.$loadingMore.outerHeight(!1)&&i.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="czrSelect2-results__option czrSelect2-results__option--load-more"role="treeitem" aria-disabled="true"></li>'),n=this.options.get("translations").get("loadingMore");return t.html(n(this.lastParams)),t},t}),t.define("czrSelect2/dropdown/attachBody",["jquery","../utils"],function(e,t){function n(t,n,r){this.$dropdownParent=r.get("dropdownParent")||e(document.body),t.call(this,n,r)}return n.prototype.bind=function(e,t,n){var r=this,i=!1;e.call(this,t,n),t.on("open",function(){r._showDropdown(),r._attachPositioningHandler(t),i||(i=!0,t.on("results:all",function(){r._positionDropdown(),r._resizeDropdown()}),t.on("results:append",function(){r._positionDropdown(),r._resizeDropdown()}))}),t.on("close",function(){r._hideDropdown(),r._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("czrSelect2"),t.addClass("czrSelect2-container--open"),t.css({position:"absolute",top:-999999}),this.$container=n},n.prototype.render=function(t){var n=e("<span></span>"),r=t.call(this);return n.append(r),this.$dropdownContainer=n,n},n.prototype._hideDropdown=function(e){this.$dropdownContainer.detach()},n.prototype._attachPositioningHandler=function(n,r){var i=this,o="scroll.czrSelect2."+r.id,s="resize.czrSelect2."+r.id,a="orientationchange.czrSelect2."+r.id,l=this.$container.parents().filter(t.hasScroll);l.each(function(){e(this).data("czrSelect2-scroll-position",{x:e(this).scrollLeft(),y:e(this).scrollTop()})}),l.on(o,function(t){var n=e(this).data("czrSelect2-scroll-position");e(this).scrollTop(n.y)}),e(window).on(o+" "+s+" "+a,function(e){i._positionDropdown(),i._resizeDropdown()})},n.prototype._detachPositioningHandler=function(n,r){var i="scroll.czrSelect2."+r.id,o="resize.czrSelect2."+r.id,s="orientationchange.czrSelect2."+r.id;this.$container.parents().filter(t.hasScroll).off(i),e(window).off(i+" "+o+" "+s)},n.prototype._positionDropdown=function(){var t=e(window),n=this.$dropdown.hasClass("czrSelect2-dropdown--above"),r=this.$dropdown.hasClass("czrSelect2-dropdown--below"),i=null,o=this.$container.offset();o.bottom=o.top+this.$container.outerHeight(!1);var s={height:this.$container.outerHeight(!1)};s.top=o.top,s.bottom=o.top+s.height;var a=this.$dropdown.outerHeight(!1),l=t.scrollTop(),c=t.scrollTop()+t.height(),u=l<o.top-a,d=c>o.bottom+a,p={left:o.left,top:s.bottom},h=this.$dropdownParent;"static"===h.css("position")&&(h=h.offsetParent());var f=h.offset();p.top-=f.top,p.left-=f.left,n||r||(i="below"),d||!u||n?!u&&d&&n&&(i="below"):i="above",("above"==i||n&&"below"!==i)&&(p.top=s.top-f.top-a),null!=i&&(this.$dropdown.removeClass("czrSelect2-dropdown--below czrSelect2-dropdown--above").addClass("czrSelect2-dropdown--"+i),this.$container.removeClass("czrSelect2-container--below czrSelect2-container--above").addClass("czrSelect2-container--"+i)),this.$dropdownContainer.css(p)},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("czrSelect2/dropdown/minimumResultsForSearch",[],function(){function e(e,t,n,r){this.minimumResultsForSearch=n.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),e.call(this,t,n,r)}return e.prototype.showSearch=function(e,t){return!(function e(t){for(var n=0,r=0;r<t.length;r++){var i=t[r];i.children?n+=e(i.children):n++}return n}(t.data.results)<this.minimumResultsForSearch)&&e.call(this,t)},e}),t.define("czrSelect2/dropdown/selectOnClose",[],function(){function e(){}return e.prototype.bind=function(e,t,n){var r=this;e.call(this,t,n),t.on("close",function(e){r._handleSelectOnClose(e)})},e.prototype._handleSelectOnClose=function(e,t){if(t&&null!=t.originalCzrSelect2Event){var n=t.originalCzrSelect2Event;if("select"===n._type||"unselect"===n._type)return}var r=this.getHighlightedResults();if(!(r.length<1)){var i=r.data("data");null!=i.element&&i.element.selected||null==i.element&&i.selected||this.trigger("select",{data:i})}},e}),t.define("czrSelect2/dropdown/closeOnSelect",[],function(){function e(){}return e.prototype.bind=function(e,t,n){var r=this;e.call(this,t,n),t.on("select",function(e){r._selectTriggered(e)}),t.on("unselect",function(e){r._selectTriggered(e)})},e.prototype._selectTriggered=function(e,t){var n=t.originalEvent;n&&n.ctrlKey||this.trigger("close",{originalEvent:n,originalCzrSelect2Event:t})},e}),t.define("czrSelect2/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…"}}}),t.define("czrSelect2/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,r,i,o,s,a,l,c,u,d,p,h,f,g,m,v,y,_,S,$,w,b,z,A,x,C,E){function O(){this.reset()}return O.prototype.apply=function(d){if(null==(d=e.extend(!0,{},this.defaults,d)).dataAdapter){if(null!=d.ajax?d.dataAdapter=f:null!=d.data?d.dataAdapter=h:d.dataAdapter=p,d.minimumInputLength>0&&(d.dataAdapter=c.Decorate(d.dataAdapter,v)),d.maximumInputLength>0&&(d.dataAdapter=c.Decorate(d.dataAdapter,y)),d.maximumSelectionLength>0&&(d.dataAdapter=c.Decorate(d.dataAdapter,_)),d.tags&&(d.dataAdapter=c.Decorate(d.dataAdapter,g)),null==d.tokenSeparators&&null==d.tokenizer||(d.dataAdapter=c.Decorate(d.dataAdapter,m)),null!=d.query){var E=t(d.amdBase+"compat/query");d.dataAdapter=c.Decorate(d.dataAdapter,E)}if(null!=d.initSelection){var O=t(d.amdBase+"compat/initSelection");d.dataAdapter=c.Decorate(d.dataAdapter,O)}}if(null==d.resultsAdapter&&(d.resultsAdapter=n,null!=d.ajax&&(d.resultsAdapter=c.Decorate(d.resultsAdapter,b)),null!=d.placeholder&&(d.resultsAdapter=c.Decorate(d.resultsAdapter,w)),d.selectOnClose&&(d.resultsAdapter=c.Decorate(d.resultsAdapter,x))),null==d.dropdownAdapter){if(d.multiple)d.dropdownAdapter=S;else{var T=c.Decorate(S,$);d.dropdownAdapter=T}if(0!==d.minimumResultsForSearch&&(d.dropdownAdapter=c.Decorate(d.dropdownAdapter,A)),d.closeOnSelect&&(d.dropdownAdapter=c.Decorate(d.dropdownAdapter,C)),null!=d.dropdownCssClass||null!=d.dropdownCss||null!=d.adaptDropdownCssClass){var D=t(d.amdBase+"compat/dropdownCss");d.dropdownAdapter=c.Decorate(d.dropdownAdapter,D)}d.dropdownAdapter=c.Decorate(d.dropdownAdapter,z)}if(null==d.selectionAdapter){if(d.multiple?d.selectionAdapter=i:d.selectionAdapter=r,null!=d.placeholder&&(d.selectionAdapter=c.Decorate(d.selectionAdapter,o)),d.allowClear&&(d.selectionAdapter=c.Decorate(d.selectionAdapter,s)),d.multiple&&(d.selectionAdapter=c.Decorate(d.selectionAdapter,a)),null!=d.containerCssClass||null!=d.containerCss||null!=d.adaptContainerCssClass){var q=t(d.amdBase+"compat/containerCss");d.selectionAdapter=c.Decorate(d.selectionAdapter,q)}d.selectionAdapter=c.Decorate(d.selectionAdapter,l)}if("string"==typeof d.language)if(d.language.indexOf("-")>0){var L=d.language.split("-")[0];d.language=[d.language,L]}else d.language=[d.language];if(e.isArray(d.language)){var j=new u;d.language.push("en");for(var P=d.language,k=0;k<P.length;k++){var I=P[k],R={};try{R=u.loadPath(I)}catch(e){try{I=this.defaults.amdLanguageBase+I,R=u.loadPath(I)}catch(e){d.debug&&window.console&&console.warn&&console.warn('CzrSelect2: The language file for "'+I+'" could not be automatically loaded. A fallback will be used instead.');continue}}j.extend(R)}d.translations=j}else{var M=u.loadPath(this.defaults.amdLanguageBase+"en"),U=new u(d.language);U.extend(M),d.translations=U}return d},O.prototype.reset=function(){function t(e){return e.replace(/[^\u0000-\u007E]/g,function(e){return d[e]||e})}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:c.escapeMarkup,language:E,matcher:function n(r,i){if("string"!=typeof r.term||""===r.term.trim())return i;if(i.children&&i.children.length>0){for(var o=e.extend(!0,{},i),s=i.children.length-1;s>=0;s--)null==n(r,i.children[s])&&o.children.splice(s,1);return o.children.length>0?o:n(r,o)}var a=t(i.text).toUpperCase(),l=t(r.term).toUpperCase();return a.indexOf(l)>-1?i:null},minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(e){return e},templateResult:function(e){return e.text},templateSelection:function(e){return e.text},theme:"default",width:"resolve"}},O.prototype.set=function(t,n){var r={};r[e.camelCase(t)]=n;var i=c._convertData(r);e.extend(this.defaults,i)},new O}),t.define("czrSelect2/options",["require","jquery","./defaults","./utils"],function(e,t,n,r){function i(t,i){if(this.options=t,null!=i&&this.fromElement(i),this.options=n.apply(this.options),i&&i.is("input")){var o=e(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=r.Decorate(this.options.dataAdapter,o)}}return i.prototype.fromElement=function(e){var n=["czrSelect2"];null==this.options.multiple&&(this.options.multiple=e.prop("multiple")),null==this.options.disabled&&(this.options.disabled=e.prop("disabled")),null==this.options.language&&(e.prop("lang")?this.options.language=e.prop("lang").toLowerCase():e.closest("[lang]").prop("lang")&&(this.options.language=e.closest("[lang]").prop("lang"))),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),e.data("czrSelect2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('CzrSelect2: The `data-czrSelect2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of CzrSelect2.'),e.data("data",e.data("czrSelect2Tags")),e.data("tags",!0)),e.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("CzrSelect2: 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 CzrSelect2."),e.attr("ajax--url",e.data("ajaxUrl")),e.data("ajax--url",e.data("ajaxUrl")));var i={};i=t.fn.jquery&&"1."==t.fn.jquery.substr(0,2)&&e[0].dataset?t.extend(!0,{},e[0].dataset,e.data()):e.data();var o=t.extend(!0,{},i);for(var s in o=r._convertData(o))t.inArray(s,n)>-1||(t.isPlainObject(this.options[s])?t.extend(this.options[s],o[s]):this.options[s]=o[s]);return this},i.prototype.get=function(e){return this.options[e]},i.prototype.set=function(e,t){this.options[e]=t},i}),t.define("czrSelect2/core",["jquery","./options","./utils","./keys"],function(e,t,n,r){var i=function(e,n){null!=e.data("czrSelect2")&&e.data("czrSelect2").destroy(),this.$element=e,this.id=this._generateId(e),n=n||{},this.options=new t(n,e),i.__super__.constructor.call(this);var r=e.attr("tabindex")||0;e.data("old-tabindex",r),e.attr("tabindex","-1");var o=this.options.get("dataAdapter");this.dataAdapter=new o(e,this.options);var s=this.render();this._placeContainer(s);var a=this.options.get("selectionAdapter");this.selection=new a(e,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,s);var l=this.options.get("dropdownAdapter");this.dropdown=new l(e,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,s);var c=this.options.get("resultsAdapter");this.results=new c(e,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var u=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(e){u.trigger("selection:update",{data:e})}),e.addClass("czrSelect2-hidden-accessible"),e.attr("aria-hidden","true"),this._syncAttributes(),e.data("czrSelect2",this)};return n.Extend(i,n.Observable),i.prototype._generateId=function(e){return"czrSelect2-"+(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 r=this._resolveWidth(e,"style");return null!=r?r:this._resolveWidth(e,"element")}if("element"==t){var i=e.outerWidth(!1);return i<=0?"auto":i+"px"}if("style"==t){var o=e.attr("style");if("string"!=typeof o)return null;for(var s=o.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 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 t=this;this.$element.on("change.czrSelect2",function(){t.dataAdapter.current(function(e){t.trigger("selection:update",{data:e})})}),this.$element.on("focus.czrSelect2",function(e){t.trigger("focus",e)}),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 r=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=r?(this._observer=new r(function(n){e.each(n,t._syncA),e.each(n,t._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",t._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",t._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",t._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(r,i){-1===e.inArray(r,n)&&t.trigger(r,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("czrSelect2-container--open")}),this.on("close",function(){e.$container.removeClass("czrSelect2-container--open")}),this.on("enable",function(){e.$container.removeClass("czrSelect2-container--disabled")}),this.on("disable",function(){e.$container.addClass("czrSelect2-container--disabled")}),this.on("blur",function(){e.$container.removeClass("czrSelect2-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===r.ESC||n===r.TAB||n===r.UP&&t.altKey?(e.close(),t.preventDefault()):n===r.ENTER?(e.trigger("results:select",{}),t.preventDefault()):n===r.SPACE&&t.ctrlKey?(e.trigger("results:toggle",{}),t.preventDefault()):n===r.UP?(e.trigger("results:previous",{}),t.preventDefault()):n===r.DOWN&&(e.trigger("results:next",{}),t.preventDefault()):(n===r.ENTER||n===r.SPACE||n===r.DOWN&&t.altKey)&&(e.open(),t.preventDefault())})},i.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",{})},i.prototype._syncSubtree=function(e,t){var n=!1,r=this;if(!e||!e.target||"OPTION"===e.target.nodeName||"OPTGROUP"===e.target.nodeName){if(t)if(t.addedNodes&&t.addedNodes.length>0)for(var i=0;i<t.addedNodes.length;i++){t.addedNodes[i].selected&&(n=!0)}else t.removedNodes&&t.removedNodes.length>0&&(n=!0);else n=!0;n&&this.dataAdapter.current(function(e){r.trigger("selection:update",{data:e})})}},i.prototype.trigger=function(e,t){var n=i.__super__.trigger,r={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===t&&(t={}),e in r){var o=r[e],s={prevented:!1,name:e,args:t};if(n.call(this,o,s),s.prevented)return void(t.prevented=!0)}n.call(this,e,t)},i.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},i.prototype.open=function(){this.isOpen()||this.trigger("query",{})},i.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},i.prototype.isOpen=function(){return this.$container.hasClass("czrSelect2-container--open")},i.prototype.hasFocus=function(){return this.$container.hasClass("czrSelect2-container--focus")},i.prototype.focus=function(e){this.hasFocus()||(this.$container.addClass("czrSelect2-container--focus"),this.trigger("focus",{}))},i.prototype.enable=function(e){this.options.get("debug")&&window.console&&console.warn&&console.warn('CzrSelect2: The `czrSelect2("enable")` method has been deprecated and will be removed in later CzrSelect2 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('CzrSelect2: Data can no longer be set using `czrSelect2("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('CzrSelect2: The `czrSelect2("val")` method has been deprecated and will be removed in later CzrSelect2 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("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(".czrSelect2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("czrSelect2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("czrSelect2"),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="czrSelect2 czrSelect2-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("czrSelect2-container--"+this.options.get("theme")),t.data("element",this.$element),t},i}),t.define("jquery-mousewheel",["jquery"],function(e){return e}),t.define("jquery.czrSelect2",["jquery","jquery-mousewheel","./czrSelect2/core","./czrSelect2/defaults"],function(e,t,n,r){if(null==e.fn.czrSelect2){var i=["open","close","destroy"];e.fn.czrSelect2=function(t){if("object"==typeof(t=t||{}))return this.each(function(){var r=e.extend(!0,{},t);new n(e(this),r)}),this;if("string"==typeof t){var r,o=Array.prototype.slice.call(arguments,1);return this.each(function(){var n=e(this).data("czrSelect2");null==n&&window.console&&console.error&&console.error("The czrSelect2('"+t+"') method was called on an element that is not using CzrSelect2."),r=n[t].apply(n,o)}),e.inArray(t,i)>-1?this:r}throw new Error("Invalid arguments for CzrSelect2: "+t)}}return null==e.fn.czrSelect2.defaults&&(e.fn.czrSelect2.defaults=r),n}),{define:t.define,require:t.require}}(),n=t.require("jquery.czrSelect2");return e.fn.czrSelect2.amd=t,n});
|
assets/czr/fmk/js/base-fmk/lib/icheck.min.js
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
/*! iCheck v1.0.1 by Damir Sultanov, http://git.io/arlzeA, MIT Licensed */
|
2 |
+
if ( 'function' != typeof(jQuery.fn.iCheck) ) {
|
3 |
+
!function(a){function b(a,b,e){var f=a[0],g=/er/.test(e)?p:/bl/.test(e)?n:l,h=e==q?{checked:f[l],disabled:f[n],indeterminate:"true"==a.attr(p)||"false"==a.attr(o)}:f[g];if(/^(ch|di|in)/.test(e)&&!h)c(a,g);else if(/^(un|en|de)/.test(e)&&h)d(a,g);else if(e==q)for(g in h)h[g]?c(a,g,!0):d(a,g,!0);else b&&"toggle"!=e||(b||a[u]("ifClicked"),h?f[r]!==k&&d(a,g):c(a,g))}function c(b,c,e){var q=b[0],u=b.parent(),v=c==l,x=c==p,y=c==n,z=x?o:v?m:"enabled",A=f(b,z+g(q[r])),B=f(b,c+g(q[r]));if(!0!==q[c]){if(!e&&c==l&&q[r]==k&&q.name){var C=b.closest("form"),D='input[name="'+q.name+'"]',D=C.length?C.find(D):a(D);D.each(function(){this!==q&&a(this).data(i)&&d(a(this),c)})}x?(q[c]=!0,q[l]&&d(b,l,"force")):(e||(q[c]=!0),v&&q[p]&&d(b,p,!1)),h(b,v,c,e)}q[n]&&f(b,w,!0)&&u.find("."+j).css(w,"default"),u[s](B||f(b,c)||""),y?u.attr("aria-disabled","true"):u.attr("aria-checked",x?"mixed":"true"),u[t](A||f(b,z)||"")}function d(a,b,c){var d=a[0],e=a.parent(),i=b==l,k=b==p,q=b==n,u=k?o:i?m:"enabled",v=f(a,u+g(d[r])),x=f(a,b+g(d[r]));!1!==d[b]&&((k||!c||"force"==c)&&(d[b]=!1),h(a,i,u,c)),!d[n]&&f(a,w,!0)&&e.find("."+j).css(w,"pointer"),e[t](x||f(a,b)||""),q?e.attr("aria-disabled","false"):e.attr("aria-checked","false"),e[s](v||f(a,u)||"")}function e(b,c){b.data(i)&&(b.parent().html(b.attr("style",b.data(i).s||"")),c&&b[u](c),b.off(".i").unwrap(),a(v+'[for="'+b[0].id+'"]').add(b.closest(v)).off(".i"))}function f(a,b,c){return a.data(i)?a.data(i).o[b+(c?"":"Class")]:void 0}function g(a){return a.charAt(0).toUpperCase()+a.slice(1)}function h(a,b,c,d){d||(b&&a[u]("ifToggled"),a[u]("ifChanged")[u]("if"+g(c)))}var i="iCheck",j=i+"-helper",k="radio",l="checked",m="un"+l,n="disabled",o="determinate",p="in"+o,q="update",r="type",s="addClass",t="removeClass",u="trigger",v="label",w="cursor",x=/ipad|iphone|ipod|android|blackberry|windows phone|opera mini|silk/i.test(navigator.userAgent);a.fn[i]=function(f,g){var h='input[type="checkbox"], input[type="'+k+'"]',m=a(),o=function(b){b.each(function(){var b=a(this);m=b.is(h)?m.add(b):m.add(b.find(h))})};if(/^(check|uncheck|toggle|indeterminate|determinate|disable|enable|update|destroy)$/i.test(f))return f=f.toLowerCase(),o(this),m.each(function(){var c=a(this);"destroy"==f?e(c,"ifDestroyed"):b(c,!0,f),a.isFunction(g)&&g()});if("object"!=typeof f&&f)return this;var w=a.extend({checkedClass:l,disabledClass:n,indeterminateClass:p,labelHover:!0,aria:!1},f),y=w.handle,z=w.hoverClass||"hover",A=w.focusClass||"focus",B=w.activeClass||"active",C=!!w.labelHover,D=w.labelHoverClass||"hover",E=0|(""+w.increaseArea).replace("%","");return("checkbox"==y||y==k)&&(h='input[type="'+y+'"]'),-50>E&&(E=-50),o(this),m.each(function(){var f=a(this);e(f);var g=this,h=g.id,m=-E+"%",o=100+2*E+"%",o={position:"absolute",top:m,left:m,display:"block",width:o,height:o,margin:0,padding:0,background:"#fff",border:0,opacity:0},m=x?{position:"absolute",visibility:"hidden"}:E?o:{position:"absolute",opacity:0},p="checkbox"==g[r]?w.checkboxClass||"icheckbox":w.radioClass||"i"+k,y=a(v+'[for="'+h+'"]').add(f.closest(v)),F=!!w.aria,G=i+"-"+Math.random().toString(36).substr(2,6),H='<div class="'+p+'" '+(F?'role="'+g[r]+'" ':"");F&&y.each(function(){H+='aria-labelledby="',this.id?H+=this.id:(this.id=G,H+=G),H+='"'}),H=f.wrap(H+"/>")[u]("ifCreated").parent().append(w.insert),o=a('<ins class="'+j+'"/>').css(o).appendTo(H),f.data(i,{o:w,s:f.attr("style")}).css(m),w.inheritClass&&H[s](g.className||""),w.inheritID&&h&&H.attr("id",i+"-"+h),"static"==H.css("position")&&H.css("position","relative"),b(f,!0,q),y.length&&y.on("click.i mouseover.i mouseout.i touchbegin.i touchend.i",function(c){var d=c[r],e=a(this);if(!g[n]){if("click"==d){if(a(c.target).is("a"))return;b(f,!1,!0)}else C&&(/ut|nd/.test(d)?(H[t](z),e[t](D)):(H[s](z),e[s](D)));if(!x)return!1;c.stopPropagation()}}),f.on("click.i focus.i blur.i keyup.i keydown.i keypress.i",function(a){var b=a[r];return a=a.keyCode,"click"==b?!1:"keydown"==b&&32==a?(g[r]==k&&g[l]||(g[l]?d(f,l):c(f,l)),!1):("keyup"==b&&g[r]==k?!g[l]&&c(f,l):/us|ur/.test(b)&&H["blur"==b?t:s](A),void 0)}),o.on("click mousedown mouseup mouseover mouseout touchbegin.i touchend.i",function(a){var c=a[r],d=/wn|up/.test(c)?B:z;if(!g[n]){if("click"==c?b(f,!1,!0):(/wn|er|in/.test(c)?H[s](d):H[t](d+" "+B),y.length&&C&&d==z&&y[/ut|nd/.test(c)?t:s](D)),!x)return!1;a.stopPropagation()}})})}}(window.jQuery||window.Zepto);
|
4 |
+
}
|
assets/czr/fmk/js/base-fmk/lib/rangeslider.min.js
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
/*! rangeslider.js - v2.3.2 | (c) 2018 @andreruffert | MIT license | https://github.com/andreruffert/rangeslider.js */
|
2 |
+
!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){"use strict";function b(){var a=document.createElement("input");return a.setAttribute("type","range"),"text"!==a.type}function c(a,b){var c=Array.prototype.slice.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)}function d(a,b){return b=b||100,function(){if(!a.debouncing){var c=Array.prototype.slice.apply(arguments);a.lastReturnVal=a.apply(window,c),a.debouncing=!0}return clearTimeout(a.debounceTimeout),a.debounceTimeout=setTimeout(function(){a.debouncing=!1},b),a.lastReturnVal}}function e(a){return a&&(0===a.offsetWidth||0===a.offsetHeight||!1===a.open)}function f(a){for(var b=[],c=a.parentNode;e(c);)b.push(c),c=c.parentNode;return b}function g(a,b){function c(a){void 0!==a.open&&(a.open=!a.open)}var d=f(a),e=d.length,g=[],h=a[b];if(e){for(var i=0;i<e;i++)g[i]=d[i].style.cssText,d[i].style.setProperty?d[i].style.setProperty("display","block","important"):d[i].style.cssText+=";display: block !important",d[i].style.height="0",d[i].style.overflow="hidden",d[i].style.visibility="hidden",c(d[i]);h=a[b];for(var j=0;j<e;j++)d[j].style.cssText=g[j],c(d[j])}return h}function h(a,b){var c=parseFloat(a);return Number.isNaN(c)?b:c}function i(a){return a.charAt(0).toUpperCase()+a.substr(1)}function j(b,e){if(this.$window=a(window),this.$document=a(document),this.$element=a(b),this.options=a.extend({},n,e),this.polyfill=this.options.polyfill,this.orientation=this.$element[0].getAttribute("data-orientation")||this.options.orientation,this.onInit=this.options.onInit,this.onSlide=this.options.onSlide,this.onSlideEnd=this.options.onSlideEnd,this.DIMENSION=o.orientation[this.orientation].dimension,this.DIRECTION=o.orientation[this.orientation].direction,this.DIRECTION_STYLE=o.orientation[this.orientation].directionStyle,this.COORDINATE=o.orientation[this.orientation].coordinate,this.polyfill&&m)return!1;this.identifier="js-"+k+"-"+l++,this.startEvent=this.options.startEvent.join("."+this.identifier+" ")+"."+this.identifier,this.moveEvent=this.options.moveEvent.join("."+this.identifier+" ")+"."+this.identifier,this.endEvent=this.options.endEvent.join("."+this.identifier+" ")+"."+this.identifier,this.toFixed=(this.step+"").replace(".","").length-1,this.$fill=a('<div class="'+this.options.fillClass+'" />'),this.$handle=a('<div class="'+this.options.handleClass+'" />'),this.$range=a('<div class="'+this.options.rangeClass+" "+this.options[this.orientation+"Class"]+'" id="'+this.identifier+'" />').insertAfter(this.$element).prepend(this.$fill,this.$handle),this.$element.css({position:"absolute",width:"1px",height:"1px",overflow:"hidden",opacity:"0"}),this.handleDown=a.proxy(this.handleDown,this),this.handleMove=a.proxy(this.handleMove,this),this.handleEnd=a.proxy(this.handleEnd,this),this.init();var f=this;this.$window.on("resize."+this.identifier,d(function(){c(function(){f.update(!1,!1)},300)},20)),this.$document.on(this.startEvent,"#"+this.identifier+":not(."+this.options.disabledClass+")",this.handleDown),this.$element.on("change."+this.identifier,function(a,b){if(!b||b.origin!==f.identifier){var c=a.target.value,d=f.getPositionFromValue(c);f.setPosition(d)}})}Number.isNaN=Number.isNaN||function(a){return"number"==typeof a&&a!==a};var k="rangeslider",l=0,m=b(),n={polyfill:!0,orientation:"horizontal",rangeClass:"rangeslider",disabledClass:"rangeslider--disabled",activeClass:"rangeslider--active",horizontalClass:"rangeslider--horizontal",verticalClass:"rangeslider--vertical",fillClass:"rangeslider__fill",handleClass:"rangeslider__handle",startEvent:["mousedown","touchstart","pointerdown"],moveEvent:["mousemove","touchmove","pointermove"],endEvent:["mouseup","touchend","pointerup"]},o={orientation:{horizontal:{dimension:"width",direction:"left",directionStyle:"left",coordinate:"x"},vertical:{dimension:"height",direction:"top",directionStyle:"bottom",coordinate:"y"}}};return j.prototype.init=function(){this.update(!0,!1),this.onInit&&"function"==typeof this.onInit&&this.onInit()},j.prototype.update=function(a,b){a=a||!1,a&&(this.min=h(this.$element[0].getAttribute("min"),0),this.max=h(this.$element[0].getAttribute("max"),100),this.value=h(this.$element[0].value,Math.round(this.min+(this.max-this.min)/2)),this.step=h(this.$element[0].getAttribute("step"),1)),this.handleDimension=g(this.$handle[0],"offset"+i(this.DIMENSION)),this.rangeDimension=g(this.$range[0],"offset"+i(this.DIMENSION)),this.maxHandlePos=this.rangeDimension-this.handleDimension,this.grabPos=this.handleDimension/2,this.position=this.getPositionFromValue(this.value),this.$element[0].disabled?this.$range.addClass(this.options.disabledClass):this.$range.removeClass(this.options.disabledClass),this.setPosition(this.position,b)},j.prototype.handleDown=function(a){if(a.preventDefault(),!(a.button&&0!==a.button||(this.$document.on(this.moveEvent,this.handleMove),this.$document.on(this.endEvent,this.handleEnd),this.$range.addClass(this.options.activeClass),(" "+a.target.className+" ").replace(/[\n\t]/g," ").indexOf(this.options.handleClass)>-1))){var b=this.getRelativePosition(a),c=this.$range[0].getBoundingClientRect()[this.DIRECTION],d=this.getPositionFromNode(this.$handle[0])-c,e="vertical"===this.orientation?this.maxHandlePos-(b-this.grabPos):b-this.grabPos;this.setPosition(e),b>=d&&b<d+this.handleDimension&&(this.grabPos=b-d)}},j.prototype.handleMove=function(a){a.preventDefault();var b=this.getRelativePosition(a),c="vertical"===this.orientation?this.maxHandlePos-(b-this.grabPos):b-this.grabPos;this.setPosition(c)},j.prototype.handleEnd=function(a){a.preventDefault(),this.$document.off(this.moveEvent,this.handleMove),this.$document.off(this.endEvent,this.handleEnd),this.$range.removeClass(this.options.activeClass),this.$element.trigger("change",{origin:this.identifier}),this.onSlideEnd&&"function"==typeof this.onSlideEnd&&this.onSlideEnd(this.position,this.value)},j.prototype.cap=function(a,b,c){return a<b?b:a>c?c:a},j.prototype.setPosition=function(a,b){var c,d;void 0===b&&(b=!0),c=this.getValueFromPosition(this.cap(a,0,this.maxHandlePos)),d=this.getPositionFromValue(c),this.$fill[0].style[this.DIMENSION]=d+this.grabPos+"px",this.$handle[0].style[this.DIRECTION_STYLE]=d+"px",this.setValue(c),this.position=d,this.value=c,b&&this.onSlide&&"function"==typeof this.onSlide&&this.onSlide(d,c)},j.prototype.getPositionFromNode=function(a){for(var b=0;null!==a;)b+=a.offsetLeft,a=a.offsetParent;return b},j.prototype.getRelativePosition=function(a){var b=i(this.COORDINATE),c=this.$range[0].getBoundingClientRect()[this.DIRECTION],d=0;return void 0!==a.originalEvent["client"+b]?d=a.originalEvent["client"+b]:a.originalEvent.touches&&a.originalEvent.touches[0]&&void 0!==a.originalEvent.touches[0]["client"+b]?d=a.originalEvent.touches[0]["client"+b]:a.currentPoint&&void 0!==a.currentPoint[this.COORDINATE]&&(d=a.currentPoint[this.COORDINATE]),d-c},j.prototype.getPositionFromValue=function(a){var b;return b=(a-this.min)/(this.max-this.min),Number.isNaN(b)?0:b*this.maxHandlePos},j.prototype.getValueFromPosition=function(a){var b,c;return b=a/(this.maxHandlePos||1),c=this.step*Math.round(b*(this.max-this.min)/this.step)+this.min,Number(c.toFixed(this.toFixed))},j.prototype.setValue=function(a){a===this.value&&""!==this.$element[0].value||this.$element.val(a).trigger("input",{origin:this.identifier})},j.prototype.destroy=function(){this.$document.off("."+this.identifier),this.$window.off("."+this.identifier),this.$element.off("."+this.identifier).removeAttr("style").removeData("plugin_"+k),this.$range&&this.$range.length&&this.$range[0].parentNode.removeChild(this.$range[0])},a.fn[k]=function(b){var c=Array.prototype.slice.call(arguments,1);return this.each(function(){var d=a(this),e=d.data("plugin_"+k);e||d.data("plugin_"+k,e=new j(this,b)),"string"==typeof b&&e[b].apply(e,c)})},"rangeslider.js is available in jQuery context e.g $(selector).rangeslider(options);"});
|
assets/czr/fmk/js/base-fmk/lib/selecter.min.js
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* Selecter v3.0.9 - 2014-02-10
|
3 |
+
* A jQuery plugin for replacing default select elements. Part of the Formstone Library.
|
4 |
+
* http://formstone.it/selecter/
|
5 |
+
*
|
6 |
+
* Copyright 2014 Ben Plum; MIT Licensed
|
7 |
+
*/
|
8 |
+
if ( 'function' != typeof(jQuery.fn.selecter) ) {
|
9 |
+
!function(a,b){"use strict";function c(b){b=a.extend({},x,b||{}),null===w&&(w=a("body"));for(var c=a(this),e=0,f=c.length;f>e;e++)d(c.eq(e),b);return c}function d(b,c){if(!b.hasClass("selecter-element")){c=a.extend({},c,b.data("selecter-options")),c.external&&(c.links=!0);var d=b.find("option, optgroup"),g=d.filter("option"),h=g.filter(":selected"),n=""!==c.label?-1:g.index(h),p=c.links?"nav":"div";c.tabIndex=b[0].tabIndex,b[0].tabIndex=-1,c.multiple=b.prop("multiple"),c.disabled=b.is(":disabled");var q="<"+p+' class="selecter '+c.customClass;v?q+=" mobile":c.cover&&(q+=" cover"),q+=c.multiple?" multiple":" closed",c.disabled&&(q+=" disabled"),q+='" tabindex="'+c.tabIndex+'">',c.multiple||(q+='<span class="selecter-selected'+(""!==c.label?" placeholder":"")+'">',q+=a("<span></span").text(r(""!==c.label?c.label:h.text(),c.trim)).html(),q+="</span>"),q+='<div class="selecter-options">',q+="</div>",q+="</"+p+">",b.addClass("selecter-element").after(q);var s=b.next(".selecter"),u=a.extend({$select:b,$allOptions:d,$options:g,$selecter:s,$selected:s.find(".selecter-selected"),$itemsWrapper:s.find(".selecter-options"),index:-1,guid:t++},c);e(u),o(n,u),void 0!==a.fn.scroller&&u.$itemsWrapper.scroller(),u.$selecter.on("touchstart.selecter click.selecter",".selecter-selected",u,f).on("click.selecter",".selecter-item",u,j).on("close.selecter",u,i).data("selecter",u),u.$select.on("change.selecter",u,k),v||(u.$selecter.on("focus.selecter",u,l).on("blur.selecter",u,m),u.$select.on("focus.selecter",u,function(a){a.data.$selecter.trigger("focus")}))}}function e(b){for(var c="",d=b.links?"a":"span",e=0,f=0,g=b.$allOptions.length;g>f;f++){var h=b.$allOptions.eq(f);if("OPTGROUP"===h[0].tagName)c+='<span class="selecter-group',h.is(":disabled")&&(c+=" disabled"),c+='">'+h.attr("label")+"</span>";else{var i=h.val();h.attr("value")||h.attr("value",i),c+="<"+d+' class="selecter-item',h.is(":selected")&&""===b.label&&(c+=" selected"),h.is(":disabled")&&(c+=" disabled"),c+='" ',c+=b.links?'href="'+i+'"':'data-value="'+i+'"',c+=">"+a("<span></span>").text(r(h.text(),b.trim)).html()+"</"+d+">",e++}}b.$itemsWrapper.html(c),b.$items=b.$selecter.find(".selecter-item")}function f(c){c.preventDefault(),c.stopPropagation();var d=c.data;if(!d.$select.is(":disabled"))if(a(".selecter").not(d.$selecter).trigger("close.selecter",[d]),v){var e=d.$select[0];if(b.document.createEvent){var f=b.document.createEvent("MouseEvents");f.initMouseEvent("mousedown",!1,!0,b,0,0,0,0,0,!1,!1,!1,!1,0,null),e.dispatchEvent(f)}else e.fireEvent&&e.fireEvent("onmousedown")}else d.$selecter.hasClass("closed")?g(c):d.$selecter.hasClass("open")&&i(c)}function g(b){b.preventDefault(),b.stopPropagation();var c=b.data;if(!c.$selecter.hasClass("open")){var d=c.$selecter.offset(),e=w.outerHeight(),f=c.$itemsWrapper.outerHeight(!0),g=c.index>=0?c.$items.eq(c.index).position():{left:0,top:0};d.top+f>e&&c.$selecter.addClass("bottom"),c.$itemsWrapper.show(),c.$selecter.removeClass("closed").addClass("open"),w.on("click.selecter-"+c.guid,":not(.selecter-options)",c,h),void 0!==a.fn.scroller?c.$itemsWrapper.scroller("scroll",c.$itemsWrapper.find(".scroller-content").scrollTop()+g.top,0).scroller("reset"):c.$itemsWrapper.scrollTop(c.$itemsWrapper.scrollTop()+g.top)}}function h(b){b.preventDefault(),b.stopPropagation(),0===a(b.currentTarget).parents(".selecter").length&&i(b)}function i(a){a.preventDefault(),a.stopPropagation();var b=a.data;b.$selecter.hasClass("open")&&(b.$itemsWrapper.hide(),b.$selecter.removeClass("open bottom").addClass("closed"),w.off(".selecter-"+b.guid))}function j(b){b.preventDefault(),b.stopPropagation();var c=a(this),d=b.data;if(!d.$select.is(":disabled")){if(d.$itemsWrapper.is(":visible")){var e=d.$items.index(c);o(e,d),p(d)}d.multiple||i(b)}}function k(b,c){var d=a(this),e=b.data;if(!c&&!e.multiple){var f=e.$options.index(e.$options.filter("[value='"+s(d.val())+"']"));o(f,e),p(e)}}function l(b){b.preventDefault(),b.stopPropagation();var c=b.data;c.$select.is(":disabled")||c.multiple||(c.$selecter.addClass("focus").on("keydown.selecter"+c.guid,c,n),a(".selecter").not(c.$selecter).trigger("close.selecter",[c]))}function m(b){b.preventDefault(),b.stopPropagation();var c=b.data;c.$selecter.removeClass("focus").off("keydown.selecter"+c.guid+" keyup.selecter"+c.guid),a(".selecter").not(c.$selecter).trigger("close.selecter",[c])}function n(b){var c=b.data;if(13===b.keyCode)c.$selecter.hasClass("open")&&(i(b),o(c.index,c)),p(c);else if(!(9===b.keyCode||b.metaKey||b.altKey||b.ctrlKey||b.shiftKey)){b.preventDefault(),b.stopPropagation();var d=c.$items.length-1,e=c.index<0?0:c.index;if(a.inArray(b.keyCode,u?[38,40,37,39]:[38,40])>-1)e+=38===b.keyCode||u&&37===b.keyCode?-1:1,0>e&&(e=0),e>d&&(e=d);else{var f,g,h=String.fromCharCode(b.keyCode).toUpperCase();for(g=c.index+1;d>=g;g++)if(f=c.$options.eq(g).text().charAt(0).toUpperCase(),f===h){e=g;break}if(0>e)for(g=0;d>=g;g++)if(f=c.$options.eq(g).text().charAt(0).toUpperCase(),f===h){e=g;break}}e>=0&&o(e,c)}}function o(a,b){var c=b.$items.eq(a),d=c.hasClass("selected"),e=c.hasClass("disabled");if(!e){if(-1===a&&""!==b.label)b.$selected.html(b.label);else if(d)b.multiple&&(b.$options.eq(a).prop("selected",null),c.removeClass("selected"));else{{var f=c.html();c.data("value")}b.multiple?b.$options.eq(a).prop("selected",!0):(b.$selected.html(f).removeClass("placeholder"),b.$items.filter(".selected").removeClass("selected"),b.$select[0].selectedIndex=a),c.addClass("selected")}(!d||b.multiple)&&(b.index=a)}}function p(a){a.links?q(a):(a.callback.call(a.$selecter,a.$select.val(),a.index),a.$select.trigger("change",[!0]))}function q(a){var c=a.$select.val();a.external?b.open(c):b.location.href=c}function r(a,b){return 0===b?a:a.length>b?a.substring(0,b)+"...":a}function s(a){return a.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1")}var t=0,u=b.navigator.userAgent.toLowerCase().indexOf("firefox")>-1,v=/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(b.navigator.userAgent||b.navigator.vendor||b.opera),w=null,x={callback:a.noop,cover:!1,customClass:"",label:"",external:!1,links:!1,trim:0},y={defaults:function(b){return x=a.extend(x,b||{}),a(this)},disable:function(b){return a(this).each(function(c,d){var e=a(d).next(".selecter").data("selecter");if(e)if("undefined"!=typeof b){var f=e.$items.index(e.$items.filter("[data-value="+b+"]"));e.$items.eq(f).addClass("disabled"),e.$options.eq(f).prop("disabled",!0)}else e.$selecter.hasClass("open")&&e.$selecter.find(".selecter-selected").trigger("click.selecter"),e.$selecter.addClass("disabled"),e.$select.prop("disabled",!0)})},enable:function(b){return a(this).each(function(c,d){var e=a(d).next(".selecter").data("selecter");if(e)if("undefined"!=typeof b){var f=e.$items.index(e.$items.filter("[data-value="+b+"]"));e.$items.eq(f).removeClass("disabled"),e.$options.eq(f).prop("disabled",!1)}else e.$selecter.removeClass("disabled"),e.$select.prop("disabled",!1)})},destroy:function(){return a(this).each(function(b,c){var d=a(c).next(".selecter").data("selecter");d&&(d.$selecter.hasClass("open")&&d.$selecter.find(".selecter-selected").trigger("click.selecter"),void 0!==a.fn.scroller&&d.$selecter.find(".selecter-options").scroller("destroy"),d.$select[0].tabIndex=d.tabIndex,d.$select.off(".selecter").removeClass("selecter-element").show(),d.$selecter.off(".selecter").remove())})},refresh:function(){return a(this).each(function(b,c){var d=a(c).next(".selecter").data("selecter");if(d){var f=d.index;d.$allOptions=d.$select.find("option, optgroup"),d.$options=d.$allOptions.filter("option"),d.index=-1,f=d.$options.index(d.$options.filter(":selected")),e(d),o(f,d)}})}};a.fn.selecter=function(a){return y[a]?y[a].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof a&&a?this:c.apply(this,arguments)},a.selecter=function(a){"defaults"===a&&y.defaults.apply(this,Array.prototype.slice.call(arguments,1))}}(jQuery,window);
|
10 |
+
}
|
assets/czr/fmk/js/base-fmk/lib/stepper.min.js
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* Stepper v3.0.5 - 2014-02-06
|
3 |
+
* A jQuery plugin for cross browser number inputs. Part of the Formstone Library.
|
4 |
+
* http://formstone.it/stepper/
|
5 |
+
*
|
6 |
+
* Copyright 2014 Ben Plum; MIT Licensed
|
7 |
+
*/
|
8 |
+
if ( 'function' != typeof(jQuery.fn.stepper) ) {
|
9 |
+
!function(a){"use strict";function b(b){b=a.extend({},k,b||{});for(var d=a(this),e=0,f=d.length;f>e;e++)c(d.eq(e),b);return d}function c(b,c){if(!b.hasClass("stepper-input")){c=a.extend({},c,b.data("stepper-options"));var e=parseFloat(b.attr("min")),f=parseFloat(b.attr("max")),g=parseFloat(b.attr("step"))||1;b.addClass("stepper-input").wrap('<div class="stepper '+c.customClass+'" />').after('<span class="stepper-arrow up">'+c.labels.up+'</span><span class="stepper-arrow down">'+c.labels.down+"</span>");var h=b.parent(".stepper"),j=a.extend({$stepper:h,$input:b,$arrow:h.find(".stepper-arrow"),min:void 0===typeof e||isNaN(e)?!1:e,max:void 0===typeof f||isNaN(f)?!1:f,step:void 0===typeof g||isNaN(g)?1:g,timer:null},c);j.digits=i(j.step),b.is(":disabled")&&h.addClass("disabled"),h.on("touchstart.stepper mousedown.stepper",".stepper-arrow",j,d).data("stepper",j)}}function d(b){b.preventDefault(),b.stopPropagation(),e(b);var c=b.data;if(!c.$input.is(":disabled")&&!c.$stepper.hasClass("disabled")){var d=a(b.target).hasClass("up")?c.step:-c.step;c.timer=g(c.timer,125,function(){f(c,d,!1)}),f(c,d),a("body").on("touchend.stepper mouseup.stepper",c,e)}}function e(b){b.preventDefault(),b.stopPropagation();var c=b.data;h(c.timer),a("body").off(".stepper")}function f(a,b){var c=parseFloat(a.$input.val()),d=b;void 0===typeof c||isNaN(c)?d=a.min!==!1?a.min:0:a.min!==!1&&c<a.min?d=a.min:d+=c;var e=(d-a.min)%a.step;0!==e&&(d-=e),a.min!==!1&&d<a.min&&(d=a.min),a.max!==!1&&d>a.max&&(d-=a.step),d!==c&&(d=j(d,a.digits),a.$input.val(d).trigger("change"))}function g(a,b,c){return h(a),setInterval(c,b)}function h(a){a&&(clearInterval(a),a=null)}function i(a){var b=String(a);return b.indexOf(".")>-1?b.length-b.indexOf(".")-1:0}function j(a,b){var c=Math.pow(10,b);return Math.round(a*c)/c}var k={customClass:"",labels:{up:"Up",down:"Down"}},l={defaults:function(b){return k=a.extend(k,b||{}),a(this)},destroy:function(){return a(this).each(function(){var b=a(this).data("stepper");b&&(b.$stepper.off(".stepper").find(".stepper-arrow").remove(),b.$input.unwrap().removeClass("stepper-input"))})},disable:function(){return a(this).each(function(){var b=a(this).data("stepper");b&&(b.$input.attr("disabled","disabled"),b.$stepper.addClass("disabled"))})},enable:function(){return a(this).each(function(){var b=a(this).data("stepper");b&&(b.$input.attr("disabled",null),b.$stepper.removeClass("disabled"))})}};a.fn.stepper=function(a){return l[a]?l[a].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof a&&a?this:b.apply(this,arguments)},a.stepper=function(a){"defaults"===a&&l.defaults.apply(this,Array.prototype.slice.call(arguments,1))}}(jQuery,this);
|
10 |
+
}
|
assets/czr/fmk/js/themes/_0_4_pre_section_panel_ubiquity.js
ADDED
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
( function ( api, $, _ ) {
|
3 |
+
/*****************************************************************************
|
4 |
+
* OBSERVE UBIQUE CONTROL'S SECTIONS EXPANSION
|
5 |
+
*****************************************************************************/
|
6 |
+
if ( 'function' === typeof api.Section ) {
|
7 |
+
//move controls back and forth in declared ubique sections
|
8 |
+
//=> implemented in the customizr theme for the social links boolean visibility controls ( socials in header, sidebar, footer )
|
9 |
+
api.control.bind( 'add', function( _ctrl ) {
|
10 |
+
if ( _ctrl.params.ubq_section && _ctrl.params.ubq_section.section ) {
|
11 |
+
//save original state
|
12 |
+
_ctrl.params.original_priority = _ctrl.params.priority;
|
13 |
+
_ctrl.params.original_section = _ctrl.params.section;
|
14 |
+
|
15 |
+
api.section.when( _ctrl.params.ubq_section.section, function( _section_instance ) {
|
16 |
+
_section_instance.expanded.bind( function( expanded ) {
|
17 |
+
if ( expanded ) {
|
18 |
+
if ( _ctrl.params.ubq_section.priority ) {
|
19 |
+
_ctrl.priority( _ctrl.params.ubq_section.priority );
|
20 |
+
}
|
21 |
+
_ctrl.section( _ctrl.params.ubq_section.section );
|
22 |
+
}
|
23 |
+
else {
|
24 |
+
_ctrl.priority( _ctrl.params.original_priority );
|
25 |
+
_ctrl.section( _ctrl.params.original_section );
|
26 |
+
}
|
27 |
+
});
|
28 |
+
|
29 |
+
} );
|
30 |
+
}
|
31 |
+
});
|
32 |
+
}
|
33 |
+
|
34 |
+
|
35 |
+
/*****************************************************************************
|
36 |
+
* OBSERVE UBIQUE CONTROL'S PANELS EXPANSION
|
37 |
+
*****************************************************************************/
|
38 |
+
if ( 'function' === typeof api.Panel ) {
|
39 |
+
//move section back and forth in declared ubique panels
|
40 |
+
api.section.bind( 'add', function( _sec ) {
|
41 |
+
if ( _sec.params.ubq_panel && _sec.params.ubq_panel.panel ) {
|
42 |
+
//save original state
|
43 |
+
_sec.params.original_priority = _sec.params.priority;
|
44 |
+
_sec.params.original_panel = _sec.params.panel;
|
45 |
+
|
46 |
+
api.panel.when( _sec.params.ubq_panel.panel, function( _panel_instance ) {
|
47 |
+
_panel_instance.expanded.bind( function( expanded ) {
|
48 |
+
if ( expanded ) {
|
49 |
+
if ( _sec.params.ubq_panel.priority ) {
|
50 |
+
_sec.priority( _sec.params.ubq_panel.priority );
|
51 |
+
}
|
52 |
+
_sec.panel( _sec.params.ubq_panel.panel );
|
53 |
+
}
|
54 |
+
else {
|
55 |
+
_sec.priority( _sec.params.original_priority );
|
56 |
+
_sec.panel( _sec.params.original_panel );
|
57 |
+
}
|
58 |
+
});
|
59 |
+
|
60 |
+
} );
|
61 |
+
}
|
62 |
+
});
|
63 |
+
}
|
64 |
+
|
65 |
+
|
66 |
+
/*****************************************************************************
|
67 |
+
* CLOSE THE MOD OPTION PANEL ( if exists ) ON : section change, panel change, skope switch
|
68 |
+
*****************************************************************************/
|
69 |
+
//@return void()
|
70 |
+
var _closeModOpt = function() {
|
71 |
+
if ( ! _.has( api, 'czr_ModOptVisible') )
|
72 |
+
return;
|
73 |
+
api.czr_ModOptVisible(false);
|
74 |
+
};
|
75 |
+
api.bind('ready', function() {
|
76 |
+
api.czr_activeSectionId.bind( _closeModOpt );
|
77 |
+
api.czr_activePanelId.bind( _closeModOpt );
|
78 |
+
});
|
79 |
+
})( wp.customize , jQuery, _);
|
assets/czr/fmk/js/themes/_0_5_pre_pro_section.js
ADDED
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
( function ( api, $, _ ) {
|
3 |
+
|
4 |
+
api.bind( 'ready', function() {
|
5 |
+
/*****************************************************************************
|
6 |
+
* ADD PRO BEFORE SPECIFIC SECTIONS AND PANELS
|
7 |
+
*****************************************************************************/
|
8 |
+
if ( window.themeServerControlParams && themeServerControlParams.isPro ) {
|
9 |
+
_.each( [
|
10 |
+
//WFC
|
11 |
+
'tc_font_customizer_settings',
|
12 |
+
|
13 |
+
//hueman pro
|
14 |
+
'contx_header_bg',
|
15 |
+
'content_blog_sec',
|
16 |
+
'static_front_page',
|
17 |
+
'content_single_sec',
|
18 |
+
|
19 |
+
//customizr-pro
|
20 |
+
'tc_fpu',
|
21 |
+
'nav',
|
22 |
+
'post_lists_sec',
|
23 |
+
'galleries_sec',
|
24 |
+
'footer_customizer_sec',
|
25 |
+
'custom_scripts_sec',
|
26 |
+
'contact_info_sec'
|
27 |
+
|
28 |
+
], function( _secId ) {
|
29 |
+
_.delay( function() {
|
30 |
+
api.section.when( _secId, function( _sec_ ) {
|
31 |
+
if ( 1 >= _sec_.headContainer.length ) {
|
32 |
+
_sec_.headContainer.find('.accordion-section-title').prepend( '<span class="pro-title-block">Pro</span>' );
|
33 |
+
}
|
34 |
+
});
|
35 |
+
}, 1000 );
|
36 |
+
});
|
37 |
+
_.each( [
|
38 |
+
//hueman pro
|
39 |
+
//'hu-header-panel',
|
40 |
+
//'hu-content-panel',
|
41 |
+
|
42 |
+
//customizr-pro
|
43 |
+
//'tc-header-panel',
|
44 |
+
//'tc-content-panel',
|
45 |
+
//'tc-footer-panel',
|
46 |
+
//'tc-advanced-panel'
|
47 |
+
], function( _secId ) {
|
48 |
+
api.panel.when( _secId, function( _sec_ ) {
|
49 |
+
if ( 1 >= _sec_.headContainer.length ) {
|
50 |
+
_sec_.headContainer.find('.accordion-section-title').prepend( '<span class="pro-title-block">Pro</span>' );
|
51 |
+
}
|
52 |
+
});
|
53 |
+
});
|
54 |
+
}
|
55 |
+
|
56 |
+
|
57 |
+
/*****************************************************************************
|
58 |
+
* PRO SECTION OVERRIDE
|
59 |
+
*****************************************************************************/
|
60 |
+
if ( ! themeServerControlParams.isPro && _.isFunction( api.Section ) ) {
|
61 |
+
proSectionInstance = api.section('go_pro_sec');
|
62 |
+
if ( ! _.isObject( proSectionInstance ) )
|
63 |
+
return;
|
64 |
+
|
65 |
+
// No events for this type of section.
|
66 |
+
proSectionInstance.attachEvents = function () {};
|
67 |
+
// Always make the section active.
|
68 |
+
proSectionInstance.isContextuallyActive = function () {
|
69 |
+
return this.active();
|
70 |
+
};
|
71 |
+
proSectionInstance._toggleActive = function(){ return true; };
|
72 |
+
|
73 |
+
proSectionInstance.active( true );
|
74 |
+
}
|
75 |
+
});
|
76 |
+
|
77 |
+
})( wp.customize , jQuery, _);
|
assets/czr/fmk/js/themes/_2_1_multiplepicker_control.js
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
//named czr_multiple_picker in the php setting map
|
3 |
+
var CZRMultiplePickerMths = CZRMultiplePickerMths || {};
|
4 |
+
/* Multiple Picker */
|
5 |
+
/**
|
6 |
+
* @constructor
|
7 |
+
* @augments wp.customize.Control
|
8 |
+
* @augments wp.customize.Class
|
9 |
+
*/
|
10 |
+
( function ( api, $, _ ) {
|
11 |
+
$.extend( CZRMultiplePickerMths , {
|
12 |
+
ready: function() {
|
13 |
+
var control = this,
|
14 |
+
_select = this.container.find('select');
|
15 |
+
|
16 |
+
|
17 |
+
_select.czrSelect2({
|
18 |
+
closeOnSelect: false,
|
19 |
+
templateSelection: czrEscapeMarkup
|
20 |
+
});
|
21 |
+
|
22 |
+
function czrEscapeMarkup(obj) {
|
23 |
+
//trim dashes
|
24 |
+
return obj.text.replace(/\u2013|\u2014/g, "");
|
25 |
+
}
|
26 |
+
|
27 |
+
//handle case when all choices become unselected
|
28 |
+
_select.on('change', function(e){
|
29 |
+
if ( 0 === $(this).find("option:selected").length )
|
30 |
+
control.setting.set([]);
|
31 |
+
});
|
32 |
+
}
|
33 |
+
});//$.extend
|
34 |
+
})( wp.customize , jQuery, _ );
|
assets/czr/fmk/js/themes/_2_2_cropped_image_control.js
ADDED
@@ -0,0 +1,111 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
//named czr_cropped_image in the php setting map
|
3 |
+
var CZRCroppedImageMths = CZRCroppedImageMths || {};
|
4 |
+
|
5 |
+
(function (api, $, _) {
|
6 |
+
/* IMAGE UPLOADER CONTROL IN THE CUSTOMIZER */
|
7 |
+
//CroppedImageControl is not available before wp 4.3
|
8 |
+
if ( 'function' != typeof wp.media.controller.Cropper || 'function' != typeof api.CroppedImageControl )
|
9 |
+
return;
|
10 |
+
|
11 |
+
|
12 |
+
/* CZRCustomizeImage Cropper */
|
13 |
+
/**
|
14 |
+
* Custom version of:
|
15 |
+
* wp.media.controller.CustomizeImageCropper (wp-includes/js/media-views.js)
|
16 |
+
*
|
17 |
+
* In order to use image destination sizes different than the suggested ones
|
18 |
+
*
|
19 |
+
* A state for cropping an image.
|
20 |
+
*
|
21 |
+
* @class
|
22 |
+
* @augments wp.media.controller.Cropper
|
23 |
+
* @augments wp.media.controller.State
|
24 |
+
* @augments Backbone.Model
|
25 |
+
*/
|
26 |
+
wp.media.controller.CZRCustomizeImageCropper = wp.media.controller.Cropper.extend({
|
27 |
+
doCrop: function( attachment ) {
|
28 |
+
var cropDetails = attachment.get( 'cropDetails' ),
|
29 |
+
control = this.get( 'control' );
|
30 |
+
|
31 |
+
cropDetails.dst_width = control.params.dst_width;
|
32 |
+
cropDetails.dst_height = control.params.dst_height;
|
33 |
+
|
34 |
+
return wp.ajax.post( 'crop-image', {
|
35 |
+
wp_customize: 'on',
|
36 |
+
nonce: attachment.get( 'nonces' ).edit,
|
37 |
+
id: attachment.get( 'id' ),
|
38 |
+
context: control.id,
|
39 |
+
cropDetails: cropDetails
|
40 |
+
} );
|
41 |
+
}
|
42 |
+
});
|
43 |
+
|
44 |
+
|
45 |
+
|
46 |
+
/* CZRCroppedImageControl */
|
47 |
+
$.extend( CZRCroppedImageMths , {
|
48 |
+
/**
|
49 |
+
* Create a media modal select frame, and store it so the instance can be reused when needed.
|
50 |
+
* CZR: We don't want to crop svg (cropping fails), gif (animated gifs become static )
|
51 |
+
* @Override
|
52 |
+
* We need to override this in order to use our ImageCropper custom extension of wp.media.controller.Cropper
|
53 |
+
*
|
54 |
+
* See api.CroppedImageControl:initFrame() ( wp-admin/js/customize-controls.js )
|
55 |
+
*/
|
56 |
+
initFrame: function() {
|
57 |
+
|
58 |
+
var l10n = _wpMediaViewsL10n;
|
59 |
+
|
60 |
+
this.frame = wp.media({
|
61 |
+
button: {
|
62 |
+
text: l10n.select,
|
63 |
+
close: false
|
64 |
+
},
|
65 |
+
states: [
|
66 |
+
new wp.media.controller.Library({
|
67 |
+
title: this.params.button_labels.frame_title,
|
68 |
+
library: wp.media.query({ type: 'image' }),
|
69 |
+
multiple: false,
|
70 |
+
date: false,
|
71 |
+
priority: 20,
|
72 |
+
suggestedWidth: this.params.width,
|
73 |
+
suggestedHeight: this.params.height
|
74 |
+
}),
|
75 |
+
new wp.media.controller.CZRCustomizeImageCropper({
|
76 |
+
imgSelectOptions: this.calculateImageSelectOptions,
|
77 |
+
control: this
|
78 |
+
})
|
79 |
+
]
|
80 |
+
});
|
81 |
+
|
82 |
+
this.frame.on( 'select', this.onSelect, this );
|
83 |
+
this.frame.on( 'cropped', this.onCropped, this );
|
84 |
+
this.frame.on( 'skippedcrop', this.onSkippedCrop, this );
|
85 |
+
},
|
86 |
+
|
87 |
+
/**
|
88 |
+
* After an image is selected in the media modal, switch to the cropper
|
89 |
+
* state if the image isn't the right size.
|
90 |
+
*
|
91 |
+
* CZR: We don't want to crop svg (cropping fails), gif (animated gifs become static )
|
92 |
+
* @Override
|
93 |
+
* See api.CroppedImageControl:onSelect() ( wp-admin/js/customize-controls.js )
|
94 |
+
*/
|
95 |
+
onSelect: function() {
|
96 |
+
var attachment = this.frame.state().get( 'selection' ).first().toJSON();
|
97 |
+
if ( ! ( attachment.mime && attachment.mime.indexOf("image") > -1 ) ){
|
98 |
+
//Todo: better error handling, show some message?
|
99 |
+
this.frame.trigger( 'content:error' );
|
100 |
+
return;
|
101 |
+
}
|
102 |
+
if ( ( _.contains( ['image/svg+xml', 'image/gif'], attachment.mime ) ) || //do not crop gifs or svgs
|
103 |
+
this.params.width === attachment.width && this.params.height === attachment.height && ! this.params.flex_width && ! this.params.flex_height ) {
|
104 |
+
this.setImageFromAttachment( attachment );
|
105 |
+
this.frame.close();
|
106 |
+
} else {
|
107 |
+
this.frame.setState( 'cropper' );
|
108 |
+
}
|
109 |
+
},
|
110 |
+
});//extend
|
111 |
+
})( wp.customize, jQuery, _);
|
assets/czr/fmk/js/themes/_2_3_upload_control.js
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
//named czr_upload in the php setting map
|
3 |
+
var CZRUploadMths = CZRUploadMths || {};
|
4 |
+
( function ( api, $, _ ) {
|
5 |
+
/**
|
6 |
+
* @constructor
|
7 |
+
* @augments wp.customize.Control
|
8 |
+
* @augments wp.customize.Class
|
9 |
+
*/
|
10 |
+
$.extend( CZRUploadMths, {
|
11 |
+
ready: function() {
|
12 |
+
var control = this;
|
13 |
+
|
14 |
+
this.params.removed = this.params.removed || '';
|
15 |
+
|
16 |
+
this.success = $.proxy( this.success, this );
|
17 |
+
|
18 |
+
this.uploader = $.extend({
|
19 |
+
container: this.container,
|
20 |
+
browser: this.container.find('.czr-upload'),
|
21 |
+
//dropzone: this.container.find('.upload-dropzone'),
|
22 |
+
success: this.success,
|
23 |
+
plupload: {},
|
24 |
+
params: {}
|
25 |
+
}, this.uploader || {} );
|
26 |
+
|
27 |
+
if ( control.params.extensions ) {
|
28 |
+
control.uploader.plupload.filters = [{
|
29 |
+
title: api.l10n.allowedFiles,
|
30 |
+
extensions: control.params.extensions
|
31 |
+
}];
|
32 |
+
}
|
33 |
+
|
34 |
+
if ( control.params.context )
|
35 |
+
control.uploader.params['post_data[context]'] = this.params.context;
|
36 |
+
|
37 |
+
if ( api.settings.theme.stylesheet )
|
38 |
+
control.uploader.params['post_data[theme]'] = api.settings.theme.stylesheet;
|
39 |
+
|
40 |
+
this.uploader = new wp.Uploader( this.uploader );
|
41 |
+
|
42 |
+
this.remover = this.container.find('.remove');
|
43 |
+
this.remover.on( 'click keydown', function( event ) {
|
44 |
+
if ( event.type === 'keydown' && 13 !== event.which ) // enter
|
45 |
+
return;
|
46 |
+
control.setting.set( control.params.removed );
|
47 |
+
event.preventDefault();
|
48 |
+
});
|
49 |
+
|
50 |
+
this.removerVisibility = $.proxy( this.removerVisibility, this );
|
51 |
+
this.setting.bind( this.removerVisibility );
|
52 |
+
this.removerVisibility( this.setting() );
|
53 |
+
},
|
54 |
+
|
55 |
+
|
56 |
+
success: function( attachment ) {
|
57 |
+
this.setting.set( attachment.get('id') );
|
58 |
+
},
|
59 |
+
removerVisibility: function( to ) {
|
60 |
+
this.remover.toggle( to != this.params.removed );
|
61 |
+
}
|
62 |
+
});//extend
|
63 |
+
})( wp.customize , jQuery, _ );
|
assets/czr/fmk/js/themes/_2_4_layout_control.js
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
//named czr_layouts in the php setting map
|
3 |
+
var CZRLayoutSelectMths = CZRLayoutSelectMths || {};
|
4 |
+
( function ( api, $, _ ) {
|
5 |
+
$.extend( CZRLayoutSelectMths , {
|
6 |
+
ready: function() {
|
7 |
+
this.setupSelect();
|
8 |
+
},
|
9 |
+
|
10 |
+
setupSelect : function( obj ) {
|
11 |
+
var control = this;
|
12 |
+
$_select = this.container.find('select');
|
13 |
+
|
14 |
+
function addImg( state ) {
|
15 |
+
if (! state.id) { return state.text; }
|
16 |
+
if ( ! _.has( control.params.layouts, state.element.value ) )
|
17 |
+
return;
|
18 |
+
|
19 |
+
var _layout_data = control.params.layouts[state.element.value],
|
20 |
+
_src = _layout_data.src,
|
21 |
+
_title = _layout_data.label,
|
22 |
+
$state = $(
|
23 |
+
'<img src="' + _src +'" class="czr-layout-img" title="' + _title + '" /><span class="czr-layout-title">' + _title + '</span>'
|
24 |
+
);
|
25 |
+
return $state;
|
26 |
+
}
|
27 |
+
|
28 |
+
//destroy selected if set
|
29 |
+
//$_select.selecter("destroy");
|
30 |
+
|
31 |
+
//fire czrSelect2
|
32 |
+
$_select.czrSelect2( {
|
33 |
+
templateResult: addImg,
|
34 |
+
templateSelection: addImg,
|
35 |
+
minimumResultsForSearch: Infinity
|
36 |
+
});
|
37 |
+
},
|
38 |
+
});//$.extend
|
39 |
+
})( wp.customize , jQuery, _ );
|
assets/czr/fmk/js/themes/_2_extend_api_theme_controls.js
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
( function ( api, $, _ ) {
|
3 |
+
//THEME CONTROLS
|
4 |
+
//api.CZRBackgroundControl = api.CZRItemControl.extend( CZRBackgroundMths );
|
5 |
+
|
6 |
+
//api.CZRWidgetAreasControl = api.CZRDynModule.extend( CZRWidgetAreasMths );
|
7 |
+
|
8 |
+
api.CZRUploadControl = api.Control.extend( CZRUploadMths );
|
9 |
+
api.CZRLayoutControl = api.Control.extend( CZRLayoutSelectMths );
|
10 |
+
api.CZRMultiplePickerControl = api.Control.extend( CZRMultiplePickerMths );
|
11 |
+
api.CZRColorAlpha = api.Control.extend({ready: api.ColorControl.prototype.ready});//api.CZRColorAlpha
|
12 |
+
|
13 |
+
$.extend( api.controlConstructor, {
|
14 |
+
czr_upload : api.CZRUploadControl,
|
15 |
+
//czr_sidebars : api.CZRWidgetAreasControl,
|
16 |
+
//czr_socials : api.CZRSocialControl,
|
17 |
+
czr_multiple_picker : api.CZRMultiplePickerControl,
|
18 |
+
czr_layouts : api.CZRLayoutControl,
|
19 |
+
wp_color_alpha : api.CZRColorAlpha,
|
20 |
+
//czr_background : api.CZRBackgroundControl
|
21 |
+
});
|
22 |
+
|
23 |
+
if ( 'function' == typeof api.CroppedImageControl ) {
|
24 |
+
api.CZRCroppedImageControl = api.CroppedImageControl.extend( CZRCroppedImageMths );
|
25 |
+
|
26 |
+
$.extend( api.controlConstructor, {
|
27 |
+
czr_cropped_image : api.CZRCroppedImageControl
|
28 |
+
});
|
29 |
+
}
|
30 |
+
|
31 |
+
if ( 'function' == typeof api.CodeEditorControl ) {
|
32 |
+
$.extend( api.controlConstructor, {
|
33 |
+
czr_code_editor : api.CodeEditorControl
|
34 |
+
});
|
35 |
+
}
|
36 |
+
|
37 |
+
})( wp.customize, jQuery, _ );
|
assets/czr/fmk/js/themes/_6_control_dependencies.js
ADDED
@@ -0,0 +1,467 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
( function (api, $, _) {
|
3 |
+
var $_nav_section_container,
|
4 |
+
i18n = serverControlParams.i18n || {};
|
5 |
+
|
6 |
+
api.czr_CrtlDependenciesReady = $.Deferred();
|
7 |
+
|
8 |
+
api.bind( 'ready' , function() {
|
9 |
+
if ( _.has( api, 'czr_ctrlDependencies') )
|
10 |
+
return;
|
11 |
+
|
12 |
+
api.czr_ctrlDependencies = new api.CZR_ctrlDependencies();
|
13 |
+
api.czr_CrtlDependenciesReady.resolve();
|
14 |
+
} );
|
15 |
+
|
16 |
+
|
17 |
+
api.CZR_ctrlDependencies = api.Class.extend( {
|
18 |
+
dominiDeps : [],
|
19 |
+
initialize: function() {
|
20 |
+
var self = this;
|
21 |
+
|
22 |
+
this.defaultDominusParams = {
|
23 |
+
dominus : '',
|
24 |
+
servi : [],
|
25 |
+
visibility : null,
|
26 |
+
actions : null,
|
27 |
+
onSectionExpand : true
|
28 |
+
};
|
29 |
+
|
30 |
+
//store the default control dependencies
|
31 |
+
this.dominiDeps = _.extend( this.dominiDeps, this._getControlDeps() );
|
32 |
+
if ( ! _.isArray( self.dominiDeps ) ) {
|
33 |
+
throw new Error('Visibilities : the dominos dependency array is not an array.');
|
34 |
+
}
|
35 |
+
api.czr_activeSectionId.bind( function( section_id ) {
|
36 |
+
if ( ! _.isEmpty( section_id ) && api.section.has( section_id ) ) {
|
37 |
+
try {
|
38 |
+
self.setServiDependencies( section_id );
|
39 |
+
} catch( er ) {
|
40 |
+
api.errorLog( 'In api.CZR_ctrlDependencies : ' + er );
|
41 |
+
}
|
42 |
+
}
|
43 |
+
});
|
44 |
+
|
45 |
+
|
46 |
+
//@param target_source is an object :
|
47 |
+
// {
|
48 |
+
// target : section_id to awake
|
49 |
+
// source : section_id from which the request for awaking has been done
|
50 |
+
// }
|
51 |
+
api.bind( 'awaken-section', function( target_source ) {
|
52 |
+
try {
|
53 |
+
self.setServiDependencies( target_source.target, target_source.source );
|
54 |
+
} catch( er ) {
|
55 |
+
api.errorLog( 'On awaken-section, ctrl deps : ' + er );
|
56 |
+
}
|
57 |
+
});
|
58 |
+
|
59 |
+
//FAVICON SPECIFICS
|
60 |
+
//@todo => move to the theme ?
|
61 |
+
//favicon note on load and on change(since wp 4.3)
|
62 |
+
this._handleFaviconNote();
|
63 |
+
},
|
64 |
+
|
65 |
+
|
66 |
+
//Process the visibility callbacks for the controls of a target targetSectionId
|
67 |
+
//@param targetSectionId : string
|
68 |
+
//@param sourceSectionId : string, the section from which the request has been done
|
69 |
+
setServiDependencies : function( targetSectionId, sourceSectionId, refresh ) {
|
70 |
+
var self = this, params, dfd = $.Deferred();
|
71 |
+
|
72 |
+
refresh = refresh || false;
|
73 |
+
|
74 |
+
if ( _.isUndefined( targetSectionId ) || ! api.section.has( targetSectionId ) ) {
|
75 |
+
throw new Error( 'Control Dependencies : the targetSectionId is missing or not registered : ' + targetSectionId );
|
76 |
+
}
|
77 |
+
|
78 |
+
//Assign a visibility state deferred to the target section
|
79 |
+
api.section( targetSectionId ).czr_ctrlDependenciesReady = api.section( targetSectionId ).czr_ctrlDependenciesReady || $.Deferred();
|
80 |
+
|
81 |
+
//Bail here if this section has already been setup for ctrl dependencies
|
82 |
+
if ( ! refresh && 'resolved' == api.section( targetSectionId ).czr_ctrlDependenciesReady.state() )
|
83 |
+
return dfd.resolve().promise();
|
84 |
+
|
85 |
+
//FIND DOMINI IN THE TARGET SECTION
|
86 |
+
//=> setup their callbacks
|
87 |
+
_.each( self.dominiDeps , function( params ) {
|
88 |
+
if ( ! _.has( params, 'dominus' ) || ! _.isString( params.dominus ) || _.isEmpty( params.dominus ) ) {
|
89 |
+
throw new Error( 'Control Dependencies : a dominus control id must be a not empty string.');
|
90 |
+
}
|
91 |
+
|
92 |
+
var wpDominusId = api.CZR_Helpers.build_setId( params.dominus );
|
93 |
+
if ( ! api.control.has( wpDominusId ) )
|
94 |
+
return;
|
95 |
+
|
96 |
+
if ( api.control( wpDominusId ).section() != targetSectionId )
|
97 |
+
return;
|
98 |
+
|
99 |
+
//Attempt to normalize the params
|
100 |
+
params = self._prepareDominusParams( params );
|
101 |
+
if ( _.isEmpty(params) )
|
102 |
+
return;
|
103 |
+
|
104 |
+
self._processDominusCallbacks( params.dominus, params, refresh )
|
105 |
+
.fail( function() {
|
106 |
+
api.consoleLog( 'self._processDominusCallbacks fail for section ' + targetSectionId );
|
107 |
+
dfd.reject();
|
108 |
+
})
|
109 |
+
.done( function() {
|
110 |
+
dfd.resolve();
|
111 |
+
});
|
112 |
+
});
|
113 |
+
|
114 |
+
|
115 |
+
//EXTERNAL DOMINI : AWAKE THE SECTIONS
|
116 |
+
//check if any control of the current section is the servus of a dominus located in another section
|
117 |
+
var _secCtrls = api.CZR_Helpers.getSectionControlIds( targetSectionId ),
|
118 |
+
_getServusDomini = function( shortServudId ) {
|
119 |
+
var _dominiIds = [];
|
120 |
+
_.each( self.dominiDeps , function( params ) {
|
121 |
+
if ( ! _.has( params, 'servi' ) || ! _.isArray( params.servi ) || ! _.has( params, 'dominus' ) || _.isEmpty( params.dominus ) ) {
|
122 |
+
api.errorLog( 'Control Dependencies : wrong params in _getServusDomini.');
|
123 |
+
return;
|
124 |
+
}
|
125 |
+
|
126 |
+
if ( _.contains( params.servi , shortServudId ) && ! _.contains( _dominiIds , params.dominus ) ) {
|
127 |
+
//Attempt to normalize the params
|
128 |
+
params = self._prepareDominusParams( params );
|
129 |
+
if ( _.isEmpty(params) )
|
130 |
+
return;
|
131 |
+
else
|
132 |
+
_dominiIds.push( params.dominus );
|
133 |
+
}
|
134 |
+
});
|
135 |
+
return ! _.isArray( _dominiIds ) ? [] : _dominiIds;
|
136 |
+
},
|
137 |
+
_servusDominiIds = [];
|
138 |
+
|
139 |
+
//Build the domini array
|
140 |
+
_.each( _secCtrls, function( servusCandidateId ) {
|
141 |
+
if ( _.isEmpty( _getServusDomini( servusCandidateId ) ) )
|
142 |
+
return;
|
143 |
+
|
144 |
+
_servusDominiIds = _.union( _servusDominiIds, _getServusDomini( servusCandidateId ) );
|
145 |
+
});
|
146 |
+
|
147 |
+
//let's loop on the domini ids and check if we need to "awake" an external section
|
148 |
+
_.each( _servusDominiIds, function( shortDominusId ){
|
149 |
+
|
150 |
+
var wpDominusId = api.CZR_Helpers.build_setId( shortDominusId );
|
151 |
+
//This dominus must be located in another section
|
152 |
+
if ( api.control( wpDominusId ).section() == targetSectionId )
|
153 |
+
return;
|
154 |
+
//The dominus section can't be the current source if set. => otherwise potential infinite loop scenario.
|
155 |
+
if ( sourceSectionId == api.control( wpDominusId ).section() )
|
156 |
+
return;
|
157 |
+
//inform the api that a section has to be awaken
|
158 |
+
//=> first silently update the section controls if skope on
|
159 |
+
//=> then fire the visibilities
|
160 |
+
api.trigger( 'awaken-section', {
|
161 |
+
target : api.control( wpDominusId ).section(),
|
162 |
+
source : targetSectionId
|
163 |
+
} );
|
164 |
+
} );
|
165 |
+
|
166 |
+
//This section has been setup for ctrl dependencies
|
167 |
+
dfd.always( function() {
|
168 |
+
api.section( targetSectionId ).czr_ctrlDependenciesReady.resolve();
|
169 |
+
});
|
170 |
+
return dfd.promise();
|
171 |
+
},
|
172 |
+
|
173 |
+
|
174 |
+
//This method fires a callback when a control is registered in the api.
|
175 |
+
//If the control is registered, then it fires the callback when it is embedded
|
176 |
+
//If the control is embedeed, it fires the callback
|
177 |
+
//=> typical use case : a control can be both removed from the API and the DOM, and then added back on skope switch
|
178 |
+
//
|
179 |
+
//@param wpCtrlId : string name of the control as registered in the WP API
|
180 |
+
//@param callback : fn callback to fire
|
181 |
+
//@param args : [] or callback arguments
|
182 |
+
_deferCallbackForControl : function( wpCrtlId, callback, args ) {
|
183 |
+
var dfd = $.Deferred();
|
184 |
+
if ( _.isEmpty(wpCrtlId) || ! _.isString(wpCrtlId) ) {
|
185 |
+
throw new Error( '_deferCallbackForControl : the control id is missing.' );
|
186 |
+
}
|
187 |
+
if ( ! _.isFunction( callback ) ) {
|
188 |
+
throw new Error( '_deferCallbackForControl : callback must be a funtion.' );
|
189 |
+
}
|
190 |
+
args = ( _.isUndefined(args) || ! _.isArray( args ) ) ? [] : args;
|
191 |
+
|
192 |
+
if ( api.control.has( wpCrtlId ) ) {
|
193 |
+
if ( 'resolved' == api.control(wpCrtlId ).deferred.embedded.state() ) {
|
194 |
+
$.when( callback.apply( null, args ) )
|
195 |
+
.fail( function() { dfd.reject(); })
|
196 |
+
.done( function() { dfd.resolve(); });
|
197 |
+
} else {
|
198 |
+
api.control( wpCrtlId ).deferred.embedded.then( function() {
|
199 |
+
$.when( callback.apply( null, args ) )
|
200 |
+
.fail( function() { dfd.reject(); })
|
201 |
+
.done( function() { dfd.resolve(); });
|
202 |
+
});
|
203 |
+
}
|
204 |
+
} else {
|
205 |
+
api.control.when( wpCrtlId, function() {
|
206 |
+
api.control( wpCrtlId ).deferred.embedded.then( function() {
|
207 |
+
$.when( callback.apply( null, args ) )
|
208 |
+
.fail( function() { dfd.reject(); })
|
209 |
+
.done( function() { dfd.resolve(); });
|
210 |
+
});
|
211 |
+
});
|
212 |
+
}
|
213 |
+
return dfd.promise();
|
214 |
+
},
|
215 |
+
|
216 |
+
|
217 |
+
/*
|
218 |
+
* @return void
|
219 |
+
* show or hide setting according to the dependency + callback pair
|
220 |
+
* @params setId = the short setting id, whitout the theme option prefix OR the WP built-in setting
|
221 |
+
* @params o = { controls [], callback fn, onSectionExpand bool }
|
222 |
+
*/
|
223 |
+
_processDominusCallbacks : function( shortDominusId, dominusParams, refresh ) {
|
224 |
+
var self = this,
|
225 |
+
wpDominusId = api.CZR_Helpers.build_setId( shortDominusId ),
|
226 |
+
dominusSetInst = api( wpDominusId ),
|
227 |
+
dfd = $.Deferred(),
|
228 |
+
hasProcessed = false;
|
229 |
+
|
230 |
+
//loop on the dominus servi and apply + bind the visibility cb
|
231 |
+
_.each( dominusParams.servi , function( servusShortSetId ) {
|
232 |
+
if ( ! api.control.has( api.CZR_Helpers.build_setId( servusShortSetId ) ) ) {
|
233 |
+
return;
|
234 |
+
}
|
235 |
+
//set visibility when control is embedded
|
236 |
+
//or when control is added to the api
|
237 |
+
//=> solves the problem of visibility callbacks lost when control are re-rendered
|
238 |
+
var _fireDominusCallbacks = function( dominusSetVal, servusShortSetId, dominusParams, refresh ) {
|
239 |
+
var _toFire = [],
|
240 |
+
_args = arguments;
|
241 |
+
_.each( dominusParams, function( _item, _key ) {
|
242 |
+
switch( _key ) {
|
243 |
+
case 'visibility' :
|
244 |
+
self._setVisibility.apply( null, _args );
|
245 |
+
break;
|
246 |
+
case 'actions' :
|
247 |
+
if ( _.isFunction( _item ) )
|
248 |
+
_item.apply( null, _args );
|
249 |
+
break;
|
250 |
+
}
|
251 |
+
});
|
252 |
+
},
|
253 |
+
_deferCallbacks = function( dominusSetVal ) {
|
254 |
+
dominusSetVal = dominusSetVal || dominusSetInst();
|
255 |
+
var wpServusSetId = api.CZR_Helpers.build_setId( servusShortSetId );
|
256 |
+
self._deferCallbackForControl(
|
257 |
+
wpServusSetId,
|
258 |
+
_fireDominusCallbacks,
|
259 |
+
[ dominusSetVal, servusShortSetId, dominusParams ]
|
260 |
+
)
|
261 |
+
.always( function() { hasProcessed = true; })
|
262 |
+
.fail( function() { dfd.reject(); })
|
263 |
+
.done( function() { dfd.resolve(); });
|
264 |
+
};
|
265 |
+
|
266 |
+
|
267 |
+
//APPLY THE DEPENDENCIES
|
268 |
+
_deferCallbacks();
|
269 |
+
|
270 |
+
//BIND THE DOMINUS SETTING INSTANCE
|
271 |
+
//store the visibility bound state
|
272 |
+
if ( ! _.has( dominusSetInst, 'czr_visibilityServi' ) )
|
273 |
+
dominusSetInst.czr_visibilityServi = new api.Value( [] );
|
274 |
+
|
275 |
+
//Maybe bind to react on setting _dirty change
|
276 |
+
var _currentDependantBound = dominusSetInst.czr_visibilityServi();
|
277 |
+
//Make sure a dependant visibility action is bound only once for a setting id to another setting control id
|
278 |
+
if ( ! _.contains( _currentDependantBound, servusShortSetId ) ) {
|
279 |
+
dominusSetInst.bind( function( dominusSetVal ) {
|
280 |
+
_deferCallbacks( dominusSetVal );
|
281 |
+
});
|
282 |
+
dominusSetInst.czr_visibilityServi( _.union( _currentDependantBound, [ servusShortSetId ] ) );
|
283 |
+
}
|
284 |
+
} );//_.each
|
285 |
+
if ( ! hasProcessed )
|
286 |
+
return dfd.resolve().promise();
|
287 |
+
return dfd.promise();
|
288 |
+
},
|
289 |
+
|
290 |
+
|
291 |
+
|
292 |
+
//@return void()
|
293 |
+
_setVisibility : function ( dominusSetVal, servusShortSetId, dominusParams, refresh ) {
|
294 |
+
var wpServusSetId = api.CZR_Helpers.build_setId( servusShortSetId ),
|
295 |
+
visibility = dominusParams.visibility( dominusSetVal, servusShortSetId, dominusParams.dominus );
|
296 |
+
|
297 |
+
refresh = refresh || false;
|
298 |
+
//Allows us to filter between visibility callbacks and other actions
|
299 |
+
//a non visibility callback shall return null
|
300 |
+
if ( ! _.isBoolean( visibility ) || ( 'unchanged' == visibility && ! refresh ) )
|
301 |
+
return;
|
302 |
+
|
303 |
+
//when skope is enabled, we might be doing a silent update
|
304 |
+
//=> this method should be bailed if so
|
305 |
+
var _doVisibilitiesWhenPossible = function() {
|
306 |
+
if ( api.state.has( 'silent-update-processing' ) && api.state( 'silent-update-processing' )() )
|
307 |
+
return;
|
308 |
+
api.control( wpServusSetId, function( _controlInst ) {
|
309 |
+
var _args = {
|
310 |
+
duration : 'fast',
|
311 |
+
completeCallback : function() {},
|
312 |
+
unchanged : false
|
313 |
+
};
|
314 |
+
|
315 |
+
if ( _.has( _controlInst, 'active' ) )
|
316 |
+
visibility = visibility && _controlInst.active();
|
317 |
+
|
318 |
+
if ( _.has( _controlInst, 'defaultActiveArguments' ) )
|
319 |
+
_args = control.defaultActiveArguments;
|
320 |
+
|
321 |
+
_controlInst.onChangeActive( visibility , _controlInst.defaultActiveArguments );
|
322 |
+
});
|
323 |
+
if ( api.state.has( 'silent-update-processing' ) ) {
|
324 |
+
api.state( 'silent-update-processing' ).unbind( _doVisibilitiesWhenPossible );
|
325 |
+
}
|
326 |
+
};
|
327 |
+
|
328 |
+
if ( api.state.has( 'silent-update-processing' ) && api.state( 'silent-update-processing' )() ) {
|
329 |
+
api.state( 'silent-update-processing' ).bind( _doVisibilitiesWhenPossible );
|
330 |
+
} else {
|
331 |
+
_doVisibilitiesWhenPossible();
|
332 |
+
}
|
333 |
+
|
334 |
+
},
|
335 |
+
|
336 |
+
|
337 |
+
|
338 |
+
|
339 |
+
|
340 |
+
|
341 |
+
|
342 |
+
|
343 |
+
|
344 |
+
|
345 |
+
/*****************************************************************************
|
346 |
+
* HELPERS
|
347 |
+
*****************************************************************************/
|
348 |
+
/*
|
349 |
+
* Abstract
|
350 |
+
* Will be provided by the theme
|
351 |
+
* @return main control dependencies object
|
352 |
+
*/
|
353 |
+
_getControlDeps : function() {
|
354 |
+
return {};
|
355 |
+
},
|
356 |
+
|
357 |
+
|
358 |
+
//@return a visibility ready object of param describing the dependencies between a dominus and its servi.
|
359 |
+
//this.defaultDominusParams = {
|
360 |
+
// dominus : '',
|
361 |
+
// servi : [],
|
362 |
+
// visibility : fn() {},
|
363 |
+
// actions : fn() {},
|
364 |
+
// onSectionExpand : true
|
365 |
+
// };
|
366 |
+
_prepareDominusParams : function( params_candidate ) {
|
367 |
+
var self = this,
|
368 |
+
_ready_params = {};
|
369 |
+
|
370 |
+
//Check mandatory conditions
|
371 |
+
if ( ! _.isObject( params_candidate ) ) {
|
372 |
+
api.errorLog( 'Visibilities : a dominus param definition must be an object.');
|
373 |
+
return _ready_params;
|
374 |
+
}
|
375 |
+
if ( ! _.has( params_candidate, 'visibility' ) && ! _.has( params_candidate, 'actions' ) ) {
|
376 |
+
api.errorLog( 'Visibilities : a dominus definition must include a visibility or an actions callback.');
|
377 |
+
return _ready_params;
|
378 |
+
}
|
379 |
+
if ( ! _.has( params_candidate, 'dominus' ) || ! _.isString( params_candidate.dominus ) || _.isEmpty( params_candidate.dominus ) ) {
|
380 |
+
api.errorLog( 'Visibilities : a dominus control id must be a not empty string.');
|
381 |
+
return _ready_params;
|
382 |
+
}
|
383 |
+
var wpDominusId = api.CZR_Helpers.build_setId( params_candidate.dominus );
|
384 |
+
if ( ! api.control.has( wpDominusId ) ) {
|
385 |
+
api.errorLog( 'Visibilities : a dominus control id is not registered : ' + wpDominusId );
|
386 |
+
return _ready_params;
|
387 |
+
}
|
388 |
+
if ( ! _.has( params_candidate, 'servi' ) || _.isUndefined( params_candidate.servi ) || ! _.isArray( params_candidate.servi ) || _.isEmpty( params_candidate.servi ) ) {
|
389 |
+
api.errorLog( 'Visibilities : servi must be set as an array not empty.');
|
390 |
+
return _ready_params;
|
391 |
+
}
|
392 |
+
|
393 |
+
_.each( self.defaultDominusParams , function( _value, _key ) {
|
394 |
+
var _candidate_val = params_candidate[ _key ];
|
395 |
+
|
396 |
+
switch( _key ) {
|
397 |
+
case 'visibility' :
|
398 |
+
if ( ! _.isUndefined( _candidate_val ) && ! _.isEmpty( _candidate_val ) && ! _.isFunction( _candidate_val ) ) {
|
399 |
+
throw new Error( 'Visibilities : a dominus visibility callback must be a function : ' + params_candidate.dominus );
|
400 |
+
}
|
401 |
+
break;
|
402 |
+
case 'actions' :
|
403 |
+
if ( ! _.isUndefined( _candidate_val ) && ! _.isEmpty( _candidate_val ) && ! _.isFunction( _candidate_val ) ) {
|
404 |
+
throw new Error( 'Visibilities : a dominus actions callback must be a function : ' + params_candidate.dominus );
|
405 |
+
}
|
406 |
+
break;
|
407 |
+
case 'onSectionExpand' :
|
408 |
+
if ( ! _.isUndefined( _candidate_val ) && ! _.isEmpty( _candidate_val ) && ! _.isBoolean( _candidate_val ) ) {
|
409 |
+
throw new Error( 'Visibilities : a dominus onSectionExpand param must be a boolean : ' + params_candidate.dominus );
|
410 |
+
}
|
411 |
+
break;
|
412 |
+
}
|
413 |
+
_ready_params[_key] = _candidate_val;
|
414 |
+
});
|
415 |
+
|
416 |
+
return _ready_params;
|
417 |
+
},
|
418 |
+
|
419 |
+
|
420 |
+
|
421 |
+
/*****************************************************************************
|
422 |
+
* FAVICON SPECIFICS
|
423 |
+
*****************************************************************************/
|
424 |
+
/**
|
425 |
+
* Fired on api ready
|
426 |
+
* May change the site_icon description on load
|
427 |
+
* May add a callback to site_icon
|
428 |
+
* @return void()
|
429 |
+
*/
|
430 |
+
_handleFaviconNote : function() {
|
431 |
+
var self = this,
|
432 |
+
_fav_setId = api.CZR_Helpers.build_setId( serverControlParams.faviconOptionName );
|
433 |
+
//do nothing if (||)
|
434 |
+
//1) WP version < 4.3 where site icon has been introduced
|
435 |
+
//2) User had not defined a favicon
|
436 |
+
//3) User has already set WP site icon
|
437 |
+
if ( ! api.has('site_icon') || ! api.control('site_icon') || ( api.has( _fav_setId ) && 0 === + api( _fav_setId )() ) || + api('site_icon')() > 0 )
|
438 |
+
return;
|
439 |
+
|
440 |
+
var _oldDes = api.control('site_icon').params.description;
|
441 |
+
_newDes = ['<strong>' , i18n.faviconNote || '' , '</strong><br/><br/>' ].join('') + _oldDes;
|
442 |
+
|
443 |
+
//on api ready
|
444 |
+
self._printFaviconNote(_newDes );
|
445 |
+
|
446 |
+
//on site icon change
|
447 |
+
api('site_icon').callbacks.add( function(to) {
|
448 |
+
if ( +to > 0 ) {
|
449 |
+
//reset the description to default
|
450 |
+
api.control('site_icon').container.find('.description').text(_oldDes);
|
451 |
+
//reset the previous favicon setting
|
452 |
+
if ( api.has( _fav_setId ) )
|
453 |
+
api( _fav_setId ).set("");
|
454 |
+
}
|
455 |
+
else {
|
456 |
+
self._printFaviconNote(_newDes );
|
457 |
+
}
|
458 |
+
});
|
459 |
+
},
|
460 |
+
|
461 |
+
//Add a note to the WP control description if user has already defined a favicon
|
462 |
+
_printFaviconNote : function( _newDes ) {
|
463 |
+
api.control('site_icon').container.find('.description').html(_newDes);
|
464 |
+
}
|
465 |
+
}
|
466 |
+
);//api.Class.extend() //api.CZR_ctrlDependencies
|
467 |
+
})( wp.customize, jQuery, _);
|
assets/czr/fmk/js/themes/_8_various_theme_dom_ready.js
ADDED
@@ -0,0 +1,115 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
//DOM READY :
|
3 |
+
//1) FIRE SPECIFIC INPUT PLUGINS
|
4 |
+
//2) ADD SOME COOL STUFFS
|
5 |
+
//3) SPECIFIC CONTROLS ACTIONS
|
6 |
+
( function ( wp, $ ) {
|
7 |
+
$( function($) {
|
8 |
+
var api = wp.customize || api;
|
9 |
+
|
10 |
+
//WHAT IS HAPPENING IN THE MESSENGER
|
11 |
+
// $(window.parent).on( 'message', function(e, o) {
|
12 |
+
// api.consoleLog('SENT STUFFS', JSON.parse( e.originalEvent.data), e );
|
13 |
+
// });
|
14 |
+
// $( window ).on( 'message', function(e, o) {
|
15 |
+
// api.consoleLog('INCOMING MESSAGE', JSON.parse( e.originalEvent.data), e );
|
16 |
+
// });
|
17 |
+
// $(window.document).bind("ajaxSend", function(e, o){
|
18 |
+
// api.consoleLog('AJAX SEND', e, arguments );
|
19 |
+
// }).bind("ajaxComplete", function(e, o){
|
20 |
+
// api.consoleLog('AJAX COMPLETE', e, o);
|
21 |
+
// });
|
22 |
+
|
23 |
+
/* RECENTER CURRENT SECTIONS */
|
24 |
+
$('.accordion-section').not('.control-panel').on('click', function () {
|
25 |
+
_recenter_current_section($(this));
|
26 |
+
});
|
27 |
+
|
28 |
+
function _recenter_current_section( section ) {
|
29 |
+
var $siblings = section.siblings( '.open' );
|
30 |
+
//check if clicked element is above or below sibling with offset.top
|
31 |
+
if ( 0 !== $siblings.length && $siblings.offset().top < 0 ) {
|
32 |
+
$('.wp-full-overlay-sidebar-content').animate({
|
33 |
+
scrollTop: - $('#customize-theme-controls').offset().top - $siblings.height() + section.offset().top + $('.wp-full-overlay-sidebar-content').offset().top
|
34 |
+
}, 700);
|
35 |
+
}
|
36 |
+
}//end of fn
|
37 |
+
|
38 |
+
|
39 |
+
/* CHECKBOXES */
|
40 |
+
api.czrSetupCheckbox = function( controlId, refresh ) {
|
41 |
+
var _ctrl = api.control( controlId );
|
42 |
+
$('input[type=checkbox]:not(.nimblecheck-input)', _ctrl.container ).each( function() {
|
43 |
+
//Exclude font customizer
|
44 |
+
if ( 'tc_font_customizer_settings' == _ctrl.params.section )
|
45 |
+
return;
|
46 |
+
//first fix the checked / unchecked status
|
47 |
+
if ( 0 === $(this).val() || '0' == $(this).val() || 'off' == $(this).val() || _.isEmpty($(this).val() ) ) {
|
48 |
+
$(this).prop('checked', false);
|
49 |
+
} else {
|
50 |
+
$(this).prop('checked', true);
|
51 |
+
}
|
52 |
+
|
53 |
+
//then render icheck if not done already
|
54 |
+
if ( 0 !== $(this).closest('div[class^="icheckbox"]').length )
|
55 |
+
return;
|
56 |
+
|
57 |
+
$(this).iCheck({
|
58 |
+
checkboxClass: 'icheckbox_flat-grey',
|
59 |
+
//checkedClass: 'checked',
|
60 |
+
radioClass: 'iradio_flat-grey',
|
61 |
+
})
|
62 |
+
.on( 'ifChanged', function(e){
|
63 |
+
$(this).val( false === $(this).is(':checked') ? 0 : 1 );
|
64 |
+
$(e.currentTarget).trigger('change');
|
65 |
+
});
|
66 |
+
});
|
67 |
+
};//api.czrSetupCheckbox()
|
68 |
+
|
69 |
+
/* SELECT INPUT */
|
70 |
+
api.czrSetupSelect = function(controlId, refresh) {
|
71 |
+
//Exclude no-selecter-js
|
72 |
+
$('select[data-customize-setting-link]', api.control(controlId).container )
|
73 |
+
.not('.no-selecter-js')
|
74 |
+
.each( function() {
|
75 |
+
$(this).selecter({
|
76 |
+
//triggers a change event on the view, passing the newly selected value + index as parameters.
|
77 |
+
// callback : function(value, index) {
|
78 |
+
// self.triggerSettingChange( window.event || {} , value, index); // first param is a null event.
|
79 |
+
// }
|
80 |
+
});
|
81 |
+
});
|
82 |
+
};//api.czrSetupSelect()
|
83 |
+
|
84 |
+
|
85 |
+
/* NUMBER INPUT */
|
86 |
+
api.czrSetupStepper = function( controlId, refresh ) {
|
87 |
+
var _ctrl = api.control( controlId );
|
88 |
+
$('input[type="number"]', _ctrl.container ).each( function() { $(this).stepper(); });
|
89 |
+
};//api.czrSetupStepper()
|
90 |
+
|
91 |
+
// LOOP ON EACH CONTROL REGISTERED AND INSTANTIATE THE PLUGINS
|
92 |
+
// @todo => react on control added
|
93 |
+
api.control.each( function( control ){
|
94 |
+
if ( ! _.has( control, 'id' ) )
|
95 |
+
return;
|
96 |
+
//exclude widget controls and menu controls for checkboxes
|
97 |
+
if ( 'widget_' != control.id.substring(0, 'widget_'.length ) && 'nav_menu' != control.id.substring( 0, 'nav_menu'.length ) ) {
|
98 |
+
api.czrSetupCheckbox(control.id);
|
99 |
+
}
|
100 |
+
if ( 'nav_menu_locations' != control.id.substring( 0, 'nav_menu_locations'.length ) ) {
|
101 |
+
api.czrSetupSelect(control.id);
|
102 |
+
}
|
103 |
+
|
104 |
+
// Stepper : exclude controls from specific sections
|
105 |
+
var _exclude = [
|
106 |
+
'publish_settings', //<= the outer section introduced in v4.9 to publish / saved draft / schedule
|
107 |
+
'tc_font_customizer_settings' //the font customizer plugin has its own way to instantiate the stepper, with custom attributes previously set to the input like step, min, etc...
|
108 |
+
];
|
109 |
+
|
110 |
+
if ( 0 < control.container.find( 'input[type="number"]' ).length && control.params && control.params.section && ! _.contains( _exclude, control.params.section ) ) {
|
111 |
+
api.czrSetupStepper(control.id);
|
112 |
+
}
|
113 |
+
});
|
114 |
+
});//end of $( function($) ) dom ready
|
115 |
+
})( wp, jQuery );
|
assets/czr/sek/css/_dev_control/DEPRECATED__0_5_control_feedback_ui.css
ADDED
@@ -0,0 +1,128 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* FEEDBACK UI */
|
2 |
+
#nimble-feedback {
|
3 |
+
background: #ffffff;
|
4 |
+
border-bottom: 1px solid #aaa!important;
|
5 |
+
border-left: 4px solid #00a0d2;
|
6 |
+
color: #222!important;
|
7 |
+
font-size: 12px!important;
|
8 |
+
position: absolute;
|
9 |
+
top: 36px;
|
10 |
+
right: 0;
|
11 |
+
left: 0;
|
12 |
+
height: 150px;
|
13 |
+
overflow: auto;
|
14 |
+
padding: 15px;
|
15 |
+
z-index: 0;
|
16 |
+
-webkit-transition: top 0.3s ease-in-out;
|
17 |
+
-moz-transition: top, 0.3s ease-in-out;
|
18 |
+
-ms-transition: top, 0.3s ease-in-out;
|
19 |
+
-o-transition: top, 0.3s ease-in-out;
|
20 |
+
transition: top 0.3s ease-in-out;
|
21 |
+
text-align: center;
|
22 |
+
display: -webkit-box;
|
23 |
+
display: -ms-flexbox;
|
24 |
+
display: flex;
|
25 |
+
-webkit-box-align: center;
|
26 |
+
-ms-flex-align: center;
|
27 |
+
align-items: center;
|
28 |
+
-webkit-box-pack: center;
|
29 |
+
-ms-flex-pack: center;
|
30 |
+
justify-content: center;
|
31 |
+
}
|
32 |
+
|
33 |
+
.nimble-feedback-ui-visible #customize-preview iframe {
|
34 |
+
top: 217px;
|
35 |
+
height: calc(100vh - 217px);
|
36 |
+
}
|
37 |
+
|
38 |
+
/*#nimble-feedback .sek-main-feedback-heading {
|
39 |
+
display: -webkit-box;
|
40 |
+
display: -ms-flexbox;
|
41 |
+
display: flex;
|
42 |
+
-webkit-box-align: center;
|
43 |
+
-ms-flex-align: center;
|
44 |
+
align-items: center;
|
45 |
+
-webkit-box-pack: center;
|
46 |
+
-ms-flex-pack: center;
|
47 |
+
justify-content: center;
|
48 |
+
}*/
|
49 |
+
#nimble-feedback .sek-main-feedback-heading p {
|
50 |
+
margin:0;
|
51 |
+
}
|
52 |
+
|
53 |
+
#nimble-feedback .sek-feedback-step-three-thanks p { font-size: 17px;}
|
54 |
+
|
55 |
+
.sek-feedback-nimble-icon {
|
56 |
+
height: 40px;
|
57 |
+
width: 40px;
|
58 |
+
}
|
59 |
+
.sek-feedback-nimble-icon.big {
|
60 |
+
height: 60px;
|
61 |
+
width: 60px;
|
62 |
+
}
|
63 |
+
|
64 |
+
.wp-core-ui #nimble-feedback .sek-feedback-btn {
|
65 |
+
margin: 0 6px;
|
66 |
+
-webkit-transition: background 200ms linear, color 200ms linear;
|
67 |
+
-ms-transition: background 200ms linear, color 200ms linear;
|
68 |
+
transition: background 200ms linear, color 200ms linear;
|
69 |
+
-webkit-border-radius: 4px;
|
70 |
+
border-radius: 4px;
|
71 |
+
box-shadow: none;
|
72 |
+
font-weight: 600;
|
73 |
+
}
|
74 |
+
.wp-core-ui #nimble-feedback .sek-feedback-btn.sek-pos {
|
75 |
+
border-color: #da791d !important;
|
76 |
+
background: #f37656;
|
77 |
+
color: #fff;
|
78 |
+
}
|
79 |
+
.wp-core-ui #nimble-feedback .sek-feedback-btn.sek-pos:hover, .wp-core-ui #nimble-feedback .sek-feedback-btn.sek-pos:focus {
|
80 |
+
border-color: #f37656 !important;
|
81 |
+
background: transparent;
|
82 |
+
color: #f37656;
|
83 |
+
opacity: 1;
|
84 |
+
}
|
85 |
+
|
86 |
+
.wp-core-ui #nimble-feedback .sek-feedback-btn.sek-neg {
|
87 |
+
border: 1px solid #f37656;
|
88 |
+
color: #f37656;
|
89 |
+
background: #ffffff;
|
90 |
+
}
|
91 |
+
.wp-core-ui #nimble-feedback .sek-feedback-btn.sek-neg:hover, .wp-core-ui #nimble-feedback .sek-feedback-btn.sek-neg:focus {
|
92 |
+
color: #ffffff;
|
93 |
+
background: #f37656;
|
94 |
+
border: 1px solid #f37656;
|
95 |
+
}
|
96 |
+
.wp-core-ui #nimble-feedback .sek-feedback-btn.sek-already {
|
97 |
+
background: none;
|
98 |
+
border: none;
|
99 |
+
color: #00a0d2;
|
100 |
+
font-weight:normal;
|
101 |
+
}
|
102 |
+
.wp-core-ui #nimble-feedback .sek-feedback-btn.sek-close-feedback-ui {
|
103 |
+
background: #ffffff;
|
104 |
+
border: none;
|
105 |
+
font-weight:normal;
|
106 |
+
}
|
107 |
+
.wp-core-ui #nimble-feedback .sek-feedback-btn.sek-close-feedback-ui:hover {
|
108 |
+
color:#f37656;
|
109 |
+
}
|
110 |
+
|
111 |
+
#nimble-feedback p {
|
112 |
+
font-size: 14px;
|
113 |
+
line-height: 1.5em;
|
114 |
+
font-style: normal;
|
115 |
+
margin: 0 0 10px;
|
116 |
+
}
|
117 |
+
#nimble-feedback .sek-stars{color:#ffb900; cursor:pointer;font-size: 25px;}
|
118 |
+
#nimble-feedback .sek-signature {
|
119 |
+
font-size: 13px;
|
120 |
+
font-style: italic;
|
121 |
+
}
|
122 |
+
.sek-close-feedback-ui {
|
123 |
+
position: fixed;
|
124 |
+
top: 44px;
|
125 |
+
right: 25px;
|
126 |
+
}
|
127 |
+
|
128 |
+
.sek-feedback-step-two-enjoying, .sek-feedback-step-two-not-enjoying, .sek-feedback-step-three-thanks { display: none;}
|
assets/czr/sek/css/_dev_control/_0_0_control_font_and_core_overrides.css
ADDED
@@ -0,0 +1,115 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* @see https://github.com/google/material-design-icons/blob/master/iconfont/material-icons.css */
|
2 |
+
@font-face {
|
3 |
+
font-family: 'Material Icons';
|
4 |
+
font-style: normal;
|
5 |
+
font-weight: 400;
|
6 |
+
src: url('../fonts/material-icons/MaterialIcons-Regular.eot'); /* For IE6-8 */
|
7 |
+
src: local('Material Icons'),
|
8 |
+
local('MaterialIcons-Regular'),
|
9 |
+
url('../fonts/material-icons/MaterialIcons-Regular.woff2') format('woff2'),
|
10 |
+
url('../fonts/material-icons/MaterialIcons-Regular.woff') format('woff'),
|
11 |
+
url('../fonts/material-icons/MaterialIcons-Regular.ttf') format('truetype');
|
12 |
+
}
|
13 |
+
.material-icons {
|
14 |
+
font-family: 'Material Icons';
|
15 |
+
font-weight: normal;
|
16 |
+
font-style: normal;
|
17 |
+
font-size: 24px; /* Preferred icon size */
|
18 |
+
display: inline-block;
|
19 |
+
line-height: 1;
|
20 |
+
text-transform: none;
|
21 |
+
letter-spacing: normal;
|
22 |
+
word-wrap: normal;
|
23 |
+
white-space: nowrap;
|
24 |
+
direction: ltr;
|
25 |
+
|
26 |
+
/* Support for all WebKit browsers. */
|
27 |
+
-webkit-font-smoothing: antialiased;
|
28 |
+
/* Support for Safari and Chrome. */
|
29 |
+
text-rendering: optimizeLegibility;
|
30 |
+
|
31 |
+
/* Support for Firefox. */
|
32 |
+
-moz-osx-font-smoothing: grayscale;
|
33 |
+
|
34 |
+
/* Support for IE. */
|
35 |
+
-webkit-font-feature-settings: 'liga';
|
36 |
+
font-feature-settings: 'liga';
|
37 |
+
}
|
38 |
+
|
39 |
+
|
40 |
+
|
41 |
+
/* OVERRIDE WP CUSTOMIZER */
|
42 |
+
|
43 |
+
/* FOR LEVEL TREE AND TEMPLATE GALLERY */
|
44 |
+
/* space for the Level Tree and template gallery */
|
45 |
+
#customize-preview iframe, #nimble-level-tree {
|
46 |
+
-webkit-transition: top 0.3s ease-in-out;
|
47 |
+
-moz-transition: top, 0.3s ease-in-out;
|
48 |
+
-ms-transition: top, 0.3s ease-in-out;
|
49 |
+
-o-transition: top, 0.3s ease-in-out;
|
50 |
+
transition: top 0.3s ease-in-out;
|
51 |
+
}
|
52 |
+
#customize-preview iframe {
|
53 |
+
z-index: 1;
|
54 |
+
}
|
55 |
+
|
56 |
+
ul[id*="sub-accordion-section-__nimble__"] {
|
57 |
+
background: #F2F2F2!important;
|
58 |
+
}
|
59 |
+
/* No sliding transition needed when switching from a section to another when generating the UI's */
|
60 |
+
#customize-theme-controls .customize-pane-child[id*="__nimble__"] {
|
61 |
+
-webkit-transition: unset;
|
62 |
+
-o-transition: unset;
|
63 |
+
transition: unset;
|
64 |
+
}
|
65 |
+
/* CONTROLS */
|
66 |
+
li[id*="__nimble__"].customize-control {
|
67 |
+
margin: 4px 0;
|
68 |
+
padding: 2px;
|
69 |
+
width: calc( 100% - 4px );
|
70 |
+
border: 1px solid rgba(221, 221, 221, 0.43);
|
71 |
+
box-shadow: 1px 1px 2px 0 rgba(75, 75, 85, 0.2);
|
72 |
+
-webkit-box-shadow: 1px 1px 2px 0 rgba(75, 75, 85, 0.2);
|
73 |
+
background-color: #fff;
|
74 |
+
}
|
75 |
+
li[id*="__nimble__"].customize-control .customize-control-title {
|
76 |
+
font-size: 13.5px;
|
77 |
+
line-height: 1.5em;
|
78 |
+
font-weight: normal;
|
79 |
+
margin-bottom: 4px;
|
80 |
+
}
|
81 |
+
li[id*="__nimble__"].customize-control label {
|
82 |
+
cursor: pointer;
|
83 |
+
}
|
84 |
+
li[id*="__nimble__"].customize-control span.customize-control-title:first-child {
|
85 |
+
margin-left: 21px;
|
86 |
+
}
|
87 |
+
|
88 |
+
/* SECTIONS */
|
89 |
+
/* nov 2019 => experimental fix for experimental fix for https://github.com/presscustomizr/nimble-builder/issues/539 */
|
90 |
+
#customize-theme-controls ul[id*="sub-accordion-section-__nimble__"].open {
|
91 |
+
top: 0!important;
|
92 |
+
}
|
93 |
+
|
94 |
+
|
95 |
+
/* VARIOUS HELPER CLASSES */
|
96 |
+
.sek-float-right {float: right;}
|
97 |
+
.sek-float-left { float: left;}
|
98 |
+
.sek-flex-vertical-center {
|
99 |
+
display: -webkit-box;
|
100 |
+
display: -ms-flexbox;
|
101 |
+
display: flex;
|
102 |
+
-webkit-box-align: center;
|
103 |
+
-ms-flex-align: center;
|
104 |
+
align-items: center;
|
105 |
+
}
|
106 |
+
|
107 |
+
|
108 |
+
/* FRONT MODULE UI */
|
109 |
+
li[id^="accordion-section-__nimble__"] {
|
110 |
+
margin-top: 16px;
|
111 |
+
}
|
112 |
+
li[id^="accordion-section-__nimble__"] > h3 {
|
113 |
+
border-top:1px solid #ddd;
|
114 |
+
}
|
115 |
+
|
assets/czr/sek/css/_dev_control/_0_1_control_module_and_section_input.css
ADDED
@@ -0,0 +1,321 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* MODULE AND SECTION PICKER INPUT */
|
2 |
+
[data-sek-content-type] {
|
3 |
+
float: left;
|
4 |
+
padding: 0%;
|
5 |
+
margin: 1.8%;
|
6 |
+
text-align: center;
|
7 |
+
cursor: move;
|
8 |
+
/*cursor: -webkit-grab;*/
|
9 |
+
/*background: #eee;*/
|
10 |
+
-webkit-transition: -webkit-box-shadow .2s ease;
|
11 |
+
transition: -webkit-box-shadow .2s ease;
|
12 |
+
-o-transition: box-shadow .2s ease;
|
13 |
+
transition: box-shadow .2s ease;
|
14 |
+
transition: box-shadow .2s ease, -webkit-box-shadow .2s ease;
|
15 |
+
-webkit-box-shadow: 0 2px 5px rgba(0,0,0,.25);
|
16 |
+
box-shadow: 0 2px 5px rgba(0,0,0,.25);
|
17 |
+
border-radius: 4px;
|
18 |
+
}
|
19 |
+
[data-sek-content-type="module"] {
|
20 |
+
width: 29%;
|
21 |
+
height: 130px;
|
22 |
+
position: relative;
|
23 |
+
}
|
24 |
+
.sek-is-pro {
|
25 |
+
position: absolute;
|
26 |
+
top: 5px;
|
27 |
+
z-index: 10;
|
28 |
+
right: 5px;
|
29 |
+
height: 20px;
|
30 |
+
width: 28px;
|
31 |
+
}
|
32 |
+
.sek-is-pro-template {
|
33 |
+
position: absolute;
|
34 |
+
top: 0px;
|
35 |
+
z-index: 10;
|
36 |
+
right: 5px;
|
37 |
+
width: 40px;
|
38 |
+
}
|
39 |
+
[data-sek-content-type="preset_section"]:hover .sek-is-pro img, [data-sek-tmpl-item-id]:hover .sek-is-pro img {
|
40 |
+
opacity: 0.5;
|
41 |
+
}
|
42 |
+
|
43 |
+
|
44 |
+
/* When sections are displayed in the module picker. Typically the columns sections */
|
45 |
+
li[id*="sek_draggable_modules"] [data-sek-content-type="preset_section"] {
|
46 |
+
width: 29%;
|
47 |
+
height: 130px;
|
48 |
+
}
|
49 |
+
|
50 |
+
.sek-content-type-wrapper [data-sek-content-type="preset_section"] {
|
51 |
+
width: 95%;
|
52 |
+
height: 165px;
|
53 |
+
position: relative;
|
54 |
+
overflow: hidden;
|
55 |
+
}
|
56 |
+
|
57 |
+
/* SEPT 2020 : LINK TO DEMO SECTION */
|
58 |
+
.sek-demo-link {
|
59 |
+
position: absolute;
|
60 |
+
bottom: -22px;
|
61 |
+
z-index: 20;
|
62 |
+
height: 18px;
|
63 |
+
width: 100%;
|
64 |
+
padding: 2px 0;
|
65 |
+
background: #000000;
|
66 |
+
background-color: rgba(0,0,0,.5);
|
67 |
+
color: #ffffff;
|
68 |
+
font-size: 13px;
|
69 |
+
cursor: pointer;
|
70 |
+
-webkit-transition: bottom 0.2s ease-in-out;
|
71 |
+
-moz-transition: bottom, 0.2s ease-in-out;
|
72 |
+
-ms-transition: bottom, 0.2s ease-in-out;
|
73 |
+
-o-transition: bottom, 0.2s ease-in-out;
|
74 |
+
transition: bottom 0.2s ease-in-out;
|
75 |
+
}
|
76 |
+
.sek-demo-link i, .sek-demo-link a, .sek-demo-link a:focus, .sek-demo-link a:visited{color:#ffffff;}
|
77 |
+
.sek-demo-link a {text-decoration: none;text-transform: uppercase;font-size: 12px;}
|
78 |
+
.sek-demo-link a:hover {color:#ffffff;text-decoration: underline;}
|
79 |
+
[data-sek-content-type="preset_section"]:hover .sek-demo-link {
|
80 |
+
bottom: 0px;
|
81 |
+
}
|
82 |
+
|
83 |
+
[data-sek-content-type="preset_section"] .sek-overlay {
|
84 |
+
display: block;
|
85 |
+
position: absolute;
|
86 |
+
top: 0;
|
87 |
+
left: 0;
|
88 |
+
right: 0;
|
89 |
+
bottom: 0;
|
90 |
+
background-color: #000000;
|
91 |
+
opacity: 0;
|
92 |
+
-webkit-transition: opacity .35s ease;
|
93 |
+
transition: opacity .35s ease;
|
94 |
+
-o-transition: opacity .35s ease;
|
95 |
+
}
|
96 |
+
[data-sek-content-type="preset_section"]:hover .sek-overlay {
|
97 |
+
opacity: 0.15;
|
98 |
+
}
|
99 |
+
/* don't elevate inactive modules ( introduced but not yet implemented ) */
|
100 |
+
[data-sek-content-type][draggable="true"]:hover {
|
101 |
+
-webkit-box-shadow: 0 12px 20px rgba(0,0,0,.2);
|
102 |
+
box-shadow: 0 12px 20px rgba(0,0,0,.2);
|
103 |
+
}
|
104 |
+
[data-sek-content-type][draggable="false"] {
|
105 |
+
background: #eee;
|
106 |
+
opacity: 0.8;
|
107 |
+
}
|
108 |
+
|
109 |
+
|
110 |
+
|
111 |
+
/* JUNE 2020 style for user sections */
|
112 |
+
/* USER SECTIONS */
|
113 |
+
.sek-user-section-wrapper {
|
114 |
+
margin-bottom: 15px;
|
115 |
+
float: left;
|
116 |
+
width: 100%
|
117 |
+
}
|
118 |
+
.sek-user-section-wrapper [data-sek-content-type="preset_section"] .sek-overlay {
|
119 |
+
opacity: 0.40;
|
120 |
+
}
|
121 |
+
.sek-user-section-wrapper [data-sek-content-type="preset_section"]:hover .sek-overlay {
|
122 |
+
opacity: 0.50;
|
123 |
+
}
|
124 |
+
.sek-user-section-wrapper [data-sek-is-user-section="true"] {
|
125 |
+
height: 165px;
|
126 |
+
margin: 0;
|
127 |
+
width: 97%;
|
128 |
+
}
|
129 |
+
|
130 |
+
.sek-user-section-wrapper .sek-sec-thumb {
|
131 |
+
position: absolute;
|
132 |
+
opacity: 0.5;
|
133 |
+
z-index: 0;
|
134 |
+
top: 0;
|
135 |
+
bottom: 0;
|
136 |
+
height: 100%;
|
137 |
+
width: 100%;
|
138 |
+
}
|
139 |
+
.sek-user-section-wrapper .sek-sec-info {
|
140 |
+
position: relative;
|
141 |
+
color: #ffffff;
|
142 |
+
padding: 2%;
|
143 |
+
overflow: hidden;
|
144 |
+
height: 100%;
|
145 |
+
max-height: 138px;
|
146 |
+
padding: 10px;
|
147 |
+
}
|
148 |
+
|
149 |
+
.sek-sec-info .sec-title {
|
150 |
+
color: #ffffff;
|
151 |
+
margin: 0;
|
152 |
+
line-height: 20px;
|
153 |
+
max-height: 20px;
|
154 |
+
overflow: hidden;
|
155 |
+
white-space: nowrap;
|
156 |
+
text-overflow: ellipsis;
|
157 |
+
}
|
158 |
+
.sek-sec-info .sec-date, .sek-sec-info .sec-desc {
|
159 |
+
margin:0;
|
160 |
+
margin-top: 5px;
|
161 |
+
font-size: 12px;
|
162 |
+
}
|
163 |
+
.sek-sec-info .sec-date {
|
164 |
+
font-size: italic;
|
165 |
+
}
|
166 |
+
|
167 |
+
.sek-sec-info > .remove-user-sec, .sek-sec-info > .edit-user-sec {
|
168 |
+
cursor: pointer;
|
169 |
+
font-size: 16px;
|
170 |
+
width: 30px;
|
171 |
+
height: 30px;
|
172 |
+
color: #535353;
|
173 |
+
background: rgba(255, 255, 255, 0.7);
|
174 |
+
border-radius: 30px;
|
175 |
+
opacity: 0.3;
|
176 |
+
-webkit-box-shadow: 0 2px 6px rgba(0,0,0,.2);
|
177 |
+
box-shadow: 0 2px 6px rgba(0,0,0,.2);
|
178 |
+
-webkit-transition: all .20s ease;
|
179 |
+
-o-transition: all .20s ease;
|
180 |
+
transition: all .20s ease;
|
181 |
+
-webkit-box-align: center;
|
182 |
+
-ms-flex-align: center;
|
183 |
+
align-items: center;
|
184 |
+
display: -webkit-box;
|
185 |
+
display: -ms-flexbox;
|
186 |
+
display: flex;
|
187 |
+
-webkit-box-pack: center;
|
188 |
+
-ms-flex-pack: center;
|
189 |
+
justify-content: center;
|
190 |
+
position: absolute;
|
191 |
+
}
|
192 |
+
.sek-sec-info > .remove-user-sec {
|
193 |
+
bottom: 0px;
|
194 |
+
right: 5px;
|
195 |
+
}
|
196 |
+
.sek-sec-info > .edit-user-sec {
|
197 |
+
bottom: 0px;
|
198 |
+
left: 5px;
|
199 |
+
}
|
200 |
+
.sek-sec-info:hover > .remove-user-sec {
|
201 |
+
opacity: 0.7;
|
202 |
+
}
|
203 |
+
.sek-sec-info:hover > .edit-user-sec {
|
204 |
+
opacity: 0.7;
|
205 |
+
}
|
206 |
+
.sek-sec-info > .remove-user-sec:hover {
|
207 |
+
opacity: 0.95;
|
208 |
+
color: red;
|
209 |
+
}
|
210 |
+
.sek-sec-info > .edit-user-sec:hover {
|
211 |
+
opacity: 0.95;
|
212 |
+
color: #000000;
|
213 |
+
}
|
214 |
+
/* DRAGGING STUFFS */
|
215 |
+
.sek-dragging [data-sek-content-type] {
|
216 |
+
-webkit-box-shadow: 0 2px 5px rgba(0,0,0,.25)!important;
|
217 |
+
box-shadow: 0 2px 5px rgba(0,0,0,.25)!important;
|
218 |
+
}
|
219 |
+
.sek-dragged {
|
220 |
+
background: #33b3db3d;
|
221 |
+
background: rgba(51, 179, 219, 0.24);
|
222 |
+
}
|
223 |
+
|
224 |
+
[data-sek-content-type] .sek-module-icon {
|
225 |
+
display: block;
|
226 |
+
padding: 0;
|
227 |
+
}
|
228 |
+
[data-sek-content-type] .sek-module-icon .nimble-module-icons {
|
229 |
+
font-size: 3rem;
|
230 |
+
max-width: 100%;/*60%!important;*/
|
231 |
+
color: #878787;
|
232 |
+
max-height: 86px;
|
233 |
+
}
|
234 |
+
|
235 |
+
/* Specific for advanced list module */
|
236 |
+
.sek-content-type-wrapper [data-sek-content-id="czr_advanced_list_module"] .sek-module-icon {
|
237 |
+
height: 66%;
|
238 |
+
display: flex;
|
239 |
+
padding: 0;
|
240 |
+
display: -webkit-box;
|
241 |
+
display: -moz-box;
|
242 |
+
display: -ms-flexbox;
|
243 |
+
display: -webkit-flex;
|
244 |
+
display: flex;
|
245 |
+
align-items: center;
|
246 |
+
justify-content: center;
|
247 |
+
}
|
248 |
+
.sek-content-type-wrapper [data-sek-content-id="czr_advanced_list_module"] .sek-module-icon img {
|
249 |
+
height: 60%;
|
250 |
+
}
|
251 |
+
|
252 |
+
/* when the module icon is a font icon */
|
253 |
+
[data-sek-content-type] .sek-module-icon.is-font-icon {
|
254 |
+
display: -webkit-box;
|
255 |
+
display: -ms-flexbox;
|
256 |
+
display: flex;
|
257 |
+
-webkit-box-align: center;
|
258 |
+
-ms-flex-align: center;
|
259 |
+
align-items: center;
|
260 |
+
-webkit-box-pack: center;
|
261 |
+
-ms-flex-pack: center;
|
262 |
+
justify-content: center;
|
263 |
+
-webkit-box-flex: 0;
|
264 |
+
-ms-flex: 0 0 100%;
|
265 |
+
flex: 0 0 100%;
|
266 |
+
max-width: 100%;
|
267 |
+
min-height: 70%;
|
268 |
+
}
|
269 |
+
[data-sek-content-type] .sek-module-icon.is-font-icon i {
|
270 |
+
font-size: 35px;
|
271 |
+
}
|
272 |
+
[data-sek-content-type] .sek-module-title {
|
273 |
+
display: -webkit-box;
|
274 |
+
display: -ms-flexbox;
|
275 |
+
display: flex;
|
276 |
+
-webkit-box-pack: center;
|
277 |
+
-ms-flex-pack: center;
|
278 |
+
justify-content: center;
|
279 |
+
-webkit-box-align: center;
|
280 |
+
-ms-flex-align: center;
|
281 |
+
align-items: center;
|
282 |
+
padding: 0 6px 0px;
|
283 |
+
font-size: 0.75rem;
|
284 |
+
height: 45px;
|
285 |
+
justify-content: center;
|
286 |
+
position: relative;
|
287 |
+
top: -18px;
|
288 |
+
}
|
289 |
+
/*.sek-grabbing {
|
290 |
+
cursor: -webkit-grabbing;
|
291 |
+
}
|
292 |
+
*/
|
293 |
+
.sek-centered-module-title {
|
294 |
+
overflow: hidden;
|
295 |
+
display: -webkit-box;
|
296 |
+
-webkit-line-clamp: 2;
|
297 |
+
-webkit-box-orient: vertical;
|
298 |
+
}
|
299 |
+
|
300 |
+
.sek-new-label {
|
301 |
+
background: #ffff00;
|
302 |
+
border: 1px solid yellow;
|
303 |
+
color: #000000;
|
304 |
+
padding: 3px 4px;
|
305 |
+
line-height: 12px;
|
306 |
+
border-radius: 8px;
|
307 |
+
font-size: 11px;
|
308 |
+
max-width: 100px;
|
309 |
+
display: inline-block;
|
310 |
+
}
|
311 |
+
|
312 |
+
/* inspired by WP core .button-see-me css class
|
313 |
+
This button bounce twice
|
314 |
+
*/
|
315 |
+
.button-see-me-twice {
|
316 |
+
-webkit-animation: bounce .7s 2;
|
317 |
+
animation: bounce .7s 2;
|
318 |
+
-webkit-transform-origin: center bottom;
|
319 |
+
-ms-transform-origin: center bottom;
|
320 |
+
transform-origin: center bottom;
|
321 |
+
}
|
assets/czr/sek/css/_dev_control/_0_2_control_inputs.css
ADDED
@@ -0,0 +1,723 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* ACCORDION MODULE */
|
2 |
+
.sek-accord-title {
|
3 |
+
color: #4b4a4a;
|
4 |
+
overflow: hidden;
|
5 |
+
text-overflow: ellipsis;
|
6 |
+
white-space: nowrap;
|
7 |
+
width: 120px;
|
8 |
+
height: 23px;
|
9 |
+
line-height: 22px;
|
10 |
+
font-size: 13px;
|
11 |
+
float: left;
|
12 |
+
padding-left: 10px;
|
13 |
+
}
|
14 |
+
|
15 |
+
|
16 |
+
/* PADDING MARGIN SPACING INPUT */
|
17 |
+
.sek-pad-marg-inner {
|
18 |
+
font-size: 12px;
|
19 |
+
display: -webkit-box;
|
20 |
+
display: -ms-flexbox;
|
21 |
+
display: flex;
|
22 |
+
margin: 10px auto 10px auto;
|
23 |
+
-webkit-box-orient: vertical;
|
24 |
+
-webkit-box-direction: normal;
|
25 |
+
-ms-flex-direction: column;
|
26 |
+
flex-direction: column;
|
27 |
+
padding: 0;
|
28 |
+
background-color: #e6e6e6;
|
29 |
+
border: 1px solid #c5c5c5;
|
30 |
+
height: 192px;
|
31 |
+
width: 232px;
|
32 |
+
-webkit-box-pack: justify;
|
33 |
+
-ms-flex-pack: justify;
|
34 |
+
justify-content: space-between;
|
35 |
+
-webkit-transition: background-color 0.2s ease;
|
36 |
+
-o-transition: background-color 0.2s ease;
|
37 |
+
transition: background-color 0.2s ease;
|
38 |
+
}
|
39 |
+
.sek-pm-top-bottom-wrap {
|
40 |
+
height: 46px;
|
41 |
+
display: -webkit-box;
|
42 |
+
display: -ms-flexbox;
|
43 |
+
display: flex;
|
44 |
+
-webkit-box-pack: center;
|
45 |
+
-ms-flex-pack: center;
|
46 |
+
justify-content: center;
|
47 |
+
}
|
48 |
+
.sek-flex-center-stretch {
|
49 |
+
display: -webkit-box;
|
50 |
+
display: -ms-flexbox;
|
51 |
+
display: flex;
|
52 |
+
-webkit-box-pack: center;
|
53 |
+
-ms-flex-pack: center;
|
54 |
+
justify-content: center;
|
55 |
+
-webkit-box-align: stretch;
|
56 |
+
-ms-flex-align: stretch;
|
57 |
+
align-items: stretch;
|
58 |
+
}
|
59 |
+
|
60 |
+
.sek-pm-input {
|
61 |
+
width: 35px;
|
62 |
+
height: 15px;
|
63 |
+
padding: 0;
|
64 |
+
text-align: center;
|
65 |
+
font-family: Source Sans Pro;
|
66 |
+
padding: 5px;
|
67 |
+
border-radius: 3px;
|
68 |
+
text-align: left;
|
69 |
+
font-size: 13px;
|
70 |
+
outline: none;
|
71 |
+
-webkit-box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.15);
|
72 |
+
box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.15);
|
73 |
+
border: 1px solid #CED6D9;
|
74 |
+
}
|
75 |
+
.sek-pm-input-parent .sek-pm-input {
|
76 |
+
-webkit-box-flex: 1;
|
77 |
+
-ms-flex: 1 1 auto;
|
78 |
+
flex: 1 1 auto;
|
79 |
+
display: block;
|
80 |
+
margin: auto 3px;
|
81 |
+
-webkit-box-sizing: border-box;
|
82 |
+
box-sizing: border-box;
|
83 |
+
padding: 1px 3px;
|
84 |
+
font-size: 12px;
|
85 |
+
font-weight: 300;
|
86 |
+
min-width: 34px;
|
87 |
+
min-height: 20px;
|
88 |
+
color: #313131;
|
89 |
+
}
|
90 |
+
.sek-pm-middle-wrap {
|
91 |
+
display: -webkit-box;
|
92 |
+
display: -ms-flexbox;
|
93 |
+
display: flex;
|
94 |
+
height: 100px;
|
95 |
+
-webkit-box-pack: justify;
|
96 |
+
-ms-flex-pack: justify;
|
97 |
+
justify-content: space-between;
|
98 |
+
}
|
99 |
+
|
100 |
+
.sek-pm-margin-left, .sek-pm-margin-right {
|
101 |
+
width: 46px;
|
102 |
+
}
|
103 |
+
|
104 |
+
.sek-pm-padding-wrapper {
|
105 |
+
display: -webkit-box;
|
106 |
+
display: -ms-flexbox;
|
107 |
+
display: flex;
|
108 |
+
-webkit-box-orient: vertical;
|
109 |
+
-webkit-box-direction: normal;
|
110 |
+
-ms-flex-direction: column;
|
111 |
+
flex-direction: column;
|
112 |
+
background-color: white;
|
113 |
+
border: 1px solid #CED6D9;
|
114 |
+
height: 100px;
|
115 |
+
width: 140px;
|
116 |
+
-webkit-box-pack: justify;
|
117 |
+
-ms-flex-pack: justify;
|
118 |
+
justify-content: space-between;
|
119 |
+
padding: 5px;
|
120 |
+
-webkit-transition: background-color 0.2s ease;
|
121 |
+
-o-transition: background-color 0.2s ease;
|
122 |
+
transition: background-color 0.2s ease;
|
123 |
+
-webkit-box-sizing: border-box;
|
124 |
+
box-sizing: border-box;
|
125 |
+
margin: auto;
|
126 |
+
}
|
127 |
+
.sek-flex-justify-center {
|
128 |
+
min-height: 0;
|
129 |
+
min-width: 0;
|
130 |
+
display: -webkit-box;
|
131 |
+
display: -ms-flexbox;
|
132 |
+
display: flex;
|
133 |
+
-webkit-box-pack: center;
|
134 |
+
-ms-flex-pack: center;
|
135 |
+
justify-content: center;
|
136 |
+
}
|
137 |
+
.sek-flex-space-between {
|
138 |
+
display: -webkit-box;
|
139 |
+
display: -ms-flexbox;
|
140 |
+
display: flex;
|
141 |
+
-webkit-box-pack: justify;
|
142 |
+
-ms-flex-pack: justify;
|
143 |
+
justify-content: space-between;
|
144 |
+
}
|
145 |
+
|
146 |
+
.sek-pm-input-parent {
|
147 |
+
/* width: 100%;*/
|
148 |
+
position: relative;
|
149 |
+
display: -webkit-box;
|
150 |
+
display: -ms-flexbox;
|
151 |
+
display: flex;
|
152 |
+
}
|
153 |
+
.sek-pm-input-parent .sek-pm-input {
|
154 |
+
min-height: 25px;
|
155 |
+
min-width: 40px;
|
156 |
+
background-color: white;
|
157 |
+
}
|
158 |
+
.sek-pm-input-parent .sek-pm-input {
|
159 |
+
-webkit-box-flex: 1;
|
160 |
+
-ms-flex: 1 1 auto;
|
161 |
+
flex: 1 1 auto;
|
162 |
+
display: block;
|
163 |
+
margin: auto 3px!important;
|
164 |
+
-webkit-box-sizing: border-box;
|
165 |
+
box-sizing: border-box;
|
166 |
+
padding: 1px 3px;
|
167 |
+
font-size: 12px;
|
168 |
+
font-weight: 300;
|
169 |
+
min-width: 34px;
|
170 |
+
min-height: 20px;
|
171 |
+
color: #313131;
|
172 |
+
width: 40px!important;
|
173 |
+
text-align: center;
|
174 |
+
}
|
175 |
+
|
176 |
+
|
177 |
+
.sek-pm-padding-wrapper label {
|
178 |
+
margin: 0;
|
179 |
+
}
|
180 |
+
.sek-pad-marg-inner label {
|
181 |
+
-webkit-box-flex: 0;
|
182 |
+
-ms-flex: 0;
|
183 |
+
flex: 0;
|
184 |
+
}
|
185 |
+
.reset-spacing-wrap {
|
186 |
+
padding: 10px 0 0;
|
187 |
+
font-size: 0.8em;
|
188 |
+
text-decoration: underline;
|
189 |
+
cursor: pointer;
|
190 |
+
text-align: center;
|
191 |
+
}
|
192 |
+
.reset-spacing-wrap:hover {
|
193 |
+
color: #006799;
|
194 |
+
}
|
195 |
+
|
196 |
+
|
197 |
+
|
198 |
+
|
199 |
+
|
200 |
+
|
201 |
+
|
202 |
+
|
203 |
+
|
204 |
+
|
205 |
+
|
206 |
+
|
207 |
+
|
208 |
+
|
209 |
+
|
210 |
+
|
211 |
+
/* BACKGROUND POSITION INPUT */
|
212 |
+
.sek-bg-pos-wrapper {
|
213 |
+
padding: 10px;
|
214 |
+
text-align: center;
|
215 |
+
display: inline-block;
|
216 |
+
width: 90px;
|
217 |
+
height: 90px;
|
218 |
+
}
|
219 |
+
.sek-bg-pos-wrapper {
|
220 |
+
display: inline-block;
|
221 |
+
width: 90px;
|
222 |
+
height: 90px;
|
223 |
+
}
|
224 |
+
.sek-bg-pos-wrapper .sek-bg-pos {
|
225 |
+
cursor: pointer;
|
226 |
+
width: 24px;
|
227 |
+
height: 24px;
|
228 |
+
margin: 3px;
|
229 |
+
float: left;
|
230 |
+
}
|
231 |
+
.sek-bg-pos-wrapper input[type="radio"] {
|
232 |
+
display: none;
|
233 |
+
}
|
234 |
+
.sek-bg-pos-wrapper .sek-bg-pos span {
|
235 |
+
display: inline-block;
|
236 |
+
width: 100%;
|
237 |
+
height: 100%;
|
238 |
+
border-radius: 6px;
|
239 |
+
background: #e6e6e6 no-repeat center;
|
240 |
+
-webkit-transition: background-color 0.2s ease;
|
241 |
+
-o-transition: background-color 0.2s ease;
|
242 |
+
transition: background-color 0.2s ease;
|
243 |
+
}
|
244 |
+
|
245 |
+
/* hover*/
|
246 |
+
.sek-bg-pos-wrapper .sek-bg-pos span:hover {
|
247 |
+
background-color: #33b3db;
|
248 |
+
}
|
249 |
+
|
250 |
+
.sek-bg-pos-wrapper .sek-bg-pos span:hover svg {
|
251 |
+
visibility: visible;
|
252 |
+
}
|
253 |
+
/* checked */
|
254 |
+
.sek-bg-pos-wrapper .sek-bg-pos input[type="radio"]:checked + span {
|
255 |
+
background-color: #33b3db;
|
256 |
+
}
|
257 |
+
.sek-bg-pos-wrapper .sek-bg-pos input[type="radio"]:checked + span svg {
|
258 |
+
visibility: visible;
|
259 |
+
}
|
260 |
+
|
261 |
+
.sek-bg-pos-wrapper .sek-bg-pos span svg {
|
262 |
+
visibility: hidden;
|
263 |
+
shape-rendering: crispEdges;
|
264 |
+
}
|
265 |
+
|
266 |
+
|
267 |
+
.sek-bg-pos-wrapper .sek-svg-bg-pos {
|
268 |
+
fill: #fff;
|
269 |
+
}
|
270 |
+
|
271 |
+
|
272 |
+
|
273 |
+
|
274 |
+
|
275 |
+
|
276 |
+
|
277 |
+
|
278 |
+
|
279 |
+
|
280 |
+
/* H and V ALIGNMENT INPUT */
|
281 |
+
div[data-sek-align] {
|
282 |
+
margin: 0 5px;
|
283 |
+
padding: 4px;
|
284 |
+
display: -webkit-inline-box;
|
285 |
+
display: -ms-inline-flexbox;
|
286 |
+
display: inline-flex;
|
287 |
+
-webkit-box-align: end;
|
288 |
+
-ms-flex-align: end;
|
289 |
+
align-items: flex-end;
|
290 |
+
position: relative;
|
291 |
+
text-align: center;
|
292 |
+
width: 23px;
|
293 |
+
height: 24px;
|
294 |
+
top: -4px;
|
295 |
+
border-radius: 4px;
|
296 |
+
cursor: pointer;
|
297 |
+
}
|
298 |
+
div[data-input-type="horizTextAlignmentWithDeviceSwitcher"] .czr-input {
|
299 |
+
text-align: center;
|
300 |
+
}
|
301 |
+
div[data-input-type="horizTextAlignmentWithDeviceSwitcher"] .sek-h-align-wrapper {
|
302 |
+
display: inline-block;
|
303 |
+
}
|
304 |
+
div[data-input-type="horizAlignmentWithDeviceSwitcher"] .czr-input {
|
305 |
+
text-align: center;
|
306 |
+
}
|
307 |
+
div[data-input-type="horizAlignmentWithDeviceSwitcher"] .sek-h-align-wrapper {
|
308 |
+
display: inline-block;
|
309 |
+
}
|
310 |
+
.sek-h-align-wrapper .sek-align-icons {
|
311 |
+
float: right
|
312 |
+
}
|
313 |
+
|
314 |
+
div[data-sek-align]:hover {
|
315 |
+
-webkit-box-shadow: inset 0 0 0 1px #555d66, inset 0 0 0 2px #fff;
|
316 |
+
box-shadow: inset 0 0 0 1px #555d66, inset 0 0 0 2px #fff;
|
317 |
+
}
|
318 |
+
div[data-sek-align].selected {
|
319 |
+
outline: none;
|
320 |
+
color: #fff;
|
321 |
+
-webkit-box-shadow: none;
|
322 |
+
box-shadow: none;
|
323 |
+
background: #555d66;
|
324 |
+
}
|
325 |
+
|
326 |
+
/* POST GRID LAYOUT PICKER */
|
327 |
+
div[data-sek-grid-layout] {
|
328 |
+
margin: 0 5px;
|
329 |
+
padding: 1px 3px 1px 1px;
|
330 |
+
display: -webkit-inline-box;
|
331 |
+
display: -ms-inline-flexbox;
|
332 |
+
display: inline-flex;
|
333 |
+
-webkit-box-align: end;
|
334 |
+
-ms-flex-align: end;
|
335 |
+
align-items: flex-end;
|
336 |
+
position: relative;
|
337 |
+
text-align: center;
|
338 |
+
/*width: 25px;
|
339 |
+
height: 24px;*/
|
340 |
+
/*top: -4px;*/
|
341 |
+
border-radius: 4px;
|
342 |
+
cursor: pointer;
|
343 |
+
}
|
344 |
+
div[data-sek-grid-layout] i {
|
345 |
+
font-size: 50px;
|
346 |
+
}
|
347 |
+
div[data-input-type="grid_layout"] .czr-input {
|
348 |
+
text-align: center;
|
349 |
+
}
|
350 |
+
div[data-input-type="grid_layout"] .sek-grid-layout-wrapper {
|
351 |
+
display: inline-block;
|
352 |
+
}
|
353 |
+
.sek-grid-layout-wrapper .sek-grid-icons {
|
354 |
+
float: right
|
355 |
+
}
|
356 |
+
|
357 |
+
div[data-sek-grid-layout]:hover {
|
358 |
+
-webkit-box-shadow: inset 0 0 0 1px #555d66, inset 0 0 0 2px #fff;
|
359 |
+
box-shadow: inset 0 0 0 1px #555d66, inset 0 0 0 2px #fff;
|
360 |
+
}
|
361 |
+
div[data-sek-grid-layout].selected {
|
362 |
+
outline: none;
|
363 |
+
color: #fff;
|
364 |
+
-webkit-box-shadow: none;
|
365 |
+
box-shadow: none;
|
366 |
+
/*background: #555d66;*/
|
367 |
+
background: #33b3db;
|
368 |
+
}
|
369 |
+
|
370 |
+
|
371 |
+
|
372 |
+
/* CATEGORY PICKER */
|
373 |
+
.customize-control select[data-czrtype="categories"] {
|
374 |
+
height: 28px;
|
375 |
+
}
|
376 |
+
|
377 |
+
|
378 |
+
/* DEVICE SWITCHER */
|
379 |
+
.sek-input-device-switcher .sek-switcher:before, .sek-mobile-device-icons .sek-switcher:before {
|
380 |
+
display: inline-block;
|
381 |
+
-webkit-font-smoothing: antialiased;
|
382 |
+
font: normal 20px/30px "dashicons";
|
383 |
+
vertical-align: top;
|
384 |
+
/* margin: 3px 0;
|
385 |
+
padding: 4px 8px;*/
|
386 |
+
color: #656a6f;
|
387 |
+
position: relative;
|
388 |
+
top: -5px
|
389 |
+
}
|
390 |
+
.sek-input-device-switcher .sek-switcher {
|
391 |
+
cursor: pointer;
|
392 |
+
}
|
393 |
+
.sek-input-device-switcher .sek-switcher, .sek-mobile-device-icons .sek-switcher {
|
394 |
+
background: transparent;
|
395 |
+
border: none;
|
396 |
+
padding: 0 1px;
|
397 |
+
margin: 0 0 0 -2px;
|
398 |
+
box-shadow: none;
|
399 |
+
border-top: 1px solid transparent;
|
400 |
+
border-bottom: 4px solid transparent;
|
401 |
+
-webkit-transition: .15s color ease-in-out,
|
402 |
+
.15s background-color ease-in-out,
|
403 |
+
.15s border-color ease-in-out;
|
404 |
+
-o-transition: .15s color ease-in-out,
|
405 |
+
.15s background-color ease-in-out,
|
406 |
+
.15s border-color ease-in-out;
|
407 |
+
transition: .15s color ease-in-out,
|
408 |
+
.15s background-color ease-in-out,
|
409 |
+
.15s border-color ease-in-out;
|
410 |
+
}
|
411 |
+
|
412 |
+
/*.sek-input-device-switcher .sek-switcher.active {
|
413 |
+
color: #0073aa;
|
414 |
+
}*/
|
415 |
+
|
416 |
+
.sek-input-device-switcher .sek-switcher:hover,
|
417 |
+
.sek-input-device-switcher .sek-switcher:focus {
|
418 |
+
background-color: #fff;
|
419 |
+
}
|
420 |
+
|
421 |
+
/*.sek-input-device-switcher .sek-switcher:focus,
|
422 |
+
.sek-input-device-switcher .sek-switcher.active:hover {
|
423 |
+
border-bottom-color: #0073aa;
|
424 |
+
}*/
|
425 |
+
|
426 |
+
.sek-input-device-switcher .sek-switcher.active:before {
|
427 |
+
color: #191e23;
|
428 |
+
}
|
429 |
+
|
430 |
+
.sek-input-device-switcher .sek-switcher:hover:before,
|
431 |
+
.sek-input-device-switcher .sek-switcher:focus:before {
|
432 |
+
color: #0073aa;
|
433 |
+
}
|
434 |
+
|
435 |
+
.sek-input-device-switcher .preview-desktop:before, .sek-mobile-device-icons .preview-desktop:before {
|
436 |
+
content: "\f472";
|
437 |
+
}
|
438 |
+
|
439 |
+
.sek-input-device-switcher .preview-tablet:before, .sek-mobile-device-icons .preview-tablet:before {
|
440 |
+
content: "\f471";
|
441 |
+
}
|
442 |
+
|
443 |
+
.sek-input-device-switcher .preview-mobile:before, .sek-mobile-device-icons .preview-mobile:before {
|
444 |
+
content: "\f470";
|
445 |
+
}
|
446 |
+
|
447 |
+
|
448 |
+
|
449 |
+
|
450 |
+
|
451 |
+
|
452 |
+
|
453 |
+
|
454 |
+
|
455 |
+
|
456 |
+
|
457 |
+
|
458 |
+
|
459 |
+
|
460 |
+
|
461 |
+
|
462 |
+
|
463 |
+
/* BORDERS AND BORDER RADIUS*/
|
464 |
+
.sek-borders {
|
465 |
+
width: 100%;
|
466 |
+
float: left;
|
467 |
+
margin-bottom: 8px;
|
468 |
+
}
|
469 |
+
.sek-borders > div {float: left;width: 100%}
|
470 |
+
.sek-borders .sek-range-unit-wrapper > div {float: left;}
|
471 |
+
.sek-borders .sek-border-type-wrapper {margin-bottom: 5px;}
|
472 |
+
.sek-borders .sek-range-unit-wrapper {margin-bottom: 5px;}
|
473 |
+
.sek-borders .sek-range-unit-wrapper .sek-unit-wrapper { float: right;}
|
474 |
+
.sek-borders .sek-color-wrapper { width:100%;}
|
475 |
+
.sek-borders .sek-color-wrapper .sek-color-picker{ width: 50%;float: left;}
|
476 |
+
.sek-borders .sek-color-wrapper .sek-reset-button { width: 50%;float: right;}
|
477 |
+
|
478 |
+
[data-sek-radius-type="top_right"] > i.material-icons {
|
479 |
+
-webkit-transform: rotate(90deg);
|
480 |
+
-ms-transform: rotate(90deg);
|
481 |
+
transform: rotate(90deg);
|
482 |
+
}
|
483 |
+
[data-sek-radius-type="bottom_right"] > i.material-icons {
|
484 |
+
-webkit-transform: rotate(180deg);
|
485 |
+
-ms-transform: rotate(180deg);
|
486 |
+
transform: rotate(180deg);
|
487 |
+
}
|
488 |
+
[data-sek-radius-type="bottom_left"] > i.material-icons {
|
489 |
+
-webkit-transform: rotate(270deg);
|
490 |
+
-ms-transform: rotate(270deg);
|
491 |
+
transform: rotate(270deg);
|
492 |
+
}
|
493 |
+
|
494 |
+
|
495 |
+
|
496 |
+
|
497 |
+
|
498 |
+
|
499 |
+
|
500 |
+
|
501 |
+
|
502 |
+
/* RANGE WITH UNIT PICKER */
|
503 |
+
.sek-range-with-unit-picker-wrapper{
|
504 |
+
width: 100%;
|
505 |
+
float: left;
|
506 |
+
margin-bottom: 8px;
|
507 |
+
}
|
508 |
+
.sek-range-with-unit-picker-wrapper .sek-unit-wrapper{ float: right; }
|
509 |
+
.sek-range-with-unit-picker-wrapper > div { float: left; }
|
510 |
+
|
511 |
+
|
512 |
+
/* RANGE INPUT */
|
513 |
+
/* This range slider is inspired from the one used in the Gutenberg plugin ( https://github.com/WordPress/gutenberg ), released under GNU General Public License
|
514 |
+
credits : Gutenberg team @wordpress */
|
515 |
+
.sek-range-wrapper {
|
516 |
+
width: 44%;
|
517 |
+
margin-right: 4px;
|
518 |
+
}
|
519 |
+
.sek-no-unit-picker .sek-range-wrapper {
|
520 |
+
width: 70%;
|
521 |
+
}
|
522 |
+
.sek-number-wrapper, .sek-simple-number-wrapper {
|
523 |
+
width: 60px;
|
524 |
+
margin-right: 5px;
|
525 |
+
}
|
526 |
+
.sek-simple-number-wrapper {
|
527 |
+
text-align: right;
|
528 |
+
}
|
529 |
+
|
530 |
+
.sek-range-input{
|
531 |
+
flex:1;
|
532 |
+
width:100%;
|
533 |
+
padding:0;
|
534 |
+
-webkit-appearance:none;
|
535 |
+
background:transparent;
|
536 |
+
height: 26px;
|
537 |
+
}
|
538 |
+
.sek-range-input::-webkit-slider-thumb{
|
539 |
+
-webkit-appearance:none;
|
540 |
+
height:20px;
|
541 |
+
width:20px;
|
542 |
+
border-radius:50%;
|
543 |
+
cursor:pointer;
|
544 |
+
background:#555d66;
|
545 |
+
border:4px solid transparent;
|
546 |
+
background-clip:padding-box;
|
547 |
+
box-sizing:border-box;
|
548 |
+
margin-top:-8px
|
549 |
+
}
|
550 |
+
.sek-range-input::-moz-range-thumb{
|
551 |
+
height:20px;
|
552 |
+
width:20px;
|
553 |
+
border-radius:50%;
|
554 |
+
cursor:pointer;
|
555 |
+
background:#555d66;
|
556 |
+
border:4px solid transparent;
|
557 |
+
background-clip:padding-box;
|
558 |
+
box-sizing:border-box;
|
559 |
+
margin-top:-7px
|
560 |
+
}
|
561 |
+
.sek-range-input::-ms-thumb{
|
562 |
+
height:20px;
|
563 |
+
width:20px;
|
564 |
+
border-radius:50%;
|
565 |
+
cursor:pointer;
|
566 |
+
background:#555d66;
|
567 |
+
border:4px solid transparent;
|
568 |
+
background-clip:padding-box;
|
569 |
+
box-sizing:border-box;
|
570 |
+
margin-top:-8px
|
571 |
+
}
|
572 |
+
/* margin-top:0;
|
573 |
+
height:14px;
|
574 |
+
width:14px;
|
575 |
+
border:2px solid transparent*/
|
576 |
+
/*}*/
|
577 |
+
.sek-range-input:focus{
|
578 |
+
outline:none
|
579 |
+
}
|
580 |
+
/*.sek-range-input:focus::-webkit-slider-thumb{
|
581 |
+
background-color:#fff;
|
582 |
+
color:#191e23;
|
583 |
+
box-shadow:inset 0 0 0 1px #6c7781,inset 0 0 0 2px #fff;
|
584 |
+
outline:2px solid transparent;
|
585 |
+
outline-offset:-2px
|
586 |
+
}
|
587 |
+
.sek-range-input:focus::-moz-range-thumb{
|
588 |
+
background-color:#fff;
|
589 |
+
color:#191e23;
|
590 |
+
box-shadow:inset 0 0 0 1px #6c7781,inset 0 0 0 2px #fff;
|
591 |
+
outline:2px solid transparent;
|
592 |
+
outline-offset:-2px
|
593 |
+
}
|
594 |
+
.sek-range-input:focus::-ms-thumb{
|
595 |
+
background-color:#fff;
|
596 |
+
color:#191e23;
|
597 |
+
box-shadow:inset 0 0 0 1px #6c7781,inset 0 0 0 2px #fff;
|
598 |
+
outline:2px solid transparent;
|
599 |
+
outline-offset:-2px
|
600 |
+
}*/
|
601 |
+
.sek-range-input::-webkit-slider-runnable-track{
|
602 |
+
height:3px;
|
603 |
+
cursor:pointer;
|
604 |
+
background:#e2e4e7;
|
605 |
+
border-radius:1.5px;
|
606 |
+
margin-top:-4px
|
607 |
+
}
|
608 |
+
.sek-range-input::-moz-range-track{
|
609 |
+
height:3px;
|
610 |
+
cursor:pointer;
|
611 |
+
background:#e2e4e7;
|
612 |
+
border-radius:1.5px
|
613 |
+
}
|
614 |
+
.sek-range-input::-ms-track{
|
615 |
+
margin-top:-4px;
|
616 |
+
background:transparent;
|
617 |
+
border-color:transparent;
|
618 |
+
color:transparent;
|
619 |
+
height:3px;
|
620 |
+
cursor:pointer;
|
621 |
+
background:#e2e4e7;
|
622 |
+
border-radius:1.5px
|
623 |
+
}
|
624 |
+
|
625 |
+
|
626 |
+
|
627 |
+
/* IMPORT / EXPORT */
|
628 |
+
.sek-import-btn-wrap {
|
629 |
+
padding: 20px 0;
|
630 |
+
}
|
631 |
+
.sek-import-btn-wrap input.sek-import-file {
|
632 |
+
margin-bottom: 10px;
|
633 |
+
}
|
634 |
+
.sek-export-btn-wrap {
|
635 |
+
padding-bottom: 20px;
|
636 |
+
border-bottom: 1px solid #ddd;
|
637 |
+
}
|
638 |
+
.sek-import-file {
|
639 |
+
background: #eeeeee;
|
640 |
+
width: 100%;
|
641 |
+
margin: 10px 0;
|
642 |
+
padding: 10px;
|
643 |
+
font-size: 12px;
|
644 |
+
}
|
645 |
+
.sek-uploading {
|
646 |
+
background: #eeeeee;
|
647 |
+
display: none;
|
648 |
+
margin: 10px 0;
|
649 |
+
padding: 10px;
|
650 |
+
font-size: 12px;
|
651 |
+
}
|
652 |
+
.czr-import-dialog {
|
653 |
+
display: none;
|
654 |
+
padding: 11px;
|
655 |
+
}
|
656 |
+
.czr-import-message {
|
657 |
+
padding-bottom: 10px;
|
658 |
+
}
|
659 |
+
.sek-import-btn-wrap .czr-import-dialog .czr-import-message {
|
660 |
+
font-size: 12px!important;
|
661 |
+
}
|
662 |
+
.sek-import-btn-wrap .czr-import-dialog .button {
|
663 |
+
margin: 4px 0;
|
664 |
+
font-size: 12px!important;
|
665 |
+
}
|
666 |
+
|
667 |
+
|
668 |
+
/* SLIDE MODULE */
|
669 |
+
.sek-slide-thumb {
|
670 |
+
width: 32px;
|
671 |
+
height: 32px;
|
672 |
+
overflow: hidden;
|
673 |
+
display: -ms-flexbox;
|
674 |
+
display: flex;
|
675 |
+
-ms-flex-pack: center;
|
676 |
+
justify-content: center;
|
677 |
+
-ms-flex-align: center;
|
678 |
+
align-items: center;
|
679 |
+
float: left;
|
680 |
+
}
|
681 |
+
.sek-slide-title {
|
682 |
+
color: #4b4a4a;
|
683 |
+
overflow: hidden;
|
684 |
+
text-overflow: ellipsis;
|
685 |
+
white-space: nowrap;
|
686 |
+
width: 120px;
|
687 |
+
height: 32px;
|
688 |
+
line-height: 32px;
|
689 |
+
font-size: 13px;
|
690 |
+
float: left;
|
691 |
+
padding-left: 10px;
|
692 |
+
}
|
693 |
+
|
694 |
+
.sek-pro-notice {
|
695 |
+
position: relative;
|
696 |
+
padding-left: 36px;
|
697 |
+
font-size: 12px;
|
698 |
+
font-weight: bold;
|
699 |
+
}
|
700 |
+
.sek-pro-notice a, .sek-pro-notice a:hover, .sek-pro-notice a:focus {
|
701 |
+
color: #f07829;
|
702 |
+
font-weight: bold;
|
703 |
+
text-decoration: none;
|
704 |
+
}
|
705 |
+
.sek-pro-notice a:hover {
|
706 |
+
text-decoration: underline;
|
707 |
+
}
|
708 |
+
.sek-pro-icon {
|
709 |
+
position: absolute;
|
710 |
+
width: 32px;
|
711 |
+
left: 0;
|
712 |
+
top: -2px;
|
713 |
+
}
|
714 |
+
.sek-pro-notice .sek-pro-notice-icon-bef-text {
|
715 |
+
display: inline-block;
|
716 |
+
width: 23px;
|
717 |
+
height: 15px;
|
718 |
+
position: relative;
|
719 |
+
}
|
720 |
+
.sek-pro-notice .sek-pro-notice-icon-bef-text img {
|
721 |
+
position: absolute;
|
722 |
+
top: 0;
|
723 |
+
}
|
assets/czr/sek/css/_dev_control/_0_3_control_buttons.css
ADDED
@@ -0,0 +1,274 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
/* DEFAULT UI BUTTONS STYLE, for unit picker, etc*/
|
3 |
+
.sek-unit-wrapper {
|
4 |
+
text-align: center;
|
5 |
+
}
|
6 |
+
.sek-ui-button-group {
|
7 |
+
display: inline-block;
|
8 |
+
}
|
9 |
+
.sek-ui-button-group .sek-ui-button:first-child {
|
10 |
+
border-radius: 3px 0 0 3px;
|
11 |
+
}
|
12 |
+
.sek-ui-button-group .sek-ui-button+.sek-ui-button {
|
13 |
+
margin-left: -1px;
|
14 |
+
}
|
15 |
+
.sek-ui-button-group .sek-ui-button:last-child {
|
16 |
+
border-radius: 0 3px 3px 0;
|
17 |
+
}
|
18 |
+
.sek-ui-button {
|
19 |
+
height: 28px;
|
20 |
+
padding: 0 10px 2px;
|
21 |
+
border-radius: 3px;
|
22 |
+
white-space: nowrap;
|
23 |
+
border-width: 1px;
|
24 |
+
border-style: solid;
|
25 |
+
display: inline-flex;
|
26 |
+
text-decoration: none;
|
27 |
+
font-size: 12px;
|
28 |
+
line-height: 25px;
|
29 |
+
font-weight: normal;
|
30 |
+
margin: 0;
|
31 |
+
cursor: pointer;
|
32 |
+
-webkit-appearance: none;
|
33 |
+
background: none;
|
34 |
+
color: #555;
|
35 |
+
border-color: #ccc;
|
36 |
+
background: #f7f7f7;
|
37 |
+
box-shadow: inset 0 -1px 0 #ccc;
|
38 |
+
vertical-align: top;
|
39 |
+
-webkit-transition: opacity 0.2s ease-in-out;
|
40 |
+
-moz-transition: opacity 0.2s ease-in-out;
|
41 |
+
-ms-transition: opacity 0.2s ease-in-out;
|
42 |
+
-o-transition: opacity 0.2s ease-in-out;
|
43 |
+
transition: opacity 0.2s ease-in-out;
|
44 |
+
}
|
45 |
+
|
46 |
+
|
47 |
+
.sek-ui-button:hover {
|
48 |
+
background: #fafafa;
|
49 |
+
border-color: #999;
|
50 |
+
box-shadow: inset 0 -1px 0 #999;
|
51 |
+
color: #23282d;
|
52 |
+
opacity: 1!important;
|
53 |
+
}
|
54 |
+
.sek-ui-button:active:not(:disabled) {
|
55 |
+
background: #eee;
|
56 |
+
border-color: #999;
|
57 |
+
box-shadow: inset 0 1px 0 #999;
|
58 |
+
}
|
59 |
+
.sek-ui-button:focus:not(:disabled) {
|
60 |
+
background: #fafafa;
|
61 |
+
color: #23282d;
|
62 |
+
border-color: #999;
|
63 |
+
box-shadow: inset 0 -1px 0 #999, 0 0 0 2px #fbfbfb;
|
64 |
+
outline: none;
|
65 |
+
}
|
66 |
+
|
67 |
+
.sek-ui-button[aria-pressed="true"] {
|
68 |
+
background: #555d66;
|
69 |
+
border-color: #555d66;
|
70 |
+
box-shadow: inset 0 -1px 0 #555d66;
|
71 |
+
color: #fff;
|
72 |
+
text-decoration: none;
|
73 |
+
}
|
74 |
+
.sek-ui-button[aria-pressed="true"]:focus:not(:disabled), .sek-ui-button[aria-pressed="true"]:hover {
|
75 |
+
background: #555d66;
|
76 |
+
border-color: #4f4f4f;
|
77 |
+
color: #fff;
|
78 |
+
}
|
79 |
+
.sek-ui-button[aria-pressed="true"]:focus:not(:disabled) {
|
80 |
+
box-shadow: inset 0 -1px 0 #4f4f4f;
|
81 |
+
}
|
82 |
+
.sek-ui-button[aria-pressed="true"]:focus:not(:disabled) {
|
83 |
+
/*box-shadow: inset 0 -1px 0 #00435d, 0 0 0 2px #bfe7f3;*/
|
84 |
+
outline: none;
|
85 |
+
}
|
86 |
+
|
87 |
+
|
88 |
+
|
89 |
+
/* Button style for the content type switcher and template dialog */
|
90 |
+
.sek-content-type-wrapper,
|
91 |
+
.sek-save-tmpl-mode-switcher,
|
92 |
+
.sek-save-tmpl-action,
|
93 |
+
.sek-save-section-mode-switcher,
|
94 |
+
.sek-save-section-action {
|
95 |
+
margin-bottom: 8px;
|
96 |
+
width: 100%;
|
97 |
+
float: left;
|
98 |
+
}
|
99 |
+
.sek-content-type-wrapper .sek-ui-button-group,
|
100 |
+
.sek-save-tmpl-mode-switcher .sek-ui-button-group,
|
101 |
+
.sek-save-tmpl-action .sek-ui-button-group,
|
102 |
+
.sek-save-section-mode-switcher .sek-ui-button-group,
|
103 |
+
.sek-save-section-action .sek-ui-button-group,
|
104 |
+
#nimble-tmpl-gallery .sek-ui-button-group {
|
105 |
+
display: block;
|
106 |
+
}
|
107 |
+
.sek-content-type-wrapper .sek-ui-button,
|
108 |
+
.sek-save-tmpl-mode-switcher .sek-ui-button,
|
109 |
+
.sek-save-tmpl-action .sek-ui-button,
|
110 |
+
.sek-save-section-mode-switcher .sek-ui-button,
|
111 |
+
.sek-save-section-action .sek-ui-button,
|
112 |
+
#nimble-tmpl-gallery .sek-ui-button {
|
113 |
+
text-align: center;
|
114 |
+
display: inline-block;
|
115 |
+
padding: 3px 10px;
|
116 |
+
height: auto;
|
117 |
+
text-transform: uppercase;
|
118 |
+
}
|
119 |
+
.sek-content-type-wrapper .sek-ui-button { width: 49%; }
|
120 |
+
.sek-save-tmpl-mode-switcher .sek-ui-button,
|
121 |
+
.sek-save-section-mode-switcher .sek-ui-button {
|
122 |
+
width: 32%;
|
123 |
+
}
|
124 |
+
|
125 |
+
/* APRIL 2020 added for https://github.com/presscustomizr/nimble-builder/issues/651 */
|
126 |
+
.sek-content-type-wrapper [data-sek-content-type="template"] {
|
127 |
+
width: 98%;
|
128 |
+
margin-top: 5px;
|
129 |
+
}
|
130 |
+
|
131 |
+
|
132 |
+
/* Button style for the option type switcher */
|
133 |
+
[data-input-type="module_option_switcher"] .sek-content-type-wrapper { margin-bottom: 0}
|
134 |
+
[data-input-type="module_option_switcher"] [aria-pressed="false"] {
|
135 |
+
opacity: 0.7;
|
136 |
+
}
|
137 |
+
[data-input-type="module_option_switcher"] [data-sek-option-type] {
|
138 |
+
position: relative;
|
139 |
+
}
|
140 |
+
.sek-wrap-opt-switch-btn {
|
141 |
+
display: -webkit-box;
|
142 |
+
display: -ms-flexbox;
|
143 |
+
display: flex;
|
144 |
+
-webkit-box-align: center;
|
145 |
+
-ms-flex-align: center;
|
146 |
+
align-items: center;
|
147 |
+
flex: 0 0 100%;
|
148 |
+
max-width: 100%;
|
149 |
+
-webkit-box-pack: center;
|
150 |
+
-ms-flex-pack: center;
|
151 |
+
justify-content: center;
|
152 |
+
}
|
153 |
+
[data-input-type="module_option_switcher"] [data-sek-option-type] .sek-wrap-opt-switch-btn > i {
|
154 |
+
font-size: 21px;
|
155 |
+
line-height: 24px;
|
156 |
+
}
|
157 |
+
[data-input-type="module_option_switcher"] [data-sek-option-type] .sek-wrap-opt-switch-btn > span {
|
158 |
+
position: relative;
|
159 |
+
padding-left: 10px;
|
160 |
+
overflow: hidden;
|
161 |
+
text-overflow:ellipsis;
|
162 |
+
white-space:nowrap;
|
163 |
+
text-align: center;
|
164 |
+
}
|
165 |
+
|
166 |
+
|
167 |
+
|
168 |
+
/* RESET BUTTON */
|
169 |
+
.wp-core-ui .button.sek-reset-button {
|
170 |
+
font-size: 11px;
|
171 |
+
padding: 0 5px 1px;
|
172 |
+
line-height: 18px;
|
173 |
+
height: 25px;
|
174 |
+
min-height: 25px;
|
175 |
+
color: #555;
|
176 |
+
border-color: #ccc;
|
177 |
+
}
|
178 |
+
|
179 |
+
|
180 |
+
|
181 |
+
/* LEVEL UI CHEVRON ICON NEXT TO TITLE */
|
182 |
+
.sek-animated-arrow {
|
183 |
+
position: absolute;
|
184 |
+
left: -20px;
|
185 |
+
margin-left: 6px;
|
186 |
+
top: 3px;
|
187 |
+
font-size: 10px;
|
188 |
+
color: #617379;
|
189 |
+
-webkit-transform: rotate(0deg);
|
190 |
+
-ms-transform: rotate(0deg);
|
191 |
+
transform: rotate(0deg);
|
192 |
+
-webkit-transition: -webkit-transform 0.2s ease-in-out;
|
193 |
+
transition: -webkit-transform 0.2s ease-in-out;
|
194 |
+
-o-transition: transform 0.2s ease-in-out;
|
195 |
+
transition: transform 0.2s ease-in-out;
|
196 |
+
transition: transform 0.2s ease-in-out, -webkit-transform 0.2s ease-in-out;
|
197 |
+
display: -webkit-box;
|
198 |
+
display: -ms-flexbox;
|
199 |
+
display: flex;
|
200 |
+
-webkit-box-pack: center;
|
201 |
+
-ms-flex-pack: center;
|
202 |
+
justify-content: center;
|
203 |
+
height: 100%;
|
204 |
+
-webkit-box-align: center;
|
205 |
+
-ms-flex-align: center;
|
206 |
+
align-items: center;
|
207 |
+
}
|
208 |
+
[data-sek-expanded="true"] label > .customize-control-title .sek-animated-arrow {
|
209 |
+
-webkit-transform: rotate(180deg);
|
210 |
+
-ms-transform: rotate(180deg);
|
211 |
+
transform: rotate(180deg);
|
212 |
+
}
|
213 |
+
/* underline the control titles of the Nimble controls */
|
214 |
+
[data-sek-expanded="true"] label > .customize-control-title .sek-ctrl-accordion-title, [data-sek-expanded] label > .customize-control-title .sek-ctrl-accordion-title:hover {
|
215 |
+
text-decoration: underline;
|
216 |
+
text-underline-position: under;
|
217 |
+
}
|
218 |
+
|
219 |
+
/* style the icon if there's one next to the title */
|
220 |
+
.customize-control-title .sek-ctrl-accordion-title > i {
|
221 |
+
font-size: 1.2em;
|
222 |
+
position: relative;
|
223 |
+
top: 4px;
|
224 |
+
padding-right: 4px;
|
225 |
+
}
|
226 |
+
|
227 |
+
/* STYLE FOR THE LEVEL ICON NEXT TO THE CONTROL TITLE */
|
228 |
+
.sek-level-option-icon {
|
229 |
+
padding-right: 5px;
|
230 |
+
min-width: 22px;
|
231 |
+
text-align: center;
|
232 |
+
}
|
233 |
+
|
234 |
+
.sek-input-title-icon {
|
235 |
+
position: relative;
|
236 |
+
top: 6px;
|
237 |
+
}
|
238 |
+
|
239 |
+
/* STYLE FOR THE PRO ICON NEXT TO THE CONTROL TITLE */
|
240 |
+
.sek-pro-icon-next-title {
|
241 |
+
padding: 5px;
|
242 |
+
width: 22px;
|
243 |
+
}
|
244 |
+
|
245 |
+
|
246 |
+
/* HIDE ADD NEW BUTTON IN MULTI-ITEM MODULES WHEN ACCORDION COLLAPSED */
|
247 |
+
[data-sek-expanded="false"] > .czr-open-pre-add-new { display: none;}
|
248 |
+
[data-sek-expanded="false"] > .czr-items-wrapper { display: none;}
|
249 |
+
|
250 |
+
/* Nimble Logo */
|
251 |
+
/* this class is added to a .accordion-section-title selector */
|
252 |
+
.sek-side-nimble-logo-wrapper {
|
253 |
+
padding: 4px 25px 0 2px!important;
|
254 |
+
display: -webkit-box;
|
255 |
+
display: -ms-flexbox;
|
256 |
+
display: flex;
|
257 |
+
-webkit-box-align: center;
|
258 |
+
-ms-flex-align: center;
|
259 |
+
align-items: center;
|
260 |
+
/* flex-direction: column; */
|
261 |
+
flex: 0 0 100%;
|
262 |
+
max-width: 100%;
|
263 |
+
}
|
264 |
+
.sek-side-nimble-logo-wrapper .sek-nimble-logo {
|
265 |
+
height: 45px;
|
266 |
+
}
|
267 |
+
.sek-side-nimble-logo-wrapper .sek-pro-pastil {
|
268 |
+
height: 30px;
|
269 |
+
}
|
270 |
+
|
271 |
+
[data-input-type="code_editor"] .czr-input {
|
272 |
+
width: 100%;
|
273 |
+
float: left;
|
274 |
+
}
|
assets/czr/sek/css/_dev_control/_0_4_control_top_bar.css
ADDED
@@ -0,0 +1,205 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
|
3 |
+
/* TOP BAR */
|
4 |
+
/* space for the Nimble topbar */
|
5 |
+
#customize-preview iframe {
|
6 |
+
top: 36px;
|
7 |
+
}
|
8 |
+
|
9 |
+
#nimble-top-bar {
|
10 |
+
max-height: 36px;
|
11 |
+
position: absolute;
|
12 |
+
text-align: center;
|
13 |
+
right: 0;
|
14 |
+
left: 0;
|
15 |
+
z-index: 20;
|
16 |
+
color: #fff;
|
17 |
+
display: block;
|
18 |
+
-webkit-transition: all 0.3s ease-in-out;
|
19 |
+
-moz-transition: all, 0.3s ease-in-out;
|
20 |
+
-ms-transition: all, 0.3s ease-in-out;
|
21 |
+
-o-transition: all, 0.3s ease-in-out;
|
22 |
+
transition: all 0.3s ease-in-out;
|
23 |
+
/*visibility: hidden;*/
|
24 |
+
opacity: 0.3;
|
25 |
+
top : 0%;
|
26 |
+
background: rgba(0, 0, 0, 0.5);
|
27 |
+
padding: 2px;
|
28 |
+
z-index: 99999;
|
29 |
+
display: -webkit-box;
|
30 |
+
display: -ms-flexbox;
|
31 |
+
display: flex;
|
32 |
+
-webkit-box-align: center;
|
33 |
+
-ms-flex-align: center;
|
34 |
+
align-items: center;
|
35 |
+
/* flex-direction: column; */
|
36 |
+
flex: 0 0 100%;
|
37 |
+
max-width: 100%;
|
38 |
+
overflow: hidden;
|
39 |
+
}
|
40 |
+
|
41 |
+
/* fixes https://github.com/presscustomizr/nimble-builder/issues/340 */
|
42 |
+
.themes-panel-expanded #nimble-top-bar, .outer-section-open #nimble-top-bar {
|
43 |
+
display: none;
|
44 |
+
}
|
45 |
+
|
46 |
+
body.nimble-top-bar-visible #nimble-top-bar {
|
47 |
+
/*visibility: inherit;*/
|
48 |
+
opacity: 1;
|
49 |
+
}
|
50 |
+
|
51 |
+
#nimble-top-bar:hover {
|
52 |
+
background: rgba(0, 0, 0, 0.7);
|
53 |
+
}
|
54 |
+
|
55 |
+
#nimble-top-bar .nimble-top-bar-content {
|
56 |
+
display: inline-block;
|
57 |
+
line-height: 20px;
|
58 |
+
width: 80%;
|
59 |
+
}
|
60 |
+
|
61 |
+
#nimble-top-bar .sek-do-undo .icon:before {
|
62 |
+
display: inline-block;
|
63 |
+
-webkit-font-smoothing: antialiased;
|
64 |
+
font: normal 20px/30px "dashicons";
|
65 |
+
vertical-align: top;
|
66 |
+
/* margin: 3px 0;
|
67 |
+
padding: 4px 8px;*/
|
68 |
+
color: #fff;
|
69 |
+
}
|
70 |
+
/* April 2020 : tmpl-saving btn added for https://github.com/presscustomizr/nimble-builder/issues/655 */
|
71 |
+
#nimble-top-bar .sek-settings, #nimble-top-bar .sek-tmpl-saving, .sek-add-content, .sek-do-undo, .sek-level-tree {
|
72 |
+
font-size: 16px;
|
73 |
+
padding: 0 4px;
|
74 |
+
}
|
75 |
+
|
76 |
+
/* vertical separators between option groups */
|
77 |
+
.sek-level-tree:before, .sek-do-undo:before, #nimble-top-bar .sek-tmpl-saving:before, #nimble-top-bar .sek-settings:before {
|
78 |
+
content: '';
|
79 |
+
border-left: 1px solid #aaa;
|
80 |
+
width: 0px;
|
81 |
+
padding: 10px 4px;
|
82 |
+
height: 100%;
|
83 |
+
position: relative;
|
84 |
+
}
|
85 |
+
#nimble-top-bar .sek-tmpl-saving:after {
|
86 |
+
content: '';
|
87 |
+
border-right: 1px solid #aaa;
|
88 |
+
width: 0px;
|
89 |
+
padding: 10px 5px;
|
90 |
+
height: 100%;
|
91 |
+
position: relative;
|
92 |
+
}
|
93 |
+
|
94 |
+
#nimble-top-bar button {
|
95 |
+
background: none;
|
96 |
+
border: none;
|
97 |
+
color: white;
|
98 |
+
cursor: pointer;
|
99 |
+
/* opacity: 0.8;*/
|
100 |
+
}
|
101 |
+
#nimble-top-bar button[data-nimble-state="disabled"] {
|
102 |
+
cursor: inherit;
|
103 |
+
opacity: 0.4!important;
|
104 |
+
cursor: not-allowed;
|
105 |
+
}
|
106 |
+
#nimble-top-bar .sek-do-undo button:hover {
|
107 |
+
opacity: 1;
|
108 |
+
}
|
109 |
+
#nimble-top-bar .sek-do-undo button:focus {
|
110 |
+
outline: none;
|
111 |
+
}
|
112 |
+
#nimble-top-bar .sek-do-undo .icon:before {
|
113 |
+
/*top: -6px;*/
|
114 |
+
position: relative;
|
115 |
+
}
|
116 |
+
#nimble-top-bar .sek-do-undo .icon.undo:before {
|
117 |
+
content:"\f171";
|
118 |
+
-webkit-transform: rotate(-45deg);
|
119 |
+
-ms-transform: rotate(-45deg);
|
120 |
+
transform: rotate(-45deg);
|
121 |
+
}
|
122 |
+
#nimble-top-bar .sek-do-undo .icon.do:before {
|
123 |
+
content:"\f172";
|
124 |
+
-webkit-transform: rotate(45deg);
|
125 |
+
-ms-transform: rotate(45deg);
|
126 |
+
transform: rotate(45deg);
|
127 |
+
}
|
128 |
+
#nimble-top-bar .sek-add-content {
|
129 |
+
width: 34px;
|
130 |
+
}
|
131 |
+
#nimble-top-bar .sek-add-content button {
|
132 |
+
padding-top: 1px;
|
133 |
+
padding-left: 5px;
|
134 |
+
margin: 0px 4px;
|
135 |
+
font-size: 21px;
|
136 |
+
width: 30px;
|
137 |
+
height: 30px;
|
138 |
+
color: #ffffff;
|
139 |
+
background: #33b3db;
|
140 |
+
border-radius: 30px;
|
141 |
+
position: absolute;
|
142 |
+
left: 5px;
|
143 |
+
top: 3px;
|
144 |
+
/* font-size: 28px; */
|
145 |
+
}
|
146 |
+
#nimble-top-bar .sek-nimble-doc {
|
147 |
+
position: absolute;
|
148 |
+
right: 10px;
|
149 |
+
cursor: pointer;
|
150 |
+
display: -webkit-box;
|
151 |
+
display: -ms-flexbox;
|
152 |
+
display: flex;
|
153 |
+
-webkit-box-align: center;
|
154 |
+
-ms-flex-align: center;
|
155 |
+
align-items: center;
|
156 |
+
/* flex-direction: column; */
|
157 |
+
flex: 0 0 100%;
|
158 |
+
max-width: 100%;
|
159 |
+
font-size: 12px;
|
160 |
+
}
|
161 |
+
#nimble-top-bar .sek-nimble-doc .sek-pointer {
|
162 |
+
text-decoration: underline;
|
163 |
+
}
|
164 |
+
.rtl #nimble-top-bar .sek-nimble-doc {
|
165 |
+
left:10px;
|
166 |
+
right: auto;
|
167 |
+
}
|
168 |
+
#nimble-top-bar .sek-nimble-doc img {
|
169 |
+
width: 30px;
|
170 |
+
height: 30px;
|
171 |
+
position: relative;
|
172 |
+
top: 2px;
|
173 |
+
-webkit-filter: grayscale(100%);
|
174 |
+
filter: grayscale(100%);
|
175 |
+
-webkit-filter: gray;
|
176 |
+
filter: gray;
|
177 |
+
}
|
178 |
+
#nimble-top-bar .sek-nimble-doc:hover img {
|
179 |
+
-webkit-filter: none;
|
180 |
+
filter: none;
|
181 |
+
}
|
182 |
+
#nimble-top-bar .sek-notifications {
|
183 |
+
max-width: 410px;
|
184 |
+
overflow: hidden;
|
185 |
+
padding: 0 10px;
|
186 |
+
font-size: 12px;
|
187 |
+
text-decoration: none;
|
188 |
+
}
|
189 |
+
#nimble-top-bar .sek-notifications.is-linked {
|
190 |
+
text-decoration: underline;
|
191 |
+
cursor: pointer;
|
192 |
+
}
|
193 |
+
#nimble-top-bar .sek-goto-site-tmpl-options {
|
194 |
+
text-decoration: underline;
|
195 |
+
cursor: pointer;
|
196 |
+
}
|
197 |
+
/* May 2020 : debug mode notification */
|
198 |
+
#nimble-top-bar .sek-notifications .debug-mode-notif {
|
199 |
+
color:#ff0000;
|
200 |
+
line-height:1.5em;
|
201 |
+
padding:3px;
|
202 |
+
background:#ffffff;
|
203 |
+
display: inline-block;
|
204 |
+
overflow: hidden;
|
205 |
+
}
|
assets/czr/sek/css/_dev_control/_0_6_control_top_save_sections_and_templates.css
ADDED
@@ -0,0 +1,260 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
/* TOP SAVE TMPL UI
|
3 |
+
* introduced april 2020 for https://github.com/presscustomizr/nimble-builder/issues/655
|
4 |
+
* and TOP SAVE SECTION UI
|
5 |
+
* introduced June 2020 for for https://github.com/presscustomizr/nimble-builder/issues/520
|
6 |
+
*/
|
7 |
+
#nimble-top-tmpl-save-ui,
|
8 |
+
#nimble-top-section-save-ui {
|
9 |
+
height: auto;
|
10 |
+
min-height: 300px;
|
11 |
+
padding: 20px;
|
12 |
+
position: absolute;
|
13 |
+
top: -300px;
|
14 |
+
/*text-align: center;*/
|
15 |
+
right: 0;
|
16 |
+
left: 0;
|
17 |
+
z-index: 20;
|
18 |
+
color: #fff;
|
19 |
+
display: block;
|
20 |
+
-webkit-transition: all 0.3s ease-in-out;
|
21 |
+
-moz-transition: all, 0.3s ease-in-out;
|
22 |
+
-ms-transition: all, 0.3s ease-in-out;
|
23 |
+
-o-transition: all, 0.3s ease-in-out;
|
24 |
+
transition: all 0.3s ease-in-out;
|
25 |
+
/*visibility: hidden;*/
|
26 |
+
opacity: 0.3;
|
27 |
+
background: rgba(0, 0, 0, 0.7);
|
28 |
+
z-index: 99999;
|
29 |
+
/*display: -webkit-box;
|
30 |
+
display: -ms-flexbox;
|
31 |
+
display: flex;
|
32 |
+
-webkit-box-align: center;
|
33 |
+
-ms-flex-align: center;
|
34 |
+
align-items: center;
|
35 |
+
flex: 0 0 100%;*/
|
36 |
+
max-width: 100%;
|
37 |
+
font-size: 16px;
|
38 |
+
line-height: 1.5em;
|
39 |
+
}
|
40 |
+
|
41 |
+
#nimble-top-tmpl-save-ui .nb-tmpl-save-inner,
|
42 |
+
#nimble-top-section-save-ui .nb-section-save-inner {
|
43 |
+
max-width: 800px;
|
44 |
+
margin: auto;
|
45 |
+
}
|
46 |
+
|
47 |
+
/*#nimble-top-tmpl-save-ui > div {
|
48 |
+
width: 100%;
|
49 |
+
}*/
|
50 |
+
|
51 |
+
body.sek-save-tmpl-ui-visible #nimble-top-tmpl-save-ui,
|
52 |
+
body.sek-save-section-ui-visible #nimble-top-section-save-ui {
|
53 |
+
/*visibility: inherit;*/
|
54 |
+
opacity: 1;
|
55 |
+
top:36px;
|
56 |
+
}
|
57 |
+
|
58 |
+
#nimble-top-tmpl-save-ui .sek-close-dialog,
|
59 |
+
#nimble-top-section-save-ui .sek-close-dialog {
|
60 |
+
position: absolute;
|
61 |
+
bottom: 10px;
|
62 |
+
right: 10px;
|
63 |
+
border-radius: 3px!important;
|
64 |
+
}
|
65 |
+
|
66 |
+
#nimble-top-tmpl-save-ui #sek-saved-tmpl-title.error,
|
67 |
+
#nimble-top-section-save-ui #sek-saved-section-title.error {
|
68 |
+
border: 1px solid #ff0000;
|
69 |
+
}
|
70 |
+
|
71 |
+
|
72 |
+
/* INPUT STYLE */
|
73 |
+
.sek-tmpl-title,
|
74 |
+
.sek-tmpl-description,
|
75 |
+
select.sek-saved-tmpl-picker,
|
76 |
+
.sek-section-title,
|
77 |
+
.sek-section-description,
|
78 |
+
select.sek-saved-section-picker {
|
79 |
+
margin-top: 10px;
|
80 |
+
float: left;
|
81 |
+
clear: both;
|
82 |
+
width: 100%;
|
83 |
+
}
|
84 |
+
|
85 |
+
.sek-tmpl-description textarea,
|
86 |
+
input#sek-saved-tmpl-title,
|
87 |
+
select.sek-saved-tmpl-picker,
|
88 |
+
.sek-section-description textarea,
|
89 |
+
input#sek-saved-section-title,
|
90 |
+
select.sek-saved-section-picker {
|
91 |
+
width: 97%;
|
92 |
+
max-width: none;
|
93 |
+
margin-bottom: 10px;
|
94 |
+
}
|
95 |
+
.sek-tmpl-description textarea,
|
96 |
+
.sek-section-description textarea {
|
97 |
+
min-height: 100px;
|
98 |
+
}
|
99 |
+
.sek-saved-tmpl-picker,
|
100 |
+
.sek-tmpl-title,
|
101 |
+
.sek-tmpl-description,
|
102 |
+
.sek-save-tmpl-action .sek-do-save-tmpl,
|
103 |
+
.sek-save-tmpl-action .sek-do-update-tmpl,
|
104 |
+
.sek-save-tmpl-action .sek-open-remove-confirmation,
|
105 |
+
.sek-saved-section-picker,
|
106 |
+
.sek-section-title,
|
107 |
+
.sek-section-description,
|
108 |
+
.sek-save-section-action .sek-do-save-section,
|
109 |
+
.sek-save-section-action .sek-do-update-section,
|
110 |
+
.sek-save-section-action .sek-open-remove-confirmation {
|
111 |
+
display: none;
|
112 |
+
}
|
113 |
+
|
114 |
+
/* the template picker is visible when template collection has been ajaxily fetched */
|
115 |
+
.tmpl-collection-populated .sek-saved-tmpl-picker,
|
116 |
+
.section-collection-populated .sek-saved-section-picker {
|
117 |
+
display:block
|
118 |
+
}
|
119 |
+
|
120 |
+
.sek-tmpl-remove-dialog,
|
121 |
+
.sek-section-remove-dialog {
|
122 |
+
display: none;
|
123 |
+
color: red;
|
124 |
+
background: #ffffff;
|
125 |
+
padding: 5px;
|
126 |
+
text-transform: uppercase;
|
127 |
+
float: left;
|
128 |
+
width: 96%;
|
129 |
+
}
|
130 |
+
.sek-tmpl-remove-dialog .sek-do-remove-tmpl,
|
131 |
+
.sek-section-remove-dialog .sek-do-remove-section {
|
132 |
+
color: red;
|
133 |
+
}
|
134 |
+
|
135 |
+
/* TMPL UI VISIBILITY = f(mode) */
|
136 |
+
[data-sek-tmpl-dialog-mode="save"] [data-tmpl-mode-switcher="remove"] {display: none;}
|
137 |
+
[data-sek-tmpl-dialog-mode="save"] .sek-saved-tmpl-picker {display: none;}
|
138 |
+
[data-sek-tmpl-dialog-mode="save"] .sek-tmpl-title {display: block;}
|
139 |
+
[data-sek-tmpl-dialog-mode="save"] .sek-tmpl-description {display: block;}
|
140 |
+
[data-sek-tmpl-dialog-mode="save"] .sek-do-save-tmpl {display: block;border-color: #ffff00;background: #f9f9b6f7;border-radius: 3px!important;}
|
141 |
+
|
142 |
+
[data-sek-tmpl-dialog-mode="update"] [data-tmpl-mode-switcher="remove"] {display: none;}
|
143 |
+
[data-sek-tmpl-dialog-mode="update"].sek-tmpl-update-selected .sek-tmpl-title {display: block;}
|
144 |
+
[data-sek-tmpl-dialog-mode="update"].sek-tmpl-update-selected .sek-tmpl-description {display: block;}
|
145 |
+
[data-sek-tmpl-dialog-mode="update"].sek-tmpl-update-selected .sek-do-update-tmpl {display: block;}
|
146 |
+
|
147 |
+
.sek-save-tmpl-mode-switcher .sek-ui-button[data-tmpl-mode-switcher="edit"] {display: none;}
|
148 |
+
[data-sek-tmpl-dialog-mode="edit"] [data-tmpl-mode-switcher="edit"] {display: inline-block!important;}
|
149 |
+
[data-sek-tmpl-dialog-mode="edit"] [data-tmpl-mode-switcher="update"] {display: none;}
|
150 |
+
[data-sek-tmpl-dialog-mode="edit"] [data-tmpl-mode-switcher="save"] {display: none;}
|
151 |
+
[data-sek-tmpl-dialog-mode="edit"] [data-tmpl-mode-switcher="remove"] {display: none;}
|
152 |
+
[data-sek-tmpl-dialog-mode="edit"] .sek-saved-tmpl-picker {display: block;}
|
153 |
+
[data-sek-tmpl-dialog-mode="edit"] .sek-tmpl-title {display: block;}
|
154 |
+
[data-sek-tmpl-dialog-mode="edit"] .sek-tmpl-description {display: block;}
|
155 |
+
[data-sek-tmpl-dialog-mode="edit"] .sek-do-update-tmpl {display: block;}
|
156 |
+
|
157 |
+
[data-sek-tmpl-dialog-mode="remove"] [data-tmpl-mode-switcher="update"] {display: none;}
|
158 |
+
[data-sek-tmpl-dialog-mode="remove"] [data-tmpl-mode-switcher="save"] {display: none;}
|
159 |
+
[data-sek-tmpl-dialog-mode="remove"].sek-tmpl-remove-selected .sek-open-remove-confirmation {display: block;}
|
160 |
+
[data-sek-tmpl-dialog-mode="remove"].sek-removal-confirmation-opened .sek-open-remove-confirmation {display: none!important;}
|
161 |
+
[data-sek-tmpl-dialog-mode="remove"].sek-removal-confirmation-opened .sek-tmpl-remove-dialog { display: block;}
|
162 |
+
|
163 |
+
/* SECTION UI VISIBILITY = f(mode) */
|
164 |
+
[data-sek-section-dialog-mode="save"] [data-section-mode-switcher="remove"] {display: none;}
|
165 |
+
[data-sek-section-dialog-mode="save"] .sek-saved-section-picker {display: none;}
|
166 |
+
[data-sek-section-dialog-mode="save"] .sek-section-title {display: block;}
|
167 |
+
[data-sek-section-dialog-mode="save"] .sek-section-description {display: block;}
|
168 |
+
[data-sek-section-dialog-mode="save"] .sek-do-save-section {display: block;border-color: #ffff00;background: #f9f9b6f7;border-radius: 3px!important;}
|
169 |
+
|
170 |
+
[data-sek-section-dialog-mode="update"] [data-section-mode-switcher="remove"] {display: none;}
|
171 |
+
[data-sek-section-dialog-mode="update"].sek-section-update-selected .sek-section-title {display: block;}
|
172 |
+
[data-sek-section-dialog-mode="update"].sek-section-update-selected .sek-section-description {display: block;}
|
173 |
+
[data-sek-section-dialog-mode="update"].sek-section-update-selected .sek-do-update-section {display: block;}
|
174 |
+
|
175 |
+
.sek-save-section-mode-switcher .sek-ui-button[data-section-mode-switcher="edit"] {display: none;}
|
176 |
+
[data-sek-section-dialog-mode="edit"] [data-section-mode-switcher="edit"] {display: inline-block!important;}
|
177 |
+
[data-sek-section-dialog-mode="edit"] [data-section-mode-switcher="update"] {display: none;}
|
178 |
+
[data-sek-section-dialog-mode="edit"] [data-section-mode-switcher="save"] {display: none;}
|
179 |
+
[data-sek-section-dialog-mode="edit"] [data-section-mode-switcher="remove"] {display: none;}
|
180 |
+
[data-sek-section-dialog-mode="edit"] .sek-saved-section-picker {display: block;}
|
181 |
+
[data-sek-section-dialog-mode="edit"] .sek-section-title {display: block;}
|
182 |
+
[data-sek-section-dialog-mode="edit"] .sek-section-description {display: block;}
|
183 |
+
[data-sek-section-dialog-mode="edit"] .sek-do-update-section {display: block;}
|
184 |
+
|
185 |
+
[data-sek-section-dialog-mode="remove"].sek-section-remove-selected .sek-open-remove-confirmation {display: block;}
|
186 |
+
[data-sek-section-dialog-mode="remove"].sek-removal-confirmation-opened .sek-open-remove-confirmation {display: none!important;}
|
187 |
+
[data-sek-section-dialog-mode="remove"].sek-removal-confirmation-opened .sek-section-remove-dialog { display: block;}
|
188 |
+
[data-sek-section-dialog-mode="remove"].sek-is-removal-only [data-section-mode-switcher="save"], [data-sek-section-dialog-mode="remove"].sek-is-removal-only [data-section-mode-switcher="update"] { display: none;}
|
189 |
+
|
190 |
+
|
191 |
+
#nimble-top-tmpl-save-ui .spinner,
|
192 |
+
#nimble-top-section-save-ui .spinner {
|
193 |
+
display: none;
|
194 |
+
}
|
195 |
+
|
196 |
+
#nimble-top-tmpl-save-ui.nimble-tmpl-processing-ajax .spinner,
|
197 |
+
#nimble-top-section-save-ui.nimble-section-processing-ajax .spinner {
|
198 |
+
display: block;
|
199 |
+
visibility: visible;
|
200 |
+
}
|
201 |
+
|
202 |
+
|
203 |
+
|
204 |
+
|
205 |
+
|
206 |
+
|
207 |
+
|
208 |
+
|
209 |
+
|
210 |
+
|
211 |
+
|
212 |
+
|
213 |
+
|
214 |
+
|
215 |
+
|
216 |
+
/* OLD TOP SAVE SECTION UI */
|
217 |
+
/* #nimble-top-section-save-ui {
|
218 |
+
height: 300px;
|
219 |
+
padding: 20px;
|
220 |
+
position: absolute;
|
221 |
+
top: -300px;
|
222 |
+
|
223 |
+
right: 0;
|
224 |
+
left: 0;
|
225 |
+
z-index: 20;
|
226 |
+
color: #fff;
|
227 |
+
display: block;
|
228 |
+
-webkit-transition: all 0.3s ease-in-out;
|
229 |
+
-moz-transition: all, 0.3s ease-in-out;
|
230 |
+
-ms-transition: all, 0.3s ease-in-out;
|
231 |
+
-o-transition: all, 0.3s ease-in-out;
|
232 |
+
transition: all 0.3s ease-in-out;
|
233 |
+
|
234 |
+
opacity: 0.3;
|
235 |
+
background: rgba(0, 0, 0, 0.5);
|
236 |
+
z-index: 99999;
|
237 |
+
|
238 |
+
max-width: 100%;
|
239 |
+
}
|
240 |
+
|
241 |
+
#nimble-top-section-save-ui > div {
|
242 |
+
width: 100%;
|
243 |
+
}
|
244 |
+
|
245 |
+
body.sek-save-section-ui-visible #nimble-top-section-save-ui {
|
246 |
+
|
247 |
+
opacity: 1;
|
248 |
+
top:36px;
|
249 |
+
}
|
250 |
+
|
251 |
+
#nimble-top-section-save-ui .sek-close-dialog {
|
252 |
+
position: absolute;
|
253 |
+
bottom: 10px;
|
254 |
+
right: 10px;
|
255 |
+
}
|
256 |
+
|
257 |
+
#nimble-top-section-save-ui #sek-saved-section-title.error {
|
258 |
+
border: 1px solid #ff0000;
|
259 |
+
}
|
260 |
+
*/
|
assets/czr/sek/css/_dev_control/_0_7_control_tmpl_gallery.css
ADDED
@@ -0,0 +1,434 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
/* TEMPLATE GALLERY */
|
3 |
+
#nimble-tmpl-gallery, #nimble-tmpl-gallery .sek-tmpl-gal-inject-dialog {
|
4 |
+
-webkit-transition: top 0.3s ease-in-out;
|
5 |
+
-moz-transition: top, 0.3s ease-in-out;
|
6 |
+
-ms-transition: top, 0.3s ease-in-out;
|
7 |
+
-o-transition: top, 0.3s ease-in-out;
|
8 |
+
transition: top 0.3s ease-in-out;
|
9 |
+
}
|
10 |
+
|
11 |
+
#nimble-tmpl-gallery {
|
12 |
+
background: rgba(240, 240, 240, 0.89)!important;
|
13 |
+
border-bottom: 1px solid #aaa!important;
|
14 |
+
color: #222!important;
|
15 |
+
font-size: 12px!important;
|
16 |
+
position: absolute;
|
17 |
+
top: -100vh;
|
18 |
+
right: 0;
|
19 |
+
left: 0;
|
20 |
+
height: calc(100vh - 36px);
|
21 |
+
overflow: auto;
|
22 |
+
padding: 15px;
|
23 |
+
z-index: 1000;
|
24 |
+
}
|
25 |
+
.sek-template-gallery-expanded #nimble-tmpl-gallery {
|
26 |
+
top: 36px;
|
27 |
+
}
|
28 |
+
|
29 |
+
|
30 |
+
/* IMPORT DIALOG BOX */
|
31 |
+
#nimble-tmpl-gallery .sek-tmpl-gal-inject-dialog {
|
32 |
+
background: rgba(240, 240, 240, 0.89)!important;
|
33 |
+
border-bottom: 1px solid #aaa!important;
|
34 |
+
color: #222!important;
|
35 |
+
font-size: 12px!important;
|
36 |
+
position: absolute;
|
37 |
+
top: -100vh;
|
38 |
+
right: 0;
|
39 |
+
left: 0;
|
40 |
+
height: calc(100vh - 36px);
|
41 |
+
overflow: auto;
|
42 |
+
padding: 15px;
|
43 |
+
z-index: 1001;
|
44 |
+
}
|
45 |
+
.sek-tmpl-dialog-expanded #nimble-tmpl-gallery .sek-tmpl-gal-inject-dialog {
|
46 |
+
top: 0px;
|
47 |
+
}
|
48 |
+
/* Hide template gallery while dialog is open. Otherwise the dialog might not be visible if a template has been clicked too low in the page */
|
49 |
+
.sek-tmpl-dialog-expanded #nimble-tmpl-gallery .sek-tmpl-gallery-inner {
|
50 |
+
display: none;
|
51 |
+
}
|
52 |
+
|
53 |
+
|
54 |
+
#nimble-tmpl-gallery .sek-tmpl-gallery-inner {
|
55 |
+
display: -webkit-box;
|
56 |
+
display: -ms-flexbox;
|
57 |
+
display: flex;
|
58 |
+
-ms-flex-wrap: wrap;
|
59 |
+
flex-wrap: wrap;
|
60 |
+
width: 100%;
|
61 |
+
margin-right: -10px;
|
62 |
+
margin-left: -10px;
|
63 |
+
margin-top: 8px;
|
64 |
+
}
|
65 |
+
#nimble-tmpl-gallery .sek-tmpl-gallery-inner *, #nimble-tmpl-gallery .sek-tmpl-gallery-inner *:after, #nimble-tmpl-gallery .sek-tmpl-gallery-inner *:before{
|
66 |
+
box-sizing: border-box;
|
67 |
+
}
|
68 |
+
/* TMPL ITEM */
|
69 |
+
.sek-tmpl-gallery-inner .sek-tmpl-item {
|
70 |
+
-ms-flex: 0 0 calc(25% - 24px);
|
71 |
+
flex: 0 0 calc(25% - 24px);
|
72 |
+
max-width: calc(25% - 24px);
|
73 |
+
padding: 0px;
|
74 |
+
margin: 12px;
|
75 |
+
width: 100%;
|
76 |
+
height: 380px;
|
77 |
+
display: -webkit-box;
|
78 |
+
display: -ms-flexbox;
|
79 |
+
display: flex;
|
80 |
+
-webkit-box-orient: vertical;
|
81 |
+
-webkit-box-direction: normal;
|
82 |
+
-ms-flex-direction: column;
|
83 |
+
flex-direction: column;
|
84 |
+
-ms-flex-align: center;
|
85 |
+
align-items: center;
|
86 |
+
position: relative;
|
87 |
+
/* cursor: pointer; */
|
88 |
+
-webkit-box-shadow: rgb(0 0 0 / 25%) 0px 3px 11px 0px;
|
89 |
+
-moz-box-shadow: rgba(0, 0, 0, 0.25) 0px 3px 11px 0px;
|
90 |
+
box-shadow: rgb(0 0 0 / 25%) 0px 3px 11px 0;
|
91 |
+
}
|
92 |
+
@media (max-width: 1300px) {
|
93 |
+
.sek-tmpl-gallery-inner .sek-tmpl-item {
|
94 |
+
-ms-flex: 0 0 calc(33.333% - 24px);
|
95 |
+
flex: 0 0 calc(33.333% - 24px);
|
96 |
+
max-width: calc(33.333% - 24px);
|
97 |
+
}
|
98 |
+
}
|
99 |
+
@media (max-width: 1000px) {
|
100 |
+
.sek-tmpl-gallery-inner .sek-tmpl-item {
|
101 |
+
-ms-flex: 0 0 calc(50% - 24px);
|
102 |
+
flex: 0 0 calc(50% - 24px);
|
103 |
+
max-width: calc(50% - 24px);
|
104 |
+
}
|
105 |
+
}
|
106 |
+
|
107 |
+
.tmpl-top-title {
|
108 |
+
padding: 10px;
|
109 |
+
background: #ffffff;
|
110 |
+
width: 100%;
|
111 |
+
}
|
112 |
+
.tmpl-top-title h3 {
|
113 |
+
padding: 0;
|
114 |
+
margin: 0;
|
115 |
+
font-size: 13px;
|
116 |
+
line-height: 1.5em;
|
117 |
+
color: #555;
|
118 |
+
}
|
119 |
+
|
120 |
+
.tmpl-thumb-and-info-wrap {
|
121 |
+
position: relative;
|
122 |
+
width: 100%;
|
123 |
+
height: 100%;
|
124 |
+
}
|
125 |
+
|
126 |
+
|
127 |
+
|
128 |
+
.sek-tmpl-info {
|
129 |
+
position: absolute;
|
130 |
+
top: 0;
|
131 |
+
bottom: 0;
|
132 |
+
width: 100%;
|
133 |
+
max-height: 100%;
|
134 |
+
padding: 10px;
|
135 |
+
overflow: hidden;
|
136 |
+
}
|
137 |
+
.sek-tmpl-info > p {
|
138 |
+
color: #ffffff;
|
139 |
+
overflow: hidden;
|
140 |
+
}
|
141 |
+
/* .sek-tmpl-info > .tmpl-title {
|
142 |
+
font-size: 15px;
|
143 |
+
margin: 0.5em 0;
|
144 |
+
} */
|
145 |
+
.sek-tmpl-info > p {
|
146 |
+
font-size: 13px;
|
147 |
+
margin: 0.5em 0;
|
148 |
+
}
|
149 |
+
.sek-tmpl-info > p.tmpl-date {
|
150 |
+
font-size: 12px;
|
151 |
+
}
|
152 |
+
|
153 |
+
/* USE TMPL BUTTON */
|
154 |
+
.sek-tmpl-info > .use-tmpl {
|
155 |
+
cursor: pointer;
|
156 |
+
font-size: 21px;
|
157 |
+
width: 50px;
|
158 |
+
height: 50px;
|
159 |
+
color: #ffffff;
|
160 |
+
background: #33b3db;
|
161 |
+
border-radius: 30px;
|
162 |
+
opacity: 0.2;
|
163 |
+
-webkit-box-shadow: 0 2px 6px rgba(0,0,0,.2);
|
164 |
+
box-shadow: 0 2px 6px rgba(0,0,0,.2);
|
165 |
+
-webkit-transition: all .20s ease;
|
166 |
+
-o-transition: all .20s ease;
|
167 |
+
transition: all .20s ease;
|
168 |
+
-webkit-box-align: center;
|
169 |
+
-ms-flex-align: center;
|
170 |
+
align-items: center;
|
171 |
+
display: -webkit-box;
|
172 |
+
display: -ms-flexbox;
|
173 |
+
display: flex;
|
174 |
+
-webkit-box-pack: center;
|
175 |
+
-ms-flex-pack: center;
|
176 |
+
justify-content: center;
|
177 |
+
position: absolute;
|
178 |
+
top: calc(50% - 25px);
|
179 |
+
left: calc(50% - 25px);
|
180 |
+
}
|
181 |
+
.sek-tmpl-info:hover > .use-tmpl {
|
182 |
+
opacity: 0.5;
|
183 |
+
}
|
184 |
+
.sek-tmpl-info > .use-tmpl:hover {
|
185 |
+
opacity: 0.95;
|
186 |
+
}
|
187 |
+
|
188 |
+
/* REMOVE TMPL BUTTON */
|
189 |
+
.sek-tmpl-info > .remove-tmpl, .sek-tmpl-info > .edit-tmpl {
|
190 |
+
cursor: pointer;
|
191 |
+
font-size: 16px;
|
192 |
+
width: 30px;
|
193 |
+
height: 30px;
|
194 |
+
color: #535353;
|
195 |
+
background: rgba(255, 255, 255, 0.7);
|
196 |
+
border-radius: 30px;
|
197 |
+
opacity: 0.4;
|
198 |
+
-webkit-box-shadow: 0 2px 6px rgba(0,0,0,.2);
|
199 |
+
box-shadow: 0 2px 6px rgba(0,0,0,.2);
|
200 |
+
-webkit-transition: all .20s ease;
|
201 |
+
-o-transition: all .20s ease;
|
202 |
+
transition: all .20s ease;
|
203 |
+
-webkit-box-align: center;
|
204 |
+
-ms-flex-align: center;
|
205 |
+
align-items: center;
|
206 |
+
display: -webkit-box;
|
207 |
+
display: -ms-flexbox;
|
208 |
+
display: flex;
|
209 |
+
-webkit-box-pack: center;
|
210 |
+
-ms-flex-pack: center;
|
211 |
+
justify-content: center;
|
212 |
+
position: absolute;
|
213 |
+
}
|
214 |
+
.sek-tmpl-info > .remove-tmpl {
|
215 |
+
bottom: 10px;
|
216 |
+
right: 10px;
|
217 |
+
}
|
218 |
+
.sek-tmpl-info > .edit-tmpl {
|
219 |
+
bottom: 10px;
|
220 |
+
left: 10px;
|
221 |
+
}
|
222 |
+
.sek-tmpl-info:hover > .remove-tmpl, .sek-tmpl-info:hover > .edit-tmpl {
|
223 |
+
opacity: 0.7;
|
224 |
+
}
|
225 |
+
.sek-tmpl-info > .remove-tmpl:hover{
|
226 |
+
opacity: 0.95;
|
227 |
+
color: red;
|
228 |
+
}
|
229 |
+
.sek-tmpl-info > .edit-tmpl:hover {
|
230 |
+
opacity: 0.95;
|
231 |
+
color: #000000;
|
232 |
+
}
|
233 |
+
|
234 |
+
.sek-tmpl-demo-link {
|
235 |
+
position: absolute;
|
236 |
+
bottom: 5px;
|
237 |
+
left: 5px;
|
238 |
+
text-transform: uppercase;
|
239 |
+
color: #ffffff;
|
240 |
+
}
|
241 |
+
.sek-tmpl-demo-link a {
|
242 |
+
color: #ffffff;
|
243 |
+
}
|
244 |
+
.sek-tmpl-demo-link a:hover, .sek-tmpl-demo-link a:visited {
|
245 |
+
color: #ffffff;
|
246 |
+
}
|
247 |
+
|
248 |
+
.sek-is-site-template {
|
249 |
+
position: absolute;
|
250 |
+
bottom: 5px;
|
251 |
+
right: 5px;
|
252 |
+
text-transform: uppercase;
|
253 |
+
font-size: 10px;
|
254 |
+
line-height: 1.5em;
|
255 |
+
background: #33b3db;
|
256 |
+
color: #ffffff;
|
257 |
+
padding: 0 3px;
|
258 |
+
}
|
259 |
+
|
260 |
+
|
261 |
+
/*.sek-tmpl-gallery-inner .sek-tmpl-item:after, .sek-tmpl-gallery-inner .sek-tmpl-item:before {
|
262 |
+
box-sizing: inherit;
|
263 |
+
}*/
|
264 |
+
.sek-tmpl-gallery-inner .sek-tmpl-thumb {
|
265 |
+
/* cursor: pointer; */
|
266 |
+
position: relative;
|
267 |
+
height: 100%;
|
268 |
+
width: 100%;
|
269 |
+
background-size: cover;
|
270 |
+
background-repeat: no-repeat;
|
271 |
+
background-position:top;
|
272 |
+
}
|
273 |
+
.sek-tmpl-thumb img { max-width: 100%; }
|
274 |
+
.sek-tmpl-gallery-inner .sek-tmpl-thumb::after {
|
275 |
+
content: "";
|
276 |
+
display: block;
|
277 |
+
position: absolute;
|
278 |
+
top: 0;
|
279 |
+
left: 0;
|
280 |
+
right: 0;
|
281 |
+
bottom: 0;
|
282 |
+
background-color: #000000;
|
283 |
+
opacity: 0.40;
|
284 |
+
-webkit-transition: opacity 0.3s ease-in-out;
|
285 |
+
-moz-transition: opacity 0.3s ease-in-out;
|
286 |
+
-ms-transition: opacity 0.3s ease-in-out;
|
287 |
+
-o-transition: opacity 0.3s ease-in-out;
|
288 |
+
transition: opacity 0.3s ease-in-out;
|
289 |
+
}
|
290 |
+
.sek-tmpl-gallery-inner .sek-tmpl-item:hover .sek-tmpl-thumb::after {
|
291 |
+
opacity: 0.65;
|
292 |
+
}
|
293 |
+
|
294 |
+
/* FILTER AND CLOSE BUTTON*/
|
295 |
+
#sek-gal-top-bar {
|
296 |
+
display: -webkit-box;
|
297 |
+
display: -ms-flexbox;
|
298 |
+
display: flex;
|
299 |
+
-ms-flex-wrap: wrap;
|
300 |
+
flex-wrap: wrap;
|
301 |
+
}
|
302 |
+
.sek-close-button {
|
303 |
+
position: absolute;
|
304 |
+
top: 10px;
|
305 |
+
right: 20px;
|
306 |
+
}
|
307 |
+
.sek-tmpl-filter-wrapper {
|
308 |
+
display: none;
|
309 |
+
width: 100%;
|
310 |
+
}
|
311 |
+
input.sek-filter-tmpl {
|
312 |
+
width: 60%;
|
313 |
+
}
|
314 |
+
#sek-gal-top-bar .sek-ui-button-group {
|
315 |
+
width: 37%;
|
316 |
+
text-align: right;
|
317 |
+
}
|
318 |
+
.search-active .sek-tmpl-item {
|
319 |
+
display: none;
|
320 |
+
}
|
321 |
+
.search-active .sek-tmpl-item.search-match {
|
322 |
+
display: -webkit-box;
|
323 |
+
display: -ms-flexbox;
|
324 |
+
display: flex;
|
325 |
+
}
|
326 |
+
|
327 |
+
/* TMPL SOURCE SWITCHER */
|
328 |
+
#sek-tmpl-source-switcher{
|
329 |
+
display: none;/* <= rendered only if we could access NB api */
|
330 |
+
width:100%;
|
331 |
+
padding: 10px 0;
|
332 |
+
}
|
333 |
+
#sek-tmpl-source-switcher .sek-ui-button-group {
|
334 |
+
display: -webkit-box;
|
335 |
+
display: -ms-flexbox;
|
336 |
+
display: flex;
|
337 |
+
-webkit-box-align: center;
|
338 |
+
-ms-flex-align: center;
|
339 |
+
align-items: center;
|
340 |
+
/* flex-direction: column; */
|
341 |
+
flex: 0 0 100%;
|
342 |
+
max-width: 100%;
|
343 |
+
}
|
344 |
+
#sek-tmpl-source-switcher .sek-ui-button[aria-pressed="true"] {
|
345 |
+
background: #33b3db;
|
346 |
+
border-color: #33b3db;
|
347 |
+
box-shadow: inset 0 -1px 0 #2271b1;
|
348 |
+
}
|
349 |
+
|
350 |
+
[data-sek-tmpl-item-source="api_tmpl"] .sek-tmpl-info .tmpl-api-hide {
|
351 |
+
opacity: 0;
|
352 |
+
}
|
353 |
+
.sek-tmpl-gallery-inner [data-sek-tmpl-item-source="api_tmpl"]:hover .sek-tmpl-info .tmpl-api-hide{
|
354 |
+
opacity: 1;
|
355 |
+
}
|
356 |
+
.sek-tmpl-gallery-inner [data-sek-tmpl-item-source="api_tmpl"] .sek-tmpl-thumb::after {
|
357 |
+
opacity: 0.10;
|
358 |
+
}
|
359 |
+
.sek-tmpl-coming-soon p {
|
360 |
+
text-transform: uppercase;
|
361 |
+
font-style: italic;
|
362 |
+
font-weight: bold;
|
363 |
+
font-size: 18px;
|
364 |
+
color: #555;
|
365 |
+
}
|
366 |
+
|
367 |
+
|
368 |
+
/* TMPL PICKING */
|
369 |
+
[data-input-type="site_tmpl_picker"] {
|
370 |
+
margin-bottom: 20px;;
|
371 |
+
}
|
372 |
+
[data-input-type="site_tmpl_picker"] > .customize-control-title {
|
373 |
+
text-transform: uppercase;
|
374 |
+
}
|
375 |
+
.sek-current-site-tmpl {
|
376 |
+
width: calc(100% - 16px);
|
377 |
+
float: left;
|
378 |
+
padding: 10px 8px;
|
379 |
+
margin: 5px 0;
|
380 |
+
border-color: #ccc;
|
381 |
+
background: #f7f7f7;
|
382 |
+
box-shadow: inset 0 0px 6px #ccc;
|
383 |
+
-webkit-box-shadow:inset 0 0px 6px #ccc;
|
384 |
+
vertical-align: top;
|
385 |
+
margin-bottom: 10px;
|
386 |
+
font-size: 12px;
|
387 |
+
border-radius: 3px;
|
388 |
+
}
|
389 |
+
|
390 |
+
|
391 |
+
.sek-has-site-tmpl .sek-current-site-tmpl {
|
392 |
+
background: #33b3db;
|
393 |
+
border-color: #33b3db;
|
394 |
+
-webkit-box-shadow: inset 1px 0px 6px #2c72ab;
|
395 |
+
box-shadow: inset 1px 0px 6px #2c72ab;
|
396 |
+
color: #ffffff;
|
397 |
+
font-size: 13px;
|
398 |
+
}
|
399 |
+
.sek-site-tmpl-not-found .sek-current-site-tmpl {
|
400 |
+
background: #f49907;
|
401 |
+
border-color: #f49907;
|
402 |
+
-webkit-box-shadow: inset 1px 0px 6px #b26e01;
|
403 |
+
box-shadow: inset 1px 0px 6px #b26e01;
|
404 |
+
color: #ffffff;
|
405 |
+
font-size: 13px;
|
406 |
+
}
|
407 |
+
|
408 |
+
.sek-site-tmpl-picking-active .sek-ui-button-group .sek-pick-site-tmpl,
|
409 |
+
.sek-site-tmpl-picking-active .sek-ui-button-group .sek-pick-site-tmpl:focus,
|
410 |
+
.sek-pick-site-tmpl:hover {
|
411 |
+
background: #33b3db;
|
412 |
+
border-color: #33b3db;
|
413 |
+
box-shadow: inset 0 -1px 0 #2271b1;
|
414 |
+
color: #ffffff;
|
415 |
+
}
|
416 |
+
.sek-pick-site-tmpl {
|
417 |
+
font-weight: bold;
|
418 |
+
-webkit-transition: all 0.2s ease-in-out;
|
419 |
+
-moz-transition: all 0.2s ease-in-out;
|
420 |
+
-ms-transition: all 0.2s ease-in-out;
|
421 |
+
-o-transition: all 0.2s ease-in-out;
|
422 |
+
transition: all 0.2s ease-in-out;
|
423 |
+
}
|
424 |
+
|
425 |
+
/* Site template picking mode */
|
426 |
+
.sek-is-site-tmpl-mode [data-sek-api-site-tmpl="false"] {
|
427 |
+
display: none!important;
|
428 |
+
}
|
429 |
+
#nimble-tmpl-gallery .sek-tmpl-gallery-inner [data-sek-api-site-tmpl="true"] {display: none;}
|
430 |
+
.sek-is-site-tmpl-mode .sek-tmpl-gallery-inner [data-sek-api-site-tmpl="true"] {
|
431 |
+
display: -webkit-box!important;
|
432 |
+
display: -ms-flexbox!important;
|
433 |
+
display: flex!important;
|
434 |
+
}
|
assets/czr/sek/css/_dev_control/_0_8_control_level_tree.css
ADDED
@@ -0,0 +1,124 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* LEVEL TREE */
|
2 |
+
#nimble-level-tree {
|
3 |
+
-webkit-transition: top 0.3s ease-in-out;
|
4 |
+
-moz-transition: top, 0.3s ease-in-out;
|
5 |
+
-ms-transition: top, 0.3s ease-in-out;
|
6 |
+
-o-transition: top, 0.3s ease-in-out;
|
7 |
+
transition: top 0.3s ease-in-out;
|
8 |
+
}
|
9 |
+
.sek-level-tree-expanded #customize-preview iframe {
|
10 |
+
top: 366px;
|
11 |
+
height: calc(100vh - 366px);
|
12 |
+
}
|
13 |
+
/* highlight icon */
|
14 |
+
.sek-level-tree-expanded #nimble-top-bar .sek-level-tree button {
|
15 |
+
color: #44b9e2;
|
16 |
+
}
|
17 |
+
#nimble-level-tree {
|
18 |
+
background: #f0f0f0!important;
|
19 |
+
border-bottom: 1px solid #aaa!important;
|
20 |
+
color: #222!important;
|
21 |
+
font-size: 12px!important;
|
22 |
+
position: absolute;
|
23 |
+
top: 36px;
|
24 |
+
right: 0;
|
25 |
+
left: 0;
|
26 |
+
height: 299px;
|
27 |
+
overflow: auto;
|
28 |
+
padding: 15px;
|
29 |
+
z-index: 0;
|
30 |
+
}
|
31 |
+
/*.sek-level-tree-expanded #nimble-level-tree {
|
32 |
+
top: 36px;
|
33 |
+
-webkit-transition: all 0.3s ease-in-out;
|
34 |
+
-moz-transition: all, 0.3s ease-in-out;
|
35 |
+
-ms-transition: all, 0.3s ease-in-out;
|
36 |
+
-o-transition: all, 0.3s ease-in-out;
|
37 |
+
transition: all 0.3s ease-in-out;
|
38 |
+
}*/
|
39 |
+
#nimble-level-tree ul li {
|
40 |
+
padding-left: 30px;
|
41 |
+
cursor: pointer;
|
42 |
+
margin-bottom: 8px;
|
43 |
+
}
|
44 |
+
#nimble-level-tree ul li .sek-remove-level {
|
45 |
+
font-size: 16px;
|
46 |
+
opacity: 0.6;
|
47 |
+
}
|
48 |
+
#nimble-level-tree ul li .sek-remove-level:hover{
|
49 |
+
opacity: 1;
|
50 |
+
}
|
51 |
+
#nimble-level-tree ul li .sek-level-infos {
|
52 |
+
line-height: 30px;
|
53 |
+
height: 30px;
|
54 |
+
padding-left: 33px;
|
55 |
+
position: relative;
|
56 |
+
width: calc(100% - 25px);
|
57 |
+
}
|
58 |
+
.sek-level-infos .sek-inner-level-infos {
|
59 |
+
background: inherit;
|
60 |
+
width: inherit;
|
61 |
+
height: inherit;
|
62 |
+
line-height: inherit;
|
63 |
+
padding-left: 4px;
|
64 |
+
display: -webkit-inline-box;
|
65 |
+
display: -ms-inline-flexbox;
|
66 |
+
display: inline-flex;
|
67 |
+
-webkit-box-align: center;
|
68 |
+
-ms-flex-align: center;
|
69 |
+
align-items: center;
|
70 |
+
-webkit-transition: background .20s ease;
|
71 |
+
transition: background .20s ease;
|
72 |
+
-o-transition: background .20s ease;
|
73 |
+
}
|
74 |
+
|
75 |
+
.sek-inner-level-infos:hover {
|
76 |
+
color: #000;
|
77 |
+
background: white;
|
78 |
+
}
|
79 |
+
.sek-close-level-tree {
|
80 |
+
position: fixed;
|
81 |
+
top: 44px;
|
82 |
+
right: 25px;
|
83 |
+
}
|
84 |
+
|
85 |
+
img.sek-svg-mod-icon {
|
86 |
+
max-width: 45px;
|
87 |
+
}
|
88 |
+
|
89 |
+
/* TREE */
|
90 |
+
.sek-level-infos::before {
|
91 |
+
position: absolute;
|
92 |
+
left: -31px;
|
93 |
+
background: #a2aab2;
|
94 |
+
width: 63px;
|
95 |
+
height: 2px;
|
96 |
+
content: "";
|
97 |
+
top: calc(50% - 1px);
|
98 |
+
}
|
99 |
+
#nimble-level-tree ul > li:first-child::before {
|
100 |
+
position: absolute;
|
101 |
+
content: "";
|
102 |
+
background: #a2aab2;
|
103 |
+
top: -15px;
|
104 |
+
height: 16px;
|
105 |
+
bottom: 0;
|
106 |
+
left: -2px;
|
107 |
+
width: 2px;
|
108 |
+
}
|
109 |
+
#nimble-level-tree ul > li:last-child::after {
|
110 |
+
position: absolute;
|
111 |
+
content: "";
|
112 |
+
background: #f0f0f0;
|
113 |
+
top: 16px;
|
114 |
+
bottom: 0;
|
115 |
+
left: -2px;
|
116 |
+
width: 2px;
|
117 |
+
}
|
118 |
+
#nimble-level-tree ul {
|
119 |
+
border-left: 2px solid #a2aab2;
|
120 |
+
position:relative;
|
121 |
+
}
|
122 |
+
#nimble-level-tree ul > li:last-child {
|
123 |
+
position: relative;
|
124 |
+
}
|
assets/czr/sek/js/_dev_control/_0_0_sektions_fmk_overrides.js
ADDED
@@ -0,0 +1,228 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
//global sektionsLocalizedData
|
2 |
+
//global serverControlParams
|
3 |
+
(function ( api, $ ) {
|
4 |
+
api.CZR_Helpers.getInputSubTemplate = function( template_name ) {
|
5 |
+
if ( $('#tmpl-nimble-subtemplate___' + template_name ).length > 0 ) {
|
6 |
+
return wp.template( 'nimble-subtemplate___' + template_name );
|
7 |
+
} else {
|
8 |
+
api.errare( 'problem in api.czr_sektions.getInputSubTemplate(), missing js template in the DOM for template_name : ' + template_name );
|
9 |
+
return null;
|
10 |
+
}
|
11 |
+
};
|
12 |
+
|
13 |
+
var getInputTemplate = function( input_type ) {
|
14 |
+
var template_name = input_type;
|
15 |
+
switch( input_type ) {
|
16 |
+
case 'czr_layouts' ://<= specific to the hueman theme
|
17 |
+
case 'select' ://<= used in the customizr and hueman theme
|
18 |
+
case 'simpleselect' ://<=used in Nimble Builder
|
19 |
+
case 'fa_icon_picker' :
|
20 |
+
case 'font_picker':
|
21 |
+
case 'animation_picker' ://<= oct 2020 added for https://github.com/presscustomizr/nimble-builder-pro/issues/73
|
22 |
+
template_name = 'simpleselect';
|
23 |
+
break;
|
24 |
+
|
25 |
+
case 'simpleselectWithDeviceSwitcher':
|
26 |
+
template_name = 'simpleselect_deviceswitcher';
|
27 |
+
break;
|
28 |
+
|
29 |
+
case 'multiselect':
|
30 |
+
case 'category_picker':
|
31 |
+
template_name = 'multiselect';
|
32 |
+
break;
|
33 |
+
|
34 |
+
case 'h_alignment' :
|
35 |
+
case 'horizAlignmentWithDeviceSwitcher' :
|
36 |
+
template_name = 'h_alignment';
|
37 |
+
break;
|
38 |
+
|
39 |
+
case 'h_text_alignment' :
|
40 |
+
case 'horizTextAlignmentWithDeviceSwitcher' :
|
41 |
+
template_name = 'h_text_alignment';
|
42 |
+
break;
|
43 |
+
|
44 |
+
case 'range_simple' :
|
45 |
+
case 'range_simple_device_switcher' :
|
46 |
+
template_name = 'range_simple';
|
47 |
+
break;
|
48 |
+
|
49 |
+
case 'number_simple' :
|
50 |
+
template_name = 'number_simple';
|
51 |
+
break;
|
52 |
+
|
53 |
+
case 'font_size' :
|
54 |
+
case 'line_height' :
|
55 |
+
case 'range_with_unit_picker' :
|
56 |
+
case 'range_with_unit_picker_device_switcher' :
|
57 |
+
template_name = 'range_with_unit_picker';
|
58 |
+
break;
|
59 |
+
|
60 |
+
case 'spacing' :
|
61 |
+
case 'spacingWithDeviceSwitcher' :
|
62 |
+
template_name = 'spacing';
|
63 |
+
break;
|
64 |
+
|
65 |
+
case 'upload' :
|
66 |
+
case 'upload_url' :
|
67 |
+
template_name = 'upload';
|
68 |
+
break;
|
69 |
+
|
70 |
+
case 'bg_position' :
|
71 |
+
case 'bgPositionWithDeviceSwitcher' :
|
72 |
+
template_name = 'bg_position';
|
73 |
+
break;
|
74 |
+
|
75 |
+
case 'verticalAlignWithDeviceSwitcher' :
|
76 |
+
template_name = 'v_alignment';
|
77 |
+
break;
|
78 |
+
}
|
79 |
+
if ( $('#tmpl-nimble-input___' + template_name ).length > 0 ) {
|
80 |
+
return wp.template( 'nimble-input___' + template_name );
|
81 |
+
} else {
|
82 |
+
api.errare( 'problem in getInputTemplate(), missing js template in the DOM for input_type : ' + input_type );
|
83 |
+
return null;
|
84 |
+
}
|
85 |
+
};
|
86 |
+
|
87 |
+
|
88 |
+
// Overrides FMK method
|
89 |
+
// @param args
|
90 |
+
// control_id: "__nimble__51b2f35191b3__main_settings"
|
91 |
+
// item_model: {id: "czr_heading_child_0", title: "", heading_text: "This is a heading.", heading_tag: "h1", h_alignment_css: {…}, …}
|
92 |
+
// module_id: "__nimble__51b2f35191b3__main_settings_czr_module"
|
93 |
+
// module_type: "czr_heading_child"
|
94 |
+
// tmpl: "item-inputs"
|
95 |
+
var originalMethod = api.CZR_Helpers.getModuleTmpl;
|
96 |
+
api.CZR_Helpers.getModuleTmpl = function( args ) {
|
97 |
+
args = _.extend( {
|
98 |
+
tmpl : '',
|
99 |
+
module_type: '',
|
100 |
+
module_id : '',
|
101 |
+
cache : true,//<= shall we cache the tmpl or not. Should be true in almost all cases.
|
102 |
+
nonce: api.settings.nonce.save//<= do we need to set a specific nonce to fetch the tmpls ?
|
103 |
+
}, args );
|
104 |
+
|
105 |
+
// target only Nimble modules
|
106 |
+
// a nimble module id looks like : "__nimble__00b8efefe207_czr_module"
|
107 |
+
if ( -1 === args.module_id.indexOf('__nimble__') ) {
|
108 |
+
return originalMethod( args );
|
109 |
+
}
|
110 |
+
|
111 |
+
var dfd = $.Deferred();
|
112 |
+
// are we good to go ?
|
113 |
+
if ( _.isEmpty( args.tmpl ) || _.isEmpty( args.module_type ) ) {
|
114 |
+
dfd.reject( 'api.CZR_Helpers.getModuleTmpl => missing tmpl or module_type param' );
|
115 |
+
}
|
116 |
+
|
117 |
+
if ( ! api.czr_sektions.isModuleRegistered( args.module_type ) ) {
|
118 |
+
dfd.reject( 'api.CZR_Helpers.getModuleTmpl => module type not registered' );
|
119 |
+
dfd.resolve();
|
120 |
+
return originalMethod( args );
|
121 |
+
}
|
122 |
+
|
123 |
+
/// TEMP !! ///
|
124 |
+
// dfd.resolve();
|
125 |
+
// return originalMethod( args );
|
126 |
+
if ( _.contains( [
|
127 |
+
// 'sek_content_type_switcher_module',
|
128 |
+
// 'sek_module_picker_module'
|
129 |
+
], args.module_type ) ) {
|
130 |
+
dfd.resolve();
|
131 |
+
return originalMethod( args );
|
132 |
+
}
|
133 |
+
/// TEMP !! ///
|
134 |
+
|
135 |
+
// Get the item input map
|
136 |
+
var item_input_tmpls = api.czr_sektions.getRegisteredModuleProperty( args.module_type, 'tmpl' );
|
137 |
+
var item_input_map = ( _.isObject( item_input_tmpls ) && item_input_tmpls[ args.tmpl ] ) ? item_input_tmpls[ args.tmpl ] : {};
|
138 |
+
if ( _.isEmpty( item_input_map ) || !_.isObject( item_input_map ) ) {
|
139 |
+
api.errare( 'getModuleTmpl => Error empty or invalid input map for module : ', args.module_type );
|
140 |
+
dfd.reject( 'getModuleTmpl => Error empty or invalid input map for module : ', args.module_type );
|
141 |
+
}
|
142 |
+
|
143 |
+
// Get the item value
|
144 |
+
var item_model = args.item_model,
|
145 |
+
default_item_model = $.extend( true, {}, api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( args.module_type ) ),
|
146 |
+
cloned_default = $.extend( true, {},default_item_model );
|
147 |
+
|
148 |
+
|
149 |
+
// normalizes the item_model with defaults
|
150 |
+
item_model = $.extend( cloned_default, item_model );
|
151 |
+
|
152 |
+
if ( _.isEmpty( item_model ) ) {
|
153 |
+
api.errare( 'getModuleTmpl => Error invalid item model for module : ', args.module_type );
|
154 |
+
dfd.reject( 'getModuleTmpl => Error invalid item model for module : ', args.module_type );
|
155 |
+
}
|
156 |
+
|
157 |
+
var input_html = '', input_type;
|
158 |
+
|
159 |
+
// Loop on the item input map and render the input
|
160 |
+
// the rendering uses a nested _ template mechanism
|
161 |
+
// see https://stackoverflow.com/questions/8938841/underscore-js-nested-templates#13649447
|
162 |
+
var renderInputCollection = function( inputCollection ) {
|
163 |
+
var _html = '';
|
164 |
+
_.each( inputCollection, function( input_data, input_id ){
|
165 |
+
input_type = input_data.input_type;
|
166 |
+
// render generic input wrapper
|
167 |
+
try { _html += wp.template( 'nimble-input-wrapper' )( {
|
168 |
+
input_type : input_type,
|
169 |
+
input_data : input_data,
|
170 |
+
input_id : input_id,
|
171 |
+
item_model : item_model,
|
172 |
+
input_tmpl : getInputTemplate( input_type ),
|
173 |
+
control_id : args.control_id //<= needed for some modules like tiny_mce_editor
|
174 |
+
}); } catch( er ) {
|
175 |
+
api.errare( 'getModuleTmpl => Error when parsing the nimble-input-wrapper template', er );
|
176 |
+
dfd.reject( 'getModuleTmpl => Error when parsing the nimble-input-wrapper template');
|
177 |
+
return false;
|
178 |
+
}
|
179 |
+
});
|
180 |
+
return _html;
|
181 |
+
};//renderInputCollection
|
182 |
+
|
183 |
+
|
184 |
+
// GENERATE MODULE HTML : two cases, with or without tabs
|
185 |
+
if ( item_input_map.tabs ) {
|
186 |
+
var _tabNavHtml = '', _tabContentHtml ='';
|
187 |
+
|
188 |
+
_.each( item_input_map.tabs, function( rawTabData, tabKey ) {
|
189 |
+
// normalizes
|
190 |
+
var tabData = $.extend( true, {}, rawTabData );
|
191 |
+
tabData = $.extend( { inputs : {}, title : '' }, tabData );
|
192 |
+
// generate tab nav html
|
193 |
+
var _attributes = !_.isEmpty( tabData.attributes ) ? tabData.attributes : '';
|
194 |
+
_tabNavHtml += '<li data-tab-id="section-topline-' + ( +tabKey+1 ) +'" '+ _attributes +'><a href="#" title="' + tabData.title + '"><span>' + tabData.title +'</span></a></li>';
|
195 |
+
// generate tab content html
|
196 |
+
var _inputCollectionHtml = renderInputCollection( tabData.inputs );
|
197 |
+
_tabContentHtml += '<section id="section-topline-' + ( +tabKey+1 ) +'">' + _inputCollectionHtml +'</section>';
|
198 |
+
});
|
199 |
+
|
200 |
+
|
201 |
+
// put it all together
|
202 |
+
input_html += [
|
203 |
+
'<div class="tabs tabs-style-topline">',
|
204 |
+
'<nav>',
|
205 |
+
'<ul>',
|
206 |
+
_tabNavHtml,
|
207 |
+
'</ul>',
|
208 |
+
'</nav>',
|
209 |
+
'<div class="content-wrap">',
|
210 |
+
_tabContentHtml,
|
211 |
+
'</div>',
|
212 |
+
'</div>',
|
213 |
+
].join('');
|
214 |
+
|
215 |
+
} else {
|
216 |
+
input_html = renderInputCollection(item_input_map);
|
217 |
+
}
|
218 |
+
|
219 |
+
|
220 |
+
|
221 |
+
// 1) Get the input map from the module registration params
|
222 |
+
// 2) Normalizes input data with defaults
|
223 |
+
// 3) loop on the input map
|
224 |
+
// 4) print the default input tmpl wrapper
|
225 |
+
|
226 |
+
return dfd.resolve( input_html ).promise();
|
227 |
+
};
|
228 |
+
})( wp.customize, jQuery );
|
assets/czr/sek/js/_dev_control/_1_0_sektions_initialize.js
ADDED
@@ -0,0 +1,721 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
//global sektionsLocalizedData
|
2 |
+
var CZRSeksPrototype = CZRSeksPrototype || {};
|
3 |
+
(function ( api, $ ) {
|
4 |
+
$.extend( CZRSeksPrototype, {
|
5 |
+
cachedElements : {
|
6 |
+
$body : $('body'),
|
7 |
+
$window : $(window)
|
8 |
+
},
|
9 |
+
|
10 |
+
initialize: function() {
|
11 |
+
var self = this;
|
12 |
+
if ( _.isUndefined( window.sektionsLocalizedData ) ) {
|
13 |
+
throw new Error( 'CZRSeksPrototype => missing localized server params sektionsLocalizedData' );
|
14 |
+
}
|
15 |
+
// this class is skope dependant
|
16 |
+
if ( ! _.isFunction( api.czr_activeSkopes ) ) {
|
17 |
+
throw new Error( 'CZRSeksPrototype => api.czr_activeSkopes' );
|
18 |
+
}
|
19 |
+
// SECTIONS ID FOR LOCAL AND GLOBAL OPTIONS
|
20 |
+
self.SECTION_ID_FOR_GLOBAL_OPTIONS = '__globalOptionsSectionId';
|
21 |
+
self.SECTION_ID_FOR_LOCAL_OPTIONS = '__localOptionsSection';
|
22 |
+
|
23 |
+
// SECTION ID FOR THE CONTENT PICKER
|
24 |
+
self.SECTION_ID_FOR_CONTENT_PICKER = '__content_picker__';
|
25 |
+
|
26 |
+
// Max possible number of columns in a section
|
27 |
+
self.MAX_NUMBER_OF_COLUMNS = 12;
|
28 |
+
|
29 |
+
// _.debounce param when updating the UI setting
|
30 |
+
// prevent hammering server + fixes https://github.com/presscustomizr/nimble-builder/issues/244
|
31 |
+
self.SETTING_UPDATE_BUFFER = 100;
|
32 |
+
|
33 |
+
// introduced for https://github.com/presscustomizr/nimble-builder/issues/403
|
34 |
+
self.TINYMCE_EDITOR_HEIGHT = 100;
|
35 |
+
|
36 |
+
// Define a default value for the sektion setting value, used when no server value has been sent
|
37 |
+
// @see php function
|
38 |
+
// function sek_get_default_location_model() {
|
39 |
+
// $defaut_sektions_value = [ 'collection' => [], 'options' => [] ];
|
40 |
+
// foreach( sek_get_locations() as $location ) {
|
41 |
+
// $defaut_sektions_value['collection'][] = [
|
42 |
+
// 'id' => $location,
|
43 |
+
// 'level' => 'location',
|
44 |
+
// 'collection' => [],
|
45 |
+
// 'options' => []
|
46 |
+
// ];
|
47 |
+
// }
|
48 |
+
// return $defaut_sektions_value;
|
49 |
+
// }
|
50 |
+
self.defaultLocalSektionSettingValue = self.getDefaultSektionSettingValue( 'local' );
|
51 |
+
|
52 |
+
// Store the contextual setting prefix
|
53 |
+
self.localSectionsSettingId = new api.Value( {} );
|
54 |
+
|
55 |
+
// Keep track of the registered ui elements dynamically registered
|
56 |
+
// this collection is populated in ::register(), if the track param is true
|
57 |
+
// this is used to know what ui elements are currently being displayed
|
58 |
+
self.registered = new api.Value([]);
|
59 |
+
|
60 |
+
// June 2020 : added for https://github.com/presscustomizr/nimble-builder/issues/708
|
61 |
+
if ( wp.customize.apiIsReady ) {
|
62 |
+
self.doSektionThinksOnApiReady();
|
63 |
+
} else {
|
64 |
+
api.bind( 'ready', function() {
|
65 |
+
self.doSektionThinksOnApiReady();
|
66 |
+
});
|
67 |
+
}
|
68 |
+
|
69 |
+
|
70 |
+
// Add the skope id on save
|
71 |
+
// Uses a WP core hook to filter the query on a customize_save action
|
72 |
+
//
|
73 |
+
// This posted skope id is useful when we need to know the skope id during ajax.
|
74 |
+
// ( Note that with the nimble ajax action, the skope_id is always posted. Not in WP core ajax actions. )
|
75 |
+
// Example of use of $_POST['local_skope_id'] => @see sek_get_parent_level_model()
|
76 |
+
// Helps fixing : https://github.com/presscustomizr/nimble-builder/issues/242, for which sek_add_css_rules_for_spacing() couldn't be set for columns margins
|
77 |
+
api.bind( 'save-request-params', function( query ) {
|
78 |
+
$.extend( query, {
|
79 |
+
local_skope_id : api.czr_skopeBase.getSkopeProperty( 'skope_id' ),
|
80 |
+
group_skope_id : api.czr_skopeBase.getSkopeProperty( 'skope_id', 'group' ),//<= feb 2021, added for #478
|
81 |
+
active_locations : api.czr_sektions.activeLocations(),
|
82 |
+
inherit_group_template : true
|
83 |
+
});
|
84 |
+
});
|
85 |
+
|
86 |
+
|
87 |
+
// TINY MCE EDITOR
|
88 |
+
var clearActiveWPEditorsInstances = function() {
|
89 |
+
if ( _.isArray( api.czrActiveWPEditors ) ) {
|
90 |
+
_.each( api.czrActiveWPEditors, function( _id ) {
|
91 |
+
wp.oldEditor.remove( _id );
|
92 |
+
});
|
93 |
+
api.czrActiveWPEditors = [];
|
94 |
+
}
|
95 |
+
};
|
96 |
+
// added for https://github.com/presscustomizr/nimble-builder/issues/403
|
97 |
+
// in fmk::setupTinyMceEditor => each id of newly instantiated editor is added to the [] api.czrActiveWPEditors
|
98 |
+
// We need to remove those instances when cleaning registered controls
|
99 |
+
api.bind( 'sek-before-clean-registered', clearActiveWPEditorsInstances );
|
100 |
+
|
101 |
+
// When using the text editor in the items of in a multi-item module
|
102 |
+
// We need to clear the editor instances each time all items are closed, before opening a new one
|
103 |
+
// 'czr-all-items-closed' is fired in CZRModuleMths.closeAllItems()
|
104 |
+
api.bind('czr-all-items-closed', clearActiveWPEditorsInstances );
|
105 |
+
},// initialize()
|
106 |
+
|
107 |
+
|
108 |
+
// @ API READY
|
109 |
+
// Fired at api.bind( 'ready', function() {})
|
110 |
+
doSektionThinksOnApiReady : function() {
|
111 |
+
var self = this;
|
112 |
+
// the main sektion panel
|
113 |
+
// the local and global options section
|
114 |
+
self.registerAndSetupDefaultPanelSectionOptions();
|
115 |
+
|
116 |
+
// Setup the collection settings => register the main settings for local and global skope and bind it
|
117 |
+
// schedule reaction to collection setting ids => the setup of the collection setting when the collection setting ids are set
|
118 |
+
//=> on skope change
|
119 |
+
//@see setContextualCollectionSettingIdWhenSkopeSet
|
120 |
+
//
|
121 |
+
// var _settingsToRegister_ = {
|
122 |
+
// 'local' : { collectionSettingId : self.localSectionsSettingId() },//<= "nimble___[skp__post_page_10]"
|
123 |
+
// 'global' : { collectionSettingId : self.getGlobalSectionsSettingId() }//<= "nimble___[skp__global]"
|
124 |
+
// };
|
125 |
+
self.localSectionsSettingId.callbacks.add( function( collectionSettingIds, previousCollectionSettingIds ) {
|
126 |
+
// register the collection setting id
|
127 |
+
// and schedule the reaction to different collection changes : refreshModules, ...
|
128 |
+
try { self.setupSettingsToBeSaved(); } catch( er ) {
|
129 |
+
api.errare( 'Error in self.localSectionsSettingId.callbacks => self.setupSettingsToBeSaved()' , er );
|
130 |
+
}
|
131 |
+
|
132 |
+
// Now that the local and global settings are registered, initialize the history log
|
133 |
+
self.initializeHistoryLogWhenSettingsRegistered();
|
134 |
+
|
135 |
+
// On init and when skope changes, request the contextually active locations
|
136 |
+
// We should not need this call, because the preview sends it on initialize
|
137 |
+
// But this is safer.
|
138 |
+
// The preview send back the list of active locations 'sek-active-locations-in-preview'
|
139 |
+
// introduced for the level tree, https://github.com/presscustomizr/nimble-builder/issues/359
|
140 |
+
api.previewer.send('sek-request-active-locations');
|
141 |
+
});
|
142 |
+
|
143 |
+
|
144 |
+
// POPULATE THE MAIN SETTING ID NOW
|
145 |
+
// + GENERATE UI FOR THE LOCAL SKOPE OPTIONS
|
146 |
+
// + GENERATE UI FOR THE GLOBAL OPTIONS
|
147 |
+
// + GENERATE UI FOR SITE TEMPLATES
|
148 |
+
var doSkopeDependantActions = function( newSkopes, previousSkopes ) {
|
149 |
+
self.setContextualCollectionSettingIdWhenSkopeSet( newSkopes, previousSkopes );
|
150 |
+
|
151 |
+
// Generate UI for the local skope options
|
152 |
+
api.section( self.SECTION_ID_FOR_LOCAL_OPTIONS, function( _section_ ) {
|
153 |
+
_section_.deferred.embedded.done( function() {
|
154 |
+
if( true === _section_.boundForLocalOptionGeneration )
|
155 |
+
return;
|
156 |
+
// Defer the UI generation when the section is expanded
|
157 |
+
_section_.boundForLocalOptionGeneration = true;
|
158 |
+
_section_.expanded.bind( function( expanded ) {
|
159 |
+
if ( true === expanded ) {
|
160 |
+
self.generateUI({ action : 'sek-generate-local-skope-options-ui'});
|
161 |
+
}
|
162 |
+
});
|
163 |
+
});
|
164 |
+
});
|
165 |
+
|
166 |
+
|
167 |
+
// The UI of the global option must be generated only once.
|
168 |
+
// We don't want to re-generate on each skope change
|
169 |
+
// fixes https://github.com/presscustomizr/nimble-builder/issues/271
|
170 |
+
api.section( self.SECTION_ID_FOR_GLOBAL_OPTIONS, function( _section_ ) {
|
171 |
+
if ( true === _section_.nimbleGlobalOptionGenerated )
|
172 |
+
return;
|
173 |
+
self.generateUI({ action : 'sek-generate-global-options-ui'});
|
174 |
+
_section_.nimbleGlobalOptionGenerated = true;
|
175 |
+
// Make sure template gallery is closed when opening/closing global options panel
|
176 |
+
// see https://github.com/presscustomizr/nimble-builder/issues/840
|
177 |
+
_section_.expanded.bind( function() {
|
178 |
+
if ( !self.templateGalleryExpanded )
|
179 |
+
return;
|
180 |
+
self.templateGalleryExpanded(false);
|
181 |
+
});
|
182 |
+
});
|
183 |
+
|
184 |
+
////////////////////////////////////////////////////////////////////////////////
|
185 |
+
///////////////////////////////////////////////////////////////////////////////////
|
186 |
+
///////////////////////////////////////////////////////////////////////////////////
|
187 |
+
///////////////////////////////////////////////////////////////////////////////////
|
188 |
+
///////////////////////////////////////////////////////////////////////////////////
|
189 |
+
///////////////////////////////////////////////////////////////////////////////////
|
190 |
+
///////////////////////////////////////////////////////////////////////////////////
|
191 |
+
///////////////////////////////////////////////////////////////////////////////////
|
192 |
+
///////////////////////////////////////////////////////////////////////////////////
|
193 |
+
///////////////////////////////////////////////////////////////////////////////////
|
194 |
+
///////////////////////////////////////////////////////////////////////////////////
|
195 |
+
///////////////////////////////////////////////////////////////////////////////////
|
196 |
+
///////////////////////////////////////////////////////////////////////////////////
|
197 |
+
// June 2020 property introduced for https://github.com/presscustomizr/nimble-builder-pro/issues/12
|
198 |
+
self.nb_is_ready = true;
|
199 |
+
|
200 |
+
// This event has been introduced when implementing https://github.com/presscustomizr/nimble-builder/issues/304
|
201 |
+
api.trigger('nimble-ready-for-current-skope');
|
202 |
+
////////////////////////////////////////////////////////////////////////////////
|
203 |
+
///////////////////////////////////////////////////////////////////////////////////
|
204 |
+
///////////////////////////////////////////////////////////////////////////////////
|
205 |
+
///////////////////////////////////////////////////////////////////////////////////
|
206 |
+
///////////////////////////////////////////////////////////////////////////////////
|
207 |
+
///////////////////////////////////////////////////////////////////////////////////
|
208 |
+
///////////////////////////////////////////////////////////////////////////////////
|
209 |
+
///////////////////////////////////////////////////////////////////////////////////
|
210 |
+
///////////////////////////////////////////////////////////////////////////////////
|
211 |
+
///////////////////////////////////////////////////////////////////////////////////
|
212 |
+
///////////////////////////////////////////////////////////////////////////////////
|
213 |
+
///////////////////////////////////////////////////////////////////////////////////
|
214 |
+
///////////////////////////////////////////////////////////////////////////////////
|
215 |
+
};//doSkopeDependantActions()
|
216 |
+
|
217 |
+
// populate the setting ids now if skopes are set
|
218 |
+
if ( !_.isEmpty( api.czr_activeSkopes().local ) ) {
|
219 |
+
doSkopeDependantActions();
|
220 |
+
}
|
221 |
+
// ON SKOPE READY
|
222 |
+
// - Set the contextual setting prefix
|
223 |
+
// - Generate UI for Nimble local skope options
|
224 |
+
// - Generate the content picker
|
225 |
+
api.czr_activeSkopes.callbacks.add( function( newSkopes, previousSkopes ) {
|
226 |
+
doSkopeDependantActions( newSkopes, previousSkopes );
|
227 |
+
});
|
228 |
+
|
229 |
+
|
230 |
+
// Communicate with the preview
|
231 |
+
self.reactToPreviewMsg();
|
232 |
+
|
233 |
+
// Setup Dnd
|
234 |
+
self.setupDnd();
|
235 |
+
|
236 |
+
|
237 |
+
// setup the tinyMce editor used for the tiny_mce_editor input
|
238 |
+
// => one object listened to by each tiny_mce_editor input
|
239 |
+
self.setupTinyMceEditor();
|
240 |
+
|
241 |
+
// print json
|
242 |
+
self.schedulePrintSectionJson();
|
243 |
+
|
244 |
+
// Always set the previewed device back to desktop on ui change
|
245 |
+
// event 'sek-ui-removed' id triggered when cleaning the registered ui controls
|
246 |
+
// @see ::cleanRegisteredAndLargeSelectInput()
|
247 |
+
// July 2020 commented to fix https://github.com/presscustomizr/nimble-builder/issues/728
|
248 |
+
// self.bind( 'sek-ui-removed', function() {
|
249 |
+
// api.previewedDevice( 'desktop' );
|
250 |
+
// });
|
251 |
+
|
252 |
+
// Synchronize api.previewedDevice with the currently rendered ui
|
253 |
+
// ensure that the selected device tab of the spacing module is the one being previewed
|
254 |
+
// =>@see spacing module, in item constructor CZRSpacingItemMths
|
255 |
+
api.previewedDevice.bind( function( device ) {
|
256 |
+
var currentControls = _.filter( self.registered(), function( uiData ) {
|
257 |
+
return 'control' == uiData.what;
|
258 |
+
});
|
259 |
+
_.each( currentControls || [] , function( ctrlData ) {
|
260 |
+
api.control( ctrlData.id, function( _ctrl_ ) {
|
261 |
+
_ctrl_.container.find('[data-sek-device="' + device + '"]').each( function() {
|
262 |
+
$(this).trigger('click');
|
263 |
+
});
|
264 |
+
});
|
265 |
+
});
|
266 |
+
|
267 |
+
// Send the previewed device to the preview
|
268 |
+
//api.previewer.send( 'sek-preview-device-changed', { device : device });
|
269 |
+
});
|
270 |
+
|
271 |
+
// Schedule a reset
|
272 |
+
$('#customize-notifications-area').on( 'click', '[data-sek-reset="true"]', function() {
|
273 |
+
api.previewer.trigger('sek-reset-collection', { scope : 'local' } );
|
274 |
+
});
|
275 |
+
|
276 |
+
|
277 |
+
// CLEAN UI BEFORE REMOVAL
|
278 |
+
// 'sek-ui-pre-removal' is triggered in ::cleanRegisteredAndLargeSelectInput
|
279 |
+
// @params { what : control, id : '' }
|
280 |
+
self.bind( 'sek-ui-pre-removal', function( params ) {
|
281 |
+
// CLEAN DRAG N DROP
|
282 |
+
if ( 'control' == params.what && -1 < params.id.indexOf( 'draggable') ) {
|
283 |
+
api.control( params.id, function( _ctrl_ ) {
|
284 |
+
_ctrl_.container.find( '[draggable]' ).each( function() {
|
285 |
+
$(this).off( 'dragstart dragend' );
|
286 |
+
});
|
287 |
+
});
|
288 |
+
}
|
289 |
+
|
290 |
+
// CLEAN SELECT2
|
291 |
+
// => we need to destroy the czrSelect2 instance, otherwise it can stay open when switching to another ui.
|
292 |
+
if ( 'control' == params.what ) {
|
293 |
+
api.control( params.id, function( _ctrl_ ) {
|
294 |
+
_ctrl_.container.find( 'select' ).each( function() {
|
295 |
+
if ( ! _.isUndefined( $(this).data('czrSelect2') ) ) {
|
296 |
+
$(this).czrSelect2('destroy');
|
297 |
+
}
|
298 |
+
});
|
299 |
+
});
|
300 |
+
}
|
301 |
+
});
|
302 |
+
|
303 |
+
|
304 |
+
// POPULATE THE REGISTERED COLLECTION
|
305 |
+
// 'czr-new-registered' is fired in api.CZR_Helpers.register()
|
306 |
+
api.bind( 'czr-new-registered', function( params ) {
|
307 |
+
//console.log( 'czr-new-registered => ', params );
|
308 |
+
// Check that we have an origin property and that make sure we populate only the registration emitted by 'nimble'
|
309 |
+
if ( _.isUndefined( params.origin ) ) {
|
310 |
+
throw new Error( 'czr-new-registered event => missing params.origin' );
|
311 |
+
}
|
312 |
+
if ( 'nimble' !== params.origin )
|
313 |
+
return;
|
314 |
+
|
315 |
+
// when no collection is provided, we use
|
316 |
+
if ( false !== params.track ) {
|
317 |
+
var currentlyRegistered = self.registered();
|
318 |
+
var newRegistered = $.extend( true, [], currentlyRegistered );
|
319 |
+
//Check for duplicates
|
320 |
+
var duplicateCandidate = _.findWhere( newRegistered, { id : params.id } );
|
321 |
+
if ( ! _.isEmpty( duplicateCandidate ) && _.isEqual( duplicateCandidate, params ) ) {
|
322 |
+
throw new Error( 'register => duplicated element in self.registered() collection ' + params.id );
|
323 |
+
}
|
324 |
+
newRegistered.push( params );
|
325 |
+
self.registered( newRegistered );
|
326 |
+
|
327 |
+
// say it
|
328 |
+
//this.trigger( [params.what, params.id , 'registered' ].join('__'), params );
|
329 |
+
}
|
330 |
+
});
|
331 |
+
|
332 |
+
|
333 |
+
// store active locations
|
334 |
+
self.activeLocations = new api.Value([]);// <= introduced for the level tree, https://github.com/presscustomizr/nimble-builder/issues/359
|
335 |
+
self.activeLocationsInfo = new api.Value([]);// <= introduced for better move up/down of sections https://github.com/presscustomizr/nimble-builder/issues/521
|
336 |
+
api.previewer.bind('sek-active-locations-in-preview', function( activelocs ){
|
337 |
+
self.activeLocations( ( _.isObject(activelocs) && _.isArray( activelocs.active_locations ) ) ? activelocs.active_locations : [] );
|
338 |
+
self.activeLocationsInfo( ( _.isObject(activelocs) && _.isArray( activelocs.active_locs_info ) ) ? activelocs.active_locs_info : [] );
|
339 |
+
// December 2020 => refresh local setting when an active location is available locally but not present in the local setting
|
340 |
+
// Fixes the problem of importing template from the gallery, with locations different than the current local page
|
341 |
+
// update : December 24th => deactivated because of https://github.com/presscustomizr/nimble-builder/issues/770
|
342 |
+
// if ( !_.isEmpty( api.dirtyValues() ) ) {
|
343 |
+
// try{ self.updateAPISetting({ action : 'sek-maybe-add-missing-locations'}); } catch(er) {
|
344 |
+
// api.errare( '::initialize => error with sek-maybe-add-missing-locations', er );
|
345 |
+
// }
|
346 |
+
// }
|
347 |
+
});
|
348 |
+
|
349 |
+
|
350 |
+
// TOP BAR
|
351 |
+
// Setup the topbar including do/undo action buttons
|
352 |
+
self.setupTopBar();//@see specific dev file
|
353 |
+
|
354 |
+
// SAVE SECTION UI
|
355 |
+
// June 2020 : for https://github.com/presscustomizr/nimble-builder/issues/520 and https://github.com/presscustomizr/nimble-builder/issues/713
|
356 |
+
self.setupSaveSectionUI();
|
357 |
+
|
358 |
+
// SAVE TEMPLATE UI
|
359 |
+
// April 2020 : introduced for https://github.com/presscustomizr/nimble-builder/issues/655
|
360 |
+
self.setupSaveTmplUI();
|
361 |
+
|
362 |
+
// SETUP DOUBLE CLICK INSERTION THINGS
|
363 |
+
// Stores the preview target for double click insertion
|
364 |
+
// implemented for https://github.com/presscustomizr/nimble-builder/issues/317
|
365 |
+
self.lastClickedTargetInPreview = new api.Value();
|
366 |
+
self.lastClickedTargetInPreview.bind( function( to, from ) {
|
367 |
+
// to and from are formed this way : { id : "__nimble__fb2ab3e47472" }
|
368 |
+
// @see 'sek-pick-content' event in ::reactToPreviewMsg()
|
369 |
+
|
370 |
+
// Send the level id of the current double-click insertion target
|
371 |
+
// => this will be used to style the level id container with a pulse animation
|
372 |
+
if ( _.isObject( to ) && to.id ) {
|
373 |
+
api.previewer.send( 'sek-set-double-click-target', to );
|
374 |
+
} else {
|
375 |
+
// Tell the preview to clean the target highlight effect
|
376 |
+
api.previewer.send( 'sek-reset-double-click-target' );
|
377 |
+
}
|
378 |
+
|
379 |
+
// reset after a delay
|
380 |
+
clearTimeout( self.cachedElements.$window.data('_preview_target_timer_') );
|
381 |
+
self.cachedElements.$window.data('_preview_target_timer_', setTimeout(function() {
|
382 |
+
// Reset the click target
|
383 |
+
self.lastClickedTargetInPreview( {} );
|
384 |
+
// Tell the preview to clean the target highlight effect
|
385 |
+
api.previewer.send( 'sek-reset-double-click-target' );
|
386 |
+
}, 20000 ) );
|
387 |
+
});
|
388 |
+
|
389 |
+
// React to the preview to clean any currently highlighted drop zone
|
390 |
+
// This event is triggered on all click in the preview iframe
|
391 |
+
// @see preview::scheduleUiClickReactions()
|
392 |
+
api.previewer.bind( 'sek-clean-target-drop-zone', function() {
|
393 |
+
// Reset the click target
|
394 |
+
self.lastClickedTargetInPreview({});
|
395 |
+
});
|
396 |
+
|
397 |
+
// Clean the current target when hitting escape
|
398 |
+
$(document).keydown(function( evt ) {
|
399 |
+
// ESCAPE key pressed
|
400 |
+
if ( evt && 27 === evt.keyCode ) {
|
401 |
+
self.lastClickedTargetInPreview({});
|
402 |
+
}
|
403 |
+
});
|
404 |
+
|
405 |
+
// PRINT A WARNING NOTICE FOR USERS OF CACHE PLUGIN
|
406 |
+
if ( sektionsLocalizedData.hasActiveCachePlugin ) {
|
407 |
+
_.delay( function() {
|
408 |
+
api.previewer.trigger('sek-notify', {
|
409 |
+
notif_id : 'has-active-cache-plugin',
|
410 |
+
type : 'info',
|
411 |
+
duration : 20000,
|
412 |
+
message : [
|
413 |
+
'<span style="color:#0075a2">',
|
414 |
+
sektionsLocalizedData.i18n['You seem to be using a cache plugin.'],
|
415 |
+
( ! _.isString( sektionsLocalizedData.hasActiveCachePlugin ) || sektionsLocalizedData.hasActiveCachePlugin.length < 2 ) ? '' : '<strong> (' + sektionsLocalizedData.hasActiveCachePlugin + ')</strong><br/>',
|
416 |
+
' <strong>',
|
417 |
+
sektionsLocalizedData.i18n['It is recommended to disable your cache plugin when customizing your website.'],
|
418 |
+
'</strong>',
|
419 |
+
'</span>'
|
420 |
+
].join('')
|
421 |
+
});
|
422 |
+
}, 2000 );//delay()
|
423 |
+
}
|
424 |
+
|
425 |
+
// SCHEDULE AN AUTOFOCUS ON THE ITEM THAT HAS BEEN MODIFIED IN THE PREVIEW
|
426 |
+
// the 'multi-items-module-refreshed' event is sent on each preview update due to a Nimble change
|
427 |
+
// @see sendSuccessDataToPanel() in SekPreviewPrototype::schedulePanelMsgReactions
|
428 |
+
api.previewer.bind('multi-items-module-refreshed', function( params ) {
|
429 |
+
if ( _.isUndefined( params.apiParams.control_id ) )
|
430 |
+
return;
|
431 |
+
// the module_id param is added on control registration
|
432 |
+
// @see CZRSeksPrototype::generateUIforFrontModules
|
433 |
+
// we use it to identify that
|
434 |
+
api.control( params.apiParams.control_id, function( _control_ ) {
|
435 |
+
if ( _.isUndefined( _control_.params.sek_registration_params ) )
|
436 |
+
return;
|
437 |
+
if ( api.control( _control_.id ).params.sek_registration_params.module_id !== params.apiParams.id )
|
438 |
+
return;
|
439 |
+
_control_.czr_Module.each( function( _module_ ) {
|
440 |
+
_module_.czr_Item.each( function( _item_ ) {
|
441 |
+
if( 'expanded' === _item_.viewState() ) {
|
442 |
+
_item_.trigger('sek-request-item-focus-in-preview');
|
443 |
+
}
|
444 |
+
});
|
445 |
+
});
|
446 |
+
});
|
447 |
+
});//api.previewer.bind()
|
448 |
+
|
449 |
+
// April 2020. For https://github.com/presscustomizr/nimble-builder/issues/651
|
450 |
+
self.setupTemplateGallery();
|
451 |
+
|
452 |
+
// March 2021. For #478. 'czr-new-skopes-synced' is sent by preview on each refresh
|
453 |
+
api.previewer.bind( 'czr-new-skopes-synced', function( skope_server_data ) {
|
454 |
+
//console.log('SKOPED SYNCED');
|
455 |
+
var localSektionsData = api.czr_skopeBase.getSkopeProperty( 'sektions', 'local');
|
456 |
+
if ( sektionsLocalizedData.isDevMode ) {
|
457 |
+
api.infoLog( '::czr-new-skopes-synced => SEKTIONS DATA ? ', localSektionsData );
|
458 |
+
}
|
459 |
+
if ( _.isEmpty( localSektionsData ) ) {
|
460 |
+
api.errare('::czr-new-skopes-synced => no sektionsData');
|
461 |
+
}
|
462 |
+
if ( _.isEmpty( localSektionsData.setting_id ) ) {
|
463 |
+
api.errare('::czr-new-skopes-synced => missing setting_id');
|
464 |
+
}
|
465 |
+
|
466 |
+
});
|
467 |
+
},//doSektionThinksOnApiReady
|
468 |
+
|
469 |
+
|
470 |
+
|
471 |
+
|
472 |
+
|
473 |
+
|
474 |
+
|
475 |
+
// Fired at api "ready"
|
476 |
+
registerAndSetupDefaultPanelSectionOptions : function() {
|
477 |
+
var self = this;
|
478 |
+
|
479 |
+
// MAIN SEKTION PANEL
|
480 |
+
var SektionPanelConstructor = api.Panel.extend({
|
481 |
+
//attachEvents : function () {},
|
482 |
+
// Always make the panel active, event if we have no sections / control in it
|
483 |
+
isContextuallyActive : function () {
|
484 |
+
return this.active();
|
485 |
+
},
|
486 |
+
_toggleActive : function(){ return true; }
|
487 |
+
});
|
488 |
+
|
489 |
+
// Prepend the Nimble logo in the main panel title
|
490 |
+
// the panel.expanded() Value is not the right candidate to be observed because it gets changed on too many events, when generating the various UI.
|
491 |
+
api.panel( sektionsLocalizedData.sektionsPanelId, function( _mainPanel_ ) {
|
492 |
+
_mainPanel_.deferred.embedded.done( function() {
|
493 |
+
var $sidePanelTitleEl = _mainPanel_.container.first().find('h3.accordion-section-title'),
|
494 |
+
$topPanelTitleEl = _mainPanel_.container.first().find('.panel-meta .accordion-section-title'),
|
495 |
+
logoHtml = [
|
496 |
+
'<img class="sek-nimble-logo" alt="'+ _mainPanel_.params.title +'" src="',
|
497 |
+
sektionsLocalizedData.baseUrl,
|
498 |
+
'/assets/img/nimble/nimble_horizontal.svg?ver=' + sektionsLocalizedData.nimbleVersion,
|
499 |
+
'"/>',
|
500 |
+
].join('');
|
501 |
+
// Add Pro
|
502 |
+
if ( sektionsLocalizedData.isPro ) {
|
503 |
+
logoHtml += [
|
504 |
+
'<img class="sek-nimble-logo sek-pro-pastil" src="',
|
505 |
+
sektionsLocalizedData.baseUrl,
|
506 |
+
'/assets/czr/sek/img/pro_white.svg?ver=' + sektionsLocalizedData.nimbleVersion,
|
507 |
+
'"/>',
|
508 |
+
].join('');
|
509 |
+
}
|
510 |
+
|
511 |
+
if ( 0 < $sidePanelTitleEl.length ) {
|
512 |
+
// The default title looks like this : Nimble Builder <span class="screen-reader-text">Press return or enter to open this section</span>
|
513 |
+
// we want to style "Nimble Builder" only.
|
514 |
+
var $sidePanelTitleElSpan = $sidePanelTitleEl.find('span');
|
515 |
+
$sidePanelTitleEl
|
516 |
+
.addClass('sek-side-nimble-logo-wrapper')
|
517 |
+
.html( logoHtml )
|
518 |
+
.append( $sidePanelTitleElSpan );
|
519 |
+
}
|
520 |
+
|
521 |
+
// default looks like
|
522 |
+
// <span class="preview-notice">You are customizing <strong class="panel-title">Nimble Builder</strong></span>
|
523 |
+
// if ( 0 < $topPanelTitleEl.length ) {
|
524 |
+
// var $topPanelTitleElInner = $topPanelTitleEl.find('.panel-title');
|
525 |
+
// $topPanelTitleElInner.html( logoHtml );
|
526 |
+
// }
|
527 |
+
|
528 |
+
// NOV FEEDBACK UI DISABLED in favor of an admin notice
|
529 |
+
// if ( sektionsLocalizedData.eligibleForFeedbackNotification ) {
|
530 |
+
// _mainPanel_.expanded.bind( function( expanded ) {
|
531 |
+
// if ( expanded && _.isUndefined( self.feedbackUIVisible ) ) {
|
532 |
+
// // FEEDBACK UI
|
533 |
+
// self.setupFeedBackUI();
|
534 |
+
|
535 |
+
// // march 2020 : print confettis
|
536 |
+
// // confettis script is enqueued in the preview
|
537 |
+
// setTimeout( function() {
|
538 |
+
// api.previewer.send('sek-print-confettis', { duration : Date.now() + (1 * 2000) } );
|
539 |
+
// }, 1000 );
|
540 |
+
// }
|
541 |
+
// });
|
542 |
+
// }//if ( sektionsLocalizedData.eligibleForFeedbackNotification )
|
543 |
+
});
|
544 |
+
});
|
545 |
+
|
546 |
+
// The parent panel for all ui sections + global options section
|
547 |
+
api.CZR_Helpers.register({
|
548 |
+
origin : 'nimble',
|
549 |
+
what : 'panel',
|
550 |
+
id : sektionsLocalizedData.sektionsPanelId,//'__sektions__'
|
551 |
+
title: sektionsLocalizedData.i18n['Nimble Builder'],
|
552 |
+
priority : -1000,
|
553 |
+
constructWith : SektionPanelConstructor,
|
554 |
+
track : false,//don't register in the self.registered() => this will prevent this container to be removed when cleaning the registered
|
555 |
+
});
|
556 |
+
|
557 |
+
|
558 |
+
//GLOBAL OPTIONS SECTION
|
559 |
+
api.CZR_Helpers.register({
|
560 |
+
origin : 'nimble',
|
561 |
+
what : 'section',
|
562 |
+
id : self.SECTION_ID_FOR_GLOBAL_OPTIONS,
|
563 |
+
title: sektionsLocalizedData.i18n['Site wide options'],
|
564 |
+
panel : sektionsLocalizedData.sektionsPanelId,
|
565 |
+
priority : 20,
|
566 |
+
track : false,//don't register in the self.registered() => this will prevent this container to be removed when cleaning the registered
|
567 |
+
constructWith : api.Section.extend({
|
568 |
+
//attachEvents : function () {},
|
569 |
+
// Always make the section active, event if we have no control in it
|
570 |
+
isContextuallyActive : function () {
|
571 |
+
return this.active();
|
572 |
+
},
|
573 |
+
_toggleActive : function(){ return true; }
|
574 |
+
})
|
575 |
+
}).done( function() {
|
576 |
+
api.section( self.SECTION_ID_FOR_GLOBAL_OPTIONS, function( _section_ ) {
|
577 |
+
// Style the section title
|
578 |
+
var $sectionTitleEl = _section_.container.find('.accordion-section-title'),
|
579 |
+
$panelTitleEl = _section_.container.find('.customize-section-title h3');
|
580 |
+
|
581 |
+
// The default title looks like this : Title <span class="screen-reader-text">Press return or enter to open this section</span>
|
582 |
+
if ( 0 < $sectionTitleEl.length ) {
|
583 |
+
$sectionTitleEl.prepend( '<i class="fas fa-globe sek-level-option-icon"></i>' );
|
584 |
+
}
|
585 |
+
|
586 |
+
// The default title looks like this : <span class="customize-action">Customizing</span> Title
|
587 |
+
if ( 0 < $panelTitleEl.length ) {
|
588 |
+
$panelTitleEl.find('.customize-action').after( '<i class="fas fa-globe sek-level-option-icon"></i>' );
|
589 |
+
}
|
590 |
+
|
591 |
+
// Schedule the accordion behaviour
|
592 |
+
self.scheduleModuleAccordion.call( _section_ );
|
593 |
+
});
|
594 |
+
});
|
595 |
+
|
596 |
+
//LOCAL OPTIONS SECTION
|
597 |
+
api.CZR_Helpers.register({
|
598 |
+
origin : 'nimble',
|
599 |
+
what : 'section',
|
600 |
+
id : self.SECTION_ID_FOR_LOCAL_OPTIONS,//<= the section id doesn't need to be skope dependant. Only the control id is skope dependant.
|
601 |
+
title: sektionsLocalizedData.i18n['Current page options'],
|
602 |
+
panel : sektionsLocalizedData.sektionsPanelId,
|
603 |
+
priority : 10,
|
604 |
+
track : false,//don't register in the self.registered() => this will prevent this container to be removed when cleaning the registered
|
605 |
+
constructWith : api.Section.extend({
|
606 |
+
//attachEvents : function () {},
|
607 |
+
// Always make the section active, event if we have no control in it
|
608 |
+
isContextuallyActive : function() {
|
609 |
+
return this.active();
|
610 |
+
},
|
611 |
+
_toggleActive : function(){ return true; }
|
612 |
+
})
|
613 |
+
}).done( function() {
|
614 |
+
api.section( self.SECTION_ID_FOR_LOCAL_OPTIONS, function( _section_ ) {
|
615 |
+
// Style the section title
|
616 |
+
var $sectionTitleEl = _section_.container.find('.accordion-section-title'),
|
617 |
+
$panelTitleEl = _section_.container.find('.customize-section-title h3');
|
618 |
+
|
619 |
+
// The default title looks like this : Title <span class="screen-reader-text">Press return or enter to open this section</span>
|
620 |
+
if ( 0 < $sectionTitleEl.length ) {
|
621 |
+
$sectionTitleEl.prepend( '<i class="fas fa-map-marker-alt sek-level-option-icon"></i>' );
|
622 |
+
}
|
623 |
+
|
624 |
+
// The default title looks like this : <span class="customize-action">Customizing</span> Title
|
625 |
+
if ( 0 < $panelTitleEl.length ) {
|
626 |
+
$panelTitleEl.find('.customize-action').after( '<i class="fas fa-map-marker-alt sek-level-option-icon"></i>' );
|
627 |
+
}
|
628 |
+
|
629 |
+
// Schedule the accordion behaviour
|
630 |
+
self.scheduleModuleAccordion.call( _section_ );
|
631 |
+
});
|
632 |
+
});
|
633 |
+
|
634 |
+
|
635 |
+
// SITE WIDE GLOBAL OPTIONS SETTING
|
636 |
+
// Will Be updated in ::generateUIforGlobalOptions()
|
637 |
+
// has no control.
|
638 |
+
api.CZR_Helpers.register( {
|
639 |
+
origin : 'nimble',
|
640 |
+
//level : params.level,
|
641 |
+
what : 'setting',
|
642 |
+
id : sektionsLocalizedData.optNameForGlobalOptions,
|
643 |
+
dirty : false,
|
644 |
+
value : sektionsLocalizedData.globalOptionDBValues,
|
645 |
+
transport : 'postMessage',//'refresh',//// ,
|
646 |
+
type : 'option'
|
647 |
+
});
|
648 |
+
|
649 |
+
// CONTENT PICKER SECTION
|
650 |
+
api.CZR_Helpers.register({
|
651 |
+
origin : 'nimble',
|
652 |
+
what : 'section',
|
653 |
+
id : self.SECTION_ID_FOR_CONTENT_PICKER,
|
654 |
+
title: sektionsLocalizedData.i18n['Content Picker'],
|
655 |
+
panel : sektionsLocalizedData.sektionsPanelId,
|
656 |
+
priority : 30,
|
657 |
+
track : false,//don't register in the self.registered() => this will prevent this container to be removed when cleaning the registered
|
658 |
+
constructWith : api.Section.extend({
|
659 |
+
//attachEvents : function () {},
|
660 |
+
// Always make the section active, event if we have no control in it
|
661 |
+
isContextuallyActive : function() {
|
662 |
+
return this.active();
|
663 |
+
},
|
664 |
+
_toggleActive : function(){ return true; }
|
665 |
+
})
|
666 |
+
}).done( function() {
|
667 |
+
// generate the UI for the content picker if not done yet
|
668 |
+
// defer this action when the section is instantiated AND the api.previewer is active, so we can trigger event on it
|
669 |
+
// => we also need the local skope to be set, that's why api.czr_initialSkopeCollectionPopulated is convenient because it ensures the api.previewer is ready and we have a local skope set.
|
670 |
+
// @see czr-skope-base.js
|
671 |
+
// @fixes https://github.com/presscustomizr/nimble-builder/issues/187
|
672 |
+
api.section( self.SECTION_ID_FOR_CONTENT_PICKER, function( _section_ ) {
|
673 |
+
if ( 'resolved' != api.czr_initialSkopeCollectionPopulated.state() ) {
|
674 |
+
api.czr_initialSkopeCollectionPopulated.done( function() {
|
675 |
+
api.previewer.trigger('sek-pick-content', { focus : false });
|
676 |
+
});
|
677 |
+
} else {
|
678 |
+
api.previewer.trigger('sek-pick-content', { focus : false });
|
679 |
+
}
|
680 |
+
});
|
681 |
+
});
|
682 |
+
},//registerAndSetupDefaultPanelSectionOptions()
|
683 |
+
|
684 |
+
|
685 |
+
|
686 |
+
|
687 |
+
|
688 |
+
|
689 |
+
|
690 |
+
//@return void()
|
691 |
+
// sektionsData is built server side :
|
692 |
+
//array(
|
693 |
+
// 'db_values' => sek_get_skoped_seks( $skope_id ),
|
694 |
+
// 'setting_id' => sek_get_seks_setting_id( $skope_id )//nimble___[skp__post_page_home]
|
695 |
+
// )
|
696 |
+
setContextualCollectionSettingIdWhenSkopeSet : function( newSkopes, previousSkopes ) {
|
697 |
+
var self = this;
|
698 |
+
previousSkopes = previousSkopes || {};
|
699 |
+
// Clear all previous sektions if the main panel is expanded and we're coming from a previousSkopes
|
700 |
+
if ( !_.isEmpty( previousSkopes.local ) && api.panel( sektionsLocalizedData.sektionsPanelId ).expanded() ) {
|
701 |
+
// We don't want to change focus to content picker when setting site templates ( which forces a preview refresh on home when being opened and modified )
|
702 |
+
if ( _.isUndefined(api._nimbleRefreshingPreviewHomeWhenSettingSiteTemplate) || !api._nimbleRefreshingPreviewHomeWhenSettingSiteTemplate ) {
|
703 |
+
api.previewer.trigger('sek-pick-content');
|
704 |
+
}
|
705 |
+
}
|
706 |
+
|
707 |
+
// set the localSectionsSettingId now, and update it on skope change
|
708 |
+
sektionsData = api.czr_skopeBase.getSkopeProperty( 'sektions', 'local');
|
709 |
+
if ( sektionsLocalizedData.isDevMode ) {
|
710 |
+
api.infoLog( '::setContextualCollectionSettingIdWhenSkopeSet => SEKTIONS DATA ? ', sektionsData );
|
711 |
+
}
|
712 |
+
if ( _.isEmpty( sektionsData ) ) {
|
713 |
+
api.errare('::setContextualCollectionSettingIdWhenSkopeSet() => no sektionsData');
|
714 |
+
}
|
715 |
+
if ( _.isEmpty( sektionsData.setting_id ) ) {
|
716 |
+
api.errare('::setContextualCollectionSettingIdWhenSkopeSet() => missing setting_id');
|
717 |
+
}
|
718 |
+
self.localSectionsSettingId( sektionsData.setting_id );
|
719 |
+
}
|
720 |
+
});//$.extend()
|
721 |
+
})( wp.customize, jQuery );
|
assets/czr/sek/js/_dev_control/_1_1_1_sektions_topbar.js
ADDED
@@ -0,0 +1,307 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
//global sektionsLocalizedData
|
2 |
+
var CZRSeksPrototype = CZRSeksPrototype || {};
|
3 |
+
(function ( api, $ ) {
|
4 |
+
$.extend( CZRSeksPrototype, {
|
5 |
+
// fired in ::initialize(), at api.bind( 'ready', function() {})
|
6 |
+
setupTopBar : function() {
|
7 |
+
var self = this;
|
8 |
+
self.topBarId = '#nimble-top-bar';
|
9 |
+
self.topBarVisible = new api.Value( false );
|
10 |
+
self.topBarVisible.bind( function( visible ){
|
11 |
+
if ( ! self.levelTreeExpanded() ) {
|
12 |
+
self.toggleTopBar( visible );
|
13 |
+
}
|
14 |
+
});
|
15 |
+
|
16 |
+
self.mouseMovedRecently = new api.Value( {} );
|
17 |
+
self.mouseMovedRecently.bind( function( position ) {
|
18 |
+
self.topBarVisible( ! _.isEmpty( position ) );
|
19 |
+
});
|
20 |
+
|
21 |
+
var trackMouseMovements = function( evt ) {
|
22 |
+
self.mouseMovedRecently( { x : evt.clientX, y : evt.clientY } );
|
23 |
+
clearTimeout( self.cachedElements.$window.data('_scroll_move_timer_') );
|
24 |
+
self.cachedElements.$window.data('_scroll_move_timer_', setTimeout(function() {
|
25 |
+
self.mouseMovedRecently.set( {} );
|
26 |
+
}, 4000 ) );
|
27 |
+
};
|
28 |
+
self.cachedElements.$window.on( 'mousemove scroll,', _.throttle( trackMouseMovements , 50 ) );
|
29 |
+
api.previewer.bind('ready', function() {
|
30 |
+
$(api.previewer.targetWindow().document ).on( 'mousemove scroll,', _.throttle( trackMouseMovements , 50 ) );
|
31 |
+
});
|
32 |
+
|
33 |
+
// LEVEL TREE
|
34 |
+
self.setupLevelTree();
|
35 |
+
},
|
36 |
+
|
37 |
+
|
38 |
+
// @return void()
|
39 |
+
// self.topBarVisible.bind( function( visible ){
|
40 |
+
// self.toggleTopBar( visible );
|
41 |
+
// });
|
42 |
+
toggleTopBar : function( visible ) {
|
43 |
+
visible = _.isUndefined( visible ) ? true : visible;
|
44 |
+
var self = this,
|
45 |
+
_renderAndSetup = function() {
|
46 |
+
$.when( self.renderAndSetupTopBarTmpl({}) ).done( function( $_el ) {
|
47 |
+
self.topBarContainer = $_el;
|
48 |
+
//display
|
49 |
+
_.delay( function() {
|
50 |
+
self.cachedElements.$body.addClass('nimble-top-bar-visible');
|
51 |
+
}, 200 );
|
52 |
+
});
|
53 |
+
},
|
54 |
+
_hide = function() {
|
55 |
+
var dfd = $.Deferred();
|
56 |
+
self.cachedElements.$body.removeClass('nimble-top-bar-visible');
|
57 |
+
if ( self.topBarContainer && self.topBarContainer.length ) {
|
58 |
+
//remove Dom element after slide up
|
59 |
+
_.delay( function() {
|
60 |
+
//self.topBarContainer.remove();
|
61 |
+
dfd.resolve();
|
62 |
+
}, 300 );
|
63 |
+
} else {
|
64 |
+
dfd.resolve();
|
65 |
+
}
|
66 |
+
return dfd.promise();
|
67 |
+
};
|
68 |
+
|
69 |
+
if ( visible ) {
|
70 |
+
_renderAndSetup();
|
71 |
+
} else {
|
72 |
+
_hide().done( function() {
|
73 |
+
self.topBarVisible( false );//should be already false
|
74 |
+
});
|
75 |
+
}
|
76 |
+
},
|
77 |
+
|
78 |
+
|
79 |
+
//@param = { }
|
80 |
+
renderAndSetupTopBarTmpl : function( params ) {
|
81 |
+
var self = this,
|
82 |
+
_tmpl;
|
83 |
+
|
84 |
+
// CHECK IF ALREADY RENDERED
|
85 |
+
if ( $( self.topBarId ).length > 0 )
|
86 |
+
return $( self.topBarId );
|
87 |
+
|
88 |
+
// RENDER
|
89 |
+
try {
|
90 |
+
_tmpl = wp.template( 'nimble-top-bar' )( {} );
|
91 |
+
} catch( er ) {
|
92 |
+
api.errare( 'Error when parsing the the top note template', er );
|
93 |
+
return false;
|
94 |
+
}
|
95 |
+
$('#customize-preview').after( $( _tmpl ) );
|
96 |
+
$('#customize-preview').trigger('nimble-top-bar-rendered');
|
97 |
+
|
98 |
+
// UNDO / REDO ON CTRL + Z / CTRL + Y EVENTS
|
99 |
+
$(document).keydown( function( evt ) {
|
100 |
+
if ( evt.ctrlKey && _.contains( [89, 90], evt.keyCode ) ) {
|
101 |
+
try { self.navigateHistory( 90 === evt.keyCode ? 'undo' : 'redo'); } catch( er ) {
|
102 |
+
api.errare( 'Error when firing self.navigateHistory', er );
|
103 |
+
}
|
104 |
+
}
|
105 |
+
});
|
106 |
+
|
107 |
+
|
108 |
+
// CLICK EVENTS
|
109 |
+
// Attach click events
|
110 |
+
$('.sek-add-content', self.topBarId).on( 'click', function(evt) {
|
111 |
+
evt.preventDefault();
|
112 |
+
api.previewer.trigger( 'sek-pick-content', { content_type : 'module' });
|
113 |
+
});
|
114 |
+
$('.sek-level-tree', self.topBarId).on( 'click', function(evt) {
|
115 |
+
evt.preventDefault();
|
116 |
+
self.levelTreeExpanded(!self.levelTreeExpanded());
|
117 |
+
});
|
118 |
+
$('[data-nimble-history]', self.topBarId).on( 'click', function(evt) {
|
119 |
+
try { self.navigateHistory( $(this).data( 'nimble-history') ); } catch( er ) {
|
120 |
+
api.errare( 'Error when firing self.navigateHistory', er );
|
121 |
+
}
|
122 |
+
});
|
123 |
+
$('.sek-settings', self.topBarId).on( 'click', function(evt) {
|
124 |
+
// Focus on the Nimble panel
|
125 |
+
api.panel( sektionsLocalizedData.sektionsPanelId, function( _panel_ ) {
|
126 |
+
self.rootPanelFocus();
|
127 |
+
_panel_.focus();
|
128 |
+
});
|
129 |
+
// // Generate UI for the local skope options
|
130 |
+
// self.generateUI({ action : 'sek-generate-local-skope-options-ui'}).done( function() {
|
131 |
+
// api.control( self.getLocalSkopeOptionId(), function( _control_ ) {
|
132 |
+
// _control_.focus();
|
133 |
+
// });
|
134 |
+
// });
|
135 |
+
});
|
136 |
+
|
137 |
+
$('.sek-nimble-doc, .sek-notifications', self.topBarId).on( 'click', function(evt) {
|
138 |
+
evt.preventDefault();
|
139 |
+
if ( $(this).data('doc-href') ) {
|
140 |
+
window.open($(this).data('doc-href'), '_blank');
|
141 |
+
}
|
142 |
+
});
|
143 |
+
|
144 |
+
$('.sek-tmpl-saving', self.topBarId ).on( 'click', function(evt) {
|
145 |
+
// Focus on the Nimble panel
|
146 |
+
// api.panel( sektionsLocalizedData.sektionsPanelId, function( _panel_ ) {
|
147 |
+
// self.rootPanelFocus();
|
148 |
+
// _panel_.focus();
|
149 |
+
// });
|
150 |
+
evt.preventDefault();
|
151 |
+
self.tmplDialogVisible(!self.tmplDialogVisible());// self.tmplDialogVisible() is initialized false
|
152 |
+
});
|
153 |
+
|
154 |
+
$( self.topBarId ).on( 'click', '.sek-reset-local-sektions', function(evt) {
|
155 |
+
// Focus on the Nimble panel
|
156 |
+
// api.panel( sektionsLocalizedData.sektionsPanelId, function( _panel_ ) {
|
157 |
+
// self.rootPanelFocus();
|
158 |
+
// _panel_.focus();
|
159 |
+
// });
|
160 |
+
// api.control( self.getLocalSkopeOptionId() + '__local_reset', function( _control_ ) {
|
161 |
+
// _control_.focus();
|
162 |
+
// _control_.container.find('.customize-control-title').trigger('click');
|
163 |
+
// });
|
164 |
+
// evt.preventDefault();
|
165 |
+
// Focus on the Nimble panel
|
166 |
+
api.panel( sektionsLocalizedData.sektionsPanelId, function( _panel_ ) {
|
167 |
+
self.rootPanelFocus();
|
168 |
+
_panel_.focus();
|
169 |
+
api.section( self.SECTION_ID_FOR_LOCAL_OPTIONS, function( _section_ ) {
|
170 |
+
_section_.focus();
|
171 |
+
setTimeout( function() {
|
172 |
+
api.control( self.getLocalSkopeOptionId() + '__local_reset', function( _control_ ) {
|
173 |
+
_control_.focus();
|
174 |
+
_control_.container.find('.customize-control-title').trigger('click');
|
175 |
+
_control_.container.addClass('button-see-me');
|
176 |
+
_.delay( function() {
|
177 |
+
_control_.container.removeClass('button-see-me');
|
178 |
+
}, 800 );
|
179 |
+
});
|
180 |
+
}, 500 );
|
181 |
+
});
|
182 |
+
});
|
183 |
+
});
|
184 |
+
|
185 |
+
$( self.topBarId ).on( 'click', '.sek-goto-site-tmpl-options', function(evt) {
|
186 |
+
// evt.preventDefault();
|
187 |
+
// Focus on the Nimble panel
|
188 |
+
api.panel( sektionsLocalizedData.sektionsPanelId, function( _panel_ ) {
|
189 |
+
self.rootPanelFocus();
|
190 |
+
_panel_.focus();
|
191 |
+
api.section( self.SECTION_ID_FOR_GLOBAL_OPTIONS, function( _section_ ) {
|
192 |
+
_section_.focus();
|
193 |
+
setTimeout( function() {
|
194 |
+
api.control( sektionsLocalizedData.prefixForSettingsNotSaved + sektionsLocalizedData.optNameForGlobalOptions + '__site_templates', function( _control_ ) {
|
195 |
+
_control_.focus();
|
196 |
+
_control_.container.find('.customize-control-title').trigger('click');
|
197 |
+
});
|
198 |
+
}, 500 );
|
199 |
+
});
|
200 |
+
});
|
201 |
+
});
|
202 |
+
|
203 |
+
// NOTIFICATION WHEN USING CUSTOM TEMPLATE
|
204 |
+
// implemented for https://github.com/presscustomizr/nimble-builder/issues/304
|
205 |
+
var printSektionsSkopeStatus = function( args ) {
|
206 |
+
if ( $(self.topBarId).length < 1 || sektionsLocalizedData.isDebugMode )
|
207 |
+
return;
|
208 |
+
var _hasLocalNBCustomizations = false;
|
209 |
+
if ( args && args.on_init ) {
|
210 |
+
//console.log('ON INIT : ', api.czr_skopeBase.getSkopeProperty( 'skope_id', 'group' ) );
|
211 |
+
_hasLocalNBCustomizations = api.czr_skopeBase.getSkopeProperty( 'has_local_nimble_customizations', 'local' );//property added server side see php:add_sektion_values_to_skope_export()
|
212 |
+
} else if ( args && args.after_reset ) {
|
213 |
+
//console.log('AFTER RESET');
|
214 |
+
_hasLocalNBCustomizations = false;
|
215 |
+
} else {
|
216 |
+
_hasLocalNBCustomizations = self.hasLocalSettingBeenCustomized();
|
217 |
+
}
|
218 |
+
|
219 |
+
//console.log('GLOBAL OPTIONS ', api(sektionsLocalizedData.optNameForGlobalOptions)() );
|
220 |
+
var _groupSkope = self.getGroupSkopeForSiteTemplate(),
|
221 |
+
_hasSiteTemplateSet = false,
|
222 |
+
_inheritsSiteTemplate = false,
|
223 |
+
_globOptions = api(sektionsLocalizedData.optNameForGlobalOptions)();
|
224 |
+
|
225 |
+
var _is_inheritance_enabled_in_local_options = true,
|
226 |
+
currentSetValue = api( self.localSectionsSettingId() )(),
|
227 |
+
localOptions = currentSetValue.local_options;
|
228 |
+
|
229 |
+
if ( localOptions && _.isObject(localOptions) && localOptions.local_reset && !_.isUndefined( localOptions.local_reset.inherit_group_scope ) ) {
|
230 |
+
_is_inheritance_enabled_in_local_options = localOptions.local_reset.inherit_group_scope;
|
231 |
+
}
|
232 |
+
|
233 |
+
if ( _.isObject(_globOptions) && _globOptions.site_templates && _.isObject(_globOptions.site_templates ) ) {
|
234 |
+
_.each( _globOptions.site_templates, function( tmpl, siteTmplSkope ) {
|
235 |
+
// If no match found, keep sniffing
|
236 |
+
if ( !_hasSiteTemplateSet ) {
|
237 |
+
// How does this work ?
|
238 |
+
// the site_templates key are intended to match exactly the skope ids, as generated by NB skope system
|
239 |
+
// But there are exceptions for some skopes that have no "group skopes" and for which we've added the suffix "for_site_tmpl"
|
240 |
+
// ex : skp__404_for_site_tmpl, skp__date_for_site_tmpl, skp__search_for_site_tmpl @see php sek_get_module_params_for_sek_site_tmpl_pickers()
|
241 |
+
_hasSiteTemplateSet = _groupSkope === siteTmplSkope;
|
242 |
+
}
|
243 |
+
} );
|
244 |
+
}
|
245 |
+
|
246 |
+
_inheritsSiteTemplate = _hasSiteTemplateSet && !_hasLocalNBCustomizations && _is_inheritance_enabled_in_local_options;
|
247 |
+
var _msg = sektionsLocalizedData.i18n['This page is not customized with NB'];
|
248 |
+
if ( _inheritsSiteTemplate ) {
|
249 |
+
_msg = '<span class="sek-goto-site-tmpl-options">' + sektionsLocalizedData.i18n['This page inherits a NB site template'] + '</span>';
|
250 |
+
} else if ( _hasLocalNBCustomizations ) {
|
251 |
+
_msg = sektionsLocalizedData.i18n['This page is customized with NB'];
|
252 |
+
_msg += '<button type="button" class="far fa-trash-alt sek-reset-local-sektions" title="' + sektionsLocalizedData.i18n['Remove all sections and options of this page'] +'" data-nimble-state="enabled"><span class="screen-reader-text">' + sektionsLocalizedData.i18n['Remove all sections and options of this page'] +'</span></button>';
|
253 |
+
}
|
254 |
+
|
255 |
+
$(self.topBarId).find('.sek-notifications')
|
256 |
+
.html([
|
257 |
+
'<span class="fas fa-info-circle"></span>',
|
258 |
+
_msg
|
259 |
+
//sektionsLocalizedData.i18n['This page uses Nimble Builder template.']
|
260 |
+
].join(' '));
|
261 |
+
//.attr('data-doc-href', 'https://docs.presscustomizr.com/article/339-changing-the-page-template');
|
262 |
+
|
263 |
+
// if ( _.isObject( templateSettingValue ) && templateSettingValue.local_template && 'default' !== templateSettingValue.local_template ) {
|
264 |
+
// if ( _inheritsSiteTemplate ) {
|
265 |
+
// $(self.topBarId).find('.sek-notifications').addClass('is-linked').data('doc-href', 'https://docs.presscustomizr.com/article/428-how-to-use-site-templates-with-nimble-builder');
|
266 |
+
// } else {
|
267 |
+
// $(self.topBarId).find('.sek-notifications').removeClass('is-linked').data('doc-href','');
|
268 |
+
// }
|
269 |
+
// } else {
|
270 |
+
// $(self.topBarId).find('.sek-notifications').html('');
|
271 |
+
// }
|
272 |
+
};
|
273 |
+
|
274 |
+
api.bind('nimble-update-topbar-skope-status', printSektionsSkopeStatus );
|
275 |
+
|
276 |
+
var initOnSkopeReady = function() {
|
277 |
+
// Schedule notification rendering on init
|
278 |
+
// @see ::generateUIforLocalSkopeOptions()
|
279 |
+
api( self.localSectionsSettingId(), function( _localSectionsSetting_ ) {
|
280 |
+
// var localSectionsValue = _localSectionsSetting_(),
|
281 |
+
// initialLocalTemplateValue = ( _.isObject( localSectionsValue ) && localSectionsValue.local_options && localSectionsValue.local_options.template ) ? localSectionsValue.local_options.template : null;
|
282 |
+
// // on init
|
283 |
+
// printSektionsSkopeStatus( initialLocal
|