Version Description
Added :
- Compatibility with WooCommerce
- Search field shortcode
- Macro
- $$WRAPPER_CLASS$$
- $$FORM_CLASS$$
- $$INPUT_ID$$
- $$SETTINGS$$
- Filters
- cherry_search_wrapper_class
- cherry_search_form_class
- cherry_search_input_id
- cherry_search_query_settings
Fixed :
- WooCommerce issue in the product page.
=
Download this release
Release Info
Developer | TemplateMonster 2002 |
Plugin | Cherry Search |
Version | 1.1.0 |
Comparing to | |
See all releases |
Code changes from version 1.0.0 to 1.1.0
- LICENSE +674 -0
- assets/js/cherry-search.js +9 -5
- assets/js/min/cherry-search.min.js +1 -1
- cherry-framework/LICENSE +674 -0
- cherry-framework/README.md +17 -0
- cherry-framework/cherry-core.php +16 -2
- cherry-framework/languages/cherry-framework.pot +119 -0
- cherry-framework/modules/cherry-breadcrumbs/cherry-breadcrumbs.php +22 -12
- cherry-framework/modules/cherry-customizer/cherry-customizer.php +8 -6
- cherry-framework/modules/cherry-customizer/inc/class-cherry-wp-customize-iconpicker.php +5 -1
- cherry-framework/modules/cherry-db-updater/cherry-db-updater.php +381 -0
- cherry-framework/modules/cherry-dynamic-css/cherry-dynamic-css.php +85 -19
- cherry-framework/modules/cherry-handler/assets/js/cherry-handler.js +23 -1
- cherry-framework/modules/cherry-handler/assets/js/min/cherry-handler.min.js +1 -1
- cherry-framework/modules/cherry-handler/cherry-handler.php +13 -22
- cherry-framework/modules/cherry-interface-builder/cherry-interface-builder.php +33 -28
- cherry-framework/modules/cherry-interface-builder/inc/assets/cherry-interface-builder.js +5 -1
- cherry-framework/modules/cherry-interface-builder/inc/assets/cherry-interface-builder.scss +15 -9
- cherry-framework/modules/cherry-interface-builder/inc/assets/min/cherry-interface-builder.min.css +1 -1
- cherry-framework/modules/cherry-interface-builder/inc/assets/min/cherry-interface-builder.min.js +1 -1
- cherry-framework/modules/cherry-js-core/assets/js/min/cherry-js-core.min.js +1 -1
- cherry-framework/modules/cherry-js-core/cherry-js-core.php +1 -1
- cherry-framework/modules/cherry-post-formats-api/cherry-post-formats-api.php +0 -1
- cherry-framework/modules/cherry-post-formats-api/inc/class-cherry-facebook-embed.php +1 -1
- cherry-framework/modules/cherry-template-manager/cherry-template-manager.php +14 -31
- cherry-framework/modules/cherry-template-manager/inc/cherry-template-loader.php +9 -58
- cherry-framework/modules/cherry-template-manager/inc/cherry-template-parser.php +3 -37
- cherry-framework/modules/cherry-ui-elements/cherry-ui-elements.php +2 -3
- cherry-framework/modules/cherry-ui-elements/i-ui.php +1 -1
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-button/assets/min/ui-button.min.css +1 -1
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-button/assets/ui-button.scss +56 -42
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-button/assets/ui-kit/_mixins.scss +23 -163
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-button/assets/ui-kit/_variables.scss +38 -17
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-button/ui-button.php +21 -22
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-button/view/button-view.php +2 -2
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-checkbox/assets/min/ui-checkbox.min.css +1 -1
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-checkbox/assets/min/ui-checkbox.min.js +1 -1
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-checkbox/assets/ui-checkbox.scss +4 -0
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-checkbox/assets/ui-kit/_mixins.scss +8 -6
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-checkbox/ui-checkbox.php +21 -18
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-colorpicker/assets/min/ui-colorpicker.min.css +1 -1
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-colorpicker/assets/ui-colorpicker.scss +73 -34
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-colorpicker/assets/ui-kit/_mixins.scss +8 -6
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-colorpicker/ui-colorpicker.php +15 -15
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-iconpicker/assets/min/ui-iconpicker.min.css +1 -1
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-iconpicker/assets/min/ui-iconpicker.min.js +1 -1
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-iconpicker/assets/ui-iconpicker.js +59 -6
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-iconpicker/assets/ui-iconpicker.scss +6 -1
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-iconpicker/assets/ui-kit/_mixins.scss +8 -6
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-iconpicker/ui-iconpicker.php +38 -15
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-media/assets/min/ui-media.min.css +1 -1
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-media/assets/min/ui-media.min.js +1 -156
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-media/assets/ui-kit/_mixins.scss +31 -163
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-media/assets/ui-kit/_variables.scss +44 -15
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-media/assets/ui-media.js +1 -1
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-media/assets/ui-media.scss +27 -60
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-media/ui-media.php +11 -10
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-radio/assets/min/ui-radio.min.css +1 -1
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-radio/assets/min/ui-radio.min.js +1 -1
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-radio/assets/ui-kit/_mixins.scss +25 -7
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-radio/assets/ui-radio.js +1 -1
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-radio/ui-radio.php +28 -26
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-repeater/assets/min/ui-repeater.min.css +1 -1
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-repeater/assets/ui-kit/_mixins.scss +21 -3
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-repeater/assets/ui-repeater.scss +6 -0
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-repeater/ui-repeater.php +9 -10
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-select/assets/min/ui-select.min.css +1 -1
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-select/assets/min/ui-select.min.js +1 -1
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-select/assets/ui-kit/_mixins.scss +6 -173
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-select/assets/ui-kit/_variables.scss +9 -21
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-select/assets/ui-select.js +1 -1
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-select/assets/ui-select.scss +9 -8
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-select/ui-select.php +42 -39
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-slider/assets/min/ui-slider.min.css +1 -1
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-slider/assets/ui-kit/_mixins.scss +8 -6
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-slider/ui-slider.php +9 -8
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-stepper/assets/min/ui-stepper.min.css +1 -1
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-stepper/assets/ui-kit/_mixins.scss +7 -174
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-stepper/assets/ui-kit/_variables.scss +5 -21
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-stepper/assets/ui-stepper.scss +1 -2
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-stepper/ui-stepper.php +18 -16
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-switcher/assets/min/ui-switcher.min.css +1 -1
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-switcher/assets/min/ui-switcher.min.js +1 -1
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-switcher/assets/ui-kit/_mixins.scss +0 -182
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-switcher/assets/ui-kit/_variables.scss +13 -21
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-switcher/assets/ui-switcher.js +1 -1
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-switcher/assets/ui-switcher.scss +30 -14
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-switcher/ui-switcher.php +22 -19
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-text/assets/min/ui-text.min.css +1 -20
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-text/assets/ui-kit/_mixins.scss +5 -172
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-text/assets/ui-kit/_variables.scss +5 -21
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-text/assets/ui-text.scss +1 -1
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-text/ui-text.php +22 -19
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-textarea/assets/min/ui-textarea.min.css +1 -22
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-textarea/assets/ui-kit/_mixins.scss +5 -172
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-textarea/assets/ui-kit/_variables.scss +5 -21
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-textarea/assets/ui-textarea.scss +1 -1
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-textarea/ui-textarea.php +17 -15
- cherry-framework/modules/cherry-ui-elements/ui-element.php +1 -1
- cherry-framework/modules/cherry-utility/cherry-utility.php +3 -3
- cherry-framework/modules/cherry-utility/inc/cherry-attributes-utilit.php +3 -2
- cherry-framework/modules/cherry-utility/inc/cherry-media-utilit.php +34 -29
- cherry-framework/modules/cherry-utility/inc/cherry-meta-data-utilit.php +1 -1
- cherry-framework/modules/cherry-utility/inc/cherry-satellite-utilit.php +55 -10
- cherry-framework/modules/cherry-widget-factory/inc/class-cherry-abstract-widget.php +2 -2
- cherry-framework/modules/cherry5-insert-shortcode/assets/cherry-insert-shortcode.js +271 -0
- cherry-framework/modules/cherry5-insert-shortcode/assets/cherry-insert-shortcode.scss +492 -0
- cherry-framework/modules/cherry5-insert-shortcode/assets/min/cherry-insert-shortcode.min.css +1 -0
- cherry-framework/modules/cherry5-insert-shortcode/assets/min/cherry-insert-shortcode.min.js +1 -0
- cherry-framework/modules/cherry5-insert-shortcode/cherry5-insert-shortcode.php +266 -0
- cherry-framework/modules/cherry5-insert-shortcode/inc/class-cherry5-insertion-button.php +71 -0
- cherry-framework/modules/cherry5-insert-shortcode/inc/class-cherry5-insertion-popup.php +285 -0
- cherry-framework/modules/cherry5-insert-shortcode/inc/views/insert-shortcode-pop-up.php +49 -0
- cherry-framework/modules/cherry5-insert-shortcode/inc/views/shortcode-content-area.php +23 -0
- cherry-framework/modules/cherry5-insert-shortcode/inc/views/shortcode-has-not-option.php +22 -0
- cherry-framework/modules/cherry5-insert-shortcode/inc/views/shortcode-options.php +25 -0
- cherry-framework/setup.php +1 -1
- cherry-search.php +7 -4
- includes/admin/class-cherry-search-admin.php +4 -1
- includes/admin/class-cherry-search-register-shortcodes.php +115 -0
- includes/admin/class-cherry-search-settings.php +37 -11
- includes/public/class-cherry-search-form-public.php +107 -42
- includes/public/class-cherry-search-form-shortcode.php +2 -2
- includes/public/class-cherry-search-macros-callback.php +87 -29
- includes/public/class-cherry-search-public-ajax-handlers.php +12 -13
- includes/public/class-cherry-search-settings-manager.php +29 -22
- readme.txt +62 -3
- templates/cherry-search/search-form-input.tmpl +2 -1
- templates/cherry-search/search-form.tmpl +2 -2
- wpml-config.xml +20 -0
LICENSE
ADDED
@@ -0,0 +1,674 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
GNU GENERAL PUBLIC LICENSE
|
2 |
+
Version 3, 29 June 2007
|
3 |
+
|
4 |
+
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
5 |
+
Everyone is permitted to copy and distribute verbatim copies
|
6 |
+
of this license document, but changing it is not allowed.
|
7 |
+
|
8 |
+
Preamble
|
9 |
+
|
10 |
+
The GNU General Public License is a free, copyleft license for
|
11 |
+
software and other kinds of works.
|
12 |
+
|
13 |
+
The licenses for most software and other practical works are designed
|
14 |
+
to take away your freedom to share and change the works. By contrast,
|
15 |
+
the GNU General Public License is intended to guarantee your freedom to
|
16 |
+
share and change all versions of a program--to make sure it remains free
|
17 |
+
software for all its users. We, the Free Software Foundation, use the
|
18 |
+
GNU General Public License for most of our software; it applies also to
|
19 |
+
any other work released this way by its authors. You can apply it to
|
20 |
+
your programs, too.
|
21 |
+
|
22 |
+
When we speak of free software, we are referring to freedom, not
|
23 |
+
price. Our General Public Licenses are designed to make sure that you
|
24 |
+
have the freedom to distribute copies of free software (and charge for
|
25 |
+
them if you wish), that you receive source code or can get it if you
|
26 |
+
want it, that you can change the software or use pieces of it in new
|
27 |
+
free programs, and that you know you can do these things.
|
28 |
+
|
29 |
+
To protect your rights, we need to prevent others from denying you
|
30 |
+
these rights or asking you to surrender the rights. Therefore, you have
|
31 |
+
certain responsibilities if you distribute copies of the software, or if
|
32 |
+
you modify it: responsibilities to respect the freedom of others.
|
33 |
+
|
34 |
+
For example, if you distribute copies of such a program, whether
|
35 |
+
gratis or for a fee, you must pass on to the recipients the same
|
36 |
+
freedoms that you received. You must make sure that they, too, receive
|
37 |
+
or can get the source code. And you must show them these terms so they
|
38 |
+
know their rights.
|
39 |
+
|
40 |
+
Developers that use the GNU GPL protect your rights with two steps:
|
41 |
+
(1) assert copyright on the software, and (2) offer you this License
|
42 |
+
giving you legal permission to copy, distribute and/or modify it.
|
43 |
+
|
44 |
+
For the developers' and authors' protection, the GPL clearly explains
|
45 |
+
that there is no warranty for this free software. For both users' and
|
46 |
+
authors' sake, the GPL requires that modified versions be marked as
|
47 |
+
changed, so that their problems will not be attributed erroneously to
|
48 |
+
authors of previous versions.
|
49 |
+
|
50 |
+
Some devices are designed to deny users access to install or run
|
51 |
+
modified versions of the software inside them, although the manufacturer
|
52 |
+
can do so. This is fundamentally incompatible with the aim of
|
53 |
+
protecting users' freedom to change the software. The systematic
|
54 |
+
pattern of such abuse occurs in the area of products for individuals to
|
55 |
+
use, which is precisely where it is most unacceptable. Therefore, we
|
56 |
+
have designed this version of the GPL to prohibit the practice for those
|
57 |
+
products. If such problems arise substantially in other domains, we
|
58 |
+
stand ready to extend this provision to those domains in future versions
|
59 |
+
of the GPL, as needed to protect the freedom of users.
|
60 |
+
|
61 |
+
Finally, every program is threatened constantly by software patents.
|
62 |
+
States should not allow patents to restrict development and use of
|
63 |
+
software on general-purpose computers, but in those that do, we wish to
|
64 |
+
avoid the special danger that patents applied to a free program could
|
65 |
+
make it effectively proprietary. To prevent this, the GPL assures that
|
66 |
+
patents cannot be used to render the program non-free.
|
67 |
+
|
68 |
+
The precise terms and conditions for copying, distribution and
|
69 |
+
modification follow.
|
70 |
+
|
71 |
+
TERMS AND CONDITIONS
|
72 |
+
|
73 |
+
0. Definitions.
|
74 |
+
|
75 |
+
"This License" refers to version 3 of the GNU General Public License.
|
76 |
+
|
77 |
+
"Copyright" also means copyright-like laws that apply to other kinds of
|
78 |
+
works, such as semiconductor masks.
|
79 |
+
|
80 |
+
"The Program" refers to any copyrightable work licensed under this
|
81 |
+
License. Each licensee is addressed as "you". "Licensees" and
|
82 |
+
"recipients" may be individuals or organizations.
|
83 |
+
|
84 |
+
To "modify" a work means to copy from or adapt all or part of the work
|
85 |
+
in a fashion requiring copyright permission, other than the making of an
|
86 |
+
exact copy. The resulting work is called a "modified version" of the
|
87 |
+
earlier work or a work "based on" the earlier work.
|
88 |
+
|
89 |
+
A "covered work" means either the unmodified Program or a work based
|
90 |
+
on the Program.
|
91 |
+
|
92 |
+
To "propagate" a work means to do anything with it that, without
|
93 |
+
permission, would make you directly or secondarily liable for
|
94 |
+
infringement under applicable copyright law, except executing it on a
|
95 |
+
computer or modifying a private copy. Propagation includes copying,
|
96 |
+
distribution (with or without modification), making available to the
|
97 |
+
public, and in some countries other activities as well.
|
98 |
+
|
99 |
+
To "convey" a work means any kind of propagation that enables other
|
100 |
+
parties to make or receive copies. Mere interaction with a user through
|
101 |
+
a computer network, with no transfer of a copy, is not conveying.
|
102 |
+
|
103 |
+
An interactive user interface displays "Appropriate Legal Notices"
|
104 |
+
to the extent that it includes a convenient and prominently visible
|
105 |
+
feature that (1) displays an appropriate copyright notice, and (2)
|
106 |
+
tells the user that there is no warranty for the work (except to the
|
107 |
+
extent that warranties are provided), that licensees may convey the
|
108 |
+
work under this License, and how to view a copy of this License. If
|
109 |
+
the interface presents a list of user commands or options, such as a
|
110 |
+
menu, a prominent item in the list meets this criterion.
|
111 |
+
|
112 |
+
1. Source Code.
|
113 |
+
|
114 |
+
The "source code" for a work means the preferred form of the work
|
115 |
+
for making modifications to it. "Object code" means any non-source
|
116 |
+
form of a work.
|
117 |
+
|
118 |
+
A "Standard Interface" means an interface that either is an official
|
119 |
+
standard defined by a recognized standards body, or, in the case of
|
120 |
+
interfaces specified for a particular programming language, one that
|
121 |
+
is widely used among developers working in that language.
|
122 |
+
|
123 |
+
The "System Libraries" of an executable work include anything, other
|
124 |
+
than the work as a whole, that (a) is included in the normal form of
|
125 |
+
packaging a Major Component, but which is not part of that Major
|
126 |
+
Component, and (b) serves only to enable use of the work with that
|
127 |
+
Major Component, or to implement a Standard Interface for which an
|
128 |
+
implementation is available to the public in source code form. A
|
129 |
+
"Major Component", in this context, means a major essential component
|
130 |
+
(kernel, window system, and so on) of the specific operating system
|
131 |
+
(if any) on which the executable work runs, or a compiler used to
|
132 |
+
produce the work, or an object code interpreter used to run it.
|
133 |
+
|
134 |
+
The "Corresponding Source" for a work in object code form means all
|
135 |
+
the source code needed to generate, install, and (for an executable
|
136 |
+
work) run the object code and to modify the work, including scripts to
|
137 |
+
control those activities. However, it does not include the work's
|
138 |
+
System Libraries, or general-purpose tools or generally available free
|
139 |
+
programs which are used unmodified in performing those activities but
|
140 |
+
which are not part of the work. For example, Corresponding Source
|
141 |
+
includes interface definition files associated with source files for
|
142 |
+
the work, and the source code for shared libraries and dynamically
|
143 |
+
linked subprograms that the work is specifically designed to require,
|
144 |
+
such as by intimate data communication or control flow between those
|
145 |
+
subprograms and other parts of the work.
|
146 |
+
|
147 |
+
The Corresponding Source need not include anything that users
|
148 |
+
can regenerate automatically from other parts of the Corresponding
|
149 |
+
Source.
|
150 |
+
|
151 |
+
The Corresponding Source for a work in source code form is that
|
152 |
+
same work.
|
153 |
+
|
154 |
+
2. Basic Permissions.
|
155 |
+
|
156 |
+
All rights granted under this License are granted for the term of
|
157 |
+
copyright on the Program, and are irrevocable provided the stated
|
158 |
+
conditions are met. This License explicitly affirms your unlimited
|
159 |
+
permission to run the unmodified Program. The output from running a
|
160 |
+
covered work is covered by this License only if the output, given its
|
161 |
+
content, constitutes a covered work. This License acknowledges your
|
162 |
+
rights of fair use or other equivalent, as provided by copyright law.
|
163 |
+
|
164 |
+
You may make, run and propagate covered works that you do not
|
165 |
+
convey, without conditions so long as your license otherwise remains
|
166 |
+
in force. You may convey covered works to others for the sole purpose
|
167 |
+
of having them make modifications exclusively for you, or provide you
|
168 |
+
with facilities for running those works, provided that you comply with
|
169 |
+
the terms of this License in conveying all material for which you do
|
170 |
+
not control copyright. Those thus making or running the covered works
|
171 |
+
for you must do so exclusively on your behalf, under your direction
|
172 |
+
and control, on terms that prohibit them from making any copies of
|
173 |
+
your copyrighted material outside their relationship with you.
|
174 |
+
|
175 |
+
Conveying under any other circumstances is permitted solely under
|
176 |
+
the conditions stated below. Sublicensing is not allowed; section 10
|
177 |
+
makes it unnecessary.
|
178 |
+
|
179 |
+
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
180 |
+
|
181 |
+
No covered work shall be deemed part of an effective technological
|
182 |
+
measure under any applicable law fulfilling obligations under article
|
183 |
+
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
184 |
+
similar laws prohibiting or restricting circumvention of such
|
185 |
+
measures.
|
186 |
+
|
187 |
+
When you convey a covered work, you waive any legal power to forbid
|
188 |
+
circumvention of technological measures to the extent such circumvention
|
189 |
+
is effected by exercising rights under this License with respect to
|
190 |
+
the covered work, and you disclaim any intention to limit operation or
|
191 |
+
modification of the work as a means of enforcing, against the work's
|
192 |
+
users, your or third parties' legal rights to forbid circumvention of
|
193 |
+
technological measures.
|
194 |
+
|
195 |
+
4. Conveying Verbatim Copies.
|
196 |
+
|
197 |
+
You may convey verbatim copies of the Program's source code as you
|
198 |
+
receive it, in any medium, provided that you conspicuously and
|
199 |
+
appropriately publish on each copy an appropriate copyright notice;
|
200 |
+
keep intact all notices stating that this License and any
|
201 |
+
non-permissive terms added in accord with section 7 apply to the code;
|
202 |
+
keep intact all notices of the absence of any warranty; and give all
|
203 |
+
recipients a copy of this License along with the Program.
|
204 |
+
|
205 |
+
You may charge any price or no price for each copy that you convey,
|
206 |
+
and you may offer support or warranty protection for a fee.
|
207 |
+
|
208 |
+
5. Conveying Modified Source Versions.
|
209 |
+
|
210 |
+
You may convey a work based on the Program, or the modifications to
|
211 |
+
produce it from the Program, in the form of source code under the
|
212 |
+
terms of section 4, provided that you also meet all of these conditions:
|
213 |
+
|
214 |
+
a) The work must carry prominent notices stating that you modified
|
215 |
+
it, and giving a relevant date.
|
216 |
+
|
217 |
+
b) The work must carry prominent notices stating that it is
|
218 |
+
released under this License and any conditions added under section
|
219 |
+
7. This requirement modifies the requirement in section 4 to
|
220 |
+
"keep intact all notices".
|
221 |
+
|
222 |
+
c) You must license the entire work, as a whole, under this
|
223 |
+
License to anyone who comes into possession of a copy. This
|
224 |
+
License will therefore apply, along with any applicable section 7
|
225 |
+
additional terms, to the whole of the work, and all its parts,
|
226 |
+
regardless of how they are packaged. This License gives no
|
227 |
+
permission to license the work in any other way, but it does not
|
228 |
+
invalidate such permission if you have separately received it.
|
229 |
+
|
230 |
+
d) If the work has interactive user interfaces, each must display
|
231 |
+
Appropriate Legal Notices; however, if the Program has interactive
|
232 |
+
interfaces that do not display Appropriate Legal Notices, your
|
233 |
+
work need not make them do so.
|
234 |
+
|
235 |
+
A compilation of a covered work with other separate and independent
|
236 |
+
works, which are not by their nature extensions of the covered work,
|
237 |
+
and which are not combined with it such as to form a larger program,
|
238 |
+
in or on a volume of a storage or distribution medium, is called an
|
239 |
+
"aggregate" if the compilation and its resulting copyright are not
|
240 |
+
used to limit the access or legal rights of the compilation's users
|
241 |
+
beyond what the individual works permit. Inclusion of a covered work
|
242 |
+
in an aggregate does not cause this License to apply to the other
|
243 |
+
parts of the aggregate.
|
244 |
+
|
245 |
+
6. Conveying Non-Source Forms.
|
246 |
+
|
247 |
+
You may convey a covered work in object code form under the terms
|
248 |
+
of sections 4 and 5, provided that you also convey the
|
249 |
+
machine-readable Corresponding Source under the terms of this License,
|
250 |
+
in one of these ways:
|
251 |
+
|
252 |
+
a) Convey the object code in, or embodied in, a physical product
|
253 |
+
(including a physical distribution medium), accompanied by the
|
254 |
+
Corresponding Source fixed on a durable physical medium
|
255 |
+
customarily used for software interchange.
|
256 |
+
|
257 |
+
b) Convey the object code in, or embodied in, a physical product
|
258 |
+
(including a physical distribution medium), accompanied by a
|
259 |
+
written offer, valid for at least three years and valid for as
|
260 |
+
long as you offer spare parts or customer support for that product
|
261 |
+
model, to give anyone who possesses the object code either (1) a
|
262 |
+
copy of the Corresponding Source for all the software in the
|
263 |
+
product that is covered by this License, on a durable physical
|
264 |
+
medium customarily used for software interchange, for a price no
|
265 |
+
more than your reasonable cost of physically performing this
|
266 |
+
conveying of source, or (2) access to copy the
|
267 |
+
Corresponding Source from a network server at no charge.
|
268 |
+
|
269 |
+
c) Convey individual copies of the object code with a copy of the
|
270 |
+
written offer to provide the Corresponding Source. This
|
271 |
+
alternative is allowed only occasionally and noncommercially, and
|
272 |
+
only if you received the object code with such an offer, in accord
|
273 |
+
with subsection 6b.
|
274 |
+
|
275 |
+
d) Convey the object code by offering access from a designated
|
276 |
+
place (gratis or for a charge), and offer equivalent access to the
|
277 |
+
Corresponding Source in the same way through the same place at no
|
278 |
+
further charge. You need not require recipients to copy the
|
279 |
+
Corresponding Source along with the object code. If the place to
|
280 |
+
copy the object code is a network server, the Corresponding Source
|
281 |
+
may be on a different server (operated by you or a third party)
|
282 |
+
that supports equivalent copying facilities, provided you maintain
|
283 |
+
clear directions next to the object code saying where to find the
|
284 |
+
Corresponding Source. Regardless of what server hosts the
|
285 |
+
Corresponding Source, you remain obligated to ensure that it is
|
286 |
+
available for as long as needed to satisfy these requirements.
|
287 |
+
|
288 |
+
e) Convey the object code using peer-to-peer transmission, provided
|
289 |
+
you inform other peers where the object code and Corresponding
|
290 |
+
Source of the work are being offered to the general public at no
|
291 |
+
charge under subsection 6d.
|
292 |
+
|
293 |
+
A separable portion of the object code, whose source code is excluded
|
294 |
+
from the Corresponding Source as a System Library, need not be
|
295 |
+
included in conveying the object code work.
|
296 |
+
|
297 |
+
A "User Product" is either (1) a "consumer product", which means any
|
298 |
+
tangible personal property which is normally used for personal, family,
|
299 |
+
or household purposes, or (2) anything designed or sold for incorporation
|
300 |
+
into a dwelling. In determining whether a product is a consumer product,
|
301 |
+
doubtful cases shall be resolved in favor of coverage. For a particular
|
302 |
+
product received by a particular user, "normally used" refers to a
|
303 |
+
typical or common use of that class of product, regardless of the status
|
304 |
+
of the particular user or of the way in which the particular user
|
305 |
+
actually uses, or expects or is expected to use, the product. A product
|
306 |
+
is a consumer product regardless of whether the product has substantial
|
307 |
+
commercial, industrial or non-consumer uses, unless such uses represent
|
308 |
+
the only significant mode of use of the product.
|
309 |
+
|
310 |
+
"Installation Information" for a User Product means any methods,
|
311 |
+
procedures, authorization keys, or other information required to install
|
312 |
+
and execute modified versions of a covered work in that User Product from
|
313 |
+
a modified version of its Corresponding Source. The information must
|
314 |
+
suffice to ensure that the continued functioning of the modified object
|
315 |
+
code is in no case prevented or interfered with solely because
|
316 |
+
modification has been made.
|
317 |
+
|
318 |
+
If you convey an object code work under this section in, or with, or
|
319 |
+
specifically for use in, a User Product, and the conveying occurs as
|
320 |
+
part of a transaction in which the right of possession and use of the
|
321 |
+
User Product is transferred to the recipient in perpetuity or for a
|
322 |
+
fixed term (regardless of how the transaction is characterized), the
|
323 |
+
Corresponding Source conveyed under this section must be accompanied
|
324 |
+
by the Installation Information. But this requirement does not apply
|
325 |
+
if neither you nor any third party retains the ability to install
|
326 |
+
modified object code on the User Product (for example, the work has
|
327 |
+
been installed in ROM).
|
328 |
+
|
329 |
+
The requirement to provide Installation Information does not include a
|
330 |
+
requirement to continue to provide support service, warranty, or updates
|
331 |
+
for a work that has been modified or installed by the recipient, or for
|
332 |
+
the User Product in which it has been modified or installed. Access to a
|
333 |
+
network may be denied when the modification itself materially and
|
334 |
+
adversely affects the operation of the network or violates the rules and
|
335 |
+
protocols for communication across the network.
|
336 |
+
|
337 |
+
Corresponding Source conveyed, and Installation Information provided,
|
338 |
+
in accord with this section must be in a format that is publicly
|
339 |
+
documented (and with an implementation available to the public in
|
340 |
+
source code form), and must require no special password or key for
|
341 |
+
unpacking, reading or copying.
|
342 |
+
|
343 |
+
7. Additional Terms.
|
344 |
+
|
345 |
+
"Additional permissions" are terms that supplement the terms of this
|
346 |
+
License by making exceptions from one or more of its conditions.
|
347 |
+
Additional permissions that are applicable to the entire Program shall
|
348 |
+
be treated as though they were included in this License, to the extent
|
349 |
+
that they are valid under applicable law. If additional permissions
|
350 |
+
apply only to part of the Program, that part may be used separately
|
351 |
+
under those permissions, but the entire Program remains governed by
|
352 |
+
this License without regard to the additional permissions.
|
353 |
+
|
354 |
+
When you convey a copy of a covered work, you may at your option
|
355 |
+
remove any additional permissions from that copy, or from any part of
|
356 |
+
it. (Additional permissions may be written to require their own
|
357 |
+
removal in certain cases when you modify the work.) You may place
|
358 |
+
additional permissions on material, added by you to a covered work,
|
359 |
+
for which you have or can give appropriate copyright permission.
|
360 |
+
|
361 |
+
Notwithstanding any other provision of this License, for material you
|
362 |
+
add to a covered work, you may (if authorized by the copyright holders of
|
363 |
+
that material) supplement the terms of this License with terms:
|
364 |
+
|
365 |
+
a) Disclaiming warranty or limiting liability differently from the
|
366 |
+
terms of sections 15 and 16 of this License; or
|
367 |
+
|
368 |
+
b) Requiring preservation of specified reasonable legal notices or
|
369 |
+
author attributions in that material or in the Appropriate Legal
|
370 |
+
Notices displayed by works containing it; or
|
371 |
+
|
372 |
+
c) Prohibiting misrepresentation of the origin of that material, or
|
373 |
+
requiring that modified versions of such material be marked in
|
374 |
+
reasonable ways as different from the original version; or
|
375 |
+
|
376 |
+
d) Limiting the use for publicity purposes of names of licensors or
|
377 |
+
authors of the material; or
|
378 |
+
|
379 |
+
e) Declining to grant rights under trademark law for use of some
|
380 |
+
trade names, trademarks, or service marks; or
|
381 |
+
|
382 |
+
f) Requiring indemnification of licensors and authors of that
|
383 |
+
material by anyone who conveys the material (or modified versions of
|
384 |
+
it) with contractual assumptions of liability to the recipient, for
|
385 |
+
any liability that these contractual assumptions directly impose on
|
386 |
+
those licensors and authors.
|
387 |
+
|
388 |
+
All other non-permissive additional terms are considered "further
|
389 |
+
restrictions" within the meaning of section 10. If the Program as you
|
390 |
+
received it, or any part of it, contains a notice stating that it is
|
391 |
+
governed by this License along with a term that is a further
|
392 |
+
restriction, you may remove that term. If a license document contains
|
393 |
+
a further restriction but permits relicensing or conveying under this
|
394 |
+
License, you may add to a covered work material governed by the terms
|
395 |
+
of that license document, provided that the further restriction does
|
396 |
+
not survive such relicensing or conveying.
|
397 |
+
|
398 |
+
If you add terms to a covered work in accord with this section, you
|
399 |
+
must place, in the relevant source files, a statement of the
|
400 |
+
additional terms that apply to those files, or a notice indicating
|
401 |
+
where to find the applicable terms.
|
402 |
+
|
403 |
+
Additional terms, permissive or non-permissive, may be stated in the
|
404 |
+
form of a separately written license, or stated as exceptions;
|
405 |
+
the above requirements apply either way.
|
406 |
+
|
407 |
+
8. Termination.
|
408 |
+
|
409 |
+
You may not propagate or modify a covered work except as expressly
|
410 |
+
provided under this License. Any attempt otherwise to propagate or
|
411 |
+
modify it is void, and will automatically terminate your rights under
|
412 |
+
this License (including any patent licenses granted under the third
|
413 |
+
paragraph of section 11).
|
414 |
+
|
415 |
+
However, if you cease all violation of this License, then your
|
416 |
+
license from a particular copyright holder is reinstated (a)
|
417 |
+
provisionally, unless and until the copyright holder explicitly and
|
418 |
+
finally terminates your license, and (b) permanently, if the copyright
|
419 |
+
holder fails to notify you of the violation by some reasonable means
|
420 |
+
prior to 60 days after the cessation.
|
421 |
+
|
422 |
+
Moreover, your license from a particular copyright holder is
|
423 |
+
reinstated permanently if the copyright holder notifies you of the
|
424 |
+
violation by some reasonable means, this is the first time you have
|
425 |
+
received notice of violation of this License (for any work) from that
|
426 |
+
copyright holder, and you cure the violation prior to 30 days after
|
427 |
+
your receipt of the notice.
|
428 |
+
|
429 |
+
Termination of your rights under this section does not terminate the
|
430 |
+
licenses of parties who have received copies or rights from you under
|
431 |
+
this License. If your rights have been terminated and not permanently
|
432 |
+
reinstated, you do not qualify to receive new licenses for the same
|
433 |
+
material under section 10.
|
434 |
+
|
435 |
+
9. Acceptance Not Required for Having Copies.
|
436 |
+
|
437 |
+
You are not required to accept this License in order to receive or
|
438 |
+
run a copy of the Program. Ancillary propagation of a covered work
|
439 |
+
occurring solely as a consequence of using peer-to-peer transmission
|
440 |
+
to receive a copy likewise does not require acceptance. However,
|
441 |
+
nothing other than this License grants you permission to propagate or
|
442 |
+
modify any covered work. These actions infringe copyright if you do
|
443 |
+
not accept this License. Therefore, by modifying or propagating a
|
444 |
+
covered work, you indicate your acceptance of this License to do so.
|
445 |
+
|
446 |
+
10. Automatic Licensing of Downstream Recipients.
|
447 |
+
|
448 |
+
Each time you convey a covered work, the recipient automatically
|
449 |
+
receives a license from the original licensors, to run, modify and
|
450 |
+
propagate that work, subject to this License. You are not responsible
|
451 |
+
for enforcing compliance by third parties with this License.
|
452 |
+
|
453 |
+
An "entity transaction" is a transaction transferring control of an
|
454 |
+
organization, or substantially all assets of one, or subdividing an
|
455 |
+
organization, or merging organizations. If propagation of a covered
|
456 |
+
work results from an entity transaction, each party to that
|
457 |
+
transaction who receives a copy of the work also receives whatever
|
458 |
+
licenses to the work the party's predecessor in interest had or could
|
459 |
+
give under the previous paragraph, plus a right to possession of the
|
460 |
+
Corresponding Source of the work from the predecessor in interest, if
|
461 |
+
the predecessor has it or can get it with reasonable efforts.
|
462 |
+
|
463 |
+
You may not impose any further restrictions on the exercise of the
|
464 |
+
rights granted or affirmed under this License. For example, you may
|
465 |
+
not impose a license fee, royalty, or other charge for exercise of
|
466 |
+
rights granted under this License, and you may not initiate litigation
|
467 |
+
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
468 |
+
any patent claim is infringed by making, using, selling, offering for
|
469 |
+
sale, or importing the Program or any portion of it.
|
470 |
+
|
471 |
+
11. Patents.
|
472 |
+
|
473 |
+
A "contributor" is a copyright holder who authorizes use under this
|
474 |
+
License of the Program or a work on which the Program is based. The
|
475 |
+
work thus licensed is called the contributor's "contributor version".
|
476 |
+
|
477 |
+
A contributor's "essential patent claims" are all patent claims
|
478 |
+
owned or controlled by the contributor, whether already acquired or
|
479 |
+
hereafter acquired, that would be infringed by some manner, permitted
|
480 |
+
by this License, of making, using, or selling its contributor version,
|
481 |
+
but do not include claims that would be infringed only as a
|
482 |
+
consequence of further modification of the contributor version. For
|
483 |
+
purposes of this definition, "control" includes the right to grant
|
484 |
+
patent sublicenses in a manner consistent with the requirements of
|
485 |
+
this License.
|
486 |
+
|
487 |
+
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
488 |
+
patent license under the contributor's essential patent claims, to
|
489 |
+
make, use, sell, offer for sale, import and otherwise run, modify and
|
490 |
+
propagate the contents of its contributor version.
|
491 |
+
|
492 |
+
In the following three paragraphs, a "patent license" is any express
|
493 |
+
agreement or commitment, however denominated, not to enforce a patent
|
494 |
+
(such as an express permission to practice a patent or covenant not to
|
495 |
+
sue for patent infringement). To "grant" such a patent license to a
|
496 |
+
party means to make such an agreement or commitment not to enforce a
|
497 |
+
patent against the party.
|
498 |
+
|
499 |
+
If you convey a covered work, knowingly relying on a patent license,
|
500 |
+
and the Corresponding Source of the work is not available for anyone
|
501 |
+
to copy, free of charge and under the terms of this License, through a
|
502 |
+
publicly available network server or other readily accessible means,
|
503 |
+
then you must either (1) cause the Corresponding Source to be so
|
504 |
+
available, or (2) arrange to deprive yourself of the benefit of the
|
505 |
+
patent license for this particular work, or (3) arrange, in a manner
|
506 |
+
consistent with the requirements of this License, to extend the patent
|
507 |
+
license to downstream recipients. "Knowingly relying" means you have
|
508 |
+
actual knowledge that, but for the patent license, your conveying the
|
509 |
+
covered work in a country, or your recipient's use of the covered work
|
510 |
+
in a country, would infringe one or more identifiable patents in that
|
511 |
+
country that you have reason to believe are valid.
|
512 |
+
|
513 |
+
If, pursuant to or in connection with a single transaction or
|
514 |
+
arrangement, you convey, or propagate by procuring conveyance of, a
|
515 |
+
covered work, and grant a patent license to some of the parties
|
516 |
+
receiving the covered work authorizing them to use, propagate, modify
|
517 |
+
or convey a specific copy of the covered work, then the patent license
|
518 |
+
you grant is automatically extended to all recipients of the covered
|
519 |
+
work and works based on it.
|
520 |
+
|
521 |
+
A patent license is "discriminatory" if it does not include within
|
522 |
+
the scope of its coverage, prohibits the exercise of, or is
|
523 |
+
conditioned on the non-exercise of one or more of the rights that are
|
524 |
+
specifically granted under this License. You may not convey a covered
|
525 |
+
work if you are a party to an arrangement with a third party that is
|
526 |
+
in the business of distributing software, under which you make payment
|
527 |
+
to the third party based on the extent of your activity of conveying
|
528 |
+
the work, and under which the third party grants, to any of the
|
529 |
+
parties who would receive the covered work from you, a discriminatory
|
530 |
+
patent license (a) in connection with copies of the covered work
|
531 |
+
conveyed by you (or copies made from those copies), or (b) primarily
|
532 |
+
for and in connection with specific products or compilations that
|
533 |
+
contain the covered work, unless you entered into that arrangement,
|
534 |
+
or that patent license was granted, prior to 28 March 2007.
|
535 |
+
|
536 |
+
Nothing in this License shall be construed as excluding or limiting
|
537 |
+
any implied license or other defenses to infringement that may
|
538 |
+
otherwise be available to you under applicable patent law.
|
539 |
+
|
540 |
+
12. No Surrender of Others' Freedom.
|
541 |
+
|
542 |
+
If conditions are imposed on you (whether by court order, agreement or
|
543 |
+
otherwise) that contradict the conditions of this License, they do not
|
544 |
+
excuse you from the conditions of this License. If you cannot convey a
|
545 |
+
covered work so as to satisfy simultaneously your obligations under this
|
546 |
+
License and any other pertinent obligations, then as a consequence you may
|
547 |
+
not convey it at all. For example, if you agree to terms that obligate you
|
548 |
+
to collect a royalty for further conveying from those to whom you convey
|
549 |
+
the Program, the only way you could satisfy both those terms and this
|
550 |
+
License would be to refrain entirely from conveying the Program.
|
551 |
+
|
552 |
+
13. Use with the GNU Affero General Public License.
|
553 |
+
|
554 |
+
Notwithstanding any other provision of this License, you have
|
555 |
+
permission to link or combine any covered work with a work licensed
|
556 |
+
under version 3 of the GNU Affero General Public License into a single
|
557 |
+
combined work, and to convey the resulting work. The terms of this
|
558 |
+
License will continue to apply to the part which is the covered work,
|
559 |
+
but the special requirements of the GNU Affero General Public License,
|
560 |
+
section 13, concerning interaction through a network will apply to the
|
561 |
+
combination as such.
|
562 |
+
|
563 |
+
14. Revised Versions of this License.
|
564 |
+
|
565 |
+
The Free Software Foundation may publish revised and/or new versions of
|
566 |
+
the GNU General Public License from time to time. Such new versions will
|
567 |
+
be similar in spirit to the present version, but may differ in detail to
|
568 |
+
address new problems or concerns.
|
569 |
+
|
570 |
+
Each version is given a distinguishing version number. If the
|
571 |
+
Program specifies that a certain numbered version of the GNU General
|
572 |
+
Public License "or any later version" applies to it, you have the
|
573 |
+
option of following the terms and conditions either of that numbered
|
574 |
+
version or of any later version published by the Free Software
|
575 |
+
Foundation. If the Program does not specify a version number of the
|
576 |
+
GNU General Public License, you may choose any version ever published
|
577 |
+
by the Free Software Foundation.
|
578 |
+
|
579 |
+
If the Program specifies that a proxy can decide which future
|
580 |
+
versions of the GNU General Public License can be used, that proxy's
|
581 |
+
public statement of acceptance of a version permanently authorizes you
|
582 |
+
to choose that version for the Program.
|
583 |
+
|
584 |
+
Later license versions may give you additional or different
|
585 |
+
permissions. However, no additional obligations are imposed on any
|
586 |
+
author or copyright holder as a result of your choosing to follow a
|
587 |
+
later version.
|
588 |
+
|
589 |
+
15. Disclaimer of Warranty.
|
590 |
+
|
591 |
+
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
592 |
+
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
593 |
+
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
594 |
+
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
595 |
+
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
596 |
+
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
597 |
+
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
598 |
+
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
599 |
+
|
600 |
+
16. Limitation of Liability.
|
601 |
+
|
602 |
+
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
603 |
+
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
604 |
+
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
605 |
+
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
606 |
+
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
607 |
+
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
608 |
+
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
609 |
+
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
610 |
+
SUCH DAMAGES.
|
611 |
+
|
612 |
+
17. Interpretation of Sections 15 and 16.
|
613 |
+
|
614 |
+
If the disclaimer of warranty and limitation of liability provided
|
615 |
+
above cannot be given local legal effect according to their terms,
|
616 |
+
reviewing courts shall apply local law that most closely approximates
|
617 |
+
an absolute waiver of all civil liability in connection with the
|
618 |
+
Program, unless a warranty or assumption of liability accompanies a
|
619 |
+
copy of the Program in return for a fee.
|
620 |
+
|
621 |
+
END OF TERMS AND CONDITIONS
|
622 |
+
|
623 |
+
How to Apply These Terms to Your New Programs
|
624 |
+
|
625 |
+
If you develop a new program, and you want it to be of the greatest
|
626 |
+
possible use to the public, the best way to achieve this is to make it
|
627 |
+
free software which everyone can redistribute and change under these terms.
|
628 |
+
|
629 |
+
To do so, attach the following notices to the program. It is safest
|
630 |
+
to attach them to the start of each source file to most effectively
|
631 |
+
state the exclusion of warranty; and each file should have at least
|
632 |
+
the "copyright" line and a pointer to where the full notice is found.
|
633 |
+
|
634 |
+
{one line to give the program's name and a brief idea of what it does.}
|
635 |
+
Copyright (C) {year} {name of author}
|
636 |
+
|
637 |
+
This program is free software: you can redistribute it and/or modify
|
638 |
+
it under the terms of the GNU General Public License as published by
|
639 |
+
the Free Software Foundation, either version 3 of the License, or
|
640 |
+
(at your option) any later version.
|
641 |
+
|
642 |
+
This program is distributed in the hope that it will be useful,
|
643 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
644 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
645 |
+
GNU General Public License for more details.
|
646 |
+
|
647 |
+
You should have received a copy of the GNU General Public License
|
648 |
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
649 |
+
|
650 |
+
Also add information on how to contact you by electronic and paper mail.
|
651 |
+
|
652 |
+
If the program does terminal interaction, make it output a short
|
653 |
+
notice like this when it starts in an interactive mode:
|
654 |
+
|
655 |
+
{project} Copyright (C) {year} {fullname}
|
656 |
+
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
657 |
+
This is free software, and you are welcome to redistribute it
|
658 |
+
under certain conditions; type `show c' for details.
|
659 |
+
|
660 |
+
The hypothetical commands `show w' and `show c' should show the appropriate
|
661 |
+
parts of the General Public License. Of course, your program's commands
|
662 |
+
might be different; for a GUI interface, you would use an "about box".
|
663 |
+
|
664 |
+
You should also get your employer (if you work as a programmer) or school,
|
665 |
+
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
666 |
+
For more information on this, and how to apply and follow the GNU GPL, see
|
667 |
+
<http://www.gnu.org/licenses/>.
|
668 |
+
|
669 |
+
The GNU General Public License does not permit incorporating your program
|
670 |
+
into proprietary programs. If your program is a subroutine library, you
|
671 |
+
may consider it more useful to permit linking proprietary applications with
|
672 |
+
the library. If this is what you want to do, use the GNU Lesser General
|
673 |
+
Public License instead of this License. But first, please read
|
674 |
+
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
assets/js/cherry-search.js
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
CherryJsCore.utilites.namespace( 'cherrySearch' );
|
5 |
CherryJsCore.cherrySearch = {
|
6 |
settings: {
|
7 |
-
searchFormWrapperClass: '.cherry-search',
|
8 |
searchFormClass: '.cherry-search__form',
|
9 |
inputClass: '.cherry-search__field',
|
10 |
submitClass: '.cherry-search__submit',
|
@@ -34,10 +34,11 @@
|
|
34 |
settings = args,
|
35 |
messages = window.cherrySearchMessages,
|
36 |
timer = null,
|
37 |
-
itemTemplate =
|
38 |
resultsList = $( settings.listClass, self ),
|
39 |
messageHolder = $( settings.messageHolder, resultsList ),
|
40 |
-
spinner = $( settings.spinner, resultsList )
|
|
|
41 |
|
42 |
if ( ! self.isInit ) {
|
43 |
self.isInit = true;
|
@@ -54,7 +55,8 @@
|
|
54 |
|
55 |
clearTimeout( timer );
|
56 |
timer = setTimeout( function() {
|
57 |
-
|
|
|
58 |
}, 450 );
|
59 |
} else {
|
60 |
self.hideList();
|
@@ -78,6 +80,7 @@
|
|
78 |
if ( 'more_button' === post ) {
|
79 |
outputHtml += posts[ post ];
|
80 |
} else {
|
|
|
81 |
outputHtml += itemTemplate( posts[ post ] );
|
82 |
}
|
83 |
}
|
@@ -131,7 +134,8 @@
|
|
131 |
|
132 |
$( settings.inputClass, self )
|
133 |
.on( 'input', self.inputChangeHandler )
|
134 |
-
.on( 'focus', self.focusHandler )
|
|
|
135 |
|
136 |
$( self )
|
137 |
.on( 'click' + settings.searchFormWrapperClass, self.formClick )
|
4 |
CherryJsCore.utilites.namespace( 'cherrySearch' );
|
5 |
CherryJsCore.cherrySearch = {
|
6 |
settings: {
|
7 |
+
searchFormWrapperClass: '.cherry-search-wrapper',
|
8 |
searchFormClass: '.cherry-search__form',
|
9 |
inputClass: '.cherry-search__field',
|
10 |
submitClass: '.cherry-search__submit',
|
34 |
settings = args,
|
35 |
messages = window.cherrySearchMessages,
|
36 |
timer = null,
|
37 |
+
itemTemplate = null,
|
38 |
resultsList = $( settings.listClass, self ),
|
39 |
messageHolder = $( settings.messageHolder, resultsList ),
|
40 |
+
spinner = $( settings.spinner, resultsList ),
|
41 |
+
data = $( self ).data( 'args' ) || [];
|
42 |
|
43 |
if ( ! self.isInit ) {
|
44 |
self.isInit = true;
|
55 |
|
56 |
clearTimeout( timer );
|
57 |
timer = setTimeout( function() {
|
58 |
+
data.value = value;
|
59 |
+
self.searchAjaxInstancer.sendData( data );
|
60 |
}, 450 );
|
61 |
} else {
|
62 |
self.hideList();
|
80 |
if ( 'more_button' === post ) {
|
81 |
outputHtml += posts[ post ];
|
82 |
} else {
|
83 |
+
itemTemplate = wp.template( 'search-form-results-item-' + data.id );
|
84 |
outputHtml += itemTemplate( posts[ post ] );
|
85 |
}
|
86 |
}
|
134 |
|
135 |
$( settings.inputClass, self )
|
136 |
.on( 'input', self.inputChangeHandler )
|
137 |
+
.on( 'focus', self.focusHandler )
|
138 |
+
/*.on( 'blur', self.hideList )*/;
|
139 |
|
140 |
$( self )
|
141 |
.on( 'click' + settings.searchFormWrapperClass, self.formClick )
|
assets/js/min/cherry-search.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(s,r){"use strict";r.utilites.namespace("cherrySearch"),r.cherrySearch={settings:{searchFormWrapperClass:".cherry-search",searchFormClass:".cherry-search__form",inputClass:".cherry-search__field",submitClass:".cherry-search__submit",listClass:".cherry-search__results-list",itemClass:".cherry-search__results-item",messageHolder:".cherry-search__message",spinner:".cherry-search__spinner",moreButton:".cherry-search__more-button",searchHandlerId:"cherry_search_public_action"},init:function(){s("body").on("focus"+this.settings.searchFormWrapperClass,this.settings.inputClass,this.initCherrySearch.bind(this))},initCherrySearch:function(r){var e=s(r.target).closest(this.settings.searchFormWrapperClass);e.cherrySearch(this.settings)}},r.cherrySearch.init(),s.fn.cherrySearch=function(e){var a=this[0],t=e,o=window.cherrySearchMessages,c=null,n=
|
1 |
+
!function(s,r){"use strict";r.utilites.namespace("cherrySearch"),r.cherrySearch={settings:{searchFormWrapperClass:".cherry-search-wrapper",searchFormClass:".cherry-search__form",inputClass:".cherry-search__field",submitClass:".cherry-search__submit",listClass:".cherry-search__results-list",itemClass:".cherry-search__results-item",messageHolder:".cherry-search__message",spinner:".cherry-search__spinner",moreButton:".cherry-search__more-button",searchHandlerId:"cherry_search_public_action"},init:function(){s("body").on("focus"+this.settings.searchFormWrapperClass,this.settings.inputClass,this.initCherrySearch.bind(this))},initCherrySearch:function(r){var e=s(r.target).closest(this.settings.searchFormWrapperClass);e.cherrySearch(this.settings)}},r.cherrySearch.init(),s.fn.cherrySearch=function(e){var a=this[0],t=e,o=window.cherrySearchMessages,c=null,n=null,i=s(t.listClass,a),l=s(t.messageHolder,i),h=s(t.spinner,i),u=s(a).data("args")||[];return a.isInit?"is init: true":(a.isInit=!0,a.inputChangeHandler=function(r){var e=r.target.value;s("ul",i).html(""),a.outputMessage("",""),e?(a.showList(),h.addClass("show"),clearTimeout(c),c=setTimeout(function(){u.value=e,a.searchAjaxInstancer.sendData(u)},450)):a.hideList()},a.successCallback=function(r){var e=r.data,t=e.error,c=e.message,m=e.posts,C=null,p="";if("error-notice"!==r.type){if(0===e.post_count||t)a.outputMessage(c,"show");else{l.removeClass("show");for(C in m)"more_button"===C?p+=m[C]:(n=wp.template("search-form-results-item-"+u.id),p+=n(m[C]))}h.removeClass("show"),s("ul",i).html(p)}else a.outputMessage(o.serverError,"error show")},a.errorCallback=function(s){"abort"!==s.statusText&&(h.removeClass("show"),a.outputMessage(o.serverError,"error show"))},a.hideList=function(){i.removeClass("show")},a.showList=function(){i.addClass("show")},a.focusHandler=function(){0!==s("ul > li",i).length&&a.showList()},a.outputMessage=function(s,r){l.removeClass("error show").addClass(r).html(s)},a.formClick=function(s){s.stopPropagation()},a.clickMoreButton=function(){s(t.searchFormClass,a).submit()},a.searchAjaxInstancer=new r.CherryAjaxHandler({handlerId:t.searchHandlerId,successCallback:a.successCallback,errorCallback:a.errorCallback}),s(t.inputClass,a).on("input",a.inputChangeHandler).on("focus",a.focusHandler),s(a).on("click"+t.searchFormWrapperClass,a.formClick).on("click"+t.searchFormWrapperClass,t.moreButton,a.clickMoreButton),s("body").on("click"+t.searchFormWrapperClass,a.hideList),void 0)}}(jQuery,window.CherryJsCore);
|
cherry-framework/LICENSE
ADDED
@@ -0,0 +1,674 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
GNU GENERAL PUBLIC LICENSE
|
2 |
+
Version 3, 29 June 2007
|
3 |
+
|
4 |
+
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
5 |
+
Everyone is permitted to copy and distribute verbatim copies
|
6 |
+
of this license document, but changing it is not allowed.
|
7 |
+
|
8 |
+
Preamble
|
9 |
+
|
10 |
+
The GNU General Public License is a free, copyleft license for
|
11 |
+
software and other kinds of works.
|
12 |
+
|
13 |
+
The licenses for most software and other practical works are designed
|
14 |
+
to take away your freedom to share and change the works. By contrast,
|
15 |
+
the GNU General Public License is intended to guarantee your freedom to
|
16 |
+
share and change all versions of a program--to make sure it remains free
|
17 |
+
software for all its users. We, the Free Software Foundation, use the
|
18 |
+
GNU General Public License for most of our software; it applies also to
|
19 |
+
any other work released this way by its authors. You can apply it to
|
20 |
+
your programs, too.
|
21 |
+
|
22 |
+
When we speak of free software, we are referring to freedom, not
|
23 |
+
price. Our General Public Licenses are designed to make sure that you
|
24 |
+
have the freedom to distribute copies of free software (and charge for
|
25 |
+
them if you wish), that you receive source code or can get it if you
|
26 |
+
want it, that you can change the software or use pieces of it in new
|
27 |
+
free programs, and that you know you can do these things.
|
28 |
+
|
29 |
+
To protect your rights, we need to prevent others from denying you
|
30 |
+
these rights or asking you to surrender the rights. Therefore, you have
|
31 |
+
certain responsibilities if you distribute copies of the software, or if
|
32 |
+
you modify it: responsibilities to respect the freedom of others.
|
33 |
+
|
34 |
+
For example, if you distribute copies of such a program, whether
|
35 |
+
gratis or for a fee, you must pass on to the recipients the same
|
36 |
+
freedoms that you received. You must make sure that they, too, receive
|
37 |
+
or can get the source code. And you must show them these terms so they
|
38 |
+
know their rights.
|
39 |
+
|
40 |
+
Developers that use the GNU GPL protect your rights with two steps:
|
41 |
+
(1) assert copyright on the software, and (2) offer you this License
|
42 |
+
giving you legal permission to copy, distribute and/or modify it.
|
43 |
+
|
44 |
+
For the developers' and authors' protection, the GPL clearly explains
|
45 |
+
that there is no warranty for this free software. For both users' and
|
46 |
+
authors' sake, the GPL requires that modified versions be marked as
|
47 |
+
changed, so that their problems will not be attributed erroneously to
|
48 |
+
authors of previous versions.
|
49 |
+
|
50 |
+
Some devices are designed to deny users access to install or run
|
51 |
+
modified versions of the software inside them, although the manufacturer
|
52 |
+
can do so. This is fundamentally incompatible with the aim of
|
53 |
+
protecting users' freedom to change the software. The systematic
|
54 |
+
pattern of such abuse occurs in the area of products for individuals to
|
55 |
+
use, which is precisely where it is most unacceptable. Therefore, we
|
56 |
+
have designed this version of the GPL to prohibit the practice for those
|
57 |
+
products. If such problems arise substantially in other domains, we
|
58 |
+
stand ready to extend this provision to those domains in future versions
|
59 |
+
of the GPL, as needed to protect the freedom of users.
|
60 |
+
|
61 |
+
Finally, every program is threatened constantly by software patents.
|
62 |
+
States should not allow patents to restrict development and use of
|
63 |
+
software on general-purpose computers, but in those that do, we wish to
|
64 |
+
avoid the special danger that patents applied to a free program could
|
65 |
+
make it effectively proprietary. To prevent this, the GPL assures that
|
66 |
+
patents cannot be used to render the program non-free.
|
67 |
+
|
68 |
+
The precise terms and conditions for copying, distribution and
|
69 |
+
modification follow.
|
70 |
+
|
71 |
+
TERMS AND CONDITIONS
|
72 |
+
|
73 |
+
0. Definitions.
|
74 |
+
|
75 |
+
"This License" refers to version 3 of the GNU General Public License.
|
76 |
+
|
77 |
+
"Copyright" also means copyright-like laws that apply to other kinds of
|
78 |
+
works, such as semiconductor masks.
|
79 |
+
|
80 |
+
"The Program" refers to any copyrightable work licensed under this
|
81 |
+
License. Each licensee is addressed as "you". "Licensees" and
|
82 |
+
"recipients" may be individuals or organizations.
|
83 |
+
|
84 |
+
To "modify" a work means to copy from or adapt all or part of the work
|
85 |
+
in a fashion requiring copyright permission, other than the making of an
|
86 |
+
exact copy. The resulting work is called a "modified version" of the
|
87 |
+
earlier work or a work "based on" the earlier work.
|
88 |
+
|
89 |
+
A "covered work" means either the unmodified Program or a work based
|
90 |
+
on the Program.
|
91 |
+
|
92 |
+
To "propagate" a work means to do anything with it that, without
|
93 |
+
permission, would make you directly or secondarily liable for
|
94 |
+
infringement under applicable copyright law, except executing it on a
|
95 |
+
computer or modifying a private copy. Propagation includes copying,
|
96 |
+
distribution (with or without modification), making available to the
|
97 |
+
public, and in some countries other activities as well.
|
98 |
+
|
99 |
+
To "convey" a work means any kind of propagation that enables other
|
100 |
+
parties to make or receive copies. Mere interaction with a user through
|
101 |
+
a computer network, with no transfer of a copy, is not conveying.
|
102 |
+
|
103 |
+
An interactive user interface displays "Appropriate Legal Notices"
|
104 |
+
to the extent that it includes a convenient and prominently visible
|
105 |
+
feature that (1) displays an appropriate copyright notice, and (2)
|
106 |
+
tells the user that there is no warranty for the work (except to the
|
107 |
+
extent that warranties are provided), that licensees may convey the
|
108 |
+
work under this License, and how to view a copy of this License. If
|
109 |
+
the interface presents a list of user commands or options, such as a
|
110 |
+
menu, a prominent item in the list meets this criterion.
|
111 |
+
|
112 |
+
1. Source Code.
|
113 |
+
|
114 |
+
The "source code" for a work means the preferred form of the work
|
115 |
+
for making modifications to it. "Object code" means any non-source
|
116 |
+
form of a work.
|
117 |
+
|
118 |
+
A "Standard Interface" means an interface that either is an official
|
119 |
+
standard defined by a recognized standards body, or, in the case of
|
120 |
+
interfaces specified for a particular programming language, one that
|
121 |
+
is widely used among developers working in that language.
|
122 |
+
|
123 |
+
The "System Libraries" of an executable work include anything, other
|
124 |
+
than the work as a whole, that (a) is included in the normal form of
|
125 |
+
packaging a Major Component, but which is not part of that Major
|
126 |
+
Component, and (b) serves only to enable use of the work with that
|
127 |
+
Major Component, or to implement a Standard Interface for which an
|
128 |
+
implementation is available to the public in source code form. A
|
129 |
+
"Major Component", in this context, means a major essential component
|
130 |
+
(kernel, window system, and so on) of the specific operating system
|
131 |
+
(if any) on which the executable work runs, or a compiler used to
|
132 |
+
produce the work, or an object code interpreter used to run it.
|
133 |
+
|
134 |
+
The "Corresponding Source" for a work in object code form means all
|
135 |
+
the source code needed to generate, install, and (for an executable
|
136 |
+
work) run the object code and to modify the work, including scripts to
|
137 |
+
control those activities. However, it does not include the work's
|
138 |
+
System Libraries, or general-purpose tools or generally available free
|
139 |
+
programs which are used unmodified in performing those activities but
|
140 |
+
which are not part of the work. For example, Corresponding Source
|
141 |
+
includes interface definition files associated with source files for
|
142 |
+
the work, and the source code for shared libraries and dynamically
|
143 |
+
linked subprograms that the work is specifically designed to require,
|
144 |
+
such as by intimate data communication or control flow between those
|
145 |
+
subprograms and other parts of the work.
|
146 |
+
|
147 |
+
The Corresponding Source need not include anything that users
|
148 |
+
can regenerate automatically from other parts of the Corresponding
|
149 |
+
Source.
|
150 |
+
|
151 |
+
The Corresponding Source for a work in source code form is that
|
152 |
+
same work.
|
153 |
+
|
154 |
+
2. Basic Permissions.
|
155 |
+
|
156 |
+
All rights granted under this License are granted for the term of
|
157 |
+
copyright on the Program, and are irrevocable provided the stated
|
158 |
+
conditions are met. This License explicitly affirms your unlimited
|
159 |
+
permission to run the unmodified Program. The output from running a
|
160 |
+
covered work is covered by this License only if the output, given its
|
161 |
+
content, constitutes a covered work. This License acknowledges your
|
162 |
+
rights of fair use or other equivalent, as provided by copyright law.
|
163 |
+
|
164 |
+
You may make, run and propagate covered works that you do not
|
165 |
+
convey, without conditions so long as your license otherwise remains
|
166 |
+
in force. You may convey covered works to others for the sole purpose
|
167 |
+
of having them make modifications exclusively for you, or provide you
|
168 |
+
with facilities for running those works, provided that you comply with
|
169 |
+
the terms of this License in conveying all material for which you do
|
170 |
+
not control copyright. Those thus making or running the covered works
|
171 |
+
for you must do so exclusively on your behalf, under your direction
|
172 |
+
and control, on terms that prohibit them from making any copies of
|
173 |
+
your copyrighted material outside their relationship with you.
|
174 |
+
|
175 |
+
Conveying under any other circumstances is permitted solely under
|
176 |
+
the conditions stated below. Sublicensing is not allowed; section 10
|
177 |
+
makes it unnecessary.
|
178 |
+
|
179 |
+
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
180 |
+
|
181 |
+
No covered work shall be deemed part of an effective technological
|
182 |
+
measure under any applicable law fulfilling obligations under article
|
183 |
+
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
184 |
+
similar laws prohibiting or restricting circumvention of such
|
185 |
+
measures.
|
186 |
+
|
187 |
+
When you convey a covered work, you waive any legal power to forbid
|
188 |
+
circumvention of technological measures to the extent such circumvention
|
189 |
+
is effected by exercising rights under this License with respect to
|
190 |
+
the covered work, and you disclaim any intention to limit operation or
|
191 |
+
modification of the work as a means of enforcing, against the work's
|
192 |
+
users, your or third parties' legal rights to forbid circumvention of
|
193 |
+
technological measures.
|
194 |
+
|
195 |
+
4. Conveying Verbatim Copies.
|
196 |
+
|
197 |
+
You may convey verbatim copies of the Program's source code as you
|
198 |
+
receive it, in any medium, provided that you conspicuously and
|
199 |
+
appropriately publish on each copy an appropriate copyright notice;
|
200 |
+
keep intact all notices stating that this License and any
|
201 |
+
non-permissive terms added in accord with section 7 apply to the code;
|
202 |
+
keep intact all notices of the absence of any warranty; and give all
|
203 |
+
recipients a copy of this License along with the Program.
|
204 |
+
|
205 |
+
You may charge any price or no price for each copy that you convey,
|
206 |
+
and you may offer support or warranty protection for a fee.
|
207 |
+
|
208 |
+
5. Conveying Modified Source Versions.
|
209 |
+
|
210 |
+
You may convey a work based on the Program, or the modifications to
|
211 |
+
produce it from the Program, in the form of source code under the
|
212 |
+
terms of section 4, provided that you also meet all of these conditions:
|
213 |
+
|
214 |
+
a) The work must carry prominent notices stating that you modified
|
215 |
+
it, and giving a relevant date.
|
216 |
+
|
217 |
+
b) The work must carry prominent notices stating that it is
|
218 |
+
released under this License and any conditions added under section
|
219 |
+
7. This requirement modifies the requirement in section 4 to
|
220 |
+
"keep intact all notices".
|
221 |
+
|
222 |
+
c) You must license the entire work, as a whole, under this
|
223 |
+
License to anyone who comes into possession of a copy. This
|
224 |
+
License will therefore apply, along with any applicable section 7
|
225 |
+
additional terms, to the whole of the work, and all its parts,
|
226 |
+
regardless of how they are packaged. This License gives no
|
227 |
+
permission to license the work in any other way, but it does not
|
228 |
+
invalidate such permission if you have separately received it.
|
229 |
+
|
230 |
+
d) If the work has interactive user interfaces, each must display
|
231 |
+
Appropriate Legal Notices; however, if the Program has interactive
|
232 |
+
interfaces that do not display Appropriate Legal Notices, your
|
233 |
+
work need not make them do so.
|
234 |
+
|
235 |
+
A compilation of a covered work with other separate and independent
|
236 |
+
works, which are not by their nature extensions of the covered work,
|
237 |
+
and which are not combined with it such as to form a larger program,
|
238 |
+
in or on a volume of a storage or distribution medium, is called an
|
239 |
+
"aggregate" if the compilation and its resulting copyright are not
|
240 |
+
used to limit the access or legal rights of the compilation's users
|
241 |
+
beyond what the individual works permit. Inclusion of a covered work
|
242 |
+
in an aggregate does not cause this License to apply to the other
|
243 |
+
parts of the aggregate.
|
244 |
+
|
245 |
+
6. Conveying Non-Source Forms.
|
246 |
+
|
247 |
+
You may convey a covered work in object code form under the terms
|
248 |
+
of sections 4 and 5, provided that you also convey the
|
249 |
+
machine-readable Corresponding Source under the terms of this License,
|
250 |
+
in one of these ways:
|
251 |
+
|
252 |
+
a) Convey the object code in, or embodied in, a physical product
|
253 |
+
(including a physical distribution medium), accompanied by the
|
254 |
+
Corresponding Source fixed on a durable physical medium
|
255 |
+
customarily used for software interchange.
|
256 |
+
|
257 |
+
b) Convey the object code in, or embodied in, a physical product
|
258 |
+
(including a physical distribution medium), accompanied by a
|
259 |
+
written offer, valid for at least three years and valid for as
|
260 |
+
long as you offer spare parts or customer support for that product
|
261 |
+
model, to give anyone who possesses the object code either (1) a
|
262 |
+
copy of the Corresponding Source for all the software in the
|
263 |
+
product that is covered by this License, on a durable physical
|
264 |
+
medium customarily used for software interchange, for a price no
|
265 |
+
more than your reasonable cost of physically performing this
|
266 |
+
conveying of source, or (2) access to copy the
|
267 |
+
Corresponding Source from a network server at no charge.
|
268 |
+
|
269 |
+
c) Convey individual copies of the object code with a copy of the
|
270 |
+
written offer to provide the Corresponding Source. This
|
271 |
+
alternative is allowed only occasionally and noncommercially, and
|
272 |
+
only if you received the object code with such an offer, in accord
|
273 |
+
with subsection 6b.
|
274 |
+
|
275 |
+
d) Convey the object code by offering access from a designated
|
276 |
+
place (gratis or for a charge), and offer equivalent access to the
|
277 |
+
Corresponding Source in the same way through the same place at no
|
278 |
+
further charge. You need not require recipients to copy the
|
279 |
+
Corresponding Source along with the object code. If the place to
|
280 |
+
copy the object code is a network server, the Corresponding Source
|
281 |
+
may be on a different server (operated by you or a third party)
|
282 |
+
that supports equivalent copying facilities, provided you maintain
|
283 |
+
clear directions next to the object code saying where to find the
|
284 |
+
Corresponding Source. Regardless of what server hosts the
|
285 |
+
Corresponding Source, you remain obligated to ensure that it is
|
286 |
+
available for as long as needed to satisfy these requirements.
|
287 |
+
|
288 |
+
e) Convey the object code using peer-to-peer transmission, provided
|
289 |
+
you inform other peers where the object code and Corresponding
|
290 |
+
Source of the work are being offered to the general public at no
|
291 |
+
charge under subsection 6d.
|
292 |
+
|
293 |
+
A separable portion of the object code, whose source code is excluded
|
294 |
+
from the Corresponding Source as a System Library, need not be
|
295 |
+
included in conveying the object code work.
|
296 |
+
|
297 |
+
A "User Product" is either (1) a "consumer product", which means any
|
298 |
+
tangible personal property which is normally used for personal, family,
|
299 |
+
or household purposes, or (2) anything designed or sold for incorporation
|
300 |
+
into a dwelling. In determining whether a product is a consumer product,
|
301 |
+
doubtful cases shall be resolved in favor of coverage. For a particular
|
302 |
+
product received by a particular user, "normally used" refers to a
|
303 |
+
typical or common use of that class of product, regardless of the status
|
304 |
+
of the particular user or of the way in which the particular user
|
305 |
+
actually uses, or expects or is expected to use, the product. A product
|
306 |
+
is a consumer product regardless of whether the product has substantial
|
307 |
+
commercial, industrial or non-consumer uses, unless such uses represent
|
308 |
+
the only significant mode of use of the product.
|
309 |
+
|
310 |
+
"Installation Information" for a User Product means any methods,
|
311 |
+
procedures, authorization keys, or other information required to install
|
312 |
+
and execute modified versions of a covered work in that User Product from
|
313 |
+
a modified version of its Corresponding Source. The information must
|
314 |
+
suffice to ensure that the continued functioning of the modified object
|
315 |
+
code is in no case prevented or interfered with solely because
|
316 |
+
modification has been made.
|
317 |
+
|
318 |
+
If you convey an object code work under this section in, or with, or
|
319 |
+
specifically for use in, a User Product, and the conveying occurs as
|
320 |
+
part of a transaction in which the right of possession and use of the
|
321 |
+
User Product is transferred to the recipient in perpetuity or for a
|
322 |
+
fixed term (regardless of how the transaction is characterized), the
|
323 |
+
Corresponding Source conveyed under this section must be accompanied
|
324 |
+
by the Installation Information. But this requirement does not apply
|
325 |
+
if neither you nor any third party retains the ability to install
|
326 |
+
modified object code on the User Product (for example, the work has
|
327 |
+
been installed in ROM).
|
328 |
+
|
329 |
+
The requirement to provide Installation Information does not include a
|
330 |
+
requirement to continue to provide support service, warranty, or updates
|
331 |
+
for a work that has been modified or installed by the recipient, or for
|
332 |
+
the User Product in which it has been modified or installed. Access to a
|
333 |
+
network may be denied when the modification itself materially and
|
334 |
+
adversely affects the operation of the network or violates the rules and
|
335 |
+
protocols for communication across the network.
|
336 |
+
|
337 |
+
Corresponding Source conveyed, and Installation Information provided,
|
338 |
+
in accord with this section must be in a format that is publicly
|
339 |
+
documented (and with an implementation available to the public in
|
340 |
+
source code form), and must require no special password or key for
|
341 |
+
unpacking, reading or copying.
|
342 |
+
|
343 |
+
7. Additional Terms.
|
344 |
+
|
345 |
+
"Additional permissions" are terms that supplement the terms of this
|
346 |
+
License by making exceptions from one or more of its conditions.
|
347 |
+
Additional permissions that are applicable to the entire Program shall
|
348 |
+
be treated as though they were included in this License, to the extent
|
349 |
+
that they are valid under applicable law. If additional permissions
|
350 |
+
apply only to part of the Program, that part may be used separately
|
351 |
+
under those permissions, but the entire Program remains governed by
|
352 |
+
this License without regard to the additional permissions.
|
353 |
+
|
354 |
+
When you convey a copy of a covered work, you may at your option
|
355 |
+
remove any additional permissions from that copy, or from any part of
|
356 |
+
it. (Additional permissions may be written to require their own
|
357 |
+
removal in certain cases when you modify the work.) You may place
|
358 |
+
additional permissions on material, added by you to a covered work,
|
359 |
+
for which you have or can give appropriate copyright permission.
|
360 |
+
|
361 |
+
Notwithstanding any other provision of this License, for material you
|
362 |
+
add to a covered work, you may (if authorized by the copyright holders of
|
363 |
+
that material) supplement the terms of this License with terms:
|
364 |
+
|
365 |
+
a) Disclaiming warranty or limiting liability differently from the
|
366 |
+
terms of sections 15 and 16 of this License; or
|
367 |
+
|
368 |
+
b) Requiring preservation of specified reasonable legal notices or
|
369 |
+
author attributions in that material or in the Appropriate Legal
|
370 |
+
Notices displayed by works containing it; or
|
371 |
+
|
372 |
+
c) Prohibiting misrepresentation of the origin of that material, or
|
373 |
+
requiring that modified versions of such material be marked in
|
374 |
+
reasonable ways as different from the original version; or
|
375 |
+
|
376 |
+
d) Limiting the use for publicity purposes of names of licensors or
|
377 |
+
authors of the material; or
|
378 |
+
|
379 |
+
e) Declining to grant rights under trademark law for use of some
|
380 |
+
trade names, trademarks, or service marks; or
|
381 |
+
|
382 |
+
f) Requiring indemnification of licensors and authors of that
|
383 |
+
material by anyone who conveys the material (or modified versions of
|
384 |
+
it) with contractual assumptions of liability to the recipient, for
|
385 |
+
any liability that these contractual assumptions directly impose on
|
386 |
+
those licensors and authors.
|
387 |
+
|
388 |
+
All other non-permissive additional terms are considered "further
|
389 |
+
restrictions" within the meaning of section 10. If the Program as you
|
390 |
+
received it, or any part of it, contains a notice stating that it is
|
391 |
+
governed by this License along with a term that is a further
|
392 |
+
restriction, you may remove that term. If a license document contains
|
393 |
+
a further restriction but permits relicensing or conveying under this
|
394 |
+
License, you may add to a covered work material governed by the terms
|
395 |
+
of that license document, provided that the further restriction does
|
396 |
+
not survive such relicensing or conveying.
|
397 |
+
|
398 |
+
If you add terms to a covered work in accord with this section, you
|
399 |
+
must place, in the relevant source files, a statement of the
|
400 |
+
additional terms that apply to those files, or a notice indicating
|
401 |
+
where to find the applicable terms.
|
402 |
+
|
403 |
+
Additional terms, permissive or non-permissive, may be stated in the
|
404 |
+
form of a separately written license, or stated as exceptions;
|
405 |
+
the above requirements apply either way.
|
406 |
+
|
407 |
+
8. Termination.
|
408 |
+
|
409 |
+
You may not propagate or modify a covered work except as expressly
|
410 |
+
provided under this License. Any attempt otherwise to propagate or
|
411 |
+
modify it is void, and will automatically terminate your rights under
|
412 |
+
this License (including any patent licenses granted under the third
|
413 |
+
paragraph of section 11).
|
414 |
+
|
415 |
+
However, if you cease all violation of this License, then your
|
416 |
+
license from a particular copyright holder is reinstated (a)
|
417 |
+
provisionally, unless and until the copyright holder explicitly and
|
418 |
+
finally terminates your license, and (b) permanently, if the copyright
|
419 |
+
holder fails to notify you of the violation by some reasonable means
|
420 |
+
prior to 60 days after the cessation.
|
421 |
+
|
422 |
+
Moreover, your license from a particular copyright holder is
|
423 |
+
reinstated permanently if the copyright holder notifies you of the
|
424 |
+
violation by some reasonable means, this is the first time you have
|
425 |
+
received notice of violation of this License (for any work) from that
|
426 |
+
copyright holder, and you cure the violation prior to 30 days after
|
427 |
+
your receipt of the notice.
|
428 |
+
|
429 |
+
Termination of your rights under this section does not terminate the
|
430 |
+
licenses of parties who have received copies or rights from you under
|
431 |
+
this License. If your rights have been terminated and not permanently
|
432 |
+
reinstated, you do not qualify to receive new licenses for the same
|
433 |
+
material under section 10.
|
434 |
+
|
435 |
+
9. Acceptance Not Required for Having Copies.
|
436 |
+
|
437 |
+
You are not required to accept this License in order to receive or
|
438 |
+
run a copy of the Program. Ancillary propagation of a covered work
|
439 |
+
occurring solely as a consequence of using peer-to-peer transmission
|
440 |
+
to receive a copy likewise does not require acceptance. However,
|
441 |
+
nothing other than this License grants you permission to propagate or
|
442 |
+
modify any covered work. These actions infringe copyright if you do
|
443 |
+
not accept this License. Therefore, by modifying or propagating a
|
444 |
+
covered work, you indicate your acceptance of this License to do so.
|
445 |
+
|
446 |
+
10. Automatic Licensing of Downstream Recipients.
|
447 |
+
|
448 |
+
Each time you convey a covered work, the recipient automatically
|
449 |
+
receives a license from the original licensors, to run, modify and
|
450 |
+
propagate that work, subject to this License. You are not responsible
|
451 |
+
for enforcing compliance by third parties with this License.
|
452 |
+
|
453 |
+
An "entity transaction" is a transaction transferring control of an
|
454 |
+
organization, or substantially all assets of one, or subdividing an
|
455 |
+
organization, or merging organizations. If propagation of a covered
|
456 |
+
work results from an entity transaction, each party to that
|
457 |
+
transaction who receives a copy of the work also receives whatever
|
458 |
+
licenses to the work the party's predecessor in interest had or could
|
459 |
+
give under the previous paragraph, plus a right to possession of the
|
460 |
+
Corresponding Source of the work from the predecessor in interest, if
|
461 |
+
the predecessor has it or can get it with reasonable efforts.
|
462 |
+
|
463 |
+
You may not impose any further restrictions on the exercise of the
|
464 |
+
rights granted or affirmed under this License. For example, you may
|
465 |
+
not impose a license fee, royalty, or other charge for exercise of
|
466 |
+
rights granted under this License, and you may not initiate litigation
|
467 |
+
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
468 |
+
any patent claim is infringed by making, using, selling, offering for
|
469 |
+
sale, or importing the Program or any portion of it.
|
470 |
+
|
471 |
+
11. Patents.
|
472 |
+
|
473 |
+
A "contributor" is a copyright holder who authorizes use under this
|
474 |
+
License of the Program or a work on which the Program is based. The
|
475 |
+
work thus licensed is called the contributor's "contributor version".
|
476 |
+
|
477 |
+
A contributor's "essential patent claims" are all patent claims
|
478 |
+
owned or controlled by the contributor, whether already acquired or
|
479 |
+
hereafter acquired, that would be infringed by some manner, permitted
|
480 |
+
by this License, of making, using, or selling its contributor version,
|
481 |
+
but do not include claims that would be infringed only as a
|
482 |
+
consequence of further modification of the contributor version. For
|
483 |
+
purposes of this definition, "control" includes the right to grant
|
484 |
+
patent sublicenses in a manner consistent with the requirements of
|
485 |
+
this License.
|
486 |
+
|
487 |
+
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
488 |
+
patent license under the contributor's essential patent claims, to
|
489 |
+
make, use, sell, offer for sale, import and otherwise run, modify and
|
490 |
+
propagate the contents of its contributor version.
|
491 |
+
|
492 |
+
In the following three paragraphs, a "patent license" is any express
|
493 |
+
agreement or commitment, however denominated, not to enforce a patent
|
494 |
+
(such as an express permission to practice a patent or covenant not to
|
495 |
+
sue for patent infringement). To "grant" such a patent license to a
|
496 |
+
party means to make such an agreement or commitment not to enforce a
|
497 |
+
patent against the party.
|
498 |
+
|
499 |
+
If you convey a covered work, knowingly relying on a patent license,
|
500 |
+
and the Corresponding Source of the work is not available for anyone
|
501 |
+
to copy, free of charge and under the terms of this License, through a
|
502 |
+
publicly available network server or other readily accessible means,
|
503 |
+
then you must either (1) cause the Corresponding Source to be so
|
504 |
+
available, or (2) arrange to deprive yourself of the benefit of the
|
505 |
+
patent license for this particular work, or (3) arrange, in a manner
|
506 |
+
consistent with the requirements of this License, to extend the patent
|
507 |
+
license to downstream recipients. "Knowingly relying" means you have
|
508 |
+
actual knowledge that, but for the patent license, your conveying the
|
509 |
+
covered work in a country, or your recipient's use of the covered work
|
510 |
+
in a country, would infringe one or more identifiable patents in that
|
511 |
+
country that you have reason to believe are valid.
|
512 |
+
|
513 |
+
If, pursuant to or in connection with a single transaction or
|
514 |
+
arrangement, you convey, or propagate by procuring conveyance of, a
|
515 |
+
covered work, and grant a patent license to some of the parties
|
516 |
+
receiving the covered work authorizing them to use, propagate, modify
|
517 |
+
or convey a specific copy of the covered work, then the patent license
|
518 |
+
you grant is automatically extended to all recipients of the covered
|
519 |
+
work and works based on it.
|
520 |
+
|
521 |
+
A patent license is "discriminatory" if it does not include within
|
522 |
+
the scope of its coverage, prohibits the exercise of, or is
|
523 |
+
conditioned on the non-exercise of one or more of the rights that are
|
524 |
+
specifically granted under this License. You may not convey a covered
|
525 |
+
work if you are a party to an arrangement with a third party that is
|
526 |
+
in the business of distributing software, under which you make payment
|
527 |
+
to the third party based on the extent of your activity of conveying
|
528 |
+
the work, and under which the third party grants, to any of the
|
529 |
+
parties who would receive the covered work from you, a discriminatory
|
530 |
+
patent license (a) in connection with copies of the covered work
|
531 |
+
conveyed by you (or copies made from those copies), or (b) primarily
|
532 |
+
for and in connection with specific products or compilations that
|
533 |
+
contain the covered work, unless you entered into that arrangement,
|
534 |
+
or that patent license was granted, prior to 28 March 2007.
|
535 |
+
|
536 |
+
Nothing in this License shall be construed as excluding or limiting
|
537 |
+
any implied license or other defenses to infringement that may
|
538 |
+
otherwise be available to you under applicable patent law.
|
539 |
+
|
540 |
+
12. No Surrender of Others' Freedom.
|
541 |
+
|
542 |
+
If conditions are imposed on you (whether by court order, agreement or
|
543 |
+
otherwise) that contradict the conditions of this License, they do not
|
544 |
+
excuse you from the conditions of this License. If you cannot convey a
|
545 |
+
covered work so as to satisfy simultaneously your obligations under this
|
546 |
+
License and any other pertinent obligations, then as a consequence you may
|
547 |
+
not convey it at all. For example, if you agree to terms that obligate you
|
548 |
+
to collect a royalty for further conveying from those to whom you convey
|
549 |
+
the Program, the only way you could satisfy both those terms and this
|
550 |
+
License would be to refrain entirely from conveying the Program.
|
551 |
+
|
552 |
+
13. Use with the GNU Affero General Public License.
|
553 |
+
|
554 |
+
Notwithstanding any other provision of this License, you have
|
555 |
+
permission to link or combine any covered work with a work licensed
|
556 |
+
under version 3 of the GNU Affero General Public License into a single
|
557 |
+
combined work, and to convey the resulting work. The terms of this
|
558 |
+
License will continue to apply to the part which is the covered work,
|
559 |
+
but the special requirements of the GNU Affero General Public License,
|
560 |
+
section 13, concerning interaction through a network will apply to the
|
561 |
+
combination as such.
|
562 |
+
|
563 |
+
14. Revised Versions of this License.
|
564 |
+
|
565 |
+
The Free Software Foundation may publish revised and/or new versions of
|
566 |
+
the GNU General Public License from time to time. Such new versions will
|
567 |
+
be similar in spirit to the present version, but may differ in detail to
|
568 |
+
address new problems or concerns.
|
569 |
+
|
570 |
+
Each version is given a distinguishing version number. If the
|
571 |
+
Program specifies that a certain numbered version of the GNU General
|
572 |
+
Public License "or any later version" applies to it, you have the
|
573 |
+
option of following the terms and conditions either of that numbered
|
574 |
+
version or of any later version published by the Free Software
|
575 |
+
Foundation. If the Program does not specify a version number of the
|
576 |
+
GNU General Public License, you may choose any version ever published
|
577 |
+
by the Free Software Foundation.
|
578 |
+
|
579 |
+
If the Program specifies that a proxy can decide which future
|
580 |
+
versions of the GNU General Public License can be used, that proxy's
|
581 |
+
public statement of acceptance of a version permanently authorizes you
|
582 |
+
to choose that version for the Program.
|
583 |
+
|
584 |
+
Later license versions may give you additional or different
|
585 |
+
permissions. However, no additional obligations are imposed on any
|
586 |
+
author or copyright holder as a result of your choosing to follow a
|
587 |
+
later version.
|
588 |
+
|
589 |
+
15. Disclaimer of Warranty.
|
590 |
+
|
591 |
+
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
592 |
+
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
593 |
+
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
594 |
+
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
595 |
+
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
596 |
+
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
597 |
+
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
598 |
+
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
599 |
+
|
600 |
+
16. Limitation of Liability.
|
601 |
+
|
602 |
+
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
603 |
+
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
604 |
+
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
605 |
+
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
606 |
+
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
607 |
+
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
608 |
+
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
609 |
+
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
610 |
+
SUCH DAMAGES.
|
611 |
+
|
612 |
+
17. Interpretation of Sections 15 and 16.
|
613 |
+
|
614 |
+
If the disclaimer of warranty and limitation of liability provided
|
615 |
+
above cannot be given local legal effect according to their terms,
|
616 |
+
reviewing courts shall apply local law that most closely approximates
|
617 |
+
an absolute waiver of all civil liability in connection with the
|
618 |
+
Program, unless a warranty or assumption of liability accompanies a
|
619 |
+
copy of the Program in return for a fee.
|
620 |
+
|
621 |
+
END OF TERMS AND CONDITIONS
|
622 |
+
|
623 |
+
How to Apply These Terms to Your New Programs
|
624 |
+
|
625 |
+
If you develop a new program, and you want it to be of the greatest
|
626 |
+
possible use to the public, the best way to achieve this is to make it
|
627 |
+
free software which everyone can redistribute and change under these terms.
|
628 |
+
|
629 |
+
To do so, attach the following notices to the program. It is safest
|
630 |
+
to attach them to the start of each source file to most effectively
|
631 |
+
state the exclusion of warranty; and each file should have at least
|
632 |
+
the "copyright" line and a pointer to where the full notice is found.
|
633 |
+
|
634 |
+
{one line to give the program's name and a brief idea of what it does.}
|
635 |
+
Copyright (C) {year} {name of author}
|
636 |
+
|
637 |
+
This program is free software: you can redistribute it and/or modify
|
638 |
+
it under the terms of the GNU General Public License as published by
|
639 |
+
the Free Software Foundation, either version 3 of the License, or
|
640 |
+
(at your option) any later version.
|
641 |
+
|
642 |
+
This program is distributed in the hope that it will be useful,
|
643 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
644 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
645 |
+
GNU General Public License for more details.
|
646 |
+
|
647 |
+
You should have received a copy of the GNU General Public License
|
648 |
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
649 |
+
|
650 |
+
Also add information on how to contact you by electronic and paper mail.
|
651 |
+
|
652 |
+
If the program does terminal interaction, make it output a short
|
653 |
+
notice like this when it starts in an interactive mode:
|
654 |
+
|
655 |
+
{project} Copyright (C) {year} {fullname}
|
656 |
+
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
657 |
+
This is free software, and you are welcome to redistribute it
|
658 |
+
under certain conditions; type `show c' for details.
|
659 |
+
|
660 |
+
The hypothetical commands `show w' and `show c' should show the appropriate
|
661 |
+
parts of the General Public License. Of course, your program's commands
|
662 |
+
might be different; for a GUI interface, you would use an "about box".
|
663 |
+
|
664 |
+
You should also get your employer (if you work as a programmer) or school,
|
665 |
+
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
666 |
+
For more information on this, and how to apply and follow the GNU GPL, see
|
667 |
+
<http://www.gnu.org/licenses/>.
|
668 |
+
|
669 |
+
The GNU General Public License does not permit incorporating your program
|
670 |
+
into proprietary programs. If your program is a subroutine library, you
|
671 |
+
may consider it more useful to permit linking proprietary applications with
|
672 |
+
the library. If this is what you want to do, use the GNU Lesser General
|
673 |
+
Public License instead of this License. But first, please read
|
674 |
+
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
cherry-framework/README.md
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
[![license](https://img.shields.io/badge/license-GPL--v.3.0%2B-blue.svg?style=flat-square)](https://github.com/CherryFramework/cherry-framework/blob/master/LICENSE)
|
2 |
+
[![Build Status](https://travis-ci.org/CherryFramework/cherry-framework.svg?branch=master)](https://travis-ci.org/CherryFramework/cherry-framework)
|
3 |
+
|
4 |
+
# cherry-framework
|
5 |
+
Module system.
|
6 |
+
|
7 |
+
## Authors
|
8 |
+
|
9 |
+
* [@MaksimTS](https://github.com/MaksimTS) - **Manager**
|
10 |
+
* [@Cheh](https://github.com/cheh) - **Developer**
|
11 |
+
* [@Behaart](https://github.com/MakhonkoDenis) - **Developer**
|
12 |
+
* [@MjHead](https://github.com/MjHead) - **Developer**
|
13 |
+
* [@Sargas](https://github.com/SargasTM) - **Developer**
|
14 |
+
* [@Shin](https://github.com/shinTM) - **Developer**
|
15 |
+
|
16 |
+
## Help
|
17 |
+
Found a bug? Feature requests? [Create an issue - Thanks!](https://github.com/CherryFramework/cherry-framework/issues/new)
|
cherry-framework/cherry-core.php
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Class Cherry Core
|
4 |
-
* Version: 1.
|
5 |
*
|
6 |
* @package Cherry_Framework
|
7 |
* @subpackage Class
|
8 |
* @author Cherry Team <cherryframework@gmail.com>
|
9 |
* @copyright Copyright (c) 2012 - 2016, Cherry Team
|
10 |
* @link http://www.cherryframework.com/
|
11 |
-
* @license http://www.gnu.org/licenses/
|
12 |
*/
|
13 |
|
14 |
// If this file is called directly, abort.
|
@@ -87,6 +87,9 @@ if ( ! class_exists( 'Cherry_Core' ) ) {
|
|
87 |
add_action( 'after_setup_theme', array( 'Cherry_Core', 'load_all_modules' ), 2 );
|
88 |
add_action( 'after_setup_theme', array( $this, 'init_required_modules' ), 2 );
|
89 |
|
|
|
|
|
|
|
90 |
// Init modules with autoload seted up into true.
|
91 |
add_action( 'after_setup_theme', array( $this, 'init_autoload_modules' ), 9999 );
|
92 |
|
@@ -165,6 +168,17 @@ if ( ! class_exists( 'Cherry_Core' ) ) {
|
|
165 |
}
|
166 |
}
|
167 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
168 |
/**
|
169 |
* Init a required modules.
|
170 |
*
|
1 |
<?php
|
2 |
/**
|
3 |
* Class Cherry Core
|
4 |
+
* Version: 1.4.1
|
5 |
*
|
6 |
* @package Cherry_Framework
|
7 |
* @subpackage Class
|
8 |
* @author Cherry Team <cherryframework@gmail.com>
|
9 |
* @copyright Copyright (c) 2012 - 2016, Cherry Team
|
10 |
* @link http://www.cherryframework.com/
|
11 |
+
* @license http://www.gnu.org/licenses/gpl-3.0.en.html
|
12 |
*/
|
13 |
|
14 |
// If this file is called directly, abort.
|
87 |
add_action( 'after_setup_theme', array( 'Cherry_Core', 'load_all_modules' ), 2 );
|
88 |
add_action( 'after_setup_theme', array( $this, 'init_required_modules' ), 2 );
|
89 |
|
90 |
+
// Load the framework textdomain.
|
91 |
+
add_action( 'after_setup_theme', array( $this, 'load_textdomain' ), 10 );
|
92 |
+
|
93 |
// Init modules with autoload seted up into true.
|
94 |
add_action( 'after_setup_theme', array( $this, 'init_autoload_modules' ), 9999 );
|
95 |
|
168 |
}
|
169 |
}
|
170 |
|
171 |
+
/**
|
172 |
+
* Load the framework textdomain.
|
173 |
+
*
|
174 |
+
* @since 1.4.0
|
175 |
+
*/
|
176 |
+
public function load_textdomain() {
|
177 |
+
$mo_file_path = dirname( __FILE__ ) . '/languages/' . get_locale() . '.mo';
|
178 |
+
|
179 |
+
load_textdomain( 'cherry-framework', $mo_file_path );
|
180 |
+
}
|
181 |
+
|
182 |
/**
|
183 |
* Init a required modules.
|
184 |
*
|
cherry-framework/languages/cherry-framework.pot
ADDED
@@ -0,0 +1,119 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#, fuzzy
|
2 |
+
msgid ""
|
3 |
+
msgstr ""
|
4 |
+
"Project-Id-Version: cherry-framework\n"
|
5 |
+
"POT-Creation-Date: 2016-12-26 14:10+0200\n"
|
6 |
+
"PO-Revision-Date: 2016-12-09 16:29+0200\n"
|
7 |
+
"Last-Translator: \n"
|
8 |
+
"Language-Team: TemplateMonster\n"
|
9 |
+
"Language: en\n"
|
10 |
+
"MIME-Version: 1.0\n"
|
11 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
12 |
+
"Content-Transfer-Encoding: 8bit\n"
|
13 |
+
"X-Generator: Poedit 1.8.11\n"
|
14 |
+
"X-Poedit-Basepath: ..\n"
|
15 |
+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
16 |
+
"X-Poedit-SourceCharset: UTF-8\n"
|
17 |
+
"X-Poedit-KeywordsList: __;_e;_n:1,2;_n_noop:1,2;_x:1,2c;_nx:1,2,4c;"
|
18 |
+
"_nx_noop:1,2,3c;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;"
|
19 |
+
"esc_html_e;esc_html_x:1,2c\n"
|
20 |
+
"X-Poedit-SearchPath-0: .\n"
|
21 |
+
"X-Poedit-SearchPath-1: .\n"
|
22 |
+
|
23 |
+
#: modules/cherry-breadcrumbs/cherry-breadcrumbs.php:346
|
24 |
+
msgid "Home"
|
25 |
+
msgstr ""
|
26 |
+
|
27 |
+
#: modules/cherry-breadcrumbs/cherry-breadcrumbs.php:352
|
28 |
+
msgid "Browse:"
|
29 |
+
msgstr ""
|
30 |
+
|
31 |
+
#: modules/cherry-breadcrumbs/cherry-breadcrumbs.php:354
|
32 |
+
msgid "404 Not Found"
|
33 |
+
msgstr ""
|
34 |
+
|
35 |
+
#: modules/cherry-breadcrumbs/cherry-breadcrumbs.php:355
|
36 |
+
msgid "Archives"
|
37 |
+
msgstr ""
|
38 |
+
|
39 |
+
#: modules/cherry-breadcrumbs/cherry-breadcrumbs.php:356
|
40 |
+
#, php-format
|
41 |
+
msgid "Search results for “%s”"
|
42 |
+
msgstr ""
|
43 |
+
|
44 |
+
#: modules/cherry-breadcrumbs/cherry-breadcrumbs.php:357
|
45 |
+
#, php-format
|
46 |
+
msgid "Page %s"
|
47 |
+
msgstr ""
|
48 |
+
|
49 |
+
#: modules/cherry-breadcrumbs/cherry-breadcrumbs.php:358
|
50 |
+
#, php-format
|
51 |
+
msgid "Minute %s"
|
52 |
+
msgstr ""
|
53 |
+
|
54 |
+
#: modules/cherry-breadcrumbs/cherry-breadcrumbs.php:359
|
55 |
+
#, php-format
|
56 |
+
msgid "Week %s"
|
57 |
+
msgstr ""
|
58 |
+
|
59 |
+
#: modules/cherry-customizer/cherry-customizer.php:269
|
60 |
+
msgid "Untitled Panel"
|
61 |
+
msgstr ""
|
62 |
+
|
63 |
+
#: modules/cherry-customizer/cherry-customizer.php:305
|
64 |
+
msgid "Untitled Section"
|
65 |
+
msgstr ""
|
66 |
+
|
67 |
+
#: modules/cherry-customizer/cherry-customizer.php:338
|
68 |
+
msgid "Untitled Control"
|
69 |
+
msgstr ""
|
70 |
+
|
71 |
+
#: modules/cherry-db-updater/cherry-db-updater.php:105
|
72 |
+
#, php-format
|
73 |
+
msgid ""
|
74 |
+
"Module DB Updater init error in %s - version and slug is required arguments"
|
75 |
+
msgstr ""
|
76 |
+
|
77 |
+
#: modules/cherry-db-updater/cherry-db-updater.php:106
|
78 |
+
msgid "We need to update your database to the latest version."
|
79 |
+
msgstr ""
|
80 |
+
|
81 |
+
#: modules/cherry-db-updater/cherry-db-updater.php:107
|
82 |
+
msgid "Update complete, thank you for updating to the latest version!"
|
83 |
+
msgstr ""
|
84 |
+
|
85 |
+
#: modules/cherry-db-updater/cherry-db-updater.php:331
|
86 |
+
msgid "Start Update"
|
87 |
+
msgstr ""
|
88 |
+
|
89 |
+
#: modules/cherry-db-updater/cherry-db-updater.php:368
|
90 |
+
msgid "Data Update"
|
91 |
+
msgstr ""
|
92 |
+
|
93 |
+
#: modules/cherry5-insert-shortcode/inc/class-cherry5-insertion-button.php:63
|
94 |
+
msgid "Cherry shortcodes"
|
95 |
+
msgstr ""
|
96 |
+
|
97 |
+
#: modules/cherry5-insert-shortcode/inc/class-cherry5-insertion-popup.php:128
|
98 |
+
msgid "insert shortcode"
|
99 |
+
msgstr ""
|
100 |
+
|
101 |
+
#: modules/cherry5-insert-shortcode/inc/class-cherry5-insertion-popup.php:148
|
102 |
+
msgid "Shortcode List"
|
103 |
+
msgstr ""
|
104 |
+
|
105 |
+
#: modules/cherry5-insert-shortcode/inc/class-cherry5-insertion-popup.php:206
|
106 |
+
msgid "Shortcode not found."
|
107 |
+
msgstr ""
|
108 |
+
|
109 |
+
#: modules/cherry5-insert-shortcode/inc/class-cherry5-insertion-popup.php:261
|
110 |
+
msgid "Shortcode content."
|
111 |
+
msgstr ""
|
112 |
+
|
113 |
+
#: modules/cherry5-insert-shortcode/inc/class-cherry5-insertion-popup.php:262
|
114 |
+
msgid "Input shortcode content."
|
115 |
+
msgstr ""
|
116 |
+
|
117 |
+
#: modules/cherry5-insert-shortcode/inc/class-cherry5-insertion-popup.php:277
|
118 |
+
msgid "Shortcode not a have options."
|
119 |
+
msgstr ""
|
cherry-framework/modules/cherry-breadcrumbs/cherry-breadcrumbs.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/**
|
3 |
* Module Name: Breadcrumb Trail
|
4 |
* Description: A breadcrumb menu script for WordPress
|
5 |
-
* Version: 1.1.
|
6 |
* Author: Cherry Team
|
7 |
* Author URI: http://www.cherryframework.com/
|
8 |
* License: GPLv3
|
@@ -343,20 +343,20 @@ if ( ! class_exists( 'Cherry_Breadcrumbs' ) ) {
|
|
343 |
}
|
344 |
|
345 |
if ( $use_custom_front_title ) {
|
346 |
-
$default = 'Home';
|
347 |
$page_on_front_title = $default;
|
348 |
$page_on_front_title = $this->prepare_label( $page_on_front_title, $default );
|
349 |
}
|
350 |
|
351 |
$labels = array(
|
352 |
-
'browse' => 'Browse:',
|
353 |
'home' => $page_on_front_title,
|
354 |
-
'error_404' => '404 Not Found',
|
355 |
-
'archives' => 'Archives',
|
356 |
-
'search' => 'Search results for “%s”',
|
357 |
-
'paged' => 'Page %s',
|
358 |
-
'archive_minute' => 'Minute %s',
|
359 |
-
'archive_week' => 'Week %s',
|
360 |
|
361 |
/* "%s" is replaced with the translated date/time format. */
|
362 |
'archive_minute_hour' => '%s',
|
@@ -916,10 +916,10 @@ if ( ! class_exists( 'Cherry_Breadcrumbs' ) ) {
|
|
916 |
/* Get the post type object. */
|
917 |
$post_type_object = get_post_type_object( get_query_var( 'post_type' ) );
|
918 |
|
919 |
-
if ( false !== $post_type_object->rewrite ) {
|
920 |
|
921 |
/* If 'with_front' is true, add $wp_rewrite->front to the trail. */
|
922 |
-
if ( $post_type_object->rewrite['with_front'] ) {
|
923 |
$this->add_rewrite_front_items();
|
924 |
}
|
925 |
}
|
@@ -1446,7 +1446,17 @@ if ( ! class_exists( 'Cherry_Breadcrumbs' ) ) {
|
|
1446 |
if ( $terms ) {
|
1447 |
|
1448 |
/* Sort the terms by ID and get the first category. */
|
1449 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1450 |
$term = get_term( $terms[0], 'category' );
|
1451 |
|
1452 |
/* If the category has a parent, add the hierarchy to the trail. */
|
2 |
/**
|
3 |
* Module Name: Breadcrumb Trail
|
4 |
* Description: A breadcrumb menu script for WordPress
|
5 |
+
* Version: 1.1.3
|
6 |
* Author: Cherry Team
|
7 |
* Author URI: http://www.cherryframework.com/
|
8 |
* License: GPLv3
|
343 |
}
|
344 |
|
345 |
if ( $use_custom_front_title ) {
|
346 |
+
$default = esc_html__( 'Home', 'cherry-framework' );
|
347 |
$page_on_front_title = $default;
|
348 |
$page_on_front_title = $this->prepare_label( $page_on_front_title, $default );
|
349 |
}
|
350 |
|
351 |
$labels = array(
|
352 |
+
'browse' => esc_html__( 'Browse:', 'cherry-framework' ),
|
353 |
'home' => $page_on_front_title,
|
354 |
+
'error_404' => esc_html__( '404 Not Found', 'cherry-framework' ),
|
355 |
+
'archives' => esc_html__( 'Archives', 'cherry-framework' ),
|
356 |
+
'search' => esc_html__( 'Search results for “%s”', 'cherry-framework' ),
|
357 |
+
'paged' => esc_html__( 'Page %s', 'cherry-framework' ),
|
358 |
+
'archive_minute' => esc_html__( 'Minute %s', 'cherry-framework' ),
|
359 |
+
'archive_week' => esc_html__( 'Week %s', 'cherry-framework' ),
|
360 |
|
361 |
/* "%s" is replaced with the translated date/time format. */
|
362 |
'archive_minute_hour' => '%s',
|
916 |
/* Get the post type object. */
|
917 |
$post_type_object = get_post_type_object( get_query_var( 'post_type' ) );
|
918 |
|
919 |
+
if ( ! empty( $post_type_object ) && false !== $post_type_object->rewrite ) {
|
920 |
|
921 |
/* If 'with_front' is true, add $wp_rewrite->front to the trail. */
|
922 |
+
if ( ! empty( $post_type_object->rewrite ) && $post_type_object->rewrite['with_front'] ) {
|
923 |
$this->add_rewrite_front_items();
|
924 |
}
|
925 |
}
|
1446 |
if ( $terms ) {
|
1447 |
|
1448 |
/* Sort the terms by ID and get the first category. */
|
1449 |
+
if ( function_exists( 'wp_list_sort' ) ) {
|
1450 |
+
$terms = wp_list_sort( $terms, array(
|
1451 |
+
'term_id' => 'ASC',
|
1452 |
+
) );
|
1453 |
+
|
1454 |
+
} else {
|
1455 |
+
|
1456 |
+
// Backward compatibility with WordPress 4.6 or later.
|
1457 |
+
usort( $terms, '_usort_terms_by_ID' );
|
1458 |
+
}
|
1459 |
+
|
1460 |
$term = get_term( $terms[0], 'category' );
|
1461 |
|
1462 |
/* If the category has a parent, add the hierarchy to the trail. */
|
cherry-framework/modules/cherry-customizer/cherry-customizer.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/**
|
3 |
* Module Name: Customizer
|
4 |
* Description: Customizer functionality.
|
5 |
-
* Version: 1.1.
|
6 |
* Author: Cherry Team
|
7 |
* Author URI: http://www.cherryframework.com/
|
8 |
* License: GPLv3
|
@@ -10,7 +10,7 @@
|
|
10 |
*
|
11 |
* @package Cherry_Framework
|
12 |
* @subpackage Modules
|
13 |
-
* @version 1.1.
|
14 |
* @author Cherry Team <cherryframework@gmail.com>
|
15 |
* @copyright Copyright (c) 2012 - 2016, Cherry Team
|
16 |
* @link http://www.cherryframework.com/
|
@@ -266,7 +266,7 @@ if ( ! class_exists( 'Cherry_Customizer' ) ) {
|
|
266 |
$prefix = $this->prefix . '_';
|
267 |
$priority = isset( $args['priority'] ) ? $args['priority'] : 160;
|
268 |
$theme_supports = isset( $args['theme_supports'] ) ? $args['theme_supports'] : '';
|
269 |
-
$title = isset( $args['title'] ) ? esc_attr( $args['title'] ) : 'Untitled Panel';
|
270 |
$description = isset( $args['description'] ) ? esc_attr( $args['description'] ) : '';
|
271 |
$active_callback = isset( $args['active_callback'] ) ? $this->active_callback( $args['active_callback'] ) : '';
|
272 |
|
@@ -302,7 +302,7 @@ if ( ! class_exists( 'Cherry_Customizer' ) ) {
|
|
302 |
*/
|
303 |
public function add_section( $id, $args ) {
|
304 |
$prefix = $this->prefix . '_';
|
305 |
-
$title = isset( $args['title'] ) ? esc_attr( $args['title'] ) : 'Untitled Section';
|
306 |
$description = isset( $args['description'] ) ? esc_attr( $args['description'] ) : '';
|
307 |
$panel = isset( $args['panel'] ) ? $prefix . esc_attr( $args['panel'] ) : '';
|
308 |
$priority = isset( $args['priority'] ) ? $args['priority'] : 160;
|
@@ -335,7 +335,7 @@ if ( ! class_exists( 'Cherry_Customizer' ) ) {
|
|
335 |
$id = ( 'option' === $this->type ) ? sprintf( '%1$s_options[%2$s]', $this->prefix, esc_attr( $id ) ) : esc_attr( $id );
|
336 |
$priority = isset( $args['priority'] ) ? $args['priority'] : ++$control_priority;
|
337 |
$default = isset( $args['default'] ) ? $args['default'] : '';
|
338 |
-
$title = isset( $args['title'] ) ? esc_attr( $args['title'] ) : 'Untitled Control';
|
339 |
$description = isset( $args['description'] ) ? esc_attr( $args['description'] ) : '';
|
340 |
$transport = isset( $args['transport'] ) ? esc_attr( $args['transport'] ) : 'refresh';
|
341 |
$field_type = isset( $args['field'] ) ? esc_attr( $args['field'] ) : 'text';
|
@@ -797,6 +797,8 @@ if ( ! class_exists( 'Cherry_Customizer' ) ) {
|
|
797 |
// Get step.
|
798 |
$step = ( isset( $atts['step'] ) ? $atts['step'] : 1 );
|
799 |
|
|
|
|
|
800 |
if ( is_float( $step ) ) {
|
801 |
|
802 |
// Ensure input is a float value.
|
@@ -805,7 +807,7 @@ if ( ! class_exists( 'Cherry_Customizer' ) ) {
|
|
805 |
} else {
|
806 |
|
807 |
// Ensure input is an absolute integer.
|
808 |
-
$number = absint( $number );
|
809 |
$checker = is_int( $number / $step );
|
810 |
}
|
811 |
|
2 |
/**
|
3 |
* Module Name: Customizer
|
4 |
* Description: Customizer functionality.
|
5 |
+
* Version: 1.1.6
|
6 |
* Author: Cherry Team
|
7 |
* Author URI: http://www.cherryframework.com/
|
8 |
* License: GPLv3
|
10 |
*
|
11 |
* @package Cherry_Framework
|
12 |
* @subpackage Modules
|
13 |
+
* @version 1.1.6
|
14 |
* @author Cherry Team <cherryframework@gmail.com>
|
15 |
* @copyright Copyright (c) 2012 - 2016, Cherry Team
|
16 |
* @link http://www.cherryframework.com/
|
266 |
$prefix = $this->prefix . '_';
|
267 |
$priority = isset( $args['priority'] ) ? $args['priority'] : 160;
|
268 |
$theme_supports = isset( $args['theme_supports'] ) ? $args['theme_supports'] : '';
|
269 |
+
$title = isset( $args['title'] ) ? esc_attr( $args['title'] ) : esc_html__( 'Untitled Panel', 'cherry-framework' );
|
270 |
$description = isset( $args['description'] ) ? esc_attr( $args['description'] ) : '';
|
271 |
$active_callback = isset( $args['active_callback'] ) ? $this->active_callback( $args['active_callback'] ) : '';
|
272 |
|
302 |
*/
|
303 |
public function add_section( $id, $args ) {
|
304 |
$prefix = $this->prefix . '_';
|
305 |
+
$title = isset( $args['title'] ) ? esc_attr( $args['title'] ) : esc_html__( 'Untitled Section', 'cherry-framework' );
|
306 |
$description = isset( $args['description'] ) ? esc_attr( $args['description'] ) : '';
|
307 |
$panel = isset( $args['panel'] ) ? $prefix . esc_attr( $args['panel'] ) : '';
|
308 |
$priority = isset( $args['priority'] ) ? $args['priority'] : 160;
|
335 |
$id = ( 'option' === $this->type ) ? sprintf( '%1$s_options[%2$s]', $this->prefix, esc_attr( $id ) ) : esc_attr( $id );
|
336 |
$priority = isset( $args['priority'] ) ? $args['priority'] : ++$control_priority;
|
337 |
$default = isset( $args['default'] ) ? $args['default'] : '';
|
338 |
+
$title = isset( $args['title'] ) ? esc_attr( $args['title'] ) : esc_html__( 'Untitled Control', 'cherry-framework' );
|
339 |
$description = isset( $args['description'] ) ? esc_attr( $args['description'] ) : '';
|
340 |
$transport = isset( $args['transport'] ) ? esc_attr( $args['transport'] ) : 'refresh';
|
341 |
$field_type = isset( $args['field'] ) ? esc_attr( $args['field'] ) : 'text';
|
797 |
// Get step.
|
798 |
$step = ( isset( $atts['step'] ) ? $atts['step'] : 1 );
|
799 |
|
800 |
+
$number = ( ! isset( $atts['min'] ) && 0 > $number ) ? $setting->default : $number ;
|
801 |
+
|
802 |
if ( is_float( $step ) ) {
|
803 |
|
804 |
// Ensure input is a float value.
|
807 |
} else {
|
808 |
|
809 |
// Ensure input is an absolute integer.
|
810 |
+
$number = ( isset( $atts['min'] ) && 0 > $atts['min'] && 0 > $number ) ? intval( $number ) : absint( $number );
|
811 |
$checker = is_int( $number / $step );
|
812 |
}
|
813 |
|
cherry-framework/modules/cherry-customizer/inc/class-cherry-wp-customize-iconpicker.php
CHANGED
@@ -40,7 +40,11 @@ if ( class_exists( 'WP_Customize_Control' ) ) {
|
|
40 |
<span class="customize-control-title">
|
41 |
<?php echo esc_html( $this->label ); ?>
|
42 |
</span>
|
43 |
-
|
|
|
|
|
|
|
|
|
44 |
</label>
|
45 |
<?php
|
46 |
echo str_replace(
|
40 |
<span class="customize-control-title">
|
41 |
<?php echo esc_html( $this->label ); ?>
|
42 |
</span>
|
43 |
+
<?php if ( isset( $this->description ) ) : ?>
|
44 |
+
<span class="description customize-control-description">
|
45 |
+
<?php echo wp_kses_post( $this->description ); ?>
|
46 |
+
</span>
|
47 |
+
<?php endif; ?>
|
48 |
</label>
|
49 |
<?php
|
50 |
echo str_replace(
|
cherry-framework/modules/cherry-db-updater/cherry-db-updater.php
ADDED
@@ -0,0 +1,381 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Module Name: Database Updater
|
4 |
+
* Description: Handle database updates if required.
|
5 |
+
* Version: 1.0.0
|
6 |
+
* Author: Cherry Team
|
7 |
+
* Author URI: http://www.cherryframework.com/
|
8 |
+
* License: GPLv3
|
9 |
+
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
+
*
|
11 |
+
* @package Db_Updater
|
12 |
+
* @subpackage Modules
|
13 |
+
* @version 1.0.0
|
14 |
+
* @author Cherry Team <cherryframework@gmail.com>
|
15 |
+
* @copyright Copyright (c) 2012 - 2016, Cherry Team
|
16 |
+
* @link http://www.cherryframework.com/
|
17 |
+
* @license http://www.gnu.org/licenses/gpl-3.0.html
|
18 |
+
*/
|
19 |
+
|
20 |
+
// If this file is called directly, abort.
|
21 |
+
if ( ! defined( 'WPINC' ) ) {
|
22 |
+
die;
|
23 |
+
}
|
24 |
+
|
25 |
+
if ( ! class_exists( 'Cherry_Db_Updater' ) ) {
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Class Cherry Db Updater.
|
29 |
+
*
|
30 |
+
* @since 1.0.0
|
31 |
+
*/
|
32 |
+
class Cherry_Db_Updater {
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Module arguments.
|
36 |
+
*
|
37 |
+
* @since 1.0.0
|
38 |
+
* @var array
|
39 |
+
*/
|
40 |
+
private $args = array(
|
41 |
+
'callbacks' => array(),
|
42 |
+
'slug' => null,
|
43 |
+
'version' => null,
|
44 |
+
);
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Option key for DB version.
|
48 |
+
*
|
49 |
+
* @since 1.0.0
|
50 |
+
* @var string
|
51 |
+
*/
|
52 |
+
protected $version_key = '%s-db-version';
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Nonce format.
|
56 |
+
*
|
57 |
+
* @since 1.0.0
|
58 |
+
* @var string
|
59 |
+
*/
|
60 |
+
protected $nonce = '_%s-db-update-nonce';
|
61 |
+
|
62 |
+
/**
|
63 |
+
* Messages array.
|
64 |
+
*
|
65 |
+
* @since 1.0.0
|
66 |
+
* @var array
|
67 |
+
*/
|
68 |
+
protected $messages = array();
|
69 |
+
|
70 |
+
/**
|
71 |
+
* Update done trigger.
|
72 |
+
*
|
73 |
+
* @since 1.0.0
|
74 |
+
* @var bool
|
75 |
+
*/
|
76 |
+
protected $updated = false;
|
77 |
+
|
78 |
+
/**
|
79 |
+
* Core instance.
|
80 |
+
*
|
81 |
+
* @since 1.0.0
|
82 |
+
* @var object
|
83 |
+
*/
|
84 |
+
public $core = null;
|
85 |
+
|
86 |
+
/**
|
87 |
+
* Cherry_Db_Updater constructor.
|
88 |
+
*
|
89 |
+
* @since 1.0.0
|
90 |
+
* @return void
|
91 |
+
*/
|
92 |
+
public function __construct( $core = null, $args = array() ) {
|
93 |
+
|
94 |
+
$this->core = $core;
|
95 |
+
$this->args = wp_parse_args( $args, $this->args );
|
96 |
+
|
97 |
+
if ( ! is_admin() || ! current_user_can( 'update_plugins' ) ) {
|
98 |
+
return;
|
99 |
+
}
|
100 |
+
|
101 |
+
add_action( 'admin_notices', array( $this, 'init_notices' ) );
|
102 |
+
add_action( 'admin_init', array( $this, 'do_update' ) );
|
103 |
+
|
104 |
+
$this->messages = array(
|
105 |
+
'error' => esc_html__( 'Module DB Updater init error in %s - version and slug is required arguments', 'cherry-framework' ),
|
106 |
+
'update' => esc_html__( 'We need to update your database to the latest version.', 'cherry-framework' ),
|
107 |
+
'updated' => esc_html__( 'Update complete, thank you for updating to the latest version!', 'cherry-framework' ),
|
108 |
+
);
|
109 |
+
|
110 |
+
}
|
111 |
+
|
112 |
+
/**
|
113 |
+
* Process DB update.
|
114 |
+
*
|
115 |
+
* @since 1.0.0
|
116 |
+
*/
|
117 |
+
public function do_update() {
|
118 |
+
|
119 |
+
if ( ! $this->is_current_update() ) {
|
120 |
+
return;
|
121 |
+
}
|
122 |
+
|
123 |
+
$callbacks = $this->prepare_callbacks();
|
124 |
+
|
125 |
+
if ( ! empty( $callbacks ) ) {
|
126 |
+
foreach ( $callbacks as $callback ) {
|
127 |
+
if ( is_callable( $callback ) ) {
|
128 |
+
call_user_func( $callback );
|
129 |
+
}
|
130 |
+
}
|
131 |
+
}
|
132 |
+
|
133 |
+
$this->set_updated();
|
134 |
+
}
|
135 |
+
|
136 |
+
/**
|
137 |
+
* Finalize update.
|
138 |
+
*
|
139 |
+
* @since 1.0.0
|
140 |
+
*/
|
141 |
+
public function set_updated() {
|
142 |
+
$this->updated = true;
|
143 |
+
$option = sprintf( $this->version_key, esc_attr( $this->args['slug'] ) );
|
144 |
+
update_option( $option, esc_attr( $this->args['version'] ) );
|
145 |
+
}
|
146 |
+
|
147 |
+
/**
|
148 |
+
* Prepare callbacks array.
|
149 |
+
*
|
150 |
+
* @since 1.0.0
|
151 |
+
* @return array
|
152 |
+
*/
|
153 |
+
private function prepare_callbacks() {
|
154 |
+
|
155 |
+
$callbacks = array();
|
156 |
+
|
157 |
+
if ( empty( $this->args['callbacks'] ) ) {
|
158 |
+
return $callbacks;
|
159 |
+
}
|
160 |
+
|
161 |
+
ksort( $this->args['callbacks'] );
|
162 |
+
|
163 |
+
foreach ( $this->args['callbacks'] as $ver => $ver_cb ) {
|
164 |
+
if ( version_compare( $this->get_current_version(), $ver, '<' ) ) {
|
165 |
+
$callbacks = array_merge( $callbacks, $ver_cb );
|
166 |
+
}
|
167 |
+
}
|
168 |
+
|
169 |
+
return $callbacks;
|
170 |
+
}
|
171 |
+
|
172 |
+
/**
|
173 |
+
* Check if we processed update for plugin passed in arguments.
|
174 |
+
*
|
175 |
+
* @since 1.0.0
|
176 |
+
* @return bool
|
177 |
+
*/
|
178 |
+
private function is_current_update() {
|
179 |
+
|
180 |
+
if ( empty( $_GET['cherry_db_update'] ) || empty( $_GET['slug'] ) || empty( $_GET['_nonce'] ) ) {
|
181 |
+
return false;
|
182 |
+
}
|
183 |
+
|
184 |
+
if ( $_GET['slug'] !== $this->args['slug'] ) {
|
185 |
+
return false;
|
186 |
+
}
|
187 |
+
|
188 |
+
$nonce_action = sprintf( $this->nonce, esc_attr( $this->args['slug'] ) );
|
189 |
+
|
190 |
+
if ( ! wp_verify_nonce( $_GET['_nonce'], $nonce_action ) ) {
|
191 |
+
return false;
|
192 |
+
}
|
193 |
+
|
194 |
+
return true;
|
195 |
+
}
|
196 |
+
|
197 |
+
/**
|
198 |
+
* Init admin notices.
|
199 |
+
*
|
200 |
+
* @since 1.0.0
|
201 |
+
* @return void
|
202 |
+
*/
|
203 |
+
public function init_notices() {
|
204 |
+
|
205 |
+
$enabled = $this->validate_module_args();
|
206 |
+
|
207 |
+
if ( ! $enabled ) {
|
208 |
+
return;
|
209 |
+
}
|
210 |
+
|
211 |
+
$slug = esc_attr( $this->args['slug'] );
|
212 |
+
|
213 |
+
if ( $this->is_update_required() ) {
|
214 |
+
$this->show_notice( $slug );
|
215 |
+
}
|
216 |
+
|
217 |
+
if ( $this->is_updated() ) {
|
218 |
+
$this->show_updated_notice( $slug );
|
219 |
+
}
|
220 |
+
}
|
221 |
+
|
222 |
+
/**
|
223 |
+
* Returns current DB version.
|
224 |
+
*
|
225 |
+
* @since 1.0.0
|
226 |
+
* @return string
|
227 |
+
*/
|
228 |
+
private function get_current_version() {
|
229 |
+
$option = sprintf( $this->version_key, esc_attr( $this->args['slug'] ) );
|
230 |
+
return get_option( $option, '1.0.0' );
|
231 |
+
}
|
232 |
+
|
233 |
+
/**
|
234 |
+
* Check if database requires update.
|
235 |
+
*
|
236 |
+
* @since 1.0.0
|
237 |
+
* @return bool
|
238 |
+
*/
|
239 |
+
private function is_update_required() {
|
240 |
+
$current = $this->get_current_version();
|
241 |
+
return version_compare( $current, esc_attr( $this->args['version'] ), '<' );
|
242 |
+
}
|
243 |
+
|
244 |
+
/**
|
245 |
+
* Check if update was succesfully done.
|
246 |
+
*
|
247 |
+
* @since 1.0.0
|
248 |
+
* @return bool
|
249 |
+
*/
|
250 |
+
private function is_updated() {
|
251 |
+
|
252 |
+
if ( ! $this->is_current_update() ) {
|
253 |
+
return false;
|
254 |
+
}
|
255 |
+
|
256 |
+
return (bool) $this->updated;
|
257 |
+
}
|
258 |
+
|
259 |
+
/**
|
260 |
+
* Validate module arguments.
|
261 |
+
*
|
262 |
+
* @since 1.0.0
|
263 |
+
* @return bool
|
264 |
+
*/
|
265 |
+
private function validate_module_args() {
|
266 |
+
|
267 |
+
if ( empty( $this->args['slug'] ) || empty( $this->args['version'] ) ) {
|
268 |
+
echo '<div class="error"><p>';
|
269 |
+
printf(
|
270 |
+
$this->messages['error'],
|
271 |
+
'<b>' . str_replace( untrailingslashit( ABSPATH ), '', $this->core->settings['base_dir'] ) . '</b>'
|
272 |
+
);
|
273 |
+
echo '</p></div>';
|
274 |
+
|
275 |
+
return false;
|
276 |
+
}
|
277 |
+
|
278 |
+
return true;
|
279 |
+
}
|
280 |
+
|
281 |
+
/**
|
282 |
+
* Show notice.
|
283 |
+
*
|
284 |
+
* @since 1.0.0
|
285 |
+
* @param string $slug Plugin slug.
|
286 |
+
* @return void
|
287 |
+
*/
|
288 |
+
private function show_notice( $slug ) {
|
289 |
+
|
290 |
+
echo '<div class="notice notice-info">';
|
291 |
+
echo '<p>';
|
292 |
+
$this->notice_title( $slug );
|
293 |
+
echo $this->messages['update'];
|
294 |
+
echo '</p>';
|
295 |
+
echo '<p>';
|
296 |
+
$this->notice_submit( $slug );
|
297 |
+
echo '</p>';
|
298 |
+
echo '</div>';
|
299 |
+
|
300 |
+
}
|
301 |
+
|
302 |
+
/**
|
303 |
+
* Show update notice.
|
304 |
+
*
|
305 |
+
* @since 1.0.0
|
306 |
+
* @return void
|
307 |
+
*/
|
308 |
+
private function show_updated_notice() {
|
309 |
+
|
310 |
+
$slug = esc_attr( $this->args['slug'] );
|
311 |
+
|
312 |
+
echo '<div class="notice notice-success is-dismissible">';
|
313 |
+
echo '<p>';
|
314 |
+
$this->notice_title( $slug );
|
315 |
+
echo $this->messages['updated'];
|
316 |
+
echo '</p>';
|
317 |
+
echo '</div>';
|
318 |
+
|
319 |
+
}
|
320 |
+
|
321 |
+
/**
|
322 |
+
* Show plugin notice submit button.
|
323 |
+
*
|
324 |
+
* @since 1.0.0
|
325 |
+
* @param string $slug Plugin slug.
|
326 |
+
* @return void
|
327 |
+
*/
|
328 |
+
private function notice_submit( $slug = '' ) {
|
329 |
+
|
330 |
+
$format = '<a href="%1s" class="button button-primary">%2$s</a>';
|
331 |
+
$label = esc_html__( 'Start Update', 'cherry-framework' );
|
332 |
+
$url = add_query_arg(
|
333 |
+
array(
|
334 |
+
'cherry_db_update' => true,
|
335 |
+
'slug' => $slug,
|
336 |
+
'_nonce' => $this->create_nonce( $slug ),
|
337 |
+
),
|
338 |
+
esc_url( admin_url( 'index.php' ) )
|
339 |
+
);
|
340 |
+
|
341 |
+
printf( $format, $url, $label );
|
342 |
+
|
343 |
+
}
|
344 |
+
|
345 |
+
/**
|
346 |
+
* Create DB update nonce.
|
347 |
+
*
|
348 |
+
* @since 1.0.0
|
349 |
+
* @param string $slug Plugin slug.
|
350 |
+
* @return string
|
351 |
+
*/
|
352 |
+
private function create_nonce( $slug ) {
|
353 |
+
return wp_create_nonce( sprintf( $this->nonce, $slug ) );
|
354 |
+
}
|
355 |
+
|
356 |
+
/**
|
357 |
+
* Show plugin notice title.
|
358 |
+
*
|
359 |
+
* @since 1.0.0
|
360 |
+
* @param string $slug Plugin slug.
|
361 |
+
* @return void
|
362 |
+
*/
|
363 |
+
private function notice_title( $slug ) {
|
364 |
+
|
365 |
+
$name = str_replace( '-', ' ', $slug );
|
366 |
+
$name = ucwords( $name );
|
367 |
+
|
368 |
+
printf( '<strong>%1$s %2$s</strong> – ', $name, esc_html__( 'Data Update', 'cherry-framework' ) );
|
369 |
+
}
|
370 |
+
|
371 |
+
/**
|
372 |
+
* Returns the instance.
|
373 |
+
*
|
374 |
+
* @since 1.0.0
|
375 |
+
* @return object
|
376 |
+
*/
|
377 |
+
public static function get_instance( $core = null, $args = array() ) {
|
378 |
+
return new self( $core, $args );
|
379 |
+
}
|
380 |
+
}
|
381 |
+
}
|
cherry-framework/modules/cherry-dynamic-css/cherry-dynamic-css.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/**
|
3 |
* Module Name: Dynamic CSS
|
4 |
* Description: CSS parser which uses variables & functions for CSS code optimization
|
5 |
-
* Version: 1.
|
6 |
* Author: Cherry Team
|
7 |
* Author URI: http://www.cherryframework.com/
|
8 |
* License: GPLv3
|
@@ -10,9 +10,9 @@
|
|
10 |
*
|
11 |
* @package Cherry_Framework
|
12 |
* @subpackage Modules
|
13 |
-
* @version 1.
|
14 |
* @author Cherry Team <cherryframework@gmail.com>
|
15 |
-
* @copyright Copyright (c) 2012 -
|
16 |
* @link http://www.cherryframework.com/
|
17 |
* @license http://www.gnu.org/licenses/gpl-3.0.html
|
18 |
*/
|
@@ -72,6 +72,17 @@ if ( ! class_exists( 'Cherry_Dynamic_Css' ) ) {
|
|
72 |
*/
|
73 |
public static $collector = null;
|
74 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
/**
|
76 |
* Constructor for the module
|
77 |
*/
|
@@ -79,18 +90,46 @@ if ( ! class_exists( 'Cherry_Dynamic_Css' ) ) {
|
|
79 |
|
80 |
$this->core = $core;
|
81 |
$this->args = wp_parse_args( $args, array(
|
82 |
-
'prefix'
|
83 |
-
'type'
|
84 |
-
'
|
85 |
-
'
|
86 |
-
'
|
|
|
87 |
) );
|
88 |
|
89 |
-
|
90 |
-
|
91 |
$this->init_collector();
|
92 |
}
|
93 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
/**
|
95 |
* Initalize CSS collector class
|
96 |
*
|
@@ -296,12 +335,12 @@ if ( ! class_exists( 'Cherry_Dynamic_Css' ) ) {
|
|
296 |
}
|
297 |
|
298 |
/**
|
299 |
-
*
|
300 |
*
|
301 |
-
* @since 1.
|
302 |
-
* @return
|
303 |
*/
|
304 |
-
public function
|
305 |
|
306 |
if ( ! $this->args['css_files'] ) {
|
307 |
return false;
|
@@ -311,6 +350,14 @@ if ( ! class_exists( 'Cherry_Dynamic_Css' ) ) {
|
|
311 |
$this->args['css_files'] = array( $this->args['css_files'] );
|
312 |
}
|
313 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
314 |
ob_start();
|
315 |
|
316 |
foreach ( $this->args['css_files'] as $file ) {
|
@@ -344,6 +391,23 @@ if ( ! class_exists( 'Cherry_Dynamic_Css' ) ) {
|
|
344 |
*/
|
345 |
$parsed_css = apply_filters( 'cherry_dynamic_css_parsed_styles', $parsed_css, $this->args );
|
346 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
347 |
printf( '<style type="text/css">%s</style>', $parsed_css );
|
348 |
|
349 |
}
|
@@ -409,11 +473,13 @@ if ( ! class_exists( 'Cherry_Dynamic_Css' ) ) {
|
|
409 |
|
410 |
$functions = $this->get_css_functions();
|
411 |
|
412 |
-
// check if function exists and is not CSS
|
413 |
-
if ( ! array_key_exists( $matches[2], $functions )
|
414 |
-
|
415 |
-
|
416 |
-
|
|
|
|
|
417 |
}
|
418 |
|
419 |
$function = $functions[ $matches[2] ];
|
2 |
/**
|
3 |
* Module Name: Dynamic CSS
|
4 |
* Description: CSS parser which uses variables & functions for CSS code optimization
|
5 |
+
* Version: 1.4.0
|
6 |
* Author: Cherry Team
|
7 |
* Author URI: http://www.cherryframework.com/
|
8 |
* License: GPLv3
|
10 |
*
|
11 |
* @package Cherry_Framework
|
12 |
* @subpackage Modules
|
13 |
+
* @version 1.4.0
|
14 |
* @author Cherry Team <cherryframework@gmail.com>
|
15 |
+
* @copyright Copyright (c) 2012 - 2017, Cherry Team
|
16 |
* @link http://www.cherryframework.com/
|
17 |
* @license http://www.gnu.org/licenses/gpl-3.0.html
|
18 |
*/
|
72 |
*/
|
73 |
public static $collector = null;
|
74 |
|
75 |
+
/**
|
76 |
+
* Reserved words list
|
77 |
+
*
|
78 |
+
* @since 1.4.0
|
79 |
+
* @var array
|
80 |
+
*/
|
81 |
+
public $css_reserved = array(
|
82 |
+
'media',
|
83 |
+
'supports',
|
84 |
+
);
|
85 |
+
|
86 |
/**
|
87 |
* Constructor for the module
|
88 |
*/
|
90 |
|
91 |
$this->core = $core;
|
92 |
$this->args = wp_parse_args( $args, array(
|
93 |
+
'prefix' => 'blank',
|
94 |
+
'type' => 'theme_mod',
|
95 |
+
'parent_handle' => false,
|
96 |
+
'single' => true,
|
97 |
+
'css_files' => null,
|
98 |
+
'options' => array(),
|
99 |
) );
|
100 |
|
101 |
+
$this->init_dynamic_css();
|
|
|
102 |
$this->init_collector();
|
103 |
}
|
104 |
|
105 |
+
/**
|
106 |
+
* Initalize dynamic CSS with fallback compatibility.
|
107 |
+
*
|
108 |
+
* @since 1.3.0
|
109 |
+
* @return void
|
110 |
+
*/
|
111 |
+
public function init_dynamic_css() {
|
112 |
+
|
113 |
+
/**
|
114 |
+
* Not actual for now, required only for fallback compatibility.
|
115 |
+
*/
|
116 |
+
if ( empty( $this->args['parent_handle'] ) ) {
|
117 |
+
add_action( 'wp_head', array( $this, 'print_inline_css' ), 99 );
|
118 |
+
}
|
119 |
+
|
120 |
+
add_action( 'wp_enqueue_scripts', array( $this, 'add_inline_css' ), 99 );
|
121 |
+
}
|
122 |
+
|
123 |
+
/**
|
124 |
+
* Adds inline CSS into queue
|
125 |
+
*
|
126 |
+
* @since 1.3.0
|
127 |
+
* @return void
|
128 |
+
*/
|
129 |
+
public function add_inline_css() {
|
130 |
+
wp_add_inline_style( $this->args['parent_handle'], $this->get_inline_css() );
|
131 |
+
}
|
132 |
+
|
133 |
/**
|
134 |
* Initalize CSS collector class
|
135 |
*
|
335 |
}
|
336 |
|
337 |
/**
|
338 |
+
* Returns complied dynamic CSS string.
|
339 |
*
|
340 |
+
* @since 1.3.0
|
341 |
+
* @return string|bool false
|
342 |
*/
|
343 |
+
public function get_inline_css() {
|
344 |
|
345 |
if ( ! $this->args['css_files'] ) {
|
346 |
return false;
|
350 |
$this->args['css_files'] = array( $this->args['css_files'] );
|
351 |
}
|
352 |
|
353 |
+
/**
|
354 |
+
* Filter CSS reserved words list
|
355 |
+
*
|
356 |
+
* @since 1.4.0
|
357 |
+
* @var array
|
358 |
+
*/
|
359 |
+
$this->css_reserved = apply_filters( 'cherry_dynamic_css_reserved_words_list', $this->css_reserved );
|
360 |
+
|
361 |
ob_start();
|
362 |
|
363 |
foreach ( $this->args['css_files'] as $file ) {
|
391 |
*/
|
392 |
$parsed_css = apply_filters( 'cherry_dynamic_css_parsed_styles', $parsed_css, $this->args );
|
393 |
|
394 |
+
return $parsed_css;
|
395 |
+
}
|
396 |
+
|
397 |
+
/**
|
398 |
+
* Print inline CSS after current theme stylesheet
|
399 |
+
*
|
400 |
+
* @since 1.0.0
|
401 |
+
* @return void|bool false
|
402 |
+
*/
|
403 |
+
public function print_inline_css() {
|
404 |
+
|
405 |
+
$parsed_css = $this->get_inline_css();
|
406 |
+
|
407 |
+
if ( empty( $parsed_css ) ) {
|
408 |
+
return false;
|
409 |
+
}
|
410 |
+
|
411 |
printf( '<style type="text/css">%s</style>', $parsed_css );
|
412 |
|
413 |
}
|
473 |
|
474 |
$functions = $this->get_css_functions();
|
475 |
|
476 |
+
// check if function exists and is not CSS-reserved word
|
477 |
+
if ( ! array_key_exists( $matches[2], $functions ) ) {
|
478 |
+
if ( is_array( $this->css_reserved ) && in_array( $matches[2], $this->css_reserved ) ) {
|
479 |
+
return $matches[0];
|
480 |
+
} else {
|
481 |
+
return $not_found;
|
482 |
+
}
|
483 |
}
|
484 |
|
485 |
$function = $functions[ $matches[2] ];
|
cherry-framework/modules/cherry-handler/assets/js/cherry-handler.js
CHANGED
@@ -21,6 +21,7 @@
|
|
21 |
'cache': false,
|
22 |
'processData': true,
|
23 |
'url': '',
|
|
|
24 |
'beforeSendCallback': function() {},
|
25 |
'errorCallback': function() {},
|
26 |
'successCallback': function() {},
|
@@ -109,7 +110,7 @@
|
|
109 |
dataType: self.handlerSettings.data_type,
|
110 |
processData: settings.processData,
|
111 |
beforeSend: function( jqXHR, ajaxSettings ) {
|
112 |
-
if ( null !== self.ajaxRequest ) {
|
113 |
self.ajaxRequest.abort();
|
114 |
}
|
115 |
|
@@ -118,12 +119,27 @@
|
|
118 |
}
|
119 |
},
|
120 |
error: function( jqXHR, textStatus, errorThrown ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
if ( settings.errorCallback && 'function' === typeof( settings.errorCallback ) ) {
|
122 |
settings.errorCallback( jqXHR, textStatus, errorThrown );
|
123 |
}
|
124 |
},
|
125 |
success: function( data, textStatus, jqXHR ) {
|
126 |
self.ajaxProcessing = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
if ( settings.successCallback && 'function' === typeof( settings.successCallback ) ) {
|
128 |
settings.successCallback( data, textStatus, jqXHR );
|
129 |
}
|
@@ -131,6 +147,12 @@
|
|
131 |
CherryJsCore.cherryHandlerUtils.noticeCreate( data.type, data.message, self.handlerSettings.is_public );
|
132 |
},
|
133 |
complete: function( jqXHR, textStatus ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
if ( settings.completeCallback && 'function' === typeof( settings.completeCallback ) ) {
|
135 |
settings.completeCallback( jqXHR, textStatus );
|
136 |
}
|
21 |
'cache': false,
|
22 |
'processData': true,
|
23 |
'url': '',
|
24 |
+
'async': false,
|
25 |
'beforeSendCallback': function() {},
|
26 |
'errorCallback': function() {},
|
27 |
'successCallback': function() {},
|
110 |
dataType: self.handlerSettings.data_type,
|
111 |
processData: settings.processData,
|
112 |
beforeSend: function( jqXHR, ajaxSettings ) {
|
113 |
+
if ( null !== self.ajaxRequest && ! settings.async ) {
|
114 |
self.ajaxRequest.abort();
|
115 |
}
|
116 |
|
119 |
}
|
120 |
},
|
121 |
error: function( jqXHR, textStatus, errorThrown ) {
|
122 |
+
$( document ).trigger( {
|
123 |
+
type: 'cherry-ajax-handler-error',
|
124 |
+
jqXHR: jqXHR,
|
125 |
+
textStatus: textStatus,
|
126 |
+
errorThrown: errorThrown
|
127 |
+
} );
|
128 |
+
|
129 |
if ( settings.errorCallback && 'function' === typeof( settings.errorCallback ) ) {
|
130 |
settings.errorCallback( jqXHR, textStatus, errorThrown );
|
131 |
}
|
132 |
},
|
133 |
success: function( data, textStatus, jqXHR ) {
|
134 |
self.ajaxProcessing = false;
|
135 |
+
|
136 |
+
$( document ).trigger( {
|
137 |
+
type: 'cherry-ajax-handler-success',
|
138 |
+
response: data,
|
139 |
+
jqXHR: jqXHR,
|
140 |
+
textStatus: textStatus
|
141 |
+
} );
|
142 |
+
|
143 |
if ( settings.successCallback && 'function' === typeof( settings.successCallback ) ) {
|
144 |
settings.successCallback( data, textStatus, jqXHR );
|
145 |
}
|
147 |
CherryJsCore.cherryHandlerUtils.noticeCreate( data.type, data.message, self.handlerSettings.is_public );
|
148 |
},
|
149 |
complete: function( jqXHR, textStatus ) {
|
150 |
+
$( document ).trigger( {
|
151 |
+
type: 'cherry-ajax-handler-complete',
|
152 |
+
jqXHR: jqXHR,
|
153 |
+
textStatus: textStatus
|
154 |
+
} );
|
155 |
+
|
156 |
if ( settings.completeCallback && 'function' === typeof( settings.completeCallback ) ) {
|
157 |
settings.completeCallback( jqXHR, textStatus );
|
158 |
}
|
cherry-framework/modules/cherry-handler/assets/js/min/cherry-handler.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(e,a){"use strict";a.utilites.namespace("CherryAjaxHandler"),a.CherryAjaxHandler=function(
|
1 |
+
!function(e,a){"use strict";a.utilites.namespace("CherryAjaxHandler"),a.CherryAjaxHandler=function(t){var n=this,r={handlerId:"",cache:!1,processData:!0,url:"",beforeSendCallback:function(){},errorCallback:function(){},successCallback:function(){},completeCallback:function(){}};return t&&e.extend(r,t),window[r.handlerId]?(n.handlerSettings=window[r.handlerId]||{},n.ajaxRequest=null,n.ajaxProcessing=!1,n.data={action:n.handlerSettings.action,nonce:n.handlerSettings.nonce},""===r.url&&("false"===n.handlerSettings.is_public?r.url=window.ajaxurl:r.url=window.cherryHandlerAjaxUrl.ajax_url),n.send=function(){n.ajaxProcessing&&a.cherryHandlerUtils.noticeCreate("error-notice",n.handlerSettings.sys_messages.wait_processing,n.handlerSettings.is_public),n.ajaxProcessing=!0,n.ajaxRequest=jQuery.ajax({type:n.handlerSettings.type,url:r.url,data:n.data,cache:r.cache,dataType:n.handlerSettings.data_type,processData:r.processData,beforeSend:function(e,a){null!==n.ajaxRequest&&n.ajaxRequest.abort(),r.beforeSendCallback&&"function"==typeof r.beforeSendCallback&&r.beforeSendCallback(e,a)},error:function(a,t,n){e(document).trigger({type:"cherry-ajax-handler-error",jqXHR:a,textStatus:t,errorThrown:n}),r.errorCallback&&"function"==typeof r.errorCallback&&r.errorCallback(a,t,n)},success:function(t,c,s){n.ajaxProcessing=!1,e(document).trigger({type:"cherry-ajax-handler-success",response:t,jqXHR:s,textStatus:c}),r.successCallback&&"function"==typeof r.successCallback&&r.successCallback(t,c,s),a.cherryHandlerUtils.noticeCreate(t.type,t.message,n.handlerSettings.is_public)},complete:function(a,t){e(document).trigger({type:"cherry-ajax-handler-complete",jqXHR:a,textStatus:t}),r.completeCallback&&"function"==typeof r.completeCallback&&r.completeCallback(a,t)}})},n.sendData=function(e){var a=e||{};n.data={action:n.handlerSettings.action,nonce:n.handlerSettings.nonce,data:a},n.send()},void(n.sendFormData=function(t){var r,c=e(t);r=a.cherryHandlerUtils.serializeObject(c),n.sendData(r)})):(window.console&&window.console.warn("Handler id not found"),!1)},a.utilites.namespace("cherryHandlerUtils"),a.cherryHandlerUtils={noticeCreate:function(a,t,n){function r(){var a=100;e(".cherry-handler-notice").each(function(){e(this).css({top:a}),a+=e(this).outerHeight(!0)})}var c,s,i=0,o=n||!1;return!(!t||"true"===o)&&(c=e('<div class="cherry-handler-notice '+a+'"><span class="dashicons"></span><div class="inner">'+t+"</div></div>"),e("body").prepend(c),r(),i=-1*(c.outerWidth(!0)+10),c.css({right:i}),s=setTimeout(function(){c.css({right:10}).addClass("show-state")},100),s=setTimeout(function(){i=-1*(c.outerWidth(!0)+10),c.css({right:i}).removeClass("show-state")},4e3),void(s=setTimeout(function(){c.remove(),clearTimeout(s)},4500)))},serializeObject:function(a){var t=this,n={},r={},c={validate:/^[a-zA-Z][a-zA-Z0-9_-]*(?:\[(?:\d*|[a-zA-Z0-9_-]+)\])*$/,key:/[a-zA-Z0-9_-]+|(?=\[\])/g,push:/^$/,fixed:/^\d+$/,named:/^[a-zA-Z0-9_-]+$/};return this.build=function(e,a,t){return e[a]=t,e},this.push_counter=function(e){return void 0===r[e]&&(r[e]=0),r[e]++},e.each(a.serializeArray(),function(){var a,r,s,i;if(c.validate.test(this.name)){for(r=this.name.match(c.key),s=this.value,i=this.name;void 0!==(a=r.pop());)i=i.replace(new RegExp("\\["+a+"\\]$"),""),a.match(c.push)?s=t.build([],t.push_counter(i),s):a.match(c.fixed)?s=t.build([],a,s):a.match(c.named)&&(s=t.build({},a,s));n=e.extend(!0,n,s)}}),n}}}(jQuery,window.CherryJsCore);
|
cherry-framework/modules/cherry-handler/cherry-handler.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/**
|
3 |
* Module Name: Cherry handler
|
4 |
* Description: Initializes handlers
|
5 |
-
* Version: 1.1.
|
6 |
* Author: Cherry Team
|
7 |
* Author URI: http://www.cherryframework.com/
|
8 |
* License: GPLv3
|
@@ -10,7 +10,7 @@
|
|
10 |
*
|
11 |
* @package Cherry_Framework
|
12 |
* @subpackage Modules
|
13 |
-
* @version 1.1.
|
14 |
* @author Cherry Team <cherryframework@gmail.com>
|
15 |
* @copyright Copyright (c) 2012 - 2016, Cherry Team
|
16 |
* @link http://www.cherryframework.com/
|
@@ -31,15 +31,6 @@ if ( ! class_exists( 'Cherry_Handler' ) ) {
|
|
31 |
*/
|
32 |
class Cherry_Handler {
|
33 |
|
34 |
-
/**
|
35 |
-
* A reference to an instance of this class.
|
36 |
-
*
|
37 |
-
* @since 1.0.0
|
38 |
-
* @access private
|
39 |
-
* @var object
|
40 |
-
*/
|
41 |
-
private static $handlers_list = array();
|
42 |
-
|
43 |
/**
|
44 |
* Default settings.
|
45 |
*
|
@@ -111,19 +102,19 @@ if ( ! class_exists( 'Cherry_Handler' ) ) {
|
|
111 |
$nonce_action = ! empty( $this->settings['action'] ) ? $this->settings['action'] : 'cherry_ajax_nonce';
|
112 |
|
113 |
if ( ! wp_verify_nonce( $nonce, $nonce_action ) ) {
|
114 |
-
$response = array(
|
115 |
'message' => $this->settings['sys_messages']['invalid_nonce'],
|
116 |
'type' => 'error-notice',
|
117 |
-
);
|
118 |
|
119 |
wp_send_json( $response );
|
120 |
}
|
121 |
|
122 |
if ( ! empty( $this->settings['capability'] ) && ! current_user_can( $this->settings['capability'] ) ) {
|
123 |
-
$response = array(
|
124 |
'message' => $this->settings['sys_messages']['no_right'],
|
125 |
'type' => 'error-notice',
|
126 |
-
);
|
127 |
|
128 |
wp_send_json( $response );
|
129 |
}
|
@@ -138,19 +129,19 @@ if ( ! class_exists( 'Cherry_Handler' ) ) {
|
|
138 |
}
|
139 |
ob_end_clean();
|
140 |
|
141 |
-
$response = array(
|
142 |
-
'message'
|
143 |
-
'type'
|
144 |
-
'data'
|
145 |
-
);
|
146 |
|
147 |
wp_send_json( $response );
|
148 |
}
|
149 |
} else {
|
150 |
-
$response = array(
|
151 |
'message' => $this->settings['sys_messages']['invalid_base_data'],
|
152 |
'type' => 'error-notice',
|
153 |
-
);
|
154 |
|
155 |
wp_send_json( $response );
|
156 |
}
|
2 |
/**
|
3 |
* Module Name: Cherry handler
|
4 |
* Description: Initializes handlers
|
5 |
+
* Version: 1.1.2
|
6 |
* Author: Cherry Team
|
7 |
* Author URI: http://www.cherryframework.com/
|
8 |
* License: GPLv3
|
10 |
*
|
11 |
* @package Cherry_Framework
|
12 |
* @subpackage Modules
|
13 |
+
* @version 1.1.2
|
14 |
* @author Cherry Team <cherryframework@gmail.com>
|
15 |
* @copyright Copyright (c) 2012 - 2016, Cherry Team
|
16 |
* @link http://www.cherryframework.com/
|
31 |
*/
|
32 |
class Cherry_Handler {
|
33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
/**
|
35 |
* Default settings.
|
36 |
*
|
102 |
$nonce_action = ! empty( $this->settings['action'] ) ? $this->settings['action'] : 'cherry_ajax_nonce';
|
103 |
|
104 |
if ( ! wp_verify_nonce( $nonce, $nonce_action ) ) {
|
105 |
+
$response = apply_filters( 'cherry_handler_response_nonce', array(
|
106 |
'message' => $this->settings['sys_messages']['invalid_nonce'],
|
107 |
'type' => 'error-notice',
|
108 |
+
) );
|
109 |
|
110 |
wp_send_json( $response );
|
111 |
}
|
112 |
|
113 |
if ( ! empty( $this->settings['capability'] ) && ! current_user_can( $this->settings['capability'] ) ) {
|
114 |
+
$response = apply_filters( 'cherry_handler_response_capability', array(
|
115 |
'message' => $this->settings['sys_messages']['no_right'],
|
116 |
'type' => 'error-notice',
|
117 |
+
) );
|
118 |
|
119 |
wp_send_json( $response );
|
120 |
}
|
129 |
}
|
130 |
ob_end_clean();
|
131 |
|
132 |
+
$response = apply_filters( 'cherry_handler_response_data', array(
|
133 |
+
'message' => $this->settings['sys_messages']['access_is_allowed'],
|
134 |
+
'type' => 'success-notice',
|
135 |
+
'data' => $data,
|
136 |
+
) );
|
137 |
|
138 |
wp_send_json( $response );
|
139 |
}
|
140 |
} else {
|
141 |
+
$response = apply_filters( 'cherry_handler_invalid_data', array(
|
142 |
'message' => $this->settings['sys_messages']['invalid_base_data'],
|
143 |
'type' => 'error-notice',
|
144 |
+
) );
|
145 |
|
146 |
wp_send_json( $response );
|
147 |
}
|
cherry-framework/modules/cherry-interface-builder/cherry-interface-builder.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/**
|
3 |
* Module Name: Interface Builder
|
4 |
* Description: The module for the creation of interfaces in the WordPress admin panel
|
5 |
-
* Version: 1.1.
|
6 |
* Author: Cherry Team
|
7 |
* Author URI: http://www.cherryframework.com/
|
8 |
* License: GPLv3
|
@@ -10,7 +10,7 @@
|
|
10 |
*
|
11 |
* @package Cherry_Framework
|
12 |
* @subpackage Modules
|
13 |
-
* @version 1.1.
|
14 |
* @author Cherry Team <cherryframework@gmail.com>
|
15 |
* @copyright Copyright (c) 2012 - 2016, Cherry Team
|
16 |
* @link http://www.cherryframework.com/
|
@@ -38,20 +38,20 @@ if ( ! class_exists( 'Cherry_Interface_Builder' ) ) {
|
|
38 |
* @var array
|
39 |
*/
|
40 |
private $args = array(
|
41 |
-
'views'
|
42 |
-
'section'
|
43 |
-
'component-tab-vertical'
|
44 |
-
'component-tab-horizontal'
|
45 |
-
'component-toggle'
|
46 |
-
'component-accordion'
|
47 |
-
'component-repeater'
|
48 |
-
'settings'
|
49 |
-
'control'
|
50 |
-
'settings-children-title'
|
51 |
-
'tab-children-title'
|
52 |
-
'toggle-children-title'
|
53 |
-
'form'
|
54 |
-
'html'
|
55 |
),
|
56 |
'views_args' => array(
|
57 |
'parent' => '',
|
@@ -193,6 +193,7 @@ if ( ! class_exists( 'Cherry_Interface_Builder' ) ) {
|
|
193 |
* @return void
|
194 |
*/
|
195 |
protected function add_new_element( array $args = array(), $type = 'section' ) {
|
|
|
196 |
if ( ! isset( $args[0] ) && ! is_array( current( $args ) ) ) {
|
197 |
|
198 |
if ( 'control' !== $type && 'component' !== $type ) {
|
@@ -200,6 +201,7 @@ if ( ! class_exists( 'Cherry_Interface_Builder' ) ) {
|
|
200 |
}
|
201 |
|
202 |
$this->structure[ $args['id'] ] = $args;
|
|
|
203 |
} else {
|
204 |
foreach ( $args as $key => $value ) {
|
205 |
|
@@ -271,16 +273,17 @@ if ( ! class_exists( 'Cherry_Interface_Builder' ) ) {
|
|
271 |
*/
|
272 |
protected function get_view( $type = 'control', array $args = array() ) {
|
273 |
|
274 |
-
if ( empty( $view ) ) {
|
275 |
-
$path =
|
276 |
-
|
|
|
|
|
|
|
277 |
} else {
|
278 |
-
$path = $view;
|
279 |
}
|
280 |
|
281 |
-
|
282 |
-
|
283 |
-
return $view;
|
284 |
}
|
285 |
|
286 |
/**
|
@@ -322,7 +325,7 @@ if ( ! class_exists( 'Cherry_Interface_Builder' ) ) {
|
|
322 |
*/
|
323 |
protected function build( array $args = array() ) {
|
324 |
$output = '';
|
325 |
-
$views
|
326 |
|
327 |
foreach ( $args as $key => $value ) {
|
328 |
$value = wp_parse_args(
|
@@ -330,16 +333,18 @@ if ( ! class_exists( 'Cherry_Interface_Builder' ) ) {
|
|
330 |
$this->args['views_args']
|
331 |
);
|
332 |
|
333 |
-
$value['class'] = isset( $value['class'] ) ? $value['class'] . ' ' : ''
|
334 |
-
$value['class'] .= $value['id'] . ' '
|
|
|
335 |
if ( $value['scroll'] ) {
|
336 |
$value['class'] .= 'cherry-scroll ';
|
337 |
}
|
|
|
338 |
if ( $value['master'] ) {
|
339 |
-
$value['class'] .= $value['master'] . ' '
|
340 |
}
|
341 |
|
342 |
-
$type
|
343 |
$has_child = isset( $value['children'] ) && is_array( $value['children'] ) && ! empty( $value['children'] );
|
344 |
|
345 |
switch ( $type ) {
|
2 |
/**
|
3 |
* Module Name: Interface Builder
|
4 |
* Description: The module for the creation of interfaces in the WordPress admin panel
|
5 |
+
* Version: 1.1.2
|
6 |
* Author: Cherry Team
|
7 |
* Author URI: http://www.cherryframework.com/
|
8 |
* License: GPLv3
|
10 |
*
|
11 |
* @package Cherry_Framework
|
12 |
* @subpackage Modules
|
13 |
+
* @version 1.1.2
|
14 |
* @author Cherry Team <cherryframework@gmail.com>
|
15 |
* @copyright Copyright (c) 2012 - 2016, Cherry Team
|
16 |
* @link http://www.cherryframework.com/
|
38 |
* @var array
|
39 |
*/
|
40 |
private $args = array(
|
41 |
+
'views' => array(
|
42 |
+
'section' => 'inc/views/section.php',
|
43 |
+
'component-tab-vertical' => 'inc/views/component-tab-vertical.php',
|
44 |
+
'component-tab-horizontal' => 'inc/views/component-tab-horizontal.php',
|
45 |
+
'component-toggle' => 'inc/views/component-toggle.php',
|
46 |
+
'component-accordion' => 'inc/views/component-accordion.php',
|
47 |
+
'component-repeater' => 'inc/views/component-repeater.php',
|
48 |
+
'settings' => 'inc/views/settings.php',
|
49 |
+
'control' => 'inc/views/control.php',
|
50 |
+
'settings-children-title' => 'inc/views/settings-children-title.php',
|
51 |
+
'tab-children-title' => 'inc/views/tab-children-title.php',
|
52 |
+
'toggle-children-title' => 'inc/views/toggle-children-title.php',
|
53 |
+
'form' => 'inc/views/form.php',
|
54 |
+
'html' => 'inc/views/html.php',
|
55 |
),
|
56 |
'views_args' => array(
|
57 |
'parent' => '',
|
193 |
* @return void
|
194 |
*/
|
195 |
protected function add_new_element( array $args = array(), $type = 'section' ) {
|
196 |
+
|
197 |
if ( ! isset( $args[0] ) && ! is_array( current( $args ) ) ) {
|
198 |
|
199 |
if ( 'control' !== $type && 'component' !== $type ) {
|
201 |
}
|
202 |
|
203 |
$this->structure[ $args['id'] ] = $args;
|
204 |
+
|
205 |
} else {
|
206 |
foreach ( $args as $key => $value ) {
|
207 |
|
273 |
*/
|
274 |
protected function get_view( $type = 'control', array $args = array() ) {
|
275 |
|
276 |
+
if ( empty( $args['view'] ) ) {
|
277 |
+
$path = ( array_key_exists( $type, $this->args['views'] ) ) ? $this->args['views'][ $type ] : $this->args['views']['control'];
|
278 |
+
|
279 |
+
$path = is_array( $path ) ? $path[0] : $path;
|
280 |
+
$path = file_exists( $path ) ? $path : trailingslashit( dirname( __FILE__ ) ) . $path;
|
281 |
+
|
282 |
} else {
|
283 |
+
$path = $args['view'];
|
284 |
}
|
285 |
|
286 |
+
return Cherry_Toolkit::render_view( $path, $args );
|
|
|
|
|
287 |
}
|
288 |
|
289 |
/**
|
325 |
*/
|
326 |
protected function build( array $args = array() ) {
|
327 |
$output = '';
|
328 |
+
$views = $this->args['views'];
|
329 |
|
330 |
foreach ( $args as $key => $value ) {
|
331 |
$value = wp_parse_args(
|
333 |
$this->args['views_args']
|
334 |
);
|
335 |
|
336 |
+
$value['class'] = isset( $value['class'] ) ? $value['class'] . ' ' : '';
|
337 |
+
$value['class'] .= $value['id'] . ' ';
|
338 |
+
|
339 |
if ( $value['scroll'] ) {
|
340 |
$value['class'] .= 'cherry-scroll ';
|
341 |
}
|
342 |
+
|
343 |
if ( $value['master'] ) {
|
344 |
+
$value['class'] .= $value['master'] . ' ';
|
345 |
}
|
346 |
|
347 |
+
$type = array_key_exists( $value['type'], $views ) ? $value['type'] : 'field';
|
348 |
$has_child = isset( $value['children'] ) && is_array( $value['children'] ) && ! empty( $value['children'] );
|
349 |
|
350 |
switch ( $type ) {
|
cherry-framework/modules/cherry-interface-builder/inc/assets/cherry-interface-builder.js
CHANGED
@@ -9,6 +9,9 @@
|
|
9 |
CherryJsCore.interfaceBuilder = {
|
10 |
init: function() {
|
11 |
this.component.init();
|
|
|
|
|
|
|
12 |
},
|
13 |
component: {
|
14 |
tabClass: '.cherry-tab',
|
@@ -35,7 +38,8 @@
|
|
35 |
|
36 |
addEvent: function() {
|
37 |
$( 'body' )
|
38 |
-
.
|
|
|
39 |
this.tabClass + ' ' + this.buttonClass + ', ' +
|
40 |
this.toggleClass + ' ' + this.buttonClass + ', ' +
|
41 |
this.accordionClass + ' ' + this.buttonClass,
|
9 |
CherryJsCore.interfaceBuilder = {
|
10 |
init: function() {
|
11 |
this.component.init();
|
12 |
+
|
13 |
+
$( document )
|
14 |
+
.on( 'cherryInterfaceBuilder', this.component.init.bind( this.component ) );
|
15 |
},
|
16 |
component: {
|
17 |
tabClass: '.cherry-tab',
|
38 |
|
39 |
addEvent: function() {
|
40 |
$( 'body' )
|
41 |
+
.off( 'click.cherryInterfaceBuilder' )
|
42 |
+
.on( 'click.cherryInterfaceBuilder',
|
43 |
this.tabClass + ' ' + this.buttonClass + ', ' +
|
44 |
this.toggleClass + ' ' + this.buttonClass + ', ' +
|
45 |
this.accordionClass + ' ' + this.buttonClass,
|
cherry-framework/modules/cherry-interface-builder/inc/assets/cherry-interface-builder.scss
CHANGED
@@ -4,7 +4,7 @@ $color-3: #96989a; // Description color and tabs button text color.
|
|
4 |
$color-4: #b4b7ba; //
|
5 |
$color-5: #f1f1f1; // Scrollbar background
|
6 |
$color-6: #e5e5e5; // Hover scrollbar background
|
7 |
-
$color-7: #
|
8 |
$link-color: #298ffc; // link color.
|
9 |
$link-hover-color: #23282d; // link hover color.
|
10 |
|
@@ -78,7 +78,8 @@ html{
|
|
78 |
color: $link-hover-color;
|
79 |
}
|
80 |
&:focus{
|
81 |
-
outline: 1px solid
|
|
|
82 |
}
|
83 |
}
|
84 |
&__description{
|
@@ -200,21 +201,26 @@ html{
|
|
200 |
border:0;
|
201 |
background: none;
|
202 |
cursor: pointer;
|
|
|
203 |
.cherry-toggle__title {
|
204 |
font-weight: 700;
|
205 |
font-size: 14px;
|
206 |
float: left;
|
207 |
margin: 0;
|
208 |
}
|
209 |
-
span{
|
|
|
|
|
|
|
|
|
|
|
210 |
font-size: 25px;
|
211 |
color: $color-4;
|
212 |
-
float: right;
|
213 |
padding: 5px 5px;
|
214 |
width: 10px;
|
215 |
height: 9px;
|
216 |
text-align: left;
|
217 |
-
|
218 |
&.hide-icon{
|
219 |
&:before{
|
220 |
position: relative;
|
@@ -230,14 +236,14 @@ html{
|
|
230 |
top: -7px;
|
231 |
left: -9px;
|
232 |
}
|
233 |
-
position: relative;
|
234 |
-
left: 14px;
|
235 |
transform:scaleX(0);
|
236 |
transition: all 300ms cubic-bezier(0.215, 0.61, 0.355, 1);
|
237 |
}
|
238 |
}
|
239 |
&.active{
|
240 |
-
span{
|
241 |
&.show-icon{
|
242 |
transform:scaleX(1);
|
243 |
transition-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275);
|
@@ -447,7 +453,7 @@ html{
|
|
447 |
border: none;
|
448 |
border-radius: $br-radius;
|
449 |
&:hover, &:active {
|
450 |
-
background:
|
451 |
}
|
452 |
}
|
453 |
&-track {
|
4 |
$color-4: #b4b7ba; //
|
5 |
$color-5: #f1f1f1; // Scrollbar background
|
6 |
$color-6: #e5e5e5; // Hover scrollbar background
|
7 |
+
$color-7: #206ff4; // Scrollbar track background
|
8 |
$link-color: #298ffc; // link color.
|
9 |
$link-hover-color: #23282d; // link hover color.
|
10 |
|
78 |
color: $link-hover-color;
|
79 |
}
|
80 |
&:focus{
|
81 |
+
outline: 1px solid rgba(41, 143, 252, .6);
|
82 |
+
box-shadow: 0px 0px 2px rgba(41,143,252,0.6);
|
83 |
}
|
84 |
}
|
85 |
&__description{
|
201 |
border:0;
|
202 |
background: none;
|
203 |
cursor: pointer;
|
204 |
+
position: relative;
|
205 |
.cherry-toggle__title {
|
206 |
font-weight: 700;
|
207 |
font-size: 14px;
|
208 |
float: left;
|
209 |
margin: 0;
|
210 |
}
|
211 |
+
>span[class*="icon"]{
|
212 |
+
position: absolute;
|
213 |
+
top: 50%;
|
214 |
+
right: 5px;
|
215 |
+
margin-top: -10px;
|
216 |
+
|
217 |
font-size: 25px;
|
218 |
color: $color-4;
|
|
|
219 |
padding: 5px 5px;
|
220 |
width: 10px;
|
221 |
height: 9px;
|
222 |
text-align: left;
|
223 |
+
overflow: hidden;
|
224 |
&.hide-icon{
|
225 |
&:before{
|
226 |
position: relative;
|
236 |
top: -7px;
|
237 |
left: -9px;
|
238 |
}
|
239 |
+
//position: relative;
|
240 |
+
//left: 14px;
|
241 |
transform:scaleX(0);
|
242 |
transition: all 300ms cubic-bezier(0.215, 0.61, 0.355, 1);
|
243 |
}
|
244 |
}
|
245 |
&.active{
|
246 |
+
>span[class*="icon"]{
|
247 |
&.show-icon{
|
248 |
transform:scaleX(1);
|
249 |
transition-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275);
|
453 |
border: none;
|
454 |
border-radius: $br-radius;
|
455 |
&:hover, &:active {
|
456 |
+
background: $color-7;
|
457 |
}
|
458 |
}
|
459 |
&-track {
|
cherry-framework/modules/cherry-interface-builder/inc/assets/min/cherry-interface-builder.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.cherry-ui-kit button *{pointer-events:none}.cherry-component__content .cherry-settings__content{display:none}.cherry-component__content .cherry-settings__content.show{display:inherit}html{font-size:13px}.cherry-ui-kit h1{font-weight:700;font-size:2.308rem;line-height:2.308rem}.cherry-ui-kit h1 .dashicons{font-size:3rem;line-height:inherit;width:20px;margin:0 20px 0 -5px}.cherry-ui-kit h2{font-weight:600;font-size:1.538rem;line-height:1.538rem}.cherry-ui-kit h2 .dashicons{font-size:2rem;line-height:inherit;width:20px;margin-right:20px}.cherry-ui-kit h3{font-weight:600;font-size:1.231rem;line-height:1.231rem}.cherry-ui-kit h3 .dashicons{font-size:1.7rem;line-height:inherit;margin-right:5px}.cherry-ui-kit h4{font-weight:500;font-size:1.077rem;line-height:1.077rem}.cherry-ui-kit h5{font-weight:500;font-size:1.077rem;line-height:1.077rem}.cherry-ui-kit h6{font-weight:400;font-size:1rem;line-height:1rem}.cherry-ui-kit a{color:#298ffc;text-decoration:none}.cherry-ui-kit a:hover{color:#23282d}.cherry-ui-kit a:focus{outline:1px solid #23282d}.cherry-ui-kit__description{font-size:0.9rem;color:#96989a;margin:10px 0}.cherry-ui-kit__title{margin:20px 0}.cherry-ui-kit.hide{display:none}.cherry-control+.cherry-control,.cherry-settings+.cherry-control{border-top:1px solid rgba(0,0,0,0.1)}.cherry-section{padding:10px;background-color:#fff;margin-left:-10px}.cherry-section__title,.cherry-section__description{margin:10px 0 0 0}.cherry-section+.cherry-ui-kit{border-top:1px solid rgba(0,0,0,0.1)}@media (min-width: 783px){.cherry-section{box-shadow:0px 5px 21px rgba(0,0,0,0.1);border-radius:5px;border:1px solid rgba(0,0,0,0.1);padding:15px;margin:15px 15px 0 0}.cherry-section__holder{background-color:#efefef;border-radius:5px;padding:15px}.cherry-section__info{background-color:#fff;border-radius:5px;padding:15px;box-shadow:0px 5px 21px rgba(0,0,0,0.1);margin-bottom:15px}.cherry-section .cherry-settings{box-shadow:0px 5px 21px rgba(0,0,0,0.1);border-radius:5px;border:1px solid rgba(0,0,0,0.1);background-color:#fff;margin-top:15px}.cherry-section .cherry-settings:first-child{margin-top:0}}@media (min-width: 961px){.cherry-section{padding:30px;margin:20px 20px 0 0}.cherry-section__info{padding:30px;margin-bottom:30px}.cherry-section__holder{padding:30px}.cherry-section .cherry-settings{margin-top:30px}}.cherry-component{padding:20px 0}@media (min-width: 783px){.cherry-component{padding:15px}}@media (min-width: 961px){.cherry-component{padding:30px}}.cherry-component+*{border-top:1px solid rgba(0,0,0,0.1)}.cherry-component__title{margin-top:0}.cherry-component .cherry-component__content .cherry-settings{padding:0;border-top:none}.cherry-component__button{display:block;min-height:45px;-webkit-transition:all 300ms cubic-bezier(0.55, 0.055, 0.675, 0.19);transition:all 300ms cubic-bezier(0.55, 0.055, 0.675, 0.19)}.cherry-component__button .cherry-ui-kit__title{color:inherit}.cherry-component__button.active,.cherry-component__button:hover{color:#298ffc;-webkit-transition-timing-function:cubic-bezier(0.215, 0.61, 0.355, 1);transition-timing-function:cubic-bezier(0.215, 0.61, 0.355, 1)}.cherry-component__button:focus{outline:none;box-shadow:inset 0px 0px 10px rgba(41,143,252,0.5);-webkit-transition-timing-function:cubic-bezier(0.175, 0.885, 0.32, 1.275);transition-timing-function:cubic-bezier(0.175, 0.885, 0.32, 1.275)}.cherry-component.cherry-accordion .cherry-component__button,.cherry-component.cherry-toggle .cherry-component__button{width:100%;padding:15px 20px;border:0;background:none;cursor:pointer}.cherry-component.cherry-accordion .cherry-component__button .cherry-toggle__title,.cherry-component.cherry-toggle .cherry-component__button .cherry-toggle__title{font-weight:700;font-size:14px;float:left;margin:0}.cherry-component.cherry-accordion .cherry-component__button span,.cherry-component.cherry-toggle .cherry-component__button span{font-size:25px;color:#b4b7ba;float:right;padding:5px 5px;width:10px;height:9px;text-align:left;margin-right:-6px}.cherry-component.cherry-accordion .cherry-component__button span.hide-icon,.cherry-component.cherry-toggle .cherry-component__button span.hide-icon{-webkit-transform:scaleX(1);-ms-transform:scaleX(1);transform:scaleX(1);-webkit-transition:all 300ms cubic-bezier(0.175, 0.885, 0.32, 1.275);transition:all 300ms cubic-bezier(0.175, 0.885, 0.32, 1.275)}.cherry-component.cherry-accordion .cherry-component__button span.hide-icon:before,.cherry-component.cherry-toggle .cherry-component__button span.hide-icon:before{position:relative;top:-8px;left:-9px}.cherry-component.cherry-accordion .cherry-component__button span.show-icon,.cherry-component.cherry-toggle .cherry-component__button span.show-icon{position:relative;left:14px;-webkit-transform:scaleX(0);-ms-transform:scaleX(0);transform:scaleX(0);-webkit-transition:all 300ms cubic-bezier(0.215, 0.61, 0.355, 1);transition:all 300ms cubic-bezier(0.215, 0.61, 0.355, 1)}.cherry-component.cherry-accordion .cherry-component__button span.show-icon:before,.cherry-component.cherry-toggle .cherry-component__button span.show-icon:before{position:relative;top:-7px;left:-9px}.cherry-component.cherry-accordion .cherry-component__button.active span.show-icon,.cherry-component.cherry-toggle .cherry-component__button.active span.show-icon{-webkit-transform:scaleX(1);-ms-transform:scaleX(1);transform:scaleX(1);-webkit-transition-timing-function:cubic-bezier(0.175, 0.885, 0.32, 1.275);transition-timing-function:cubic-bezier(0.175, 0.885, 0.32, 1.275)}.cherry-component.cherry-accordion .cherry-component__button.active span.hide-icon,.cherry-component.cherry-toggle .cherry-component__button.active span.hide-icon{-webkit-transform:scaleX(0);-ms-transform:scaleX(0);transform:scaleX(0);-webkit-transition-timing-function:cubic-bezier(0.215, 0.61, 0.355, 1);transition-timing-function:cubic-bezier(0.215, 0.61, 0.355, 1)}.cherry-component.cherry-accordion .cherry-component__button+.cherry-settings__content,.cherry-component.cherry-toggle .cherry-component__button+.cherry-settings__content{border-top:1px solid rgba(0,0,0,0.1)}.cherry-component.cherry-accordion>.cherry-ui-kit__content>.cherry-settings+.cherry-settings,.cherry-component.cherry-toggle>.cherry-ui-kit__content>.cherry-settings+.cherry-settings{margin-top:10px}.cherry-component.cherry-accordion>.cherry-ui-kit__content>.cherry-settings,.cherry-component.cherry-toggle>.cherry-ui-kit__content>.cherry-settings{box-shadow:0px 5px 21px rgba(0,0,0,0.1);border-radius:5px;border:1px solid rgba(0,0,0,0.1)}.cherry-component.cherry-tab .cherry-tab__tabs{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-flow:row wrap;-ms-flex-flow:row wrap;flex-flow:row wrap;-webkit-box-pack:start;-webkit-justify-content:flex-start;-ms-flex-pack:start;justify-content:flex-start;-webkit-box-align:start;-webkit-align-items:flex-start;-ms-flex-align:start;align-items:flex-start;-webkit-align-content:flex-start;-ms-flex-line-pack:start;align-content:flex-start;border-bottom:1px solid rgba(0,0,0,0.1)}.cherry-component.cherry-tab .cherry-tab__tabs .cherry-component__button{-webkit-box-ordinal-group:1;-webkit-order:0;-ms-flex-order:0;order:0;-webkit-box-flex:0;-webkit-flex:0 1 100%;-ms-flex:0 1 100%;flex:0 1 100%;-webkit-align-self:auto;-ms-flex-item-align:auto;align-self:auto;padding:15px 20px;border:0;background:none;cursor:pointer}.cherry-component.cherry-tab .cherry-tab__tabs .cherry-component__button.active{-ms-box-shadow:inset 0px -3px 0px 0px #298ffc;box-shadow:inset 0px -3px 0px 0px #298ffc}.cherry-component.cherry-tab .cherry-tab__tabs .cherry-component__button .cherry-tab__title{font-weight:700;font-size:14px;float:left;margin:0}.cherry-component.cherry-tab .cherry-tab__tabs .cherry-component__button+button{border-top:1px solid rgba(0,0,0,0.1)}.cherry-component.cherry-tab .cherry-tab__body{box-shadow:0px 5px 21px rgba(0,0,0,0.1);border-radius:5px;border:1px solid rgba(0,0,0,0.1);background-color:#fff}.cherry-component.cherry-tab .cherry-tab__body .cherry-settings{box-shadow:none;border-radius:0;border:none;background-color:inherit;margin:0}@media (min-width: 783px){.cherry-component.cherry-tab .cherry-tab__tabs{border:solid 1px rgba(0,0,0,0.1)}.cherry-component.cherry-tab .cherry-tab__tabs .cherry-component__button+button{border-top:none}.cherry-component.cherry-tab .cherry-tab__body{border:none}.cherry-component.cherry-tab .cherry-tab__body .cherry-tab__content{border:1px solid rgba(0,0,0,0.1)}.cherry-component.cherry-tab--horizontal>.cherry-tab__body{border-radius:none}.cherry-component.cherry-tab--horizontal>.cherry-tab__body>.cherry-tab__tabs{-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;border-radius:5px 5px 0 0;border-bottom:none}.cherry-component.cherry-tab--horizontal>.cherry-tab__body>.cherry-tab__tabs .cherry-component__button{-webkit-box-flex:0;-webkit-flex:0 1 auto;-ms-flex:0 1 auto;flex:0 1 auto}.cherry-component.cherry-tab--horizontal>.cherry-tab__body>.cherry-tab__content{border-radius:0 0 5px 5px}.cherry-component.cherry-tab--vertical>.cherry-tab__body{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;border-radius:none}.cherry-component.cherry-tab--vertical>.cherry-tab__body>.cherry-tab__tabs{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-box-flex:0;-webkit-flex:0 1 25%;-ms-flex:0 1 25%;flex:0 1 25%;border-radius:5px 0 0 5px;border-right:none}.cherry-component.cherry-tab--vertical>.cherry-tab__body>.cherry-tab__tabs .cherry-component__button{text-align:right}.cherry-component.cherry-tab--vertical>.cherry-tab__body>.cherry-tab__tabs .cherry-component__button .cherry-tab__title{width:100%}.cherry-component.cherry-tab--vertical>.cherry-tab__body>.cherry-tab__tabs .cherry-component__button.active{box-shadow:inset -3px 0px 0px #298ffc}.cherry-component.cherry-tab--vertical>.cherry-tab__body>.cherry-tab__content{-webkit-box-flex:0;-webkit-flex:0 1 75%;-ms-flex:0 1 75%;flex:0 1 75%;border-radius:0 5px 5px 0}}@media (min-width: 1200px){.cherry-component.cherry-tab--vertical .cherry-tab__tabs{-webkit-box-flex:0;-webkit-flex:0 1 20%;-ms-flex:0 1 20%;flex:0 1 20%}.cherry-component.cherry-tab--vertical .cherry-tab__content{-webkit-box-flex:0;-webkit-flex:0 1 80%;-ms-flex:0 1 80%;flex:0 1 80%}}.cherry-settings+.cherry-settings{border-top:1px solid rgba(0,0,0,0.1)}.cherry-settings .cherry-settings__title{margin-bottom:10px}.cherry-settings__description,.cherry-settings .cherry-settings__title{margin-left:10px}@media (min-width: 783px){.cherry-settings__description,.cherry-settings .cherry-settings__title{margin-left:15px}}@media (min-width: 961px){.cherry-settings__description,.cherry-settings .cherry-settings__title{margin-left:30px}}.cherry-control{padding:15px 20px}.cherry-control__title{margin:0 0 10px 0}.cherry-control__description{margin-top:0}.cherry-control .cherry-ui-container{margin:0}@media (min-width: 783px){.cherry-control{padding:15px;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-flow:row nowrap;-ms-flex-flow:row nowrap;flex-flow:row nowrap}.cherry-control__info{-webkit-box-flex:0;-webkit-flex:0 1 30%;-ms-flex:0 1 30%;flex:0 1 30%;padding-right:15px}.cherry-control__content{-webkit-box-flex:0;-webkit-flex:0 1 70%;-ms-flex:0 1 70%;flex:0 1 70%}}@media (min-width: 961px){.cherry-control{padding:30px}}@media (min-width: 783px){.cherry-section.cherry-scroll>.cherry-section__holder>.cherry-section__inner,.cherry-tab__content>.cherry-scroll,.cherry-accordion__content>.cherry-scroll>.cherry-settings__content,.cherry-toggle__content>.cherry-scroll>.cherry-settings__content{max-height:700px;overflow-y:auto;position:relative}.cherry-section.cherry-scroll>.cherry-section__holder>.cherry-section__inner::-webkit-scrollbar,.cherry-tab__content>.cherry-scroll::-webkit-scrollbar,.cherry-accordion__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar,.cherry-toggle__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar{width:10px;height:10px}.cherry-section.cherry-scroll>.cherry-section__holder>.cherry-section__inner::-webkit-scrollbar-button,.cherry-tab__content>.cherry-scroll::-webkit-scrollbar-button,.cherry-accordion__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar-button,.cherry-toggle__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar-button{width:0px;height:0px}.cherry-section.cherry-scroll>.cherry-section__holder>.cherry-section__inner::-webkit-scrollbar-thumb,.cherry-tab__content>.cherry-scroll::-webkit-scrollbar-thumb,.cherry-accordion__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar-thumb,.cherry-toggle__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar-thumb{background-color:#298ffc;border:none;border-radius:5px}.cherry-section.cherry-scroll>.cherry-section__holder>.cherry-section__inner::-webkit-scrollbar-thumb:hover,.cherry-section.cherry-scroll>.cherry-section__holder>.cherry-section__inner::-webkit-scrollbar-thumb:active,.cherry-tab__content>.cherry-scroll::-webkit-scrollbar-thumb:hover,.cherry-tab__content>.cherry-scroll::-webkit-scrollbar-thumb:active,.cherry-accordion__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar-thumb:hover,.cherry-accordion__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar-thumb:active,.cherry-toggle__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar-thumb:hover,.cherry-toggle__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar-thumb:active{background:#206ff4}.cherry-section.cherry-scroll>.cherry-section__holder>.cherry-section__inner::-webkit-scrollbar-track,.cherry-tab__content>.cherry-scroll::-webkit-scrollbar-track,.cherry-accordion__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar-track,.cherry-toggle__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar-track{background-color:#fff;border:none;border-radius:5px}.cherry-section.cherry-scroll>.cherry-section__holder>.cherry-section__inner::-webkit-scrollbar-corner,.cherry-tab__content>.cherry-scroll::-webkit-scrollbar-corner,.cherry-accordion__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar-corner,.cherry-toggle__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar-corner{background:transparent}}
|
1 |
+
.cherry-ui-kit button *{pointer-events:none}.cherry-component__content .cherry-settings__content{display:none}.cherry-component__content .cherry-settings__content.show{display:inherit}html{font-size:13px}.cherry-ui-kit h1{font-weight:700;font-size:2.308rem;line-height:2.308rem}.cherry-ui-kit h1 .dashicons{font-size:3rem;line-height:inherit;width:20px;margin:0 20px 0 -5px}.cherry-ui-kit h2{font-weight:600;font-size:1.538rem;line-height:1.538rem}.cherry-ui-kit h2 .dashicons{font-size:2rem;line-height:inherit;width:20px;margin-right:20px}.cherry-ui-kit h3{font-weight:600;font-size:1.231rem;line-height:1.231rem}.cherry-ui-kit h3 .dashicons{font-size:1.7rem;line-height:inherit;margin-right:5px}.cherry-ui-kit h4{font-weight:500;font-size:1.077rem;line-height:1.077rem}.cherry-ui-kit h5{font-weight:500;font-size:1.077rem;line-height:1.077rem}.cherry-ui-kit h6{font-weight:400;font-size:1rem;line-height:1rem}.cherry-ui-kit a{color:#298ffc;text-decoration:none}.cherry-ui-kit a:hover{color:#23282d}.cherry-ui-kit a:focus{outline:1px solid rgba(41,143,252,0.6);box-shadow:0px 0px 2px rgba(41,143,252,0.6)}.cherry-ui-kit__description{font-size:0.9rem;color:#96989a;margin:10px 0}.cherry-ui-kit__title{margin:20px 0}.cherry-ui-kit.hide{display:none}.cherry-control+.cherry-control,.cherry-settings+.cherry-control{border-top:1px solid rgba(0,0,0,0.1)}.cherry-section{padding:10px;background-color:#fff;margin-left:-10px}.cherry-section__title,.cherry-section__description{margin:10px 0 0 0}.cherry-section+.cherry-ui-kit{border-top:1px solid rgba(0,0,0,0.1)}@media (min-width: 783px){.cherry-section{box-shadow:0px 5px 21px rgba(0,0,0,0.1);border-radius:5px;border:1px solid rgba(0,0,0,0.1);padding:15px;margin:15px 15px 0 0}.cherry-section__holder{background-color:#efefef;border-radius:5px;padding:15px}.cherry-section__info{background-color:#fff;border-radius:5px;padding:15px;box-shadow:0px 5px 21px rgba(0,0,0,0.1);margin-bottom:15px}.cherry-section .cherry-settings{box-shadow:0px 5px 21px rgba(0,0,0,0.1);border-radius:5px;border:1px solid rgba(0,0,0,0.1);background-color:#fff;margin-top:15px}.cherry-section .cherry-settings:first-child{margin-top:0}}@media (min-width: 961px){.cherry-section{padding:30px;margin:20px 20px 0 0}.cherry-section__info{padding:30px;margin-bottom:30px}.cherry-section__holder{padding:30px}.cherry-section .cherry-settings{margin-top:30px}}.cherry-component{padding:20px 0}@media (min-width: 783px){.cherry-component{padding:15px}}@media (min-width: 961px){.cherry-component{padding:30px}}.cherry-component+*{border-top:1px solid rgba(0,0,0,0.1)}.cherry-component__title{margin-top:0}.cherry-component .cherry-component__content .cherry-settings{padding:0;border-top:none}.cherry-component__button{display:block;min-height:45px;-webkit-transition:all 300ms cubic-bezier(0.55, 0.055, 0.675, 0.19);transition:all 300ms cubic-bezier(0.55, 0.055, 0.675, 0.19)}.cherry-component__button .cherry-ui-kit__title{color:inherit}.cherry-component__button.active,.cherry-component__button:hover{color:#298ffc;-webkit-transition-timing-function:cubic-bezier(0.215, 0.61, 0.355, 1);transition-timing-function:cubic-bezier(0.215, 0.61, 0.355, 1)}.cherry-component__button:focus{outline:none;box-shadow:inset 0px 0px 10px rgba(41,143,252,0.5);-webkit-transition-timing-function:cubic-bezier(0.175, 0.885, 0.32, 1.275);transition-timing-function:cubic-bezier(0.175, 0.885, 0.32, 1.275)}.cherry-component.cherry-accordion .cherry-component__button,.cherry-component.cherry-toggle .cherry-component__button{width:100%;padding:15px 20px;border:0;background:none;cursor:pointer;position:relative}.cherry-component.cherry-accordion .cherry-component__button .cherry-toggle__title,.cherry-component.cherry-toggle .cherry-component__button .cherry-toggle__title{font-weight:700;font-size:14px;float:left;margin:0}.cherry-component.cherry-accordion .cherry-component__button>span[class*="icon"],.cherry-component.cherry-toggle .cherry-component__button>span[class*="icon"]{position:absolute;top:50%;right:5px;margin-top:-10px;font-size:25px;color:#b4b7ba;padding:5px 5px;width:10px;height:9px;text-align:left;overflow:hidden}.cherry-component.cherry-accordion .cherry-component__button>span[class*="icon"].hide-icon,.cherry-component.cherry-toggle .cherry-component__button>span[class*="icon"].hide-icon{-webkit-transform:scaleX(1);transform:scaleX(1);-webkit-transition:all 300ms cubic-bezier(0.175, 0.885, 0.32, 1.275);transition:all 300ms cubic-bezier(0.175, 0.885, 0.32, 1.275)}.cherry-component.cherry-accordion .cherry-component__button>span[class*="icon"].hide-icon:before,.cherry-component.cherry-toggle .cherry-component__button>span[class*="icon"].hide-icon:before{position:relative;top:-8px;left:-9px}.cherry-component.cherry-accordion .cherry-component__button>span[class*="icon"].show-icon,.cherry-component.cherry-toggle .cherry-component__button>span[class*="icon"].show-icon{-webkit-transform:scaleX(0);transform:scaleX(0);-webkit-transition:all 300ms cubic-bezier(0.215, 0.61, 0.355, 1);transition:all 300ms cubic-bezier(0.215, 0.61, 0.355, 1)}.cherry-component.cherry-accordion .cherry-component__button>span[class*="icon"].show-icon:before,.cherry-component.cherry-toggle .cherry-component__button>span[class*="icon"].show-icon:before{position:relative;top:-7px;left:-9px}.cherry-component.cherry-accordion .cherry-component__button.active>span[class*="icon"].show-icon,.cherry-component.cherry-toggle .cherry-component__button.active>span[class*="icon"].show-icon{-webkit-transform:scaleX(1);transform:scaleX(1);-webkit-transition-timing-function:cubic-bezier(0.175, 0.885, 0.32, 1.275);transition-timing-function:cubic-bezier(0.175, 0.885, 0.32, 1.275)}.cherry-component.cherry-accordion .cherry-component__button.active>span[class*="icon"].hide-icon,.cherry-component.cherry-toggle .cherry-component__button.active>span[class*="icon"].hide-icon{-webkit-transform:scaleX(0);transform:scaleX(0);-webkit-transition-timing-function:cubic-bezier(0.215, 0.61, 0.355, 1);transition-timing-function:cubic-bezier(0.215, 0.61, 0.355, 1)}.cherry-component.cherry-accordion .cherry-component__button+.cherry-settings__content,.cherry-component.cherry-toggle .cherry-component__button+.cherry-settings__content{border-top:1px solid rgba(0,0,0,0.1)}.cherry-component.cherry-accordion>.cherry-ui-kit__content>.cherry-settings+.cherry-settings,.cherry-component.cherry-toggle>.cherry-ui-kit__content>.cherry-settings+.cherry-settings{margin-top:10px}.cherry-component.cherry-accordion>.cherry-ui-kit__content>.cherry-settings,.cherry-component.cherry-toggle>.cherry-ui-kit__content>.cherry-settings{box-shadow:0px 5px 21px rgba(0,0,0,0.1);border-radius:5px;border:1px solid rgba(0,0,0,0.1)}.cherry-component.cherry-tab .cherry-tab__tabs{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-flow:row wrap;flex-flow:row wrap;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start;-ms-flex-line-pack:start;align-content:flex-start;border-bottom:1px solid rgba(0,0,0,0.1)}.cherry-component.cherry-tab .cherry-tab__tabs .cherry-component__button{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0;-webkit-box-flex:0;-ms-flex:0 1 100%;flex:0 1 100%;-ms-flex-item-align:auto;-ms-grid-row-align:auto;align-self:auto;padding:15px 20px;border:0;background:none;cursor:pointer}.cherry-component.cherry-tab .cherry-tab__tabs .cherry-component__button.active{-ms-box-shadow:inset 0px -3px 0px 0px #298ffc;box-shadow:inset 0px -3px 0px 0px #298ffc}.cherry-component.cherry-tab .cherry-tab__tabs .cherry-component__button .cherry-tab__title{font-weight:700;font-size:14px;float:left;margin:0}.cherry-component.cherry-tab .cherry-tab__tabs .cherry-component__button+button{border-top:1px solid rgba(0,0,0,0.1)}.cherry-component.cherry-tab .cherry-tab__body{box-shadow:0px 5px 21px rgba(0,0,0,0.1);border-radius:5px;border:1px solid rgba(0,0,0,0.1);background-color:#fff}.cherry-component.cherry-tab .cherry-tab__body .cherry-settings{box-shadow:none;border-radius:0;border:none;background-color:inherit;margin:0}@media (min-width: 783px){.cherry-component.cherry-tab .cherry-tab__tabs{border:solid 1px rgba(0,0,0,0.1)}.cherry-component.cherry-tab .cherry-tab__tabs .cherry-component__button+button{border-top:none}.cherry-component.cherry-tab .cherry-tab__body{border:none}.cherry-component.cherry-tab .cherry-tab__body .cherry-tab__content{border:1px solid rgba(0,0,0,0.1)}.cherry-component.cherry-tab--horizontal>.cherry-tab__body{border-radius:none}.cherry-component.cherry-tab--horizontal>.cherry-tab__body>.cherry-tab__tabs{-ms-flex-wrap:nowrap;flex-wrap:nowrap;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;border-radius:5px 5px 0 0;border-bottom:none}.cherry-component.cherry-tab--horizontal>.cherry-tab__body>.cherry-tab__tabs .cherry-component__button{-webkit-box-flex:0;-ms-flex:0 1 auto;flex:0 1 auto}.cherry-component.cherry-tab--horizontal>.cherry-tab__body>.cherry-tab__content{border-radius:0 0 5px 5px}.cherry-component.cherry-tab--vertical>.cherry-tab__body{display:-webkit-box;display:-ms-flexbox;display:flex;border-radius:none}.cherry-component.cherry-tab--vertical>.cherry-tab__body>.cherry-tab__tabs{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-flex:0;-ms-flex:0 1 25%;flex:0 1 25%;border-radius:5px 0 0 5px;border-right:none}.cherry-component.cherry-tab--vertical>.cherry-tab__body>.cherry-tab__tabs .cherry-component__button{text-align:right}.cherry-component.cherry-tab--vertical>.cherry-tab__body>.cherry-tab__tabs .cherry-component__button .cherry-tab__title{width:100%}.cherry-component.cherry-tab--vertical>.cherry-tab__body>.cherry-tab__tabs .cherry-component__button.active{box-shadow:inset -3px 0px 0px #298ffc}.cherry-component.cherry-tab--vertical>.cherry-tab__body>.cherry-tab__content{-webkit-box-flex:0;-ms-flex:0 1 75%;flex:0 1 75%;border-radius:0 5px 5px 0}}@media (min-width: 1200px){.cherry-component.cherry-tab--vertical .cherry-tab__tabs{-webkit-box-flex:0;-ms-flex:0 1 20%;flex:0 1 20%}.cherry-component.cherry-tab--vertical .cherry-tab__content{-webkit-box-flex:0;-ms-flex:0 1 80%;flex:0 1 80%}}.cherry-settings+.cherry-settings{border-top:1px solid rgba(0,0,0,0.1)}.cherry-settings .cherry-settings__title{margin-bottom:10px}.cherry-settings__description,.cherry-settings .cherry-settings__title{margin-left:10px}@media (min-width: 783px){.cherry-settings__description,.cherry-settings .cherry-settings__title{margin-left:15px}}@media (min-width: 961px){.cherry-settings__description,.cherry-settings .cherry-settings__title{margin-left:30px}}.cherry-control{padding:15px 20px}.cherry-control__title{margin:0 0 10px 0}.cherry-control__description{margin-top:0}.cherry-control .cherry-ui-container{margin:0}@media (min-width: 783px){.cherry-control{padding:15px;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-flow:row nowrap;flex-flow:row nowrap}.cherry-control__info{-webkit-box-flex:0;-ms-flex:0 1 30%;flex:0 1 30%;padding-right:15px}.cherry-control__content{-webkit-box-flex:0;-ms-flex:0 1 70%;flex:0 1 70%}}@media (min-width: 961px){.cherry-control{padding:30px}}@media (min-width: 783px){.cherry-section.cherry-scroll>.cherry-section__holder>.cherry-section__inner,.cherry-tab__content>.cherry-scroll,.cherry-accordion__content>.cherry-scroll>.cherry-settings__content,.cherry-toggle__content>.cherry-scroll>.cherry-settings__content{max-height:700px;overflow-y:auto;position:relative}.cherry-section.cherry-scroll>.cherry-section__holder>.cherry-section__inner::-webkit-scrollbar,.cherry-tab__content>.cherry-scroll::-webkit-scrollbar,.cherry-accordion__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar,.cherry-toggle__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar{width:10px;height:10px}.cherry-section.cherry-scroll>.cherry-section__holder>.cherry-section__inner::-webkit-scrollbar-button,.cherry-tab__content>.cherry-scroll::-webkit-scrollbar-button,.cherry-accordion__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar-button,.cherry-toggle__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar-button{width:0px;height:0px}.cherry-section.cherry-scroll>.cherry-section__holder>.cherry-section__inner::-webkit-scrollbar-thumb,.cherry-tab__content>.cherry-scroll::-webkit-scrollbar-thumb,.cherry-accordion__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar-thumb,.cherry-toggle__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar-thumb{background-color:#298ffc;border:none;border-radius:5px}.cherry-section.cherry-scroll>.cherry-section__holder>.cherry-section__inner::-webkit-scrollbar-thumb:hover,.cherry-section.cherry-scroll>.cherry-section__holder>.cherry-section__inner::-webkit-scrollbar-thumb:active,.cherry-tab__content>.cherry-scroll::-webkit-scrollbar-thumb:hover,.cherry-tab__content>.cherry-scroll::-webkit-scrollbar-thumb:active,.cherry-accordion__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar-thumb:hover,.cherry-accordion__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar-thumb:active,.cherry-toggle__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar-thumb:hover,.cherry-toggle__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar-thumb:active{background:#206ff4}.cherry-section.cherry-scroll>.cherry-section__holder>.cherry-section__inner::-webkit-scrollbar-track,.cherry-tab__content>.cherry-scroll::-webkit-scrollbar-track,.cherry-accordion__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar-track,.cherry-toggle__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar-track{background-color:#fff;border:none;border-radius:5px}.cherry-section.cherry-scroll>.cherry-section__holder>.cherry-section__inner::-webkit-scrollbar-corner,.cherry-tab__content>.cherry-scroll::-webkit-scrollbar-corner,.cherry-accordion__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar-corner,.cherry-toggle__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar-corner{background:transparent}}
|
cherry-framework/modules/cherry-interface-builder/inc/assets/min/cherry-interface-builder.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(t,s){"use strict";s.utilites.namespace("interfaceBuilder"),s.interfaceBuilder={init:function(){this.component.init()},component:{tabClass:".cherry-tab",accordionClass:".cherry-accordion",toggleClass:".cherry-toggle",buttonClass:".cherry-component__button",contentClass:".cherry-settings__content",buttonActiveClass:"active",showClass:"show",localStorage:{},init:function(){this.localStorage=this.getState()||{},this.componentInit(this.tabClass),this.componentInit(this.accordionClass),this.componentInit(this.toggleClass),this.addEvent()},addEvent:function(){t("body").on("click",this.tabClass+" "+this.buttonClass+", "+this.toggleClass+" "+this.buttonClass+", "+this.accordionClass+" "+this.buttonClass,this.componentClick.bind(this))},componentInit:function(s){var
|
1 |
+
!function(t,s){"use strict";s.utilites.namespace("interfaceBuilder"),s.interfaceBuilder={init:function(){this.component.init(),t(document).on("cherryInterfaceBuilder",this.component.init.bind(this.component))},component:{tabClass:".cherry-tab",accordionClass:".cherry-accordion",toggleClass:".cherry-toggle",buttonClass:".cherry-component__button",contentClass:".cherry-settings__content",buttonActiveClass:"active",showClass:"show",localStorage:{},init:function(){this.localStorage=this.getState()||{},this.componentInit(this.tabClass),this.componentInit(this.accordionClass),this.componentInit(this.toggleClass),this.addEvent()},addEvent:function(){t("body").off("click.cherryInterfaceBuilder").on("click.cherryInterfaceBuilder",this.tabClass+" "+this.buttonClass+", "+this.toggleClass+" "+this.buttonClass+", "+this.accordionClass+" "+this.buttonClass,this.componentClick.bind(this))},componentInit:function(s){var e=this,a=t(s),o=null,i=null,n=null,l="";a.each(function(a,c){switch(c=t(c),o=c.data("compotent-id"),s){case e.toggleClass:e.localStorage[o]&&e.localStorage[o].length&&(l=e.localStorage[o].join(", ")),t(e.contentClass,c).not(l).addClass(e.showClass).prevAll(e.buttonClass).addClass(e.buttonActiveClass);break;case e.tabClass:case e.accordionClass:e.localStorage[o]?(n=e.localStorage[o][0],i=t('[data-content-id="'+n+'"]',c)):(i=t(e.buttonClass,c).eq(0),n=i.data("content-id")),e.showElement(i,c,n)}})},componentClick:function(s){var e,a=t(s.target),o=a.closest(this.tabClass+", "+this.accordionClass+", "+this.toggleClass),i=new RegExp(this.tabClass+"|"+this.accordionClass+"|"+this.toggleClass),n=o[0].className.match(i)[0].replace(" ","."),l=a.data("content-id"),c=o.data("compotent-id"),r=a.hasClass(this.buttonActiveClass);switch(n){case this.tabClass:r||(this.hideElement(o),this.showElement(a,o,l),this.localStorage[c]=new Array(l),this.setState());break;case this.accordionClass:this.hideElement(o),r?this.localStorage[c]={}:(this.showElement(a,o,l),this.localStorage[c]=new Array(l)),this.setState();break;case this.toggleClass:a.toggleClass(this.buttonActiveClass).nextAll(l).toggleClass(this.showClass),Array.isArray(this.localStorage[c])?(e=this.localStorage[c].indexOf(l),-1!==e?this.localStorage[c].splice(e,1):this.localStorage[c].push(l)):this.localStorage[c]=new Array(l),this.setState()}return a.blur(),!1},showElement:function(s,e,a){s.addClass(this.buttonActiveClass),e.data("content-id",a),t(a,e).addClass(this.showClass)},hideElement:function(s){var e=s.data("content-id");t('[data-content-id="'+e+'"]',s).removeClass(this.buttonActiveClass),t(e,s).removeClass(this.showClass)},getState:function(){try{return JSON.parse(localStorage.getItem("interface-builder"))}catch(t){return!1}},setState:function(){try{localStorage.setItem("interface-builder",JSON.stringify(this.localStorage))}catch(t){return!1}}}},s.interfaceBuilder.init()}(jQuery,window.CherryJsCore);
|
cherry-framework/modules/cherry-js-core/assets/js/min/cherry-js-core.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var CherryJsCore={};!function(r){"use strict";CherryJsCore={name:"Cherry Js Core",version:"1.0.0",author:"Cherry Team",variable:{$document:r(document),$window:r(window),browser:r.browser,browser_supported:!0,security:window.cherry_ajax,loaded_assets:{script:window.wp_load_script,style:window.wp_load_style},ui_auto_init:"true"===window.ui_init_object.auto_init
|
1 |
+
var CherryJsCore={};!function(r){"use strict";CherryJsCore={name:"Cherry Js Core",version:"1.0.0",author:"Cherry Team",variable:{$document:r(document),$window:r(window),browser:r.browser,browser_supported:!0,security:window.cherry_ajax,loaded_assets:{script:window.wp_load_script,style:window.wp_load_style},ui_auto_init:"true"===window.ui_init_object.auto_init,ui_auto_target:window.ui_init_object.targets},status:{on_load:!1,is_ready:!1},init:function(){CherryJsCore.set_variable(),r(document).on("ready",CherryJsCore.ready),r(window).on("load",CherryJsCore.load)},set_variable:function(){CherryJsCore.variable.browser_supported=function(){var r=CherryJsCore.variable.browser,e={msie:[8]};for(var i in e)if("undefined"!==r.browser)for(var o in e[i])if(r.version<=e[i][o])return!1;return!0}()},ready:function(){CherryJsCore.status.is_ready=!0,CherryJsCore.expressions.widget_ui_init()},load:function(){CherryJsCore.status.on_load=!0},expressions:{widget_ui_init:function(){r(document).on("widget-added widget-updated",function(e,i){r("body").trigger({type:"cherry-ui-elements-init",_target:i})})}},utilites:{namespace:function(r){var e=r.split("."),i=CherryJsCore,o=e.length,t=0;for(t=0;t<o;t+=1)"undefined"==typeof i[e[t]]&&(i[e[t]]={}),i=i[e[t]];return i}}},CherryJsCore.init()}(jQuery);
|
cherry-framework/modules/cherry-js-core/cherry-js-core.php
CHANGED
@@ -46,7 +46,7 @@ if ( ! class_exists( 'Cherry_Js_Core' ) ) {
|
|
46 |
* @since 1.0.0
|
47 |
* @var string
|
48 |
*/
|
49 |
-
private $module_version = '1.1.
|
50 |
|
51 |
/**
|
52 |
* Default options.
|
46 |
* @since 1.0.0
|
47 |
* @var string
|
48 |
*/
|
49 |
+
private $module_version = '1.1.2';
|
50 |
|
51 |
/**
|
52 |
* Default options.
|
cherry-framework/modules/cherry-post-formats-api/cherry-post-formats-api.php
CHANGED
@@ -793,7 +793,6 @@ if ( ! class_exists( 'Cherry_Post_Formats_Api' ) ) {
|
|
793 |
return;
|
794 |
}
|
795 |
|
796 |
-
$atts = array_merge( $atts, $this->args['gallery_args'] );
|
797 |
$result = $this->get_gallery_html( $attachments, $atts );
|
798 |
|
799 |
return $result;
|
793 |
return;
|
794 |
}
|
795 |
|
|
|
796 |
$result = $this->get_gallery_html( $attachments, $atts );
|
797 |
|
798 |
return $result;
|
cherry-framework/modules/cherry-post-formats-api/inc/class-cherry-facebook-embed.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
* @author Cherry Team <cherryframework@gmail.com>
|
8 |
* @copyright Copyright (c) 2012 - 2016, Cherry Team
|
9 |
* @link http://www.cherryframework.com/
|
10 |
-
* @license http://www.gnu.org/licenses/
|
11 |
*/
|
12 |
|
13 |
// If this file is called directly, abort.
|
7 |
* @author Cherry Team <cherryframework@gmail.com>
|
8 |
* @copyright Copyright (c) 2012 - 2016, Cherry Team
|
9 |
* @link http://www.cherryframework.com/
|
10 |
+
* @license http://www.gnu.org/licenses/gpl-3.0.en.html
|
11 |
*/
|
12 |
|
13 |
// If this file is called directly, abort.
|
cherry-framework/modules/cherry-template-manager/cherry-template-manager.php
CHANGED
@@ -2,15 +2,15 @@
|
|
2 |
/**
|
3 |
* Module Name: Template Manager
|
4 |
* Description: Module load and parse tmpl files.
|
5 |
-
* Version: 1.0.
|
6 |
* Author: Cherry Team
|
7 |
* Author URI: http://www.cherryframework.com/
|
8 |
* License: GPLv3
|
9 |
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
*
|
11 |
-
* @package
|
12 |
* @subpackage Modules
|
13 |
-
* @version 1.0.
|
14 |
* @author Cherry Team <cherryframework@gmail.com>
|
15 |
* @copyright Copyright (c) 2012 - 2016, Cherry Team
|
16 |
* @link http://www.cherryframework.com/
|
@@ -32,22 +32,20 @@ if ( ! class_exists( 'Cherry_Template_Manager' ) ) {
|
|
32 |
class Cherry_Template_Manager {
|
33 |
|
34 |
/**
|
35 |
-
*
|
36 |
*
|
37 |
* @since 1.0.0
|
38 |
* @access private
|
39 |
-
* @var
|
40 |
*/
|
41 |
-
private
|
42 |
|
43 |
/**
|
44 |
-
*
|
45 |
*
|
46 |
-
* @
|
47 |
-
* @access private
|
48 |
-
* @var array
|
49 |
*/
|
50 |
-
|
51 |
|
52 |
/**
|
53 |
* It contains a class Cherry_Template_Parser.
|
@@ -75,9 +73,11 @@ if ( ! class_exists( 'Cherry_Template_Manager' ) ) {
|
|
75 |
* @return void
|
76 |
*/
|
77 |
public function __construct( $core = null, $args = array() ) {
|
|
|
|
|
78 |
$this->include_class();
|
79 |
|
80 |
-
$this->args =
|
81 |
$args,
|
82 |
$this->args
|
83 |
);
|
@@ -105,25 +105,8 @@ if ( ! class_exists( 'Cherry_Template_Manager' ) ) {
|
|
105 |
* @return void
|
106 |
*/
|
107 |
public function set_class() {
|
108 |
-
$this->loader = Cherry_Template_Loader
|
109 |
-
$this->parser = Cherry_Template_Parser
|
110 |
-
}
|
111 |
-
|
112 |
-
/**
|
113 |
-
* Returns the instance.
|
114 |
-
*
|
115 |
-
* @since 1.0.0
|
116 |
-
* @access public
|
117 |
-
* @return object
|
118 |
-
*/
|
119 |
-
public static function get_instance() {
|
120 |
-
|
121 |
-
// If the single instance hasn't been set, set it now.
|
122 |
-
if ( null == self::$instance ) {
|
123 |
-
self::$instance = new self;
|
124 |
-
}
|
125 |
-
|
126 |
-
return self::$instance;
|
127 |
}
|
128 |
}
|
129 |
}
|
2 |
/**
|
3 |
* Module Name: Template Manager
|
4 |
* Description: Module load and parse tmpl files.
|
5 |
+
* Version: 1.0.2
|
6 |
* Author: Cherry Team
|
7 |
* Author URI: http://www.cherryframework.com/
|
8 |
* License: GPLv3
|
9 |
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
*
|
11 |
+
* @package Template_Manager
|
12 |
* @subpackage Modules
|
13 |
+
* @version 1.0.2
|
14 |
* @author Cherry Team <cherryframework@gmail.com>
|
15 |
* @copyright Copyright (c) 2012 - 2016, Cherry Team
|
16 |
* @link http://www.cherryframework.com/
|
32 |
class Cherry_Template_Manager {
|
33 |
|
34 |
/**
|
35 |
+
* Module arguments.
|
36 |
*
|
37 |
* @since 1.0.0
|
38 |
* @access private
|
39 |
+
* @var array
|
40 |
*/
|
41 |
+
private $args = array();
|
42 |
|
43 |
/**
|
44 |
+
* Core instance
|
45 |
*
|
46 |
+
* @var object
|
|
|
|
|
47 |
*/
|
48 |
+
public $core = null;
|
49 |
|
50 |
/**
|
51 |
* It contains a class Cherry_Template_Parser.
|
73 |
* @return void
|
74 |
*/
|
75 |
public function __construct( $core = null, $args = array() ) {
|
76 |
+
$this->core = $core;
|
77 |
+
|
78 |
$this->include_class();
|
79 |
|
80 |
+
$this->args = wp_parse_args(
|
81 |
$args,
|
82 |
$this->args
|
83 |
);
|
105 |
* @return void
|
106 |
*/
|
107 |
public function set_class() {
|
108 |
+
$this->loader = new Cherry_Template_Loader( $this->args, $this );
|
109 |
+
$this->parser = new Cherry_Template_Parser( $this->args, $this );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
110 |
}
|
111 |
}
|
112 |
}
|
cherry-framework/modules/cherry-template-manager/inc/cherry-template-loader.php
CHANGED
@@ -1,16 +1,8 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
*
|
4 |
-
* Description: Module load tmpl files.
|
5 |
-
* Version: 1.0.0
|
6 |
-
* Author: Cherry Team
|
7 |
-
* Author URI: http://www.cherryframework.com/
|
8 |
-
* License: GPLv3
|
9 |
-
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
*
|
11 |
-
* @package
|
12 |
-
* @subpackage Modules
|
13 |
-
* @version 1.0.0
|
14 |
* @author Cherry Team <cherryframework@gmail.com>
|
15 |
* @copyright Copyright (c) 2012 - 2016, Cherry Team
|
16 |
* @link http://www.cherryframework.com/
|
@@ -31,15 +23,6 @@ if ( ! class_exists( 'Cherry_Template_Loader' ) ) {
|
|
31 |
*/
|
32 |
class Cherry_Template_Loader {
|
33 |
|
34 |
-
/**
|
35 |
-
* A reference to an instance of this class.
|
36 |
-
*
|
37 |
-
* @since 1.0.0
|
38 |
-
* @access private
|
39 |
-
* @var object
|
40 |
-
*/
|
41 |
-
private static $instance = null;
|
42 |
-
|
43 |
/**
|
44 |
* A reference to an instance of this Cherry_Template_Manager class.
|
45 |
*
|
@@ -58,8 +41,8 @@ if ( ! class_exists( 'Cherry_Template_Loader' ) ) {
|
|
58 |
*/
|
59 |
private $args = array(
|
60 |
'template_dir' => 'templates/%1$s/%2$s.tmpl',
|
61 |
-
'slug' =>
|
62 |
-
'upload_dir' =>
|
63 |
);
|
64 |
|
65 |
/**
|
@@ -71,7 +54,7 @@ if ( ! class_exists( 'Cherry_Template_Loader' ) ) {
|
|
71 |
*/
|
72 |
public function __construct( $args = array(), $main_class = null ) {
|
73 |
|
74 |
-
$this->args =
|
75 |
$args,
|
76 |
$this->args
|
77 |
);
|
@@ -120,12 +103,11 @@ if ( ! class_exists( 'Cherry_Template_Loader' ) ) {
|
|
120 |
* Return product slug.
|
121 |
*
|
122 |
* @since 1.0.0
|
123 |
-
* @since 1.1.3 Using dirname( __FILE__ ) instead of __DIR__.
|
124 |
* @access private
|
125 |
* @return string
|
126 |
*/
|
127 |
private function get_slug() {
|
128 |
-
$file_dir = wp_normalize_path( dirname(
|
129 |
$product_dir = $this->get_project_root();
|
130 |
|
131 |
$slug = str_replace( $product_dir, '', $file_dir );
|
@@ -138,14 +120,13 @@ if ( ! class_exists( 'Cherry_Template_Loader' ) ) {
|
|
138 |
* Function return the project root dir, themes or plugins.
|
139 |
*
|
140 |
* @since 1.0.0
|
141 |
-
* @since 1.1.3 Using dirname( __FILE__ ) instead of __DIR__.
|
142 |
* @access private
|
143 |
* @return string
|
144 |
*/
|
145 |
private function get_project_root() {
|
146 |
$themes_dir = wp_normalize_path( get_theme_root() );
|
147 |
$plugin_dir = wp_normalize_path( WP_PLUGIN_DIR );
|
148 |
-
$file_dir = wp_normalize_path( dirname(
|
149 |
$project_root = ( false === strpos( $file_dir, $themes_dir ) ) ? $plugin_dir : $themes_dir;
|
150 |
|
151 |
return trailingslashit( $project_root );
|
@@ -184,26 +165,13 @@ if ( ! class_exists( 'Cherry_Template_Loader' ) ) {
|
|
184 |
* Read template (static).
|
185 |
*
|
186 |
* @since 1.0.0
|
|
|
187 |
* @param string $file Correct file path.
|
188 |
* @access public
|
189 |
* @return string|bool
|
190 |
*/
|
191 |
public function get_contents( $file ) {
|
192 |
-
|
193 |
-
|
194 |
-
$file = wp_normalize_path( $file );
|
195 |
-
|
196 |
-
// Check for existence.
|
197 |
-
if ( ! $content = $wp_filesystem->get_contents( $file ) ) {
|
198 |
-
return false;
|
199 |
-
}
|
200 |
-
|
201 |
-
if ( ! $content ) {
|
202 |
-
// Return error object.
|
203 |
-
return new WP_Error( 'reading_error', 'Error when reading file' );
|
204 |
-
}
|
205 |
-
|
206 |
-
return $content;
|
207 |
}
|
208 |
|
209 |
/**
|
@@ -221,22 +189,5 @@ if ( ! class_exists( 'Cherry_Template_Loader' ) ) {
|
|
221 |
return;
|
222 |
}
|
223 |
}
|
224 |
-
|
225 |
-
|
226 |
-
/**
|
227 |
-
* Returns the instance.
|
228 |
-
*
|
229 |
-
* @since 1.0.0
|
230 |
-
* @return object
|
231 |
-
*/
|
232 |
-
public static function get_instance( $args, $main_class ) {
|
233 |
-
|
234 |
-
// If the single instance hasn't been set, set it now.
|
235 |
-
if ( null == self::$instance ) {
|
236 |
-
self::$instance = new self( $args, $main_class );
|
237 |
-
}
|
238 |
-
|
239 |
-
return self::$instance;
|
240 |
-
}
|
241 |
}
|
242 |
}
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Class for load templates.
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
*
|
5 |
+
* @package Template_Manager
|
|
|
|
|
6 |
* @author Cherry Team <cherryframework@gmail.com>
|
7 |
* @copyright Copyright (c) 2012 - 2016, Cherry Team
|
8 |
* @link http://www.cherryframework.com/
|
23 |
*/
|
24 |
class Cherry_Template_Loader {
|
25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
/**
|
27 |
* A reference to an instance of this Cherry_Template_Manager class.
|
28 |
*
|
41 |
*/
|
42 |
private $args = array(
|
43 |
'template_dir' => 'templates/%1$s/%2$s.tmpl',
|
44 |
+
'slug' => null,
|
45 |
+
'upload_dir' => null,
|
46 |
);
|
47 |
|
48 |
/**
|
54 |
*/
|
55 |
public function __construct( $args = array(), $main_class = null ) {
|
56 |
|
57 |
+
$this->args = wp_parse_args(
|
58 |
$args,
|
59 |
$this->args
|
60 |
);
|
103 |
* Return product slug.
|
104 |
*
|
105 |
* @since 1.0.0
|
|
|
106 |
* @access private
|
107 |
* @return string
|
108 |
*/
|
109 |
private function get_slug() {
|
110 |
+
$file_dir = wp_normalize_path( dirname( $this->cherry_template_manager_class->core->settings['extra_base_dir'] ) );
|
111 |
$product_dir = $this->get_project_root();
|
112 |
|
113 |
$slug = str_replace( $product_dir, '', $file_dir );
|
120 |
* Function return the project root dir, themes or plugins.
|
121 |
*
|
122 |
* @since 1.0.0
|
|
|
123 |
* @access private
|
124 |
* @return string
|
125 |
*/
|
126 |
private function get_project_root() {
|
127 |
$themes_dir = wp_normalize_path( get_theme_root() );
|
128 |
$plugin_dir = wp_normalize_path( WP_PLUGIN_DIR );
|
129 |
+
$file_dir = wp_normalize_path( dirname( $this->cherry_template_manager_class->core->settings['extra_base_dir'] ) );
|
130 |
$project_root = ( false === strpos( $file_dir, $themes_dir ) ) ? $plugin_dir : $themes_dir;
|
131 |
|
132 |
return trailingslashit( $project_root );
|
165 |
* Read template (static).
|
166 |
*
|
167 |
* @since 1.0.0
|
168 |
+
* @since 1.0.1 - Use Cherry_Toolkit::get_file instead of WP Filesystem.
|
169 |
* @param string $file Correct file path.
|
170 |
* @access public
|
171 |
* @return string|bool
|
172 |
*/
|
173 |
public function get_contents( $file ) {
|
174 |
+
return Cherry_Toolkit::get_file( $file );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
175 |
}
|
176 |
|
177 |
/**
|
189 |
return;
|
190 |
}
|
191 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
192 |
}
|
193 |
}
|
cherry-framework/modules/cherry-template-manager/inc/cherry-template-parser.php
CHANGED
@@ -1,16 +1,8 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
*
|
4 |
-
* Description: Module parsed tmpl files.
|
5 |
-
* Version: 1.0.0
|
6 |
-
* Author: Cherry Team
|
7 |
-
* Author URI: http://www.cherryframework.com/
|
8 |
-
* License: GPLv3
|
9 |
-
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
*
|
11 |
-
* @package
|
12 |
-
* @subpackage Modules
|
13 |
-
* @version 1.0.0
|
14 |
* @author Cherry Team <cherryframework@gmail.com>
|
15 |
* @copyright Copyright (c) 2012 - 2016, Cherry Team
|
16 |
* @link http://www.cherryframework.com/
|
@@ -30,16 +22,6 @@ if ( ! class_exists( 'Cherry_Template_Parser' ) ) {
|
|
30 |
* @since 1.0.0
|
31 |
*/
|
32 |
class Cherry_Template_Parser {
|
33 |
-
|
34 |
-
/**
|
35 |
-
* A reference to an instance of this class.
|
36 |
-
*
|
37 |
-
* @since 1.0.0
|
38 |
-
* @access private
|
39 |
-
* @var object
|
40 |
-
*/
|
41 |
-
private static $instance = null;
|
42 |
-
|
43 |
/**
|
44 |
* A reference to an instance of this Cherry_Template_Manager class.
|
45 |
*
|
@@ -78,7 +60,7 @@ if ( ! class_exists( 'Cherry_Template_Parser' ) ) {
|
|
78 |
* @return void
|
79 |
*/
|
80 |
public function __construct( $args = array(), $main_class = null ) {
|
81 |
-
$this->args =
|
82 |
$args,
|
83 |
$this->args
|
84 |
);
|
@@ -210,21 +192,5 @@ if ( ! class_exists( 'Cherry_Template_Parser' ) ) {
|
|
210 |
return;
|
211 |
}
|
212 |
}
|
213 |
-
|
214 |
-
/**
|
215 |
-
* Returns the instance.
|
216 |
-
*
|
217 |
-
* @since 1.0.0
|
218 |
-
* @return object
|
219 |
-
*/
|
220 |
-
public static function get_instance( $args, $main_class ) {
|
221 |
-
|
222 |
-
// If the single instance hasn't been set, set it now.
|
223 |
-
if ( null == self::$instance ) {
|
224 |
-
self::$instance = new self( $args, $main_class );
|
225 |
-
}
|
226 |
-
|
227 |
-
return self::$instance;
|
228 |
-
}
|
229 |
}
|
230 |
}
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Class for parse templates.
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
*
|
5 |
+
* @package Template_Manager
|
|
|
|
|
6 |
* @author Cherry Team <cherryframework@gmail.com>
|
7 |
* @copyright Copyright (c) 2012 - 2016, Cherry Team
|
8 |
* @link http://www.cherryframework.com/
|
22 |
* @since 1.0.0
|
23 |
*/
|
24 |
class Cherry_Template_Parser {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
/**
|
26 |
* A reference to an instance of this Cherry_Template_Manager class.
|
27 |
*
|
60 |
* @return void
|
61 |
*/
|
62 |
public function __construct( $args = array(), $main_class = null ) {
|
63 |
+
$this->args = wp_parse_args(
|
64 |
$args,
|
65 |
$this->args
|
66 |
);
|
192 |
return;
|
193 |
}
|
194 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
195 |
}
|
196 |
}
|
cherry-framework/modules/cherry-ui-elements/cherry-ui-elements.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/**
|
3 |
* Module Name: UI Elements
|
4 |
* Description: Class for the building ui elements
|
5 |
-
* Version: 1.
|
6 |
* Author: Cherry Team
|
7 |
* Author URI: http://www.cherryframework.com/
|
8 |
* License: GPLv3
|
@@ -10,7 +10,7 @@
|
|
10 |
*
|
11 |
* @package Cherry_Framework
|
12 |
* @subpackage Modules
|
13 |
-
* @version 1.
|
14 |
* @author Cherry Team <cherryframework@gmail.com>
|
15 |
* @copyright Copyright (c) 2012 - 2016, Cherry Team
|
16 |
* @link http://www.cherryframework.com/
|
@@ -136,7 +136,6 @@ if ( ! class_exists( 'Cherry_UI_Elements' ) ) {
|
|
136 |
foreach ( $this->args['ui_elements'] as $ui_element ) {
|
137 |
$ui_class_name = 'UI_' . ucwords( $ui_element );
|
138 |
call_user_func( array( $ui_class_name, 'enqueue_assets' ) );
|
139 |
-
|
140 |
}
|
141 |
}
|
142 |
}
|
2 |
/**
|
3 |
* Module Name: UI Elements
|
4 |
* Description: Class for the building ui elements
|
5 |
+
* Version: 1.4.0
|
6 |
* Author: Cherry Team
|
7 |
* Author URI: http://www.cherryframework.com/
|
8 |
* License: GPLv3
|
10 |
*
|
11 |
* @package Cherry_Framework
|
12 |
* @subpackage Modules
|
13 |
+
* @version 1.4.0
|
14 |
* @author Cherry Team <cherryframework@gmail.com>
|
15 |
* @copyright Copyright (c) 2012 - 2016, Cherry Team
|
16 |
* @link http://www.cherryframework.com/
|
136 |
foreach ( $this->args['ui_elements'] as $ui_element ) {
|
137 |
$ui_class_name = 'UI_' . ucwords( $ui_element );
|
138 |
call_user_func( array( $ui_class_name, 'enqueue_assets' ) );
|
|
|
139 |
}
|
140 |
}
|
141 |
}
|
cherry-framework/modules/cherry-ui-elements/i-ui.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
* @author Cherry Team <cherryframework@gmail.com>
|
8 |
* @copyright Copyright (c) 2012 - 2016, Cherry Team
|
9 |
* @link http://www.cherryframework.com/
|
10 |
-
* @license http://www.gnu.org/licenses/
|
11 |
*/
|
12 |
|
13 |
/**
|
7 |
* @author Cherry Team <cherryframework@gmail.com>
|
8 |
* @copyright Copyright (c) 2012 - 2016, Cherry Team
|
9 |
* @link http://www.cherryframework.com/
|
10 |
+
* @license http://www.gnu.org/licenses/gpl-3.0.en.html
|
11 |
*/
|
12 |
|
13 |
/**
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-button/assets/min/ui-button.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.ui-button{
|
1 |
+
.cherry5-ui-button{position:relative;display:inline-block;font-size:12px;line-height:18px;font-weight:900;letter-spacing:0.5px;text-decoration:none;padding:15px 20px;color:#23282d;text-transform:uppercase;border-radius:4px;border-width:1px;border-style:solid;outline:none;cursor:pointer;transition:all 200ms linear}.cherry5-ui-button:before{position:absolute;display:block;width:100%;height:100%;top:0;left:0;border-radius:4px;background-image:linear-gradient(180deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 100%);content:''}.cherry5-ui-button:hover:before{background-image:linear-gradient(0deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 100%)}.cherry5-ui-button:active:before{opacity:0}.cherry5-ui-button.cherry5-ui-button-normal-style{color:#23282d;border-color:#d7d7d7 #b7b7b7 #b7b7b7 #d7d7d7;background-color:#f0f0f0}.cherry5-ui-button.cherry5-ui-button-normal-style:active{background-color:#e1e1e1;border-color:#9e9e9e #d7d7d7 #d7d7d7 #9e9e9e}.cherry5-ui-button.cherry5-ui-button-success-style{color:#fff;border-color:#49c56a #3a9e54 #3a9e54 #49c56a;background-color:#49c66a}.cherry5-ui-button.cherry5-ui-button-success-style:active{background-color:#3ba956;border-color:#2c7940 #49c56a #49c56a #2c7940}.cherry5-ui-button.cherry5-ui-button-primary-style{color:#fff;border-color:#5b9add #3e6a99 #3e6a99 #5b9add;background-color:#2a90fc}.cherry5-ui-button.cherry5-ui-button-primary-style:active{background-color:#206ff4;border-color:#2f5175 #5b9add #5b9add #2f5175}.cherry5-ui-button.cherry5-ui-button-secondary-style{color:#fff;border-color:#777879 #41464d #41464d #777879;background-color:#495159}.cherry5-ui-button.cherry5-ui-button-secondary-style:active{background-color:#495159;border-color:#2a2d31 #777879 #777879 #2a2d31}.cherry5-ui-button.cherry5-ui-button-danger-style{color:#fff;border-color:#e54444 #b83636 #b83636 #e54444;background-color:#e64545}.cherry5-ui-button.cherry5-ui-button-danger-style:active{background-color:#c73434;border-color:#912a2a #e54444 #e54444 #912a2a}.cherry5-ui-button.cherry5-ui-button-warning-style{color:#fff;border-color:#faa832 #c98627 #c98627 #faa832;background-color:#faa832}.cherry5-ui-button.cherry5-ui-button-warning-style:active{background-color:#ee8425;border-color:#9e6a1f #faa832 #faa832 #9e6a1f}
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-button/assets/ui-button.scss
CHANGED
@@ -1,52 +1,66 @@
|
|
1 |
@import "ui-kit/variables";
|
2 |
@import "ui-kit/mixins";
|
3 |
|
4 |
-
.ui-button{
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
border: none;
|
15 |
-
transition: background 300ms ease-in-out;
|
16 |
-
&:hover{
|
17 |
-
background-color: $grey_color_4;
|
18 |
-
}
|
19 |
-
&:focus{
|
20 |
-
outline: none;
|
21 |
}
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
|
|
|
|
|
|
|
|
27 |
}
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
|
|
|
|
|
|
|
|
33 |
}
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
|
|
|
|
|
|
|
|
39 |
}
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
|
|
|
|
|
|
|
|
45 |
}
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
|
|
|
|
|
|
|
|
51 |
}
|
|
|
52 |
}
|
1 |
@import "ui-kit/variables";
|
2 |
@import "ui-kit/mixins";
|
3 |
|
4 |
+
.cherry5-ui-button{
|
5 |
+
@include button_base();
|
6 |
+
|
7 |
+
&.cherry5-ui-button-normal-style {
|
8 |
+
color: $dark_color;
|
9 |
+
border-color: $normal_outset_1 $normal_outset_2 $normal_outset_2 $normal_outset_1;
|
10 |
+
background-color: $normal_gradint_2;
|
11 |
+
&:active {
|
12 |
+
background-color: $normal_bg_color;
|
13 |
+
border-color: darken( $normal_outset_2, 10%) $normal_outset_1 $normal_outset_1 darken( $normal_outset_2, 10%);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
}
|
15 |
+
}
|
16 |
+
|
17 |
+
&.cherry5-ui-button-success-style {
|
18 |
+
color: $light_color;
|
19 |
+
border-color: $success_outset_1 $success_outset_2 $success_outset_2 $success_outset_1;
|
20 |
+
background-color: $success_gradint_2;
|
21 |
+
&:active {
|
22 |
+
background-color: $success_bg_color;
|
23 |
+
border-color: darken( $success_outset_2, 10%) $success_outset_1 $success_outset_1 darken( $success_outset_2, 10%);
|
24 |
}
|
25 |
+
}
|
26 |
+
|
27 |
+
&.cherry5-ui-button-primary-style {
|
28 |
+
color: $light_color;
|
29 |
+
border-color: $primary_outset_1 $primary_outset_2 $primary_outset_2 $primary_outset_1;
|
30 |
+
background-color: $primary_gradint_2;
|
31 |
+
&:active {
|
32 |
+
background-color: $primary_bg_color;
|
33 |
+
border-color: darken( $primary_outset_2, 10%) $primary_outset_1 $primary_outset_1 darken( $primary_outset_2, 10%);
|
34 |
}
|
35 |
+
}
|
36 |
+
|
37 |
+
&.cherry5-ui-button-secondary-style {
|
38 |
+
color: $light_color;
|
39 |
+
border-color: $secondary_outset_1 $secondary_outset_2 $secondary_outset_2 $secondary_outset_1;
|
40 |
+
background-color: $secondary_gradint_2;
|
41 |
+
&:active {
|
42 |
+
background-color: $secondary_bg_color;
|
43 |
+
border-color: darken( $secondary_outset_2, 10%) $secondary_outset_1 $secondary_outset_1 darken( $secondary_outset_2, 10%);
|
44 |
}
|
45 |
+
}
|
46 |
+
|
47 |
+
&.cherry5-ui-button-danger-style{
|
48 |
+
color: $light_color;
|
49 |
+
border-color: $danger_outset_1 $danger_outset_2 $danger_outset_2 $danger_outset_1;
|
50 |
+
background-color: $danger_gradint_2;
|
51 |
+
&:active {
|
52 |
+
background-color: $danger_bg_color;
|
53 |
+
border-color: darken( $danger_outset_2, 10%) $danger_outset_1 $danger_outset_1 darken( $danger_outset_2, 10%);
|
54 |
}
|
55 |
+
}
|
56 |
+
|
57 |
+
&.cherry5-ui-button-warning-style{
|
58 |
+
color: $light_color;
|
59 |
+
border-color: $warning_outset_1 $warning_outset_2 $warning_outset_2 $warning_outset_1;
|
60 |
+
background-color: $warning_gradint_2;
|
61 |
+
&:active {
|
62 |
+
background-color: $warning_bg_color;
|
63 |
+
border-color: darken( $warning_outset_2, 10%) $warning_outset_1 $warning_outset_1 darken( $warning_outset_2, 10%);
|
64 |
}
|
65 |
+
}
|
66 |
}
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-button/assets/ui-kit/_mixins.scss
CHANGED
@@ -1,182 +1,42 @@
|
|
1 |
@mixin button_base() {
|
|
|
2 |
display: inline-block;
|
3 |
-
text-decoration: none;
|
4 |
font-size: 12px;
|
5 |
-
line-height:
|
6 |
-
font-weight:
|
|
|
|
|
7 |
padding: 15px 20px;
|
8 |
-
color:
|
9 |
text-transform: uppercase;
|
10 |
border-radius: $border_radius_small;
|
|
|
|
|
|
|
|
|
11 |
transition: all 200ms linear;
|
12 |
-
box-shadow: $box_shadow;
|
13 |
-
&:hover {
|
14 |
-
color: #fff;
|
15 |
-
box-shadow: none;
|
16 |
-
}
|
17 |
-
&:focus,
|
18 |
-
&:active {
|
19 |
-
outline: none;
|
20 |
-
box-shadow: none;
|
21 |
-
color: #fff;
|
22 |
-
}
|
23 |
-
}
|
24 |
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
background: $blue_color_h;
|
36 |
-
}
|
37 |
-
}
|
38 |
-
|
39 |
-
@mixin button_success() {
|
40 |
-
background: $green_color;
|
41 |
-
&:hover {
|
42 |
-
background: $green_color_h;
|
43 |
-
}
|
44 |
-
}
|
45 |
-
|
46 |
-
@mixin button_danger() {
|
47 |
-
background: $red_color;
|
48 |
-
&:hover {
|
49 |
-
background: $red_color_h;
|
50 |
}
|
51 |
-
}
|
52 |
|
53 |
-
@mixin button_warning() {
|
54 |
-
background: $orange_color;
|
55 |
&:hover {
|
56 |
-
|
57 |
-
|
58 |
-
}
|
59 |
-
|
60 |
-
@mixin input() {
|
61 |
-
font-size: 14px;
|
62 |
-
line-height: 20px;
|
63 |
-
color: $dark_color_1;
|
64 |
-
background-color: $grey_color_3;
|
65 |
-
border-radius: $border_radius_extra_small;
|
66 |
-
padding: 10px 20px;
|
67 |
-
min-height: 50px;
|
68 |
-
border: 1px solid $grey_color_3;
|
69 |
-
box-shadow: none;
|
70 |
-
&:focus{
|
71 |
-
border-color: rgba(72,197,105,.6);
|
72 |
-
box-shadow: 0 0 2px rgba(72,197,105,.6);
|
73 |
}
|
74 |
-
}
|
75 |
-
|
76 |
-
@mixin button_icon( $icon ) {
|
77 |
-
content: $icon;
|
78 |
-
display: inline-block;
|
79 |
-
font-family: dashicons;
|
80 |
-
font-size: 16px;
|
81 |
-
font-style: normal;
|
82 |
-
font-weight: 400;
|
83 |
-
height: 18px;
|
84 |
-
line-height: 18px;
|
85 |
-
text-align: center;
|
86 |
-
text-decoration: inherit;
|
87 |
-
transition: all 200ms linear;
|
88 |
-
vertical-align: middle;
|
89 |
-
}
|
90 |
-
|
91 |
-
@mixin button_icon_before( $icon ) {
|
92 |
-
&:before {
|
93 |
-
@include button_icon( $icon );
|
94 |
-
padding: 0 5px 0 0;
|
95 |
-
}
|
96 |
-
}
|
97 |
-
|
98 |
-
@mixin button_icon_after( $icon ) {
|
99 |
-
&:after {
|
100 |
-
@include button_icon( $icon );
|
101 |
-
padding: 0 0 0 5px;
|
102 |
-
}
|
103 |
-
}
|
104 |
-
|
105 |
-
@mixin button_icon_middle( $icon ) {
|
106 |
-
&:before {
|
107 |
-
@include button_icon( $icon );
|
108 |
-
margin: 0 -5px;
|
109 |
}
|
110 |
-
}
|
111 |
|
112 |
-
@mixin link() {
|
113 |
-
display: inline-block;
|
114 |
-
text-decoration: none;
|
115 |
-
font-size: 12px;
|
116 |
-
line-height: 20px;
|
117 |
-
font-weight: bold;
|
118 |
-
color: $blue_color;
|
119 |
-
text-transform: uppercase;
|
120 |
-
transition: all 200ms linear;
|
121 |
-
&:hover {
|
122 |
-
color: $dark_color_1;
|
123 |
-
box-shadow: none;
|
124 |
-
}
|
125 |
-
&:focus,
|
126 |
&:active {
|
127 |
-
outline: none;
|
128 |
-
box-shadow: none;
|
129 |
-
color: $blue_color;
|
130 |
-
}
|
131 |
-
}
|
132 |
-
|
133 |
-
@mixin link_icon_before( $icon ) {
|
134 |
-
&:before {
|
135 |
-
@include button_icon( $icon );
|
136 |
-
padding: 0 5px 0 0;
|
137 |
-
color: $grey_color_4;
|
138 |
-
}
|
139 |
-
&:hover {
|
140 |
&:before {
|
141 |
-
|
142 |
}
|
143 |
}
|
144 |
}
|
145 |
-
|
146 |
-
@mixin container() {
|
147 |
-
padding: 30px;
|
148 |
-
border: 2px solid $grey_color_2;
|
149 |
-
background: $grey_color_3;
|
150 |
-
border-radius: $border_radius_large;
|
151 |
-
}
|
152 |
-
|
153 |
-
@mixin container_heading() {
|
154 |
-
margin: -30px -30px 30px -30px;
|
155 |
-
border-radius: $border_radius_large $border_radius_large 0 0;
|
156 |
-
border-bottom: 1px solid $grey_color_2;
|
157 |
-
padding: 20px 30px;
|
158 |
-
font-weight: bold;
|
159 |
-
font-size: 16px;
|
160 |
-
line-height: 18px;
|
161 |
-
text-align: center;
|
162 |
-
background: #fff;
|
163 |
-
}
|
164 |
-
|
165 |
-
@mixin box() {
|
166 |
-
margin: 0 0 30px;
|
167 |
-
padding: 20px;
|
168 |
-
background: #fff;
|
169 |
-
box-shadow: $box_shadow_box;
|
170 |
-
border-radius: $border_radius;
|
171 |
-
}
|
172 |
-
|
173 |
-
@mixin box_heading() {
|
174 |
-
margin: -20px -20px 20px -20px;
|
175 |
-
border-radius: $border_radius_small $border_radius_small 0 0;
|
176 |
-
border-bottom: 1px solid $grey_color_2;
|
177 |
-
padding: 20px 30px;
|
178 |
-
font-weight: bold;
|
179 |
-
font-size: 16px;
|
180 |
-
line-height: 18px;
|
181 |
-
background: #fff;
|
182 |
-
}
|
1 |
@mixin button_base() {
|
2 |
+
position: relative;
|
3 |
display: inline-block;
|
|
|
4 |
font-size: 12px;
|
5 |
+
line-height: 18px;
|
6 |
+
font-weight: 900;
|
7 |
+
letter-spacing: 0.5px;
|
8 |
+
text-decoration: none;
|
9 |
padding: 15px 20px;
|
10 |
+
color: $dark_color;
|
11 |
text-transform: uppercase;
|
12 |
border-radius: $border_radius_small;
|
13 |
+
border-width: 1px;
|
14 |
+
border-style: solid;
|
15 |
+
outline: none;
|
16 |
+
cursor: pointer;
|
17 |
transition: all 200ms linear;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
+
&:before {
|
20 |
+
position: absolute;
|
21 |
+
display: block;
|
22 |
+
width: 100%;
|
23 |
+
height: 100%;
|
24 |
+
top: 0;
|
25 |
+
left: 0;
|
26 |
+
border-radius: $border_radius_small;
|
27 |
+
background-image: linear-gradient(180deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 100%);
|
28 |
+
content: '';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
}
|
|
|
30 |
|
|
|
|
|
31 |
&:hover {
|
32 |
+
&:before {
|
33 |
+
background-image: linear-gradient(0deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 100%);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
}
|
|
|
36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
&:active {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
&:before {
|
39 |
+
opacity: 0;
|
40 |
}
|
41 |
}
|
42 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-button/assets/ui-kit/_variables.scss
CHANGED
@@ -1,20 +1,41 @@
|
|
1 |
-
$
|
2 |
-
$
|
3 |
-
|
4 |
-
$
|
5 |
-
$
|
6 |
-
$
|
7 |
-
$
|
8 |
-
$
|
9 |
-
|
10 |
-
$
|
11 |
-
$
|
12 |
-
$
|
13 |
-
$
|
14 |
-
$
|
15 |
-
|
16 |
-
$
|
17 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
$border_radius_extra_small: 2px;
|
20 |
$border_radius_small: 4px;
|
1 |
+
$light_color: #ffffff;
|
2 |
+
$dark_color: #23282d;
|
3 |
+
|
4 |
+
$normal_bg_color: #e1e1e1;
|
5 |
+
$normal_gradint_1: #ffffff;
|
6 |
+
$normal_gradint_2: #f0f0f0;
|
7 |
+
$normal_outset_1: #d7d7d7;
|
8 |
+
$normal_outset_2: #b7b7b7;
|
9 |
+
|
10 |
+
$primary_bg_color: #206ff4;
|
11 |
+
$primary_gradint_1: #5fadff;
|
12 |
+
$primary_gradint_2: #2a90fc;
|
13 |
+
$primary_outset_1: #5b9add;
|
14 |
+
$primary_outset_2: #3e6a99;
|
15 |
+
|
16 |
+
$secondary_bg_color: #495159;
|
17 |
+
$secondary_gradint_1: #4c5054;
|
18 |
+
$secondary_gradint_2: #495159;
|
19 |
+
$secondary_outset_1: #777879;
|
20 |
+
$secondary_outset_2: #41464d;
|
21 |
+
|
22 |
+
$success_bg_color: #3ba956;
|
23 |
+
$success_gradint_1: #71e18f;
|
24 |
+
$success_gradint_2: #49c66a;
|
25 |
+
$success_outset_1: #49c56a;
|
26 |
+
$success_outset_2: #3a9e54;
|
27 |
+
|
28 |
+
$danger_bg_color: #c73434;
|
29 |
+
$danger_gradint_1: #f98888;
|
30 |
+
$danger_gradint_2: #e64545;
|
31 |
+
$danger_outset_1: #e54444;
|
32 |
+
$danger_outset_2: #b83636;
|
33 |
+
|
34 |
+
$warning_bg_color: #ee8425;
|
35 |
+
$warning_gradint_1: #ffcb81;
|
36 |
+
$warning_gradint_2: #faa832;
|
37 |
+
$warning_outset_1: #faa832;
|
38 |
+
$warning_outset_2: #c98627;
|
39 |
|
40 |
$border_radius_extra_small: 2px;
|
41 |
$border_radius_small: 4px;
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-button/ui-button.php
CHANGED
@@ -18,34 +18,34 @@ if ( ! defined( 'WPINC' ) ) {
|
|
18 |
if ( ! class_exists( 'UI_Button' ) ) {
|
19 |
|
20 |
/**
|
21 |
-
* Class for the building ui-
|
22 |
*/
|
23 |
class UI_Button extends UI_Element implements I_UI {
|
24 |
|
25 |
/**
|
26 |
-
* Default settings
|
27 |
*
|
|
|
28 |
* @var array
|
29 |
*/
|
30 |
private $defaults_settings = array(
|
31 |
-
'
|
32 |
-
'
|
33 |
-
'
|
34 |
-
'
|
35 |
-
'
|
36 |
-
'
|
37 |
-
'
|
38 |
-
'
|
39 |
-
'
|
40 |
-
'
|
41 |
-
'
|
42 |
-
'master' => '',
|
43 |
);
|
44 |
|
45 |
/**
|
46 |
-
* Constructor method for the
|
47 |
*
|
48 |
-
* @since
|
49 |
*/
|
50 |
function __construct( $args = array() ) {
|
51 |
$this->defaults_settings['id'] = 'cherry-ui-button-' . uniqid();
|
@@ -55,9 +55,9 @@ if ( ! class_exists( 'UI_Button' ) ) {
|
|
55 |
}
|
56 |
|
57 |
/**
|
58 |
-
* Render html
|
59 |
*
|
60 |
-
* @since
|
61 |
*/
|
62 |
public function render() {
|
63 |
$html = Cherry_Toolkit::render_view(
|
@@ -69,17 +69,16 @@ if ( ! class_exists( 'UI_Button' ) ) {
|
|
69 |
}
|
70 |
|
71 |
/**
|
72 |
-
* Enqueue javascript and stylesheet
|
73 |
*
|
74 |
-
* @since
|
75 |
*/
|
76 |
public static function enqueue_assets() {
|
77 |
-
|
78 |
wp_enqueue_style(
|
79 |
'ui-button',
|
80 |
esc_url( Cherry_Core::base_url( 'assets/min/ui-button.min.css', __FILE__ ) ),
|
81 |
array(),
|
82 |
-
'1.
|
83 |
'all'
|
84 |
);
|
85 |
}
|
18 |
if ( ! class_exists( 'UI_Button' ) ) {
|
19 |
|
20 |
/**
|
21 |
+
* Class for the building ui-button elements.
|
22 |
*/
|
23 |
class UI_Button extends UI_Element implements I_UI {
|
24 |
|
25 |
/**
|
26 |
+
* Default settings.
|
27 |
*
|
28 |
+
* @since 1.0.0
|
29 |
* @var array
|
30 |
*/
|
31 |
private $defaults_settings = array(
|
32 |
+
'id' => 'cherry-ui-button-id',
|
33 |
+
'name' => 'cherry-ui-button-name',
|
34 |
+
'value' => 'button',
|
35 |
+
'disabled' => false,
|
36 |
+
'form' => '',
|
37 |
+
'formaction' => '',
|
38 |
+
'button_type' => 'button',
|
39 |
+
'style' => 'normal',
|
40 |
+
'content' => 'Button',
|
41 |
+
'class' => '',
|
42 |
+
'master' => '',
|
|
|
43 |
);
|
44 |
|
45 |
/**
|
46 |
+
* Constructor method for the UI_Button class.
|
47 |
*
|
48 |
+
* @since 1.0.0
|
49 |
*/
|
50 |
function __construct( $args = array() ) {
|
51 |
$this->defaults_settings['id'] = 'cherry-ui-button-' . uniqid();
|
55 |
}
|
56 |
|
57 |
/**
|
58 |
+
* Render html UI_Button.
|
59 |
*
|
60 |
+
* @since 1.0.0
|
61 |
*/
|
62 |
public function render() {
|
63 |
$html = Cherry_Toolkit::render_view(
|
69 |
}
|
70 |
|
71 |
/**
|
72 |
+
* Enqueue javascript and stylesheet UI_Button.
|
73 |
*
|
74 |
+
* @since 1.0.0
|
75 |
*/
|
76 |
public static function enqueue_assets() {
|
|
|
77 |
wp_enqueue_style(
|
78 |
'ui-button',
|
79 |
esc_url( Cherry_Core::base_url( 'assets/min/ui-button.min.css', __FILE__ ) ),
|
80 |
array(),
|
81 |
+
'1.3.2',
|
82 |
'all'
|
83 |
);
|
84 |
}
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-button/view/button-view.php
CHANGED
@@ -14,10 +14,10 @@
|
|
14 |
if ( ! defined( 'WPINC' ) ) {
|
15 |
die;
|
16 |
}
|
17 |
-
$class = trim( implode( ' ', array( 'ui-button', 'ui-button-' . $__data['style'] . '-style ', $__data['master'], $__data['class'] ) ) );
|
18 |
$attrs = Cherry_Toolkit::join(
|
19 |
array(
|
20 |
-
'type' => esc_attr( $__data['
|
21 |
'id' => esc_attr( $__data['id'] ),
|
22 |
'name' => esc_attr( $__data['name'] ),
|
23 |
'class' => esc_attr( $class ),
|
14 |
if ( ! defined( 'WPINC' ) ) {
|
15 |
die;
|
16 |
}
|
17 |
+
$class = trim( implode( ' ', array( 'cherry5-ui-button', 'cherry5-ui-button-' . $__data['style'] . '-style ', $__data['master'], $__data['class'], 'ui-button' ) ) );
|
18 |
$attrs = Cherry_Toolkit::join(
|
19 |
array(
|
20 |
+
'type' => esc_attr( $__data['button_type'] ),
|
21 |
'id' => esc_attr( $__data['id'] ),
|
22 |
'name' => esc_attr( $__data['name'] ),
|
23 |
'class' => esc_attr( $class ),
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-checkbox/assets/min/ui-checkbox.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.cherry-ui-container{margin:10px 0 20px 0}label.cherry-label{margin:0 0 5px 0;display:block}.hide{display:none !important}.cherry-checkbox-item{width:26px;height:26px;display:inline-block;border-radius:2px;margin-right:10px;margin-bottom:6px;cursor:pointer;position:relative;background-color:#f1f1f1;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transition:all 0.4s cubic-bezier(0.77, 0, 0.175, 1);transition:all 0.4s cubic-bezier(0.77, 0, 0.175, 1)}.cherry-checkbox-item .marker{position:absolute;width:26px;height:26px;top:0px;left:0px;color:#fff;font-size:28px;-webkit-transition:inherit;transition:inherit;-webkit-transform:scale(0)
|
1 |
+
.cherry-ui-container{margin:10px 0 20px 0}label.cherry-label{margin:0 0 5px 0;display:block}.hide{display:none !important}.cherry-checkbox-item{width:26px;height:26px;display:inline-block;border-radius:2px;margin-right:10px;margin-bottom:6px;cursor:pointer;position:relative;background-color:#f1f1f1;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transition:all 0.4s cubic-bezier(0.77, 0, 0.175, 1);transition:all 0.4s cubic-bezier(0.77, 0, 0.175, 1)}.cherry-checkbox-item .marker{position:absolute;width:26px;height:26px;top:0px;left:0px;color:#fff;font-size:28px;-webkit-transition:inherit;transition:inherit;-webkit-transform:scale(0);transform:scale(0)}.cherry-checkbox-item .marker:before{-webkit-transition:inherit;transition:inherit;position:relative;left:-2px}.cherry-checkbox-input[checked]+.cherry-checkbox-item{background-color:#48c569}.cherry-checkbox-input[checked]+.cherry-checkbox-item .marker{-webkit-transform:scale(1);transform:scale(1)}.cherry-checkbox-label{display:inline-block;vertical-align:top;font-size:14px;line-height:26px;color:#23282d;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.cherry-checkbox-label:focus{outline:1px solid rgba(41,143,252,0.6);box-shadow:0px 0px 2px rgba(41,143,252,0.6)}
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-checkbox/assets/min/ui-checkbox.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(e,t){"use strict";t.utilites.namespace("ui_elements.checkbox"),t.ui_elements.checkbox={inputClass:'.cherry-checkbox-input[type="hidden"]:not([name*="__i__"])',labelClass:".cherry-checkbox-label, .cherry-checkbox-item",init:function(){e(document).on("ready.cherry-ui-elements-init",this.addEvent.bind(this)).on("cherry-ui-elements-init",this.initState.bind(this))},addEvent:function(){e("body").on("click.masterSlave",this.labelClass,this.switchState.bind(this)),this.initState()},initState:function(){for(var t,i,s,n=e(this.inputClass),c=n.length-1;c>=0;c--)t=e(n[c]),i=t.data(),s=t.closest("form"),jQuery.isEmptyObject(i)||e("."+i.slave,s)[t[0].checked?"removeClass":"addClass"]("hide")},switchState:function(t){var i=e(t.currentTarget).siblings(this.inputClass),s=i.data(),n=i[0].checked,c=i.closest("form");i.val(n?"false":"true").attr("checked"
|
1 |
+
!function(e,t){"use strict";t.utilites.namespace("ui_elements.checkbox"),t.ui_elements.checkbox={inputClass:'.cherry-checkbox-input[type="hidden"]:not([name*="__i__"])',labelClass:".cherry-checkbox-label, .cherry-checkbox-item",init:function(){e(document).on("ready.cherry-ui-elements-init",this.addEvent.bind(this)).on("cherry-ui-elements-init",this.initState.bind(this))},addEvent:function(){e("body").on("click.masterSlave",this.labelClass,this.switchState.bind(this)),this.initState()},initState:function(){for(var t,i,s,n=e(this.inputClass),c=n.length-1;c>=0;c--)t=e(n[c]),i=t.data(),s=t.closest("form"),jQuery.isEmptyObject(i)||e("."+i.slave,s)[t[0].checked?"removeClass":"addClass"]("hide")},switchState:function(t){var i=e(t.currentTarget).siblings(this.inputClass),s=i.data(),n=i[0].checked,c=i.closest("form");i.val(n?"false":"true").attr("checked",!n).trigger("change"),jQuery.isEmptyObject(s)||e("."+s.slave,c)[n?"addClass":"removeClass"]("hide")}},t.ui_elements.checkbox.init()}(jQuery,window.CherryJsCore);
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-checkbox/assets/ui-checkbox.scss
CHANGED
@@ -55,4 +55,8 @@ label.cherry-label{
|
|
55 |
line-height: 26px;
|
56 |
color: $dark_color_1;
|
57 |
user-select: none;
|
|
|
|
|
|
|
|
|
58 |
}
|
55 |
line-height: 26px;
|
56 |
color: $dark_color_1;
|
57 |
user-select: none;
|
58 |
+
&:focus{
|
59 |
+
outline: 1px solid rgba(41, 143, 252, .6);
|
60 |
+
box-shadow: 0px 0px 2px rgba(41,143,252,0.6);
|
61 |
+
}
|
62 |
}
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-checkbox/assets/ui-kit/_mixins.scss
CHANGED
@@ -17,7 +17,8 @@
|
|
17 |
&:focus,
|
18 |
&:active {
|
19 |
outline: none;
|
20 |
-
|
|
|
21 |
color: #fff;
|
22 |
}
|
23 |
}
|
@@ -64,12 +65,12 @@
|
|
64 |
background-color: $grey_color_3;
|
65 |
border-radius: $border_radius_extra_small;
|
66 |
padding: 10px 20px;
|
67 |
-
height: 50px;
|
68 |
border: 1px solid $grey_color_3;
|
69 |
box-shadow: none;
|
70 |
&:focus{
|
71 |
-
border-color: rgba(
|
72 |
-
box-shadow: 0 0 2px rgba(
|
73 |
}
|
74 |
}
|
75 |
|
@@ -125,7 +126,8 @@
|
|
125 |
&:focus,
|
126 |
&:active {
|
127 |
outline: none;
|
128 |
-
|
|
|
129 |
color: $blue_color;
|
130 |
}
|
131 |
}
|
@@ -179,4 +181,4 @@
|
|
179 |
font-size: 16px;
|
180 |
line-height: 18px;
|
181 |
background: #fff;
|
182 |
-
}
|
17 |
&:focus,
|
18 |
&:active {
|
19 |
outline: none;
|
20 |
+
border-color: rgba(41, 143, 252, .6);
|
21 |
+
box-shadow: 0 0 2px rgba(41, 143, 252, .6);
|
22 |
color: #fff;
|
23 |
}
|
24 |
}
|
65 |
background-color: $grey_color_3;
|
66 |
border-radius: $border_radius_extra_small;
|
67 |
padding: 10px 20px;
|
68 |
+
min-height: 50px;
|
69 |
border: 1px solid $grey_color_3;
|
70 |
box-shadow: none;
|
71 |
&:focus{
|
72 |
+
border-color: rgba(41, 143, 252, .6);
|
73 |
+
box-shadow: 0 0 2px rgba(41, 143, 252, .6);
|
74 |
}
|
75 |
}
|
76 |
|
126 |
&:focus,
|
127 |
&:active {
|
128 |
outline: none;
|
129 |
+
border-color: rgba(41, 143, 252, .6);
|
130 |
+
box-shadow: 0 0 2px rgba(41, 143, 252, .6);
|
131 |
color: $blue_color;
|
132 |
}
|
133 |
}
|
181 |
font-size: 16px;
|
182 |
line-height: 18px;
|
183 |
background: #fff;
|
184 |
+
}
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-checkbox/ui-checkbox.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
* @author Cherry Team <support@cherryframework.com>
|
8 |
* @copyright Copyright (c) 2012 - 2015, Cherry Team
|
9 |
* @link http://www.cherryframework.com/
|
10 |
-
* @license http://www.gnu.org/licenses/
|
11 |
*/
|
12 |
|
13 |
// If this file is called directly, abort.
|
@@ -21,44 +21,47 @@ if ( ! class_exists( 'UI_Checkbox' ) ) {
|
|
21 |
* Class for the building UI_Checkbox elements.
|
22 |
*/
|
23 |
class UI_Checkbox extends UI_Element implements I_UI {
|
|
|
24 |
/**
|
25 |
-
* Default settings
|
26 |
*
|
|
|
27 |
* @var array
|
28 |
*/
|
29 |
private $defaults_settings = array(
|
30 |
-
'id'
|
31 |
-
'name'
|
32 |
-
'value'
|
33 |
'checkbox-1' => 'true',
|
34 |
'checkbox-2' => 'true',
|
35 |
'checkbox-3' => 'true',
|
36 |
),
|
37 |
-
'options'
|
38 |
-
'checkbox-1'
|
39 |
-
'checkbox-2'
|
40 |
-
'checkbox-3'
|
41 |
),
|
42 |
-
'label'
|
43 |
-
'class'
|
44 |
-
'master'
|
45 |
);
|
46 |
|
47 |
/**
|
48 |
* Constructor method for the UI_Checkbox class.
|
49 |
*
|
50 |
-
* @since
|
51 |
*/
|
52 |
function __construct( $args = array() ) {
|
53 |
$this->defaults_settings['id'] = 'cherry-ui-checkbox-' . uniqid();
|
54 |
$this->settings = wp_parse_args( $args, $this->defaults_settings );
|
|
|
55 |
add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
|
56 |
}
|
57 |
|
58 |
/**
|
59 |
* Render html UI_Checkbox.
|
60 |
*
|
61 |
-
* @since
|
62 |
*/
|
63 |
public function render() {
|
64 |
$html = '';
|
@@ -106,16 +109,16 @@ if ( ! class_exists( 'UI_Checkbox' ) ) {
|
|
106 |
}
|
107 |
|
108 |
/**
|
109 |
-
* Enqueue javascript and stylesheet UI_Checkbox
|
110 |
*
|
111 |
-
* @since
|
112 |
*/
|
113 |
public static function enqueue_assets() {
|
114 |
wp_enqueue_script(
|
115 |
'ui-checkbox-min',
|
116 |
esc_url( Cherry_Core::base_url( 'assets/min/ui-checkbox.min.js', __FILE__ ) ),
|
117 |
array( 'jquery' ),
|
118 |
-
'1.
|
119 |
true
|
120 |
);
|
121 |
|
@@ -123,7 +126,7 @@ if ( ! class_exists( 'UI_Checkbox' ) ) {
|
|
123 |
'ui-checkbox-min',
|
124 |
esc_url( Cherry_Core::base_url( 'assets/min/ui-checkbox.min.css', __FILE__ ) ),
|
125 |
array(),
|
126 |
-
'1.
|
127 |
'all'
|
128 |
);
|
129 |
}
|
7 |
* @author Cherry Team <support@cherryframework.com>
|
8 |
* @copyright Copyright (c) 2012 - 2015, Cherry Team
|
9 |
* @link http://www.cherryframework.com/
|
10 |
+
* @license http://www.gnu.org/licenses/gpl-3.0.en.html
|
11 |
*/
|
12 |
|
13 |
// If this file is called directly, abort.
|
21 |
* Class for the building UI_Checkbox elements.
|
22 |
*/
|
23 |
class UI_Checkbox extends UI_Element implements I_UI {
|
24 |
+
|
25 |
/**
|
26 |
+
* Default settings.
|
27 |
*
|
28 |
+
* @since 1.0.0
|
29 |
* @var array
|
30 |
*/
|
31 |
private $defaults_settings = array(
|
32 |
+
'id' => 'cherry-ui-checkbox-id',
|
33 |
+
'name' => 'cherry-ui-checkbox-name',
|
34 |
+
'value' => array(
|
35 |
'checkbox-1' => 'true',
|
36 |
'checkbox-2' => 'true',
|
37 |
'checkbox-3' => 'true',
|
38 |
),
|
39 |
+
'options' => array(
|
40 |
+
'checkbox-1' => 'checkbox 1',
|
41 |
+
'checkbox-2' => 'checkbox 2',
|
42 |
+
'checkbox-3' => 'checkbox 3',
|
43 |
),
|
44 |
+
'label' => '',
|
45 |
+
'class' => '',
|
46 |
+
'master' => '',
|
47 |
);
|
48 |
|
49 |
/**
|
50 |
* Constructor method for the UI_Checkbox class.
|
51 |
*
|
52 |
+
* @since 1.0.0
|
53 |
*/
|
54 |
function __construct( $args = array() ) {
|
55 |
$this->defaults_settings['id'] = 'cherry-ui-checkbox-' . uniqid();
|
56 |
$this->settings = wp_parse_args( $args, $this->defaults_settings );
|
57 |
+
|
58 |
add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
|
59 |
}
|
60 |
|
61 |
/**
|
62 |
* Render html UI_Checkbox.
|
63 |
*
|
64 |
+
* @since 1.0.0
|
65 |
*/
|
66 |
public function render() {
|
67 |
$html = '';
|
109 |
}
|
110 |
|
111 |
/**
|
112 |
+
* Enqueue javascript and stylesheet UI_Checkbox.
|
113 |
*
|
114 |
+
* @since 1.0.0
|
115 |
*/
|
116 |
public static function enqueue_assets() {
|
117 |
wp_enqueue_script(
|
118 |
'ui-checkbox-min',
|
119 |
esc_url( Cherry_Core::base_url( 'assets/min/ui-checkbox.min.js', __FILE__ ) ),
|
120 |
array( 'jquery' ),
|
121 |
+
'1.3.2',
|
122 |
true
|
123 |
);
|
124 |
|
126 |
'ui-checkbox-min',
|
127 |
esc_url( Cherry_Core::base_url( 'assets/min/ui-checkbox.min.css', __FILE__ ) ),
|
128 |
array(),
|
129 |
+
'1.3.2',
|
130 |
'all'
|
131 |
);
|
132 |
}
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-colorpicker/assets/min/ui-colorpicker.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.cherry-ui-container{margin:10px 0 20px 0}label.cherry-label{margin:0 0 5px 0;display:block}.
|
1 |
+
.cherry-ui-container{margin:10px 0 20px 0}label.cherry-label{margin:0 0 5px 0;display:block}.cherry-ui-colorpicker-wrapper{background-color:#f1f1f1;padding:5px;max-width:230px;height:46px;box-sizing:border-box}.cherry-ui-colorpicker-wrapper .wp-picker-container,.customize-control-content .wp-picker-container{display:block;position:relative;z-index:1000}.cherry-ui-colorpicker-wrapper .wp-picker-container:active,.customize-control-content .wp-picker-container:active{display:block}.cherry-ui-colorpicker-wrapper .wp-picker-container>.wp-color-result,.customize-control-content .wp-picker-container>.wp-color-result{margin:0;border-radius:2px;display:block;border:none;box-shadow:none;height:auto;padding-left:35px}.cherry-ui-colorpicker-wrapper .wp-picker-container>.wp-color-result:after,.customize-control-content .wp-picker-container>.wp-color-result:after{padding:7px 0px;font-size:14px;border-left:none}.cherry-ui-colorpicker-wrapper .wp-picker-container>.wp-color-result:focus,.cherry-ui-colorpicker-wrapper .wp-picker-container>.wp-color-result:active,.customize-control-content .wp-picker-container>.wp-color-result:focus,.customize-control-content .wp-picker-container>.wp-color-result:active{outline:none;border:1px solid rgba(41,143,252,0.6);box-shadow:0px 0px 2px rgba(41,143,252,0.6)}.cherry-ui-colorpicker-wrapper .wp-picker-container>.wp-picker-input-wrap,.customize-control-content .wp-picker-container>.wp-picker-input-wrap{display:none;display:-webkit-box;display:-ms-flexbox;display:flex;width:calc(100% - 40px);max-width:calc(100% - 40px);float:right}.cherry-ui-colorpicker-wrapper .wp-picker-container>.wp-picker-input-wrap:after,.customize-control-content .wp-picker-container>.wp-picker-input-wrap:after{content:'.';clear:both;visibility:hidden;height:0}.cherry-ui-colorpicker-wrapper .wp-picker-container>.wp-picker-input-wrap input[type="text"],.customize-control-content .wp-picker-container>.wp-picker-input-wrap input[type="text"]{padding:8px 10px 9px;font-size:14px;max-width:100%;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1}.cherry-ui-colorpicker-wrapper .wp-picker-container>.wp-picker-input-wrap input[type="button"],.customize-control-content .wp-picker-container>.wp-picker-input-wrap input[type="button"]{height:auto;border:none;border-radius:2px;box-shadow:none;padding:6px 10px 7px;font-size:14px;margin-left:5px;-ms-flex-negative:0;flex-shrink:0}.cherry-ui-colorpicker-wrapper .wp-picker-container.wp-picker-active>.wp-color-result,.customize-control-content .wp-picker-container.wp-picker-active>.wp-color-result{height:35px;width:0;display:inline-block;margin-right:5px}.cherry-ui-colorpicker-wrapper .wp-picker-container.wp-picker-active>.wp-color-result:after,.customize-control-content .wp-picker-container.wp-picker-active>.wp-color-result:after{display:none}.cherry-ui-colorpicker-wrapper .wp-picker-container.wp-picker-active>.wp-picker-input-wrap,.customize-control-content .wp-picker-container.wp-picker-active>.wp-picker-input-wrap{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex}
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-colorpicker/assets/ui-colorpicker.scss
CHANGED
@@ -1,6 +1,8 @@
|
|
1 |
@import "ui-kit/variables";
|
2 |
@import "ui-kit/mixins";
|
3 |
|
|
|
|
|
4 |
.cherry-ui-container{
|
5 |
margin: 10px 0 20px 0;
|
6 |
}
|
@@ -8,46 +10,83 @@ label.cherry-label{
|
|
8 |
margin: 0 0 5px 0;
|
9 |
display: block;
|
10 |
}
|
11 |
-
.
|
12 |
-
display: block;
|
13 |
background-color: $grey_color_3;
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
&:
|
26 |
-
|
27 |
-
border: medium none;
|
28 |
-
border-radius: 0;
|
29 |
-
line-height: 36px;
|
30 |
-
font-size: 14px;
|
31 |
-
color: $dark_color_1;
|
32 |
-
padding: 0 80px 0 20px;
|
33 |
}
|
34 |
-
|
35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
&:after{
|
37 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
}
|
39 |
}
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
}
|
49 |
-
|
50 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
}
|
52 |
}
|
53 |
}
|
1 |
@import "ui-kit/variables";
|
2 |
@import "ui-kit/mixins";
|
3 |
|
4 |
+
$font_size: 14px;
|
5 |
+
|
6 |
.cherry-ui-container{
|
7 |
margin: 10px 0 20px 0;
|
8 |
}
|
10 |
margin: 0 0 5px 0;
|
11 |
display: block;
|
12 |
}
|
13 |
+
.cherry-ui-colorpicker-wrapper{
|
|
|
14 |
background-color: $grey_color_3;
|
15 |
+
padding: 5px;
|
16 |
+
max-width: 230px;
|
17 |
+
height: 46px;
|
18 |
+
box-sizing: border-box;
|
19 |
+
}
|
20 |
+
.cherry-ui-colorpicker-wrapper, .customize-control-content{
|
21 |
+
& .wp-picker-container{
|
22 |
+
display: block;
|
23 |
+
|
24 |
+
position: relative;
|
25 |
+
z-index: 1000;
|
26 |
+
&:active{
|
27 |
+
display: block;
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
}
|
29 |
+
> .wp-color-result{
|
30 |
+
margin: 0;
|
31 |
+
border-radius: $border_radius_extra_small;
|
32 |
+
display: block;
|
33 |
+
border: none;
|
34 |
+
box-shadow: none;
|
35 |
+
height: auto;
|
36 |
+
padding-left: 35px;
|
37 |
&:after{
|
38 |
+
padding:7px 0px;
|
39 |
+
font-size: $font_size;
|
40 |
+
border-left: none;
|
41 |
+
};
|
42 |
+
&:focus, &:active{
|
43 |
+
outline: none;
|
44 |
+
border: 1px solid rgba(41, 143, 252, .6);
|
45 |
+
box-shadow: 0px 0px 2px rgba(41,143,252,0.6);
|
46 |
}
|
47 |
}
|
48 |
+
> .wp-picker-input-wrap{
|
49 |
+
display: none;
|
50 |
+
display: flex;
|
51 |
+
width: calc(100% - 40px);
|
52 |
+
max-width: calc(100% - 40px);
|
53 |
+
float: right;
|
54 |
+
&:after{
|
55 |
+
content: '.';
|
56 |
+
clear: both;
|
57 |
+
visibility: hidden;
|
58 |
+
height: 0;
|
59 |
+
};
|
60 |
+
input[type="text"]{
|
61 |
+
padding: 8px 10px 9px;
|
62 |
+
font-size: $font_size;
|
63 |
+
max-width: 100%;
|
64 |
+
flex-grow: 1;
|
65 |
+
}
|
66 |
+
input[type="button"]{
|
67 |
+
height: auto;
|
68 |
+
border: none;
|
69 |
+
border-radius: $border_radius_extra_small;
|
70 |
+
box-shadow: none;
|
71 |
+
padding: 6px 10px 7px;
|
72 |
+
font-size: $font_size;
|
73 |
+
margin-left: 5px;
|
74 |
+
flex-shrink: 0;
|
75 |
+
}
|
76 |
}
|
77 |
+
&.wp-picker-active{
|
78 |
+
> .wp-color-result{
|
79 |
+
height: 35px;
|
80 |
+
width: 0;
|
81 |
+
display: inline-block;
|
82 |
+
margin-right: 5px;
|
83 |
+
&:after{
|
84 |
+
display: none;
|
85 |
+
}
|
86 |
+
}
|
87 |
+
> .wp-picker-input-wrap{
|
88 |
+
display: inline-flex;
|
89 |
+
}
|
90 |
}
|
91 |
}
|
92 |
}
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-colorpicker/assets/ui-kit/_mixins.scss
CHANGED
@@ -17,7 +17,8 @@
|
|
17 |
&:focus,
|
18 |
&:active {
|
19 |
outline: none;
|
20 |
-
|
|
|
21 |
color: #fff;
|
22 |
}
|
23 |
}
|
@@ -64,12 +65,12 @@
|
|
64 |
background-color: $grey_color_3;
|
65 |
border-radius: $border_radius_extra_small;
|
66 |
padding: 10px 20px;
|
67 |
-
height: 50px;
|
68 |
border: 1px solid $grey_color_3;
|
69 |
box-shadow: none;
|
70 |
&:focus{
|
71 |
-
border-color: rgba(
|
72 |
-
box-shadow: 0 0 2px rgba(
|
73 |
}
|
74 |
}
|
75 |
|
@@ -125,7 +126,8 @@
|
|
125 |
&:focus,
|
126 |
&:active {
|
127 |
outline: none;
|
128 |
-
|
|
|
129 |
color: $blue_color;
|
130 |
}
|
131 |
}
|
@@ -179,4 +181,4 @@
|
|
179 |
font-size: 16px;
|
180 |
line-height: 18px;
|
181 |
background: #fff;
|
182 |
-
}
|
17 |
&:focus,
|
18 |
&:active {
|
19 |
outline: none;
|
20 |
+
border-color: rgba(41, 143, 252, .6);
|
21 |
+
box-shadow: 0 0 2px rgba(41, 143, 252, .6);
|
22 |
color: #fff;
|
23 |
}
|
24 |
}
|
65 |
background-color: $grey_color_3;
|
66 |
border-radius: $border_radius_extra_small;
|
67 |
padding: 10px 20px;
|
68 |
+
min-height: 50px;
|
69 |
border: 1px solid $grey_color_3;
|
70 |
box-shadow: none;
|
71 |
&:focus{
|
72 |
+
border-color: rgba(41, 143, 252, .6);
|
73 |
+
box-shadow: 0 0 2px rgba(41, 143, 252, .6);
|
74 |
}
|
75 |
}
|
76 |
|
126 |
&:focus,
|
127 |
&:active {
|
128 |
outline: none;
|
129 |
+
border-color: rgba(41, 143, 252, .6);
|
130 |
+
box-shadow: 0 0 2px rgba(41, 143, 252, .6);
|
131 |
color: $blue_color;
|
132 |
}
|
133 |
}
|
181 |
font-size: 16px;
|
182 |
line-height: 18px;
|
183 |
background: #fff;
|
184 |
+
}
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-colorpicker/ui-colorpicker.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
* @author Cherry Team <support@cherryframework.com>
|
8 |
* @copyright Copyright (c) 2012 - 2015, Cherry Team
|
9 |
* @link http://www.cherryframework.com/
|
10 |
-
* @license http://www.gnu.org/licenses/
|
11 |
*/
|
12 |
|
13 |
// If this file is called directly, abort.
|
@@ -23,26 +23,26 @@ if ( ! class_exists( 'UI_Colorpicker' ) ) {
|
|
23 |
class UI_Colorpicker extends UI_Element implements I_UI {
|
24 |
|
25 |
/**
|
26 |
-
* Default settings
|
27 |
*
|
|
|
28 |
* @var array
|
29 |
*/
|
30 |
private $defaults_settings = array(
|
31 |
-
'id'
|
32 |
-
'name'
|
33 |
-
'value'
|
34 |
-
'label'
|
35 |
-
'class'
|
36 |
-
'master'
|
37 |
);
|
38 |
|
39 |
/**
|
40 |
* Constructor method for the UI_Colorpicker class.
|
41 |
*
|
42 |
-
* @since
|
43 |
*/
|
44 |
function __construct( $args = array() ) {
|
45 |
-
|
46 |
$this->defaults_settings['id'] = 'cherry-ui-colorpicker-' . uniqid();
|
47 |
$this->settings = wp_parse_args( $args, $this->defaults_settings );
|
48 |
|
@@ -52,7 +52,7 @@ if ( ! class_exists( 'UI_Colorpicker' ) ) {
|
|
52 |
/**
|
53 |
* Render html UI_Colorpicker.
|
54 |
*
|
55 |
-
* @since
|
56 |
*/
|
57 |
public function render() {
|
58 |
$html = '';
|
@@ -72,9 +72,9 @@ if ( ! class_exists( 'UI_Colorpicker' ) ) {
|
|
72 |
}
|
73 |
|
74 |
/**
|
75 |
-
* Enqueue javascript and stylesheet UI_Colorpicker
|
76 |
*
|
77 |
-
* @since
|
78 |
*/
|
79 |
public static function enqueue_assets() {
|
80 |
|
@@ -82,7 +82,7 @@ if ( ! class_exists( 'UI_Colorpicker' ) ) {
|
|
82 |
'ui-colorpicker-min',
|
83 |
esc_url( Cherry_Core::base_url( 'assets/min/ui-colorpicker.min.js', __FILE__ ) ),
|
84 |
array( 'jquery', 'wp-color-picker' ),
|
85 |
-
'1.
|
86 |
true
|
87 |
);
|
88 |
|
@@ -90,7 +90,7 @@ if ( ! class_exists( 'UI_Colorpicker' ) ) {
|
|
90 |
'ui-colorpicker-min',
|
91 |
esc_url( Cherry_Core::base_url( 'assets/min/ui-colorpicker.min.css', __FILE__ ) ),
|
92 |
array( 'wp-color-picker' ),
|
93 |
-
'1.
|
94 |
'all'
|
95 |
);
|
96 |
}
|
7 |
* @author Cherry Team <support@cherryframework.com>
|
8 |
* @copyright Copyright (c) 2012 - 2015, Cherry Team
|
9 |
* @link http://www.cherryframework.com/
|
10 |
+
* @license http://www.gnu.org/licenses/gpl-3.0.en.html
|
11 |
*/
|
12 |
|
13 |
// If this file is called directly, abort.
|
23 |
class UI_Colorpicker extends UI_Element implements I_UI {
|
24 |
|
25 |
/**
|
26 |
+
* Default settings.
|
27 |
*
|
28 |
+
* @since 1.0.0
|
29 |
* @var array
|
30 |
*/
|
31 |
private $defaults_settings = array(
|
32 |
+
'id' => 'cherry-ui-colorpicker-id',
|
33 |
+
'name' => 'cherry-ui-colorpicker-name',
|
34 |
+
'value' => '',
|
35 |
+
'label' => '',
|
36 |
+
'class' => '',
|
37 |
+
'master' => '',
|
38 |
);
|
39 |
|
40 |
/**
|
41 |
* Constructor method for the UI_Colorpicker class.
|
42 |
*
|
43 |
+
* @since 1.0.0
|
44 |
*/
|
45 |
function __construct( $args = array() ) {
|
|
|
46 |
$this->defaults_settings['id'] = 'cherry-ui-colorpicker-' . uniqid();
|
47 |
$this->settings = wp_parse_args( $args, $this->defaults_settings );
|
48 |
|
52 |
/**
|
53 |
* Render html UI_Colorpicker.
|
54 |
*
|
55 |
+
* @since 1.0.0
|
56 |
*/
|
57 |
public function render() {
|
58 |
$html = '';
|
72 |
}
|
73 |
|
74 |
/**
|
75 |
+
* Enqueue javascript and stylesheet UI_Colorpicker.
|
76 |
*
|
77 |
+
* @since 1.0.0
|
78 |
*/
|
79 |
public static function enqueue_assets() {
|
80 |
|
82 |
'ui-colorpicker-min',
|
83 |
esc_url( Cherry_Core::base_url( 'assets/min/ui-colorpicker.min.js', __FILE__ ) ),
|
84 |
array( 'jquery', 'wp-color-picker' ),
|
85 |
+
'1.3.2',
|
86 |
true
|
87 |
);
|
88 |
|
90 |
'ui-colorpicker-min',
|
91 |
esc_url( Cherry_Core::base_url( 'assets/min/ui-colorpicker.min.css', __FILE__ ) ),
|
92 |
array( 'wp-color-picker' ),
|
93 |
+
'1.3.2',
|
94 |
'all'
|
95 |
);
|
96 |
}
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-iconpicker/assets/min/ui-iconpicker.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.cherry-ui-iconpicker-group{max-width:230px
|
1 |
+
.cherry-ui-iconpicker-group{position:relative}.full .cherry-ui-iconpicker-group{max-width:100%}.fixed .cherry-ui-iconpicker-group{max-width:230px}.cherry-ui-iconpicker-group .input-group-addon{position:absolute;width:36px;height:36px;left:0px;top:0px;background:#f1f1f1;font-size:14px;line-height:36px;text-align:center;border-radius:3px 0 0 3px;border-right:1px solid #dddcdc;margin:7px}.cherry-ui-iconpicker-group .input-group-addon .fa{line-height:36px}.cherry-ui-iconpicker-group .cherry-ui-text{font-size:14px;line-height:20px;color:#23282d;background-color:#f1f1f1;border-radius:2px;padding:10px 20px;min-height:50px;border:1px solid #f1f1f1;box-shadow:none;padding-left:60px}.cherry-ui-iconpicker-group .cherry-ui-text:focus{border-color:rgba(41,143,252,0.6);box-shadow:0 0 2px rgba(41,143,252,0.6)}.iconpicker-popover.popover{position:absolute;top:0;left:0;display:none;max-width:none;padding:1px;text-align:left;width:242px;background:#f0f0f0;z-index:999}.iconpicker-popover.popover.top,.iconpicker-popover.popover.topLeftCorner,.iconpicker-popover.popover.topLeft,.iconpicker-popover.popover.topRight,.iconpicker-popover.popover.topRightCorner{margin-top:-10px}.iconpicker-popover.popover.right,.iconpicker-popover.popover.rightTop,.iconpicker-popover.popover.rightBottom{margin-left:10px}.iconpicker-popover.popover.bottom,.iconpicker-popover.popover.bottomRightCorner,.iconpicker-popover.popover.bottomRight,.iconpicker-popover.popover.bottomLeft,.iconpicker-popover.popover.bottomLeftCorner{margin-top:10px}.iconpicker-popover.popover.left,.iconpicker-popover.popover.leftBottom,.iconpicker-popover.popover.leftTop{margin-left:-10px}.iconpicker-popover.popover.inline{margin:0 0 14px 0;position:relative;display:inline-block;opacity:1;top:auto;left:auto;bottom:auto;right:auto;max-width:100%;box-shadow:none;z-index:auto;vertical-align:top}.iconpicker-popover.popover.inline>.arrow{display:none}.dropdown-menu .iconpicker-popover.inline{margin:0;border:none}.dropdown-menu.iconpicker-container{padding:0}.iconpicker-popover.popover .popover-title{padding:14px;font-size:14px;line-height:16px;border-bottom:1px solid #ebebeb;background-color:#f0f0f0}.iconpicker-popover.popover .popover-title input[type=search].iconpicker-search{margin:0 0 2px 0}.iconpicker-popover.popover .popover-title-text ~ input[type=search].iconpicker-search{margin-top:14px}.iconpicker-popover.popover .popover-content{padding:0px;text-align:center}.iconpicker-popover .popover-footer{float:none;clear:both;padding:14px;text-align:right;margin:0;border-top:1px solid #ebebeb;background-color:#f0f0f0}.iconpicker-popover .popover-footer:before,.iconpicker-popover .popover-footer:after{content:" ";display:table}.iconpicker-popover .popover-footer:after{clear:both}.iconpicker-popover .popover-footer .iconpicker-btn{margin-left:10px}.iconpicker-popover .popover-footer input[type=search].iconpicker-search{margin-bottom:14px}.iconpicker-popover.popover>.arrow,.iconpicker-popover.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.iconpicker-popover.popover>.arrow{border-width:11px}.iconpicker-popover.popover>.arrow:after{border-width:10px;content:""}.iconpicker-popover.popover.top>.arrow,.iconpicker-popover.popover.topLeft>.arrow,.iconpicker-popover.popover.topRight>.arrow{left:50%;margin-left:-11px;border-bottom-width:0;border-top-color:#f0f0f0;bottom:-11px}.iconpicker-popover.popover.top>.arrow:after,.iconpicker-popover.popover.topLeft>.arrow:after,.iconpicker-popover.popover.topRight>.arrow:after{content:" ";bottom:1px;margin-left:-10px;border-bottom-width:0;border-top-color:#ffffff}.iconpicker-popover.popover.topLeft>.arrow{left:14px;margin-left:0}.iconpicker-popover.popover.topRight>.arrow{left:auto;right:14px;margin-left:0}.iconpicker-popover.popover.right>.arrow,.iconpicker-popover.popover.rightTop>.arrow,.iconpicker-popover.popover.rightBottom>.arrow{top:50%;left:-11px;margin-top:-11px;border-left-width:0;border-right-color:#f0f0f0}.iconpicker-popover.popover.right>.arrow:after,.iconpicker-popover.popover.rightTop>.arrow:after,.iconpicker-popover.popover.rightBottom>.arrow:after{content:" ";left:1px;bottom:-10px;border-left-width:0;border-right-color:#ffffff}.iconpicker-popover.popover.rightTop>.arrow{top:auto;bottom:14px;margin-top:0}.iconpicker-popover.popover.rightBottom>.arrow{top:14px;margin-top:0}.iconpicker-popover.popover.bottom>.arrow,.iconpicker-popover.popover.bottomRight>.arrow,.iconpicker-popover.popover.bottomLeft>.arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#f0f0f0;top:-11px}.iconpicker-popover.popover.bottom>.arrow:after,.iconpicker-popover.popover.bottomRight>.arrow:after,.iconpicker-popover.popover.bottomLeft>.arrow:after{content:" ";top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#f0f0f0}.iconpicker-popover.popover.bottomLeft>.arrow{left:14px;margin-left:0}.iconpicker-popover.popover.bottomRight>.arrow{left:auto;right:14px;margin-left:0}.iconpicker-popover.popover.left>.arrow,.iconpicker-popover.popover.leftBottom>.arrow,.iconpicker-popover.popover.leftTop>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#f0f0f0}.iconpicker-popover.popover.left>.arrow:after,.iconpicker-popover.popover.leftBottom>.arrow:after,.iconpicker-popover.popover.leftTop>.arrow:after{content:" ";right:1px;border-right-width:0;border-left-color:#ffffff;bottom:-10px}.iconpicker-popover.popover.leftBottom>.arrow{top:14px;margin-top:0}.iconpicker-popover.popover.leftTop>.arrow{top:auto;bottom:14px;margin-top:0}.iconpicker{position:relative;text-align:left;text-shadow:none;line-height:0;display:block;margin:0;overflow:hidden}.iconpicker *{box-sizing:content-box;position:relative}.iconpicker:before,.iconpicker:after{content:" ";display:table}.iconpicker:after{clear:both}.iconpicker .iconpicker-items{position:relative;clear:both;float:none;padding:10px 0 0 10px;background:#fff;margin:0;overflow:hidden;overflow-y:auto;min-height:55px;max-height:275px}.iconpicker .iconpicker-items:before,.iconpicker .iconpicker-items:after{content:" ";display:table}.iconpicker .iconpicker-items:after{clear:both}.iconpicker .iconpicker-item{float:left;width:28px;height:28px;line-height:28px;margin:0 7px 7px 0;text-align:center;cursor:pointer;border-radius:3px;font-size:18px;color:#444;box-shadow:0 0 0 1px #dddddd}.iconpicker .iconpicker-item .fa{line-height:28px}.iconpicker .iconpicker-item:hover:not(.iconpicker-selected){background-color:#eeeeee}.iconpicker .iconpicker-item.iconpicker-selected{box-shadow:none;background:#ddd}.iconpicker-component{cursor:pointer}
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-iconpicker/assets/min/ui-iconpicker.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(e,
|
1 |
+
!function(e,t,n){"use strict";t.utilites.namespace("ui_elements.iconpicker"),t.ui_elements.iconpicker={iconSets:{},iconSetsKey:"cherry5-icon-sets",init:function(){e(document).on("cherry-ajax-handler-success",this.setIconsSets.bind(this)).on("ready.iconpicker",this.setIconsSets.bind(this,window.cherry5IconSets)).on("ready.iconpicker",this.render.bind(this)).on("cherry-ui-elements-init",this.render.bind(this))},setIconsSets:function(e){var t,i=this;e&&(t=e.response?e.response.cherry5IconSets:e,n.each(t,function(e,t){i.iconSets[t]=e}),i.setState(i.iconSetsKey,i.iconSets))},getIconsSets:function(){var e=this.getState(this.iconSetsKey);e&&(this.iconSets=e)},render:function(t){var n,i,s,c=t._target?t._target:e("body"),o=e('.cherry-ui-iconpicker:not([name*="__i__"])',c),r=this;o[0]&&(this.getIconsSets(),o.each(function(){n=e(this),i=n.data("set"),s=r.iconSets[i],n.length&&s.icons&&n.iconpicker({icons:s.icons,iconBaseClass:s.iconBase,iconClassPrefix:s.iconPrefix,animation:!1,fullClassFormatter:function(e){return s.iconBase+" "+s.iconPrefix+e}}).on("iconpickerUpdated",function(){e(this).trigger("change")}),s&&e("head").append('<link rel="stylesheet" type="text/css" href="'+s.iconCSS+'"">')}))},getState:function(e){try{return JSON.parse(window.sessionStorage.getItem(e))}catch(e){return!1}},setState:function(e,t){try{window.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){return!1}}},t.ui_elements.iconpicker.init()}(jQuery,window.CherryJsCore,window._);
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-iconpicker/assets/ui-iconpicker.js
CHANGED
@@ -1,27 +1,63 @@
|
|
1 |
/**
|
2 |
* Iconpicker
|
3 |
*/
|
4 |
-
(function( $, CherryJsCore ) {
|
5 |
'use strict';
|
6 |
|
7 |
CherryJsCore.utilites.namespace( 'ui_elements.iconpicker' );
|
8 |
CherryJsCore.ui_elements.iconpicker = {
|
|
|
|
|
|
|
9 |
init: function() {
|
10 |
$( document )
|
11 |
-
.on( '
|
12 |
-
.on( '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
},
|
|
|
14 |
render: function( event ) {
|
15 |
var target = ( event._target ) ? event._target : $( 'body' ),
|
16 |
$picker = $( '.cherry-ui-iconpicker:not([name*="__i__"])', target ),
|
17 |
$this,
|
18 |
set,
|
19 |
-
setData
|
|
|
|
|
|
|
|
|
20 |
|
21 |
$picker.each( function() {
|
22 |
$this = $( this );
|
23 |
set = $this.data( 'set' );
|
24 |
-
setData =
|
25 |
|
26 |
if ( $this.length && setData.icons ) {
|
27 |
$this.iconpicker({
|
@@ -41,9 +77,26 @@
|
|
41 |
$( 'head' ).append( '<link rel="stylesheet" type="text/css" href="' + setData.iconCSS + '"">' );
|
42 |
}
|
43 |
} );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
}
|
45 |
};
|
46 |
|
47 |
CherryJsCore.ui_elements.iconpicker.init();
|
48 |
|
49 |
-
}( jQuery, window.CherryJsCore ) );
|
1 |
/**
|
2 |
* Iconpicker
|
3 |
*/
|
4 |
+
(function( $, CherryJsCore, underscore ) {
|
5 |
'use strict';
|
6 |
|
7 |
CherryJsCore.utilites.namespace( 'ui_elements.iconpicker' );
|
8 |
CherryJsCore.ui_elements.iconpicker = {
|
9 |
+
iconSets: {},
|
10 |
+
iconSetsKey: 'cherry5-icon-sets',
|
11 |
+
|
12 |
init: function() {
|
13 |
$( document )
|
14 |
+
.on( 'cherry-ajax-handler-success', this.setIconsSets.bind( this ) )
|
15 |
+
.on( 'ready.iconpicker', this.setIconsSets.bind( this, window.cherry5IconSets ) )
|
16 |
+
.on( 'ready.iconpicker', this.render.bind( this ) )
|
17 |
+
.on( 'cherry-ui-elements-init', this.render.bind( this ) );
|
18 |
+
},
|
19 |
+
|
20 |
+
setIconsSets: function( iconSets ) {
|
21 |
+
var icon,
|
22 |
+
_this = this;
|
23 |
+
|
24 |
+
if ( iconSets ) {
|
25 |
+
icon = ( iconSets.response ) ? iconSets.response.cherry5IconSets : iconSets;
|
26 |
+
|
27 |
+
underscore.each(
|
28 |
+
icon,
|
29 |
+
function( element, index ) {
|
30 |
+
_this.iconSets[ index ] = element;
|
31 |
+
}
|
32 |
+
);
|
33 |
+
|
34 |
+
_this.setState( _this.iconSetsKey, _this.iconSets );
|
35 |
+
}
|
36 |
+
},
|
37 |
+
|
38 |
+
getIconsSets: function() {
|
39 |
+
var iconSets = this.getState( this.iconSetsKey );
|
40 |
+
|
41 |
+
if ( iconSets ) {
|
42 |
+
this.iconSets = iconSets;
|
43 |
+
}
|
44 |
},
|
45 |
+
|
46 |
render: function( event ) {
|
47 |
var target = ( event._target ) ? event._target : $( 'body' ),
|
48 |
$picker = $( '.cherry-ui-iconpicker:not([name*="__i__"])', target ),
|
49 |
$this,
|
50 |
set,
|
51 |
+
setData,
|
52 |
+
_this = this;
|
53 |
+
|
54 |
+
if ( $picker[0] ) {
|
55 |
+
this.getIconsSets();
|
56 |
|
57 |
$picker.each( function() {
|
58 |
$this = $( this );
|
59 |
set = $this.data( 'set' );
|
60 |
+
setData = _this.iconSets[set];
|
61 |
|
62 |
if ( $this.length && setData.icons ) {
|
63 |
$this.iconpicker({
|
77 |
$( 'head' ).append( '<link rel="stylesheet" type="text/css" href="' + setData.iconCSS + '"">' );
|
78 |
}
|
79 |
} );
|
80 |
+
}
|
81 |
+
},
|
82 |
+
|
83 |
+
getState: function( key ) {
|
84 |
+
try {
|
85 |
+
return JSON.parse( window.sessionStorage.getItem( key ) );
|
86 |
+
} catch ( e ) {
|
87 |
+
return false;
|
88 |
+
}
|
89 |
+
},
|
90 |
+
|
91 |
+
setState: function( key, data ) {
|
92 |
+
try {
|
93 |
+
window.sessionStorage.setItem( key, JSON.stringify( data ) );
|
94 |
+
} catch ( e ) {
|
95 |
+
return false;
|
96 |
+
}
|
97 |
}
|
98 |
};
|
99 |
|
100 |
CherryJsCore.ui_elements.iconpicker.init();
|
101 |
|
102 |
+
}( jQuery, window.CherryJsCore, window._ ) );
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-iconpicker/assets/ui-iconpicker.scss
CHANGED
@@ -2,8 +2,13 @@
|
|
2 |
@import "ui-kit/mixins";
|
3 |
|
4 |
.cherry-ui-iconpicker-group {
|
5 |
-
max-width: 230px;
|
6 |
position: relative;
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
.input-group-addon {
|
8 |
position: absolute;
|
9 |
width: 36px;
|
2 |
@import "ui-kit/mixins";
|
3 |
|
4 |
.cherry-ui-iconpicker-group {
|
|
|
5 |
position: relative;
|
6 |
+
.full &{
|
7 |
+
max-width: 100%;
|
8 |
+
}
|
9 |
+
.fixed &{
|
10 |
+
max-width: 230px;
|
11 |
+
}
|
12 |
.input-group-addon {
|
13 |
position: absolute;
|
14 |
width: 36px;
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-iconpicker/assets/ui-kit/_mixins.scss
CHANGED
@@ -17,7 +17,8 @@
|
|
17 |
&:focus,
|
18 |
&:active {
|
19 |
outline: none;
|
20 |
-
|
|
|
21 |
color: #fff;
|
22 |
}
|
23 |
}
|
@@ -64,12 +65,12 @@
|
|
64 |
background-color: $grey_color_3;
|
65 |
border-radius: $border_radius_extra_small;
|
66 |
padding: 10px 20px;
|
67 |
-
height: 50px;
|
68 |
border: 1px solid $grey_color_3;
|
69 |
box-shadow: none;
|
70 |
&:focus{
|
71 |
-
border-color: rgba(
|
72 |
-
box-shadow: 0 0 2px rgba(
|
73 |
}
|
74 |
}
|
75 |
|
@@ -125,7 +126,8 @@
|
|
125 |
&:focus,
|
126 |
&:active {
|
127 |
outline: none;
|
128 |
-
|
|
|
129 |
color: $blue_color;
|
130 |
}
|
131 |
}
|
@@ -179,4 +181,4 @@
|
|
179 |
font-size: 16px;
|
180 |
line-height: 18px;
|
181 |
background: #fff;
|
182 |
-
}
|
17 |
&:focus,
|
18 |
&:active {
|
19 |
outline: none;
|
20 |
+
border-color: rgba(41, 143, 252, .6);
|
21 |
+
box-shadow: 0 0 2px rgba(41, 143, 252, .6);
|
22 |
color: #fff;
|
23 |
}
|
24 |
}
|
65 |
background-color: $grey_color_3;
|
66 |
border-radius: $border_radius_extra_small;
|
67 |
padding: 10px 20px;
|
68 |
+
min-height: 50px;
|
69 |
border: 1px solid $grey_color_3;
|
70 |
box-shadow: none;
|
71 |
&:focus{
|
72 |
+
border-color: rgba(41, 143, 252, .6);
|
73 |
+
box-shadow: 0 0 2px rgba(41, 143, 252, .6);
|
74 |
}
|
75 |
}
|
76 |
|
126 |
&:focus,
|
127 |
&:active {
|
128 |
outline: none;
|
129 |
+
border-color: rgba(41, 143, 252, .6);
|
130 |
+
box-shadow: 0 0 2px rgba(41, 143, 252, .6);
|
131 |
color: $blue_color;
|
132 |
}
|
133 |
}
|
181 |
font-size: 16px;
|
182 |
line-height: 18px;
|
183 |
background: #fff;
|
184 |
+
}
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-iconpicker/ui-iconpicker.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
* @author Cherry Team <support@cherryframework.com>
|
8 |
* @copyright Copyright (c) 2012 - 2015, Cherry Team
|
9 |
* @link http://www.cherryframework.com/
|
10 |
-
* @license http://www.gnu.org/licenses/
|
11 |
*/
|
12 |
|
13 |
// If this file is called directly, abort.
|
@@ -23,8 +23,9 @@ if ( ! class_exists( 'UI_Iconpicker' ) ) {
|
|
23 |
class UI_Iconpicker extends UI_Element implements I_UI {
|
24 |
|
25 |
/**
|
26 |
-
* Default settings
|
27 |
*
|
|
|
28 |
* @var array
|
29 |
*/
|
30 |
private $defaults_settings = array(
|
@@ -38,11 +39,12 @@ if ( ! class_exists( 'UI_Iconpicker' ) ) {
|
|
38 |
'label' => '',
|
39 |
'class' => '',
|
40 |
'master' => '',
|
|
|
41 |
'required' => false,
|
42 |
);
|
43 |
|
44 |
/**
|
45 |
-
* Default icon data settings
|
46 |
*
|
47 |
* @var array
|
48 |
*/
|
@@ -76,9 +78,9 @@ if ( ! class_exists( 'UI_Iconpicker' ) ) {
|
|
76 |
public static $printed_sets = array();
|
77 |
|
78 |
/**
|
79 |
-
* Constructor method for the
|
80 |
*
|
81 |
-
* @since
|
82 |
*/
|
83 |
function __construct( $args = array() ) {
|
84 |
$this->defaults_settings['id'] = 'cherry-ui-input-icon-' . uniqid();
|
@@ -87,6 +89,7 @@ if ( ! class_exists( 'UI_Iconpicker' ) ) {
|
|
87 |
add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
|
88 |
add_action( 'admin_footer', array( $this, 'print_icon_set' ), 1 );
|
89 |
add_action( 'customize_controls_print_footer_scripts', array( $this, 'print_icon_set' ), 9999 );
|
|
|
90 |
}
|
91 |
|
92 |
/**
|
@@ -102,13 +105,13 @@ if ( ! class_exists( 'UI_Iconpicker' ) ) {
|
|
102 |
}
|
103 |
|
104 |
/**
|
105 |
-
* Render html
|
106 |
*
|
107 |
-
* @since
|
108 |
*/
|
109 |
public function render() {
|
110 |
$html = '';
|
111 |
-
$class = $this->settings['class'];
|
112 |
$class .= ' ' . $this->settings['master'];
|
113 |
|
114 |
$html .= '<div class="cherry-ui-container ' . esc_attr( $class ) . '">';
|
@@ -133,6 +136,7 @@ if ( ! class_exists( 'UI_Iconpicker' ) ) {
|
|
133 |
|
134 |
$html .= '</div>';
|
135 |
$html .= '</div>';
|
|
|
136 |
return $html;
|
137 |
}
|
138 |
|
@@ -173,7 +177,6 @@ if ( ! class_exists( 'UI_Iconpicker' ) ) {
|
|
173 |
'icons' => $this->settings['icon_data']['icons'],
|
174 |
);
|
175 |
}
|
176 |
-
|
177 |
}
|
178 |
|
179 |
/**
|
@@ -234,6 +237,25 @@ if ( ! class_exists( 'UI_Iconpicker' ) ) {
|
|
234 |
|
235 |
}
|
236 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
237 |
/**
|
238 |
* Print icon sets
|
239 |
*
|
@@ -256,15 +278,15 @@ if ( ! class_exists( 'UI_Iconpicker' ) ) {
|
|
256 |
self::$printed_sets[] = $set;
|
257 |
$json = json_encode( $data );
|
258 |
|
259 |
-
printf( '<script>window.%1$s = %2$s</script>', $set, $json );
|
260 |
}
|
261 |
|
262 |
}
|
263 |
|
264 |
/**
|
265 |
-
* Enqueue javascript and stylesheet
|
266 |
*
|
267 |
-
* @since
|
268 |
*/
|
269 |
public static function enqueue_assets() {
|
270 |
|
@@ -272,7 +294,7 @@ if ( ! class_exists( 'UI_Iconpicker' ) ) {
|
|
272 |
'ui-iconpicker',
|
273 |
esc_url( Cherry_Core::base_url( 'assets/min/ui-iconpicker.min.css', __FILE__ ) ),
|
274 |
array(),
|
275 |
-
'1.
|
276 |
'all'
|
277 |
);
|
278 |
|
@@ -280,14 +302,15 @@ if ( ! class_exists( 'UI_Iconpicker' ) ) {
|
|
280 |
'jquery-iconpicker',
|
281 |
esc_url( Cherry_Core::base_url( 'assets/min/jquery-iconpicker.min.js', __FILE__ ) ),
|
282 |
array( 'jquery' ),
|
283 |
-
'1.
|
284 |
true
|
285 |
);
|
|
|
286 |
wp_enqueue_script(
|
287 |
'ui-iconpicker',
|
288 |
esc_url( Cherry_Core::base_url( 'assets/min/ui-iconpicker.min.js', __FILE__ ) ),
|
289 |
array( 'jquery' ),
|
290 |
-
'1.
|
291 |
true
|
292 |
);
|
293 |
}
|
7 |
* @author Cherry Team <support@cherryframework.com>
|
8 |
* @copyright Copyright (c) 2012 - 2015, Cherry Team
|
9 |
* @link http://www.cherryframework.com/
|
10 |
+
* @license http://www.gnu.org/licenses/gpl-3.0.en.html
|
11 |
*/
|
12 |
|
13 |
// If this file is called directly, abort.
|
23 |
class UI_Iconpicker extends UI_Element implements I_UI {
|
24 |
|
25 |
/**
|
26 |
+
* Default settings.
|
27 |
*
|
28 |
+
* @since 1.0.0
|
29 |
* @var array
|
30 |
*/
|
31 |
private $defaults_settings = array(
|
39 |
'label' => '',
|
40 |
'class' => '',
|
41 |
'master' => '',
|
42 |
+
'width' => 'fixed', // full, fixed
|
43 |
'required' => false,
|
44 |
);
|
45 |
|
46 |
/**
|
47 |
+
* Default icon data settings.
|
48 |
*
|
49 |
* @var array
|
50 |
*/
|
78 |
public static $printed_sets = array();
|
79 |
|
80 |
/**
|
81 |
+
* Constructor method for the UI_Iconpicker class.
|
82 |
*
|
83 |
+
* @since 1.0.0
|
84 |
*/
|
85 |
function __construct( $args = array() ) {
|
86 |
$this->defaults_settings['id'] = 'cherry-ui-input-icon-' . uniqid();
|
89 |
add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
|
90 |
add_action( 'admin_footer', array( $this, 'print_icon_set' ), 1 );
|
91 |
add_action( 'customize_controls_print_footer_scripts', array( $this, 'print_icon_set' ), 9999 );
|
92 |
+
add_filter( 'cherry_handler_response_data', array( $this, 'send_icon_set' ), 10, 1 );
|
93 |
}
|
94 |
|
95 |
/**
|
105 |
}
|
106 |
|
107 |
/**
|
108 |
+
* Render html UI_Iconpicker.
|
109 |
*
|
110 |
+
* @since 1.0.0
|
111 |
*/
|
112 |
public function render() {
|
113 |
$html = '';
|
114 |
+
$class = $this->settings['class'] . $this->settings['width'] ;
|
115 |
$class .= ' ' . $this->settings['master'];
|
116 |
|
117 |
$html .= '<div class="cherry-ui-container ' . esc_attr( $class ) . '">';
|
136 |
|
137 |
$html .= '</div>';
|
138 |
$html .= '</div>';
|
139 |
+
|
140 |
return $html;
|
141 |
}
|
142 |
|
177 |
'icons' => $this->settings['icon_data']['icons'],
|
178 |
);
|
179 |
}
|
|
|
180 |
}
|
181 |
|
182 |
/**
|
237 |
|
238 |
}
|
239 |
|
240 |
+
/**
|
241 |
+
* Function sends the icons into ajax response.
|
242 |
+
*
|
243 |
+
* @param array $data Icon data.
|
244 |
+
* @return array
|
245 |
+
*/
|
246 |
+
public function send_icon_set( $data ) {
|
247 |
+
|
248 |
+
if ( empty( $data['cherryIconsSets'] ) ) {
|
249 |
+
$data['cherry5IconSets'] = array();
|
250 |
+
}
|
251 |
+
|
252 |
+
foreach ( self::$sets as $key => $value ) {
|
253 |
+
$data['cherry5IconSets'][ $key ] = $value;
|
254 |
+
}
|
255 |
+
|
256 |
+
return $data;
|
257 |
+
}
|
258 |
+
|
259 |
/**
|
260 |
* Print icon sets
|
261 |
*
|
278 |
self::$printed_sets[] = $set;
|
279 |
$json = json_encode( $data );
|
280 |
|
281 |
+
printf( '<script> if ( ! window.cherry5IconSets ) { window.cherry5IconSets = {} } window.cherry5IconSets.%1$s = %2$s</script>', $set, $json );
|
282 |
}
|
283 |
|
284 |
}
|
285 |
|
286 |
/**
|
287 |
+
* Enqueue javascript and stylesheet UI_Iconpicker
|
288 |
*
|
289 |
+
* @since 1.0.0
|
290 |
*/
|
291 |
public static function enqueue_assets() {
|
292 |
|
294 |
'ui-iconpicker',
|
295 |
esc_url( Cherry_Core::base_url( 'assets/min/ui-iconpicker.min.css', __FILE__ ) ),
|
296 |
array(),
|
297 |
+
'1.3.2',
|
298 |
'all'
|
299 |
);
|
300 |
|
302 |
'jquery-iconpicker',
|
303 |
esc_url( Cherry_Core::base_url( 'assets/min/jquery-iconpicker.min.js', __FILE__ ) ),
|
304 |
array( 'jquery' ),
|
305 |
+
'1.3.2',
|
306 |
true
|
307 |
);
|
308 |
+
|
309 |
wp_enqueue_script(
|
310 |
'ui-iconpicker',
|
311 |
esc_url( Cherry_Core::base_url( 'assets/min/ui-iconpicker.min.js', __FILE__ ) ),
|
312 |
array( 'jquery' ),
|
313 |
+
'1.3.2',
|
314 |
true
|
315 |
);
|
316 |
}
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-media/assets/min/ui-media.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.cherry-ui-container{margin:10px 0 20px 0}label.cherry-label{margin:0 0 5px 0;display:block}.cherry-ui-media-wrap .cherry-upload-preview{display:block;margin:0 0 5px 0}.cherry-ui-media-wrap .cherry-upload-preview .cherry-image-wrap{position:relative;display:inline-block;vertical-align:top;width:120px;height:120px}.cherry-ui-media-wrap .cherry-upload-preview .cherry-image-wrap .inner{width:110px;height:110px;margin:3px;position:relative;border:2px solid #298ffc;border-radius:2px;overflow:hidden}.cherry-ui-media-wrap .cherry-upload-preview .cherry-image-wrap .inner .preview-holder{width:100%;height:100%;position:relative;background:#f1f1f1;box-sizing:border-box}.cherry-ui-media-wrap .cherry-upload-preview .cherry-image-wrap .inner .preview-holder .centered{position:absolute;width:100%;height:100%;top:0;left:0;-webkit-transform:translate(50%, 50%)
|
1 |
+
.cherry-ui-container{margin:10px 0 20px 0}label.cherry-label{margin:0 0 5px 0;display:block}.cherry-ui-media-wrap .cherry-upload-preview{display:block;margin:0 0 5px 0}.cherry-ui-media-wrap .cherry-upload-preview .cherry-image-wrap{position:relative;display:inline-block;vertical-align:top;width:120px;height:120px}.cherry-ui-media-wrap .cherry-upload-preview .cherry-image-wrap .inner{width:110px;height:110px;margin:3px;position:relative;border:2px solid #298ffc;border-radius:2px;overflow:hidden}.cherry-ui-media-wrap .cherry-upload-preview .cherry-image-wrap .inner .preview-holder{width:100%;height:100%;position:relative;background:#f1f1f1;box-sizing:border-box}.cherry-ui-media-wrap .cherry-upload-preview .cherry-image-wrap .inner .preview-holder .centered{position:absolute;width:100%;height:100%;top:0;left:0;-webkit-transform:translate(50%, 50%);transform:translate(50%, 50%)}.cherry-ui-media-wrap .cherry-upload-preview .cherry-image-wrap .inner .preview-holder img{max-width:100%;height:auto;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%)}.cherry-ui-media-wrap .cherry-upload-preview .cherry-image-wrap .inner .preview-holder span{width:auto;height:auto;font-size:60px;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%)}.cherry-ui-media-wrap .cherry-upload-preview .cherry-image-wrap .inner .title{position:absolute;width:100%;padding:5px 0;bottom:0;left:0;color:#fff;background:rgba(41,143,252,0.8);text-align:center;font-size:11px;overflow:hidden}.cherry-ui-media-wrap .cherry-upload-preview .cherry-image-wrap:hover .cherry-remove-image{display:block}.cherry-ui-media-wrap .cherry-upload-preview .cherry-media-thumb-sortable-placeholder{width:112px;height:112px;margin:3px;vertical-align:top;border:1px dashed #dcdcdc;display:inline-block;background-color:#f1f1f1}.cherry-ui-media-wrap .upload-button{float:left}.cherry-ui-media-wrap .cherry-remove-image{width:30px;height:30px;color:#e54343;display:block;position:absolute;top:0;right:0;cursor:pointer;text-decoration:none;outline:0;display:none}.cherry-ui-media-wrap .cherry-remove-image i{width:30px;height:30px;font-size:30px}.cherry-ui-media-wrap .cherry-remove-image:hover{color:#d71e1e}.cherry-ui-media-wrap .cherry-bgsetting{float:left;width:32%;margin-right:1%}.cherry-ui-media-wrap .cherry-bgsetting:nth-child(3n+1){width:34%;margin-right:0}.cherry-ui-media-wrap .cherry-bgsetting select{margin-bottom:10px}.button-default_{position:relative;display:inline-block;font-size:12px;line-height:18px;font-weight:900;letter-spacing:0.5px;text-decoration:none;padding:15px 20px;color:#23282d;text-transform:uppercase;border-radius:4px;border-width:1px;border-style:solid;outline:none;cursor:pointer;transition:all 200ms linear;color:#fff;border-color:#777879 #2f343a #2f343a #777879;background-color:#495159}.button-default_:before{position:absolute;display:block;width:100%;height:100%;top:0;left:0;border-radius:4px;background-image:linear-gradient(180deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 100%);content:''}.button-default_:hover:before{background-image:linear-gradient(0deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 100%)}.button-default_:active:before{opacity:0}.button-default_:active{background-color:#495159;border-color:#181b1e #777879 #777879 #181b1e}
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-media/assets/min/ui-media.min.js
CHANGED
@@ -1,156 +1 @@
|
|
1 |
-
|
2 |
-
* Media
|
3 |
-
*/
|
4 |
-
(function( $, CherryJsCore){
|
5 |
-
'use strict';
|
6 |
-
|
7 |
-
CherryJsCore.utilites.namespace('ui_elements.media');
|
8 |
-
CherryJsCore.ui_elements.media = {
|
9 |
-
init: function () {
|
10 |
-
$( document )
|
11 |
-
.on( 'ready', this.render )
|
12 |
-
.on( 'cherry-ui-elements-init', this.render );
|
13 |
-
},
|
14 |
-
render: function ( event ) {
|
15 |
-
var target = ( event._target ) ? event._target : $( 'body' ),
|
16 |
-
buttons = $('.cherry-upload-button', target);
|
17 |
-
|
18 |
-
buttons.each( function() {
|
19 |
-
var button = $( this ),
|
20 |
-
button_parent = button.closest('.cherry-ui-media-wrap'),
|
21 |
-
settings = {
|
22 |
-
input: $('.cherry-upload-input', button_parent),
|
23 |
-
img_holder: $('.cherry-upload-preview', button_parent),
|
24 |
-
title_text: button.data('title'),
|
25 |
-
multiple: button.data('multi-upload'),
|
26 |
-
library_type: button.data('library-type'),
|
27 |
-
},
|
28 |
-
cherry_uploader = wp.media.frames.file_frame = wp.media({
|
29 |
-
title: settings.title_text,
|
30 |
-
button: { text: settings.title_text },
|
31 |
-
multiple: settings.multiple,
|
32 |
-
library : { type : settings.library_type }
|
33 |
-
});
|
34 |
-
|
35 |
-
if ( ! button_parent.has('input[name*="__i__"]')[ 0 ] ) {
|
36 |
-
button.on( 'click', function() {
|
37 |
-
cherry_uploader.open();
|
38 |
-
return !1;
|
39 |
-
} ); // end click
|
40 |
-
|
41 |
-
cherry_uploader.on('select', function() {
|
42 |
-
var attachment = cherry_uploader.state().get('selection').toJSON(),
|
43 |
-
count = 0,
|
44 |
-
input_value = '',
|
45 |
-
new_img_object = $('.cherry-all-images-wrap', settings.img_holder),
|
46 |
-
new_img = '',
|
47 |
-
delimiter = '';
|
48 |
-
|
49 |
-
if ( settings.multiple ) {
|
50 |
-
input_value = settings.input.val();
|
51 |
-
delimiter = ',';
|
52 |
-
new_img = new_img_object.html();
|
53 |
-
}
|
54 |
-
|
55 |
-
while( attachment[ count ] ) {
|
56 |
-
var img_data = attachment[count],
|
57 |
-
return_data = img_data.id,
|
58 |
-
mimeType = img_data.mime,
|
59 |
-
img_src = '',
|
60 |
-
thumb = '';
|
61 |
-
|
62 |
-
switch (mimeType) {
|
63 |
-
case 'image/jpeg':
|
64 |
-
case 'image/png':
|
65 |
-
case 'image/gif':
|
66 |
-
if( img_data.sizes !== undefined){
|
67 |
-
img_src = img_data.sizes.thumbnail ? img_data.sizes.thumbnail.url : img_data.sizes.full.url;
|
68 |
-
}
|
69 |
-
thumb = '<img src="' + img_src + '" alt="" data-img-attr="'+return_data+'">';
|
70 |
-
break;
|
71 |
-
case 'image/x-icon':
|
72 |
-
thumb = '<span class="dashicons dashicons-format-image"></span>';
|
73 |
-
break;
|
74 |
-
case 'video/mpeg':
|
75 |
-
case 'video/mp4':
|
76 |
-
case 'video/quicktime':
|
77 |
-
case 'video/webm':
|
78 |
-
case 'video/ogg':
|
79 |
-
thumb = '<span class="dashicons dashicons-format-video"></span>';
|
80 |
-
break;
|
81 |
-
case 'audio/mpeg':
|
82 |
-
case 'audio/wav':
|
83 |
-
case 'audio/ogg':
|
84 |
-
thumb = '<span class="dashicons dashicons-format-audio"></span>';
|
85 |
-
break;
|
86 |
-
}
|
87 |
-
|
88 |
-
new_img += '<div class="cherry-image-wrap">'+
|
89 |
-
'<div class="inner">'+
|
90 |
-
'<div class="preview-holder" data-id-attr="' + return_data +'"><div class="centered">' + thumb + '</div></div>'+
|
91 |
-
'<a class="cherry-remove-image" href="#"><i class="dashicons dashicons-no"></i></a>'+
|
92 |
-
'<span class="title">' + img_data.title + '</span>'+
|
93 |
-
'</div>'+
|
94 |
-
'</div>';
|
95 |
-
|
96 |
-
input_value += delimiter+return_data;
|
97 |
-
count++;
|
98 |
-
}
|
99 |
-
|
100 |
-
settings.input.val(input_value.replace(/(^,)/, '')).trigger( 'change' );
|
101 |
-
new_img_object.html(new_img);
|
102 |
-
} );
|
103 |
-
|
104 |
-
var removeMediaPreview = function( item ) {
|
105 |
-
var button_parent = item.closest('.cherry-ui-media-wrap'),
|
106 |
-
input = $('.cherry-upload-input', button_parent),
|
107 |
-
img_holder = item.parent().parent('.cherry-image-wrap'),
|
108 |
-
img_attr = $('.preview-holder', img_holder).data('id-attr'),
|
109 |
-
input_value = input.attr('value'),
|
110 |
-
pattern = new RegExp(''+img_attr+'(,*)', 'i');
|
111 |
-
|
112 |
-
input_value = input_value.replace(pattern, '');
|
113 |
-
input_value = input_value.replace(/(,$)/, '');
|
114 |
-
input.attr({'value':input_value}).trigger( 'change' );
|
115 |
-
img_holder.remove();
|
116 |
-
};
|
117 |
-
|
118 |
-
// This function remove upload image
|
119 |
-
button_parent.on('click', '.cherry-remove-image', function () {
|
120 |
-
removeMediaPreview( $(this) );
|
121 |
-
return !1;
|
122 |
-
});
|
123 |
-
}
|
124 |
-
} ); // end each
|
125 |
-
|
126 |
-
// Image ordering
|
127 |
-
$('.cherry-all-images-wrap', target).sortable( {
|
128 |
-
items: 'div.cherry-image-wrap',
|
129 |
-
cursor: 'move',
|
130 |
-
scrollSensitivity: 40,
|
131 |
-
forcePlaceholderSize: true,
|
132 |
-
forceHelperSize: false,
|
133 |
-
helper: 'clone',
|
134 |
-
opacity: 0.65,
|
135 |
-
placeholder: 'cherry-media-thumb-sortable-placeholder',
|
136 |
-
start:function(){},
|
137 |
-
stop:function(){},
|
138 |
-
update: function() {
|
139 |
-
var attachment_ids = '';
|
140 |
-
$('.cherry-image-wrap', this).each(
|
141 |
-
function() {
|
142 |
-
var attachment_id = $('.preview-holder', this).data( 'id-attr' );
|
143 |
-
attachment_ids = attachment_ids + attachment_id + ',';
|
144 |
-
}
|
145 |
-
);
|
146 |
-
attachment_ids = attachment_ids.substr(0, attachment_ids.lastIndexOf(',') );
|
147 |
-
$(this).parent().siblings('.cherry-element-wrap').find('input.cherry-upload-input').val( attachment_ids ).trigger( 'change' );
|
148 |
-
}
|
149 |
-
} );
|
150 |
-
// End Image ordering
|
151 |
-
}
|
152 |
-
};
|
153 |
-
|
154 |
-
CherryJsCore.ui_elements.media.init();
|
155 |
-
|
156 |
-
}( jQuery , window.CherryJsCore ) );
|
1 |
+
!function(e,a){"use strict";a.utilites.namespace("ui_elements.media"),a.ui_elements.media={init:function(){e(document).on("ready",this.render).on("cherry-ui-elements-init",this.render)},render:function(a){var i=a._target?a._target:e("body"),r=e(".cherry-upload-button",i);r.each(function(){var a=e(this),i=a.closest(".cherry-ui-media-wrap"),r={input:e(".cherry-upload-input",i),img_holder:e(".cherry-upload-preview",i),title_text:a.data("title"),multiple:a.data("multi-upload"),library_type:a.data("library-type")},t=wp.media.frames.file_frame=wp.media({title:r.title_text,button:{text:r.title_text},multiple:r.multiple,library:{type:r.library_type}});if(!i.has('input[name*="__i__"]')[0]){a.off("click.cherry-media").on("click.cherry-media",function(){return t.open(),!1}),t.on("select",function(){var a=t.state().get("selection").toJSON(),i=0,s="",c=e(".cherry-all-images-wrap",r.img_holder),n="",l="";for(r.multiple&&(s=r.input.val(),l=",",n=c.html());a[i];){var o=a[i],d=o.id,p=o.mime,m="",u="";switch(p){case"image/jpeg":case"image/png":case"image/gif":void 0!==o.sizes&&(m=o.sizes.thumbnail?o.sizes.thumbnail.url:o.sizes.full.url),u='<img src="'+m+'" alt="" data-img-attr="'+d+'">';break;case"image/x-icon":u='<span class="dashicons dashicons-format-image"></span>';break;case"video/mpeg":case"video/mp4":case"video/quicktime":case"video/webm":case"video/ogg":u='<span class="dashicons dashicons-format-video"></span>';break;case"audio/mpeg":case"audio/wav":case"audio/ogg":u='<span class="dashicons dashicons-format-audio"></span>'}n+='<div class="cherry-image-wrap"><div class="inner"><div class="preview-holder" data-id-attr="'+d+'"><div class="centered">'+u+'</div></div><a class="cherry-remove-image" href="#"><i class="dashicons dashicons-no"></i></a><span class="title">'+o.title+"</span></div></div>",s+=l+d,i++}r.input.val(s.replace(/(^,)/,"")).trigger("change"),c.html(n)});var s=function(a){var i=a.closest(".cherry-ui-media-wrap"),r=e(".cherry-upload-input",i),t=a.parent().parent(".cherry-image-wrap"),s=e(".preview-holder",t).data("id-attr"),c=r.attr("value"),n=new RegExp(""+s+"(,*)","i");c=c.replace(n,""),c=c.replace(/(,$)/,""),r.attr({value:c}).trigger("change"),t.remove()};i.on("click",".cherry-remove-image",function(){return s(e(this)),!1})}}),e(".cherry-all-images-wrap",i).sortable({items:"div.cherry-image-wrap",cursor:"move",scrollSensitivity:40,forcePlaceholderSize:!0,forceHelperSize:!1,helper:"clone",opacity:.65,placeholder:"cherry-media-thumb-sortable-placeholder",start:function(){},stop:function(){},update:function(){var a="";e(".cherry-image-wrap",this).each(function(){var i=e(".preview-holder",this).data("id-attr");a=a+i+","}),a=a.substr(0,a.lastIndexOf(",")),e(this).parent().siblings(".cherry-element-wrap").find("input.cherry-upload-input").val(a).trigger("change")}})}},a.ui_elements.media.init()}(jQuery,window.CherryJsCore);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-media/assets/ui-kit/_mixins.scss
CHANGED
@@ -1,184 +1,52 @@
|
|
1 |
@mixin button_base() {
|
|
|
2 |
display: inline-block;
|
3 |
-
text-decoration: none;
|
4 |
font-size: 12px;
|
5 |
-
line-height:
|
6 |
-
font-weight:
|
|
|
|
|
7 |
padding: 15px 20px;
|
8 |
-
color:
|
9 |
text-transform: uppercase;
|
10 |
border-radius: $border_radius_small;
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
cursor: pointer;
|
15 |
-
&:hover {
|
16 |
-
color: #fff;
|
17 |
-
box-shadow: none;
|
18 |
-
}
|
19 |
-
&:focus,
|
20 |
-
&:active {
|
21 |
-
outline: none;
|
22 |
-
box-shadow: none;
|
23 |
-
color: #fff;
|
24 |
-
}
|
25 |
-
}
|
26 |
-
|
27 |
-
@mixin button_normal() {
|
28 |
-
background: $dark_color_2;
|
29 |
-
&:hover {
|
30 |
-
background: $dark_color_2_h;
|
31 |
-
}
|
32 |
-
}
|
33 |
-
|
34 |
-
@mixin button_primary() {
|
35 |
-
background: $blue_color;
|
36 |
-
&:hover {
|
37 |
-
background: $blue_color_h;
|
38 |
-
}
|
39 |
-
}
|
40 |
-
|
41 |
-
@mixin button_success() {
|
42 |
-
background: $green_color;
|
43 |
-
&:hover {
|
44 |
-
background: $green_color_h;
|
45 |
-
}
|
46 |
-
}
|
47 |
-
|
48 |
-
@mixin button_danger() {
|
49 |
-
background: $red_color;
|
50 |
-
&:hover {
|
51 |
-
background: $red_color_h;
|
52 |
-
}
|
53 |
-
}
|
54 |
-
|
55 |
-
@mixin button_warning() {
|
56 |
-
background: $orange_color;
|
57 |
-
&:hover {
|
58 |
-
background: $orange_color_h;
|
59 |
-
}
|
60 |
-
}
|
61 |
-
|
62 |
-
@mixin input() {
|
63 |
-
font-size: 14px;
|
64 |
-
line-height: 20px;
|
65 |
-
color: $dark_color_1;
|
66 |
-
background-color: $grey_color_3;
|
67 |
-
border-radius: $border_radius_extra_small;
|
68 |
-
padding: 10px 20px;
|
69 |
-
height: 50px;
|
70 |
-
border: 1px solid $grey_color_3;
|
71 |
-
box-shadow: none;
|
72 |
-
&:focus{
|
73 |
-
border-color: rgba(72,197,105,.6);
|
74 |
-
box-shadow: 0 0 2px rgba(72,197,105,.6);
|
75 |
-
}
|
76 |
-
}
|
77 |
-
|
78 |
-
@mixin button_icon( $icon ) {
|
79 |
-
content: $icon;
|
80 |
-
display: inline-block;
|
81 |
-
font-family: dashicons;
|
82 |
-
font-size: 16px;
|
83 |
-
font-style: normal;
|
84 |
-
font-weight: 400;
|
85 |
-
height: 18px;
|
86 |
-
line-height: 18px;
|
87 |
-
text-align: center;
|
88 |
-
text-decoration: inherit;
|
89 |
transition: all 200ms linear;
|
90 |
-
vertical-align: middle;
|
91 |
-
}
|
92 |
|
93 |
-
@mixin button_icon_before( $icon ) {
|
94 |
&:before {
|
95 |
-
|
96 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
}
|
98 |
-
}
|
99 |
|
100 |
-
@mixin button_icon_after( $icon ) {
|
101 |
-
&:after {
|
102 |
-
@include button_icon( $icon );
|
103 |
-
padding: 0 0 0 5px;
|
104 |
-
}
|
105 |
-
}
|
106 |
-
|
107 |
-
@mixin button_icon_middle( $icon ) {
|
108 |
-
&:before {
|
109 |
-
@include button_icon( $icon );
|
110 |
-
margin: 0 -5px;
|
111 |
-
}
|
112 |
-
}
|
113 |
-
|
114 |
-
@mixin link() {
|
115 |
-
display: inline-block;
|
116 |
-
text-decoration: none;
|
117 |
-
font-size: 12px;
|
118 |
-
line-height: 20px;
|
119 |
-
font-weight: bold;
|
120 |
-
color: $blue_color;
|
121 |
-
text-transform: uppercase;
|
122 |
-
transition: all 200ms linear;
|
123 |
&:hover {
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
&:focus,
|
128 |
-
&:active {
|
129 |
-
outline: none;
|
130 |
-
box-shadow: none;
|
131 |
-
color: $blue_color;
|
132 |
}
|
133 |
-
}
|
134 |
|
135 |
-
|
136 |
-
&:before {
|
137 |
-
@include button_icon( $icon );
|
138 |
-
padding: 0 5px 0 0;
|
139 |
-
color: $grey_color_4;
|
140 |
-
}
|
141 |
-
&:hover {
|
142 |
&:before {
|
143 |
-
|
144 |
}
|
145 |
}
|
146 |
}
|
147 |
|
148 |
-
@mixin
|
149 |
-
|
150 |
-
border:
|
151 |
-
background: $
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
margin: -30px -30px 30px -30px;
|
157 |
-
border-radius: $border_radius_large $border_radius_large 0 0;
|
158 |
-
border-bottom: 1px solid $grey_color_2;
|
159 |
-
padding: 20px 30px;
|
160 |
-
font-weight: bold;
|
161 |
-
font-size: 16px;
|
162 |
-
line-height: 18px;
|
163 |
-
text-align: center;
|
164 |
-
background: #fff;
|
165 |
-
}
|
166 |
-
|
167 |
-
@mixin box() {
|
168 |
-
margin: 0 0 30px;
|
169 |
-
padding: 20px;
|
170 |
-
background: #fff;
|
171 |
-
box-shadow: $box_shadow_box;
|
172 |
-
border-radius: $border_radius;
|
173 |
}
|
174 |
-
|
175 |
-
@mixin box_heading() {
|
176 |
-
margin: -20px -20px 20px -20px;
|
177 |
-
border-radius: $border_radius_small $border_radius_small 0 0;
|
178 |
-
border-bottom: 1px solid $grey_color_2;
|
179 |
-
padding: 20px 30px;
|
180 |
-
font-weight: bold;
|
181 |
-
font-size: 16px;
|
182 |
-
line-height: 18px;
|
183 |
-
background: #fff;
|
184 |
-
}
|
1 |
@mixin button_base() {
|
2 |
+
position: relative;
|
3 |
display: inline-block;
|
|
|
4 |
font-size: 12px;
|
5 |
+
line-height: 18px;
|
6 |
+
font-weight: 900;
|
7 |
+
letter-spacing: 0.5px;
|
8 |
+
text-decoration: none;
|
9 |
padding: 15px 20px;
|
10 |
+
color: $dark_color;
|
11 |
text-transform: uppercase;
|
12 |
border-radius: $border_radius_small;
|
13 |
+
border-width: 1px;
|
14 |
+
border-style: solid;
|
15 |
+
outline: none;
|
16 |
cursor: pointer;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
transition: all 200ms linear;
|
|
|
|
|
18 |
|
|
|
19 |
&:before {
|
20 |
+
position: absolute;
|
21 |
+
display: block;
|
22 |
+
width: 100%;
|
23 |
+
height: 100%;
|
24 |
+
top: 0;
|
25 |
+
left: 0;
|
26 |
+
border-radius: $border_radius_small;
|
27 |
+
background-image: linear-gradient(180deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 100%);
|
28 |
+
content: '';
|
29 |
}
|
|
|
30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
&:hover {
|
32 |
+
&:before {
|
33 |
+
background-image: linear-gradient(0deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 100%);
|
34 |
+
}
|
|
|
|
|
|
|
|
|
|
|
35 |
}
|
|
|
36 |
|
37 |
+
&:active {
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
&:before {
|
39 |
+
opacity: 0;
|
40 |
}
|
41 |
}
|
42 |
}
|
43 |
|
44 |
+
@mixin secondary_button() {
|
45 |
+
color: $light_color;
|
46 |
+
border-color: $secondary_outset_1 $secondary_outset_2 $secondary_outset_2 $secondary_outset_1;
|
47 |
+
background-color: $secondary_gradint_2;
|
48 |
+
&:active {
|
49 |
+
background-color: $secondary_bg_color;
|
50 |
+
border-color: darken( $secondary_outset_2, 10%) $secondary_outset_1 $secondary_outset_1 darken( $secondary_outset_2, 10%);
|
51 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-media/assets/ui-kit/_variables.scss
CHANGED
@@ -1,18 +1,47 @@
|
|
1 |
-
$
|
2 |
-
$
|
3 |
-
|
4 |
-
$grey_color_1: #96989a;
|
5 |
-
$grey_color_2: #e5e5e5;
|
6 |
-
$grey_color_3: #f1f1f1;
|
7 |
-
$grey_color_4: #b4b7ba;
|
8 |
$blue_color: #298ffc;
|
9 |
-
$
|
10 |
-
|
11 |
-
$
|
12 |
-
$
|
13 |
-
|
14 |
-
$
|
15 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
|
17 |
$border_radius_extra_small: 2px;
|
18 |
$border_radius_small: 4px;
|
@@ -20,4 +49,4 @@ $border_radius_medium: 6px;
|
|
20 |
$border_radius_large: 8px;
|
21 |
|
22 |
$box_shadow: 0 5px 13px rgba(0,0,0,.18);
|
23 |
-
$box_shadow_box: 0 8px 21px rgba(0,0,0,.1);
|
1 |
+
$bg_color: #f1f1f1;
|
2 |
+
$border_color: #dcdcdc;
|
3 |
+
|
|
|
|
|
|
|
|
|
4 |
$blue_color: #298ffc;
|
5 |
+
$remove_color: #e54343;
|
6 |
+
|
7 |
+
$light_color: #ffffff;
|
8 |
+
$dark_color: #23282d;
|
9 |
+
|
10 |
+
$normal_bg_color: #e1e1e1;
|
11 |
+
$normal_gradint_1: #ffffff;
|
12 |
+
$normal_gradint_2: #f0f0f0;
|
13 |
+
$normal_outset_1: #d7d7d7;
|
14 |
+
$normal_outset_2: #b7b7b7;
|
15 |
+
|
16 |
+
$primary_bg_color: #206ff4;
|
17 |
+
$primary_gradint_1: #5fadff;
|
18 |
+
$primary_gradint_2: #2a90fc;
|
19 |
+
$primary_outset_1: #5b9add;
|
20 |
+
$primary_outset_2: #3e6a99;
|
21 |
+
|
22 |
+
$secondary_bg_color: #495159;
|
23 |
+
$secondary_gradint_1: #4c5054;
|
24 |
+
$secondary_gradint_2: #495159;
|
25 |
+
$secondary_outset_1: #777879;
|
26 |
+
$secondary_outset_2: #2f343a;
|
27 |
+
|
28 |
+
$success_bg_color: #3ba956;
|
29 |
+
$success_gradint_1: #71e18f;
|
30 |
+
$success_gradint_2: #49c66a;
|
31 |
+
$success_outset_1: #49c56a;
|
32 |
+
$success_outset_2: #3a9e54;
|
33 |
+
|
34 |
+
$danger_bg_color: #c73434;
|
35 |
+
$danger_gradint_1: #f98888;
|
36 |
+
$danger_gradint_2: #e64545;
|
37 |
+
$danger_outset_1: #e54444;
|
38 |
+
$danger_outset_2: #b83636;
|
39 |
+
|
40 |
+
$warning_bg_color: #ee8425;
|
41 |
+
$warning_gradint_1: #ffcb81;
|
42 |
+
$warning_gradint_2: #faa832;
|
43 |
+
$warning_outset_1: #faa832;
|
44 |
+
$warning_outset_2: #c98627;
|
45 |
|
46 |
$border_radius_extra_small: 2px;
|
47 |
$border_radius_small: 4px;
|
49 |
$border_radius_large: 8px;
|
50 |
|
51 |
$box_shadow: 0 5px 13px rgba(0,0,0,.18);
|
52 |
+
$box_shadow_box: 0 8px 21px rgba(0,0,0,.1);
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-media/assets/ui-media.js
CHANGED
@@ -33,7 +33,7 @@
|
|
33 |
});
|
34 |
|
35 |
if ( ! button_parent.has('input[name*="__i__"]')[ 0 ] ) {
|
36 |
-
button.on( 'click', function() {
|
37 |
cherry_uploader.open();
|
38 |
return !1;
|
39 |
} ); // end click
|
33 |
});
|
34 |
|
35 |
if ( ! button_parent.has('input[name*="__i__"]')[ 0 ] ) {
|
36 |
+
button.off( 'click.cherry-media' ).on( 'click.cherry-media', function() {
|
37 |
cherry_uploader.open();
|
38 |
return !1;
|
39 |
} ); // end click
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-media/assets/ui-media.scss
CHANGED
@@ -1,24 +1,24 @@
|
|
1 |
@import "ui-kit/variables";
|
2 |
@import "ui-kit/mixins";
|
3 |
|
4 |
-
.cherry-ui-container{
|
5 |
margin: 10px 0 20px 0;
|
6 |
}
|
7 |
-
label.cherry-label{
|
8 |
margin: 0 0 5px 0;
|
9 |
display: block;
|
10 |
}
|
11 |
-
.cherry-ui-media-wrap{
|
12 |
.cherry-upload-preview{
|
13 |
display: block;
|
14 |
margin: 0 0 5px 0;
|
15 |
-
.cherry-image-wrap{
|
16 |
position: relative;
|
17 |
display: inline-block;
|
18 |
vertical-align: top;
|
19 |
width: 120px;
|
20 |
height: 120px;
|
21 |
-
.inner{
|
22 |
width: 110px;
|
23 |
height: 110px;
|
24 |
margin: 3px;
|
@@ -26,13 +26,13 @@ label.cherry-label{
|
|
26 |
border: 2px solid $blue_color;
|
27 |
border-radius: $border_radius_extra_small;
|
28 |
overflow: hidden;
|
29 |
-
.preview-holder{
|
30 |
width: 100%;
|
31 |
height: 100%;
|
32 |
position: relative;
|
33 |
-
background: $
|
34 |
box-sizing: border-box;
|
35 |
-
.centered{
|
36 |
position: absolute;
|
37 |
width: 100%;
|
38 |
height: 100%;
|
@@ -40,19 +40,19 @@ label.cherry-label{
|
|
40 |
left: 0;
|
41 |
transform: translate(50%,50%);
|
42 |
}
|
43 |
-
img{
|
44 |
max-width: 100%;
|
45 |
height: auto;
|
46 |
transform: translate(-50%,-50%);
|
47 |
}
|
48 |
-
span{
|
49 |
width: auto;
|
50 |
height: auto;
|
51 |
font-size: 60px;
|
52 |
transform: translate(-50%,-50%);
|
53 |
}
|
54 |
}
|
55 |
-
.title{
|
56 |
position: absolute;
|
57 |
width: 100%;
|
58 |
padding: 5px 0;
|
@@ -65,29 +65,29 @@ label.cherry-label{
|
|
65 |
overflow: hidden;
|
66 |
}
|
67 |
}
|
68 |
-
&:hover{
|
69 |
-
.cherry-remove-image{
|
70 |
display: block;
|
71 |
}
|
72 |
}
|
73 |
}
|
74 |
-
.cherry-media-thumb-sortable-placeholder{
|
75 |
width: 112px;
|
76 |
height: 112px;
|
77 |
margin: 3px;
|
78 |
vertical-align: top;
|
79 |
-
border: 1px dashed $
|
80 |
display: inline-block;
|
81 |
-
background-color: $
|
82 |
}
|
83 |
}
|
84 |
-
.upload-button{
|
85 |
float: left;
|
86 |
}
|
87 |
-
.cherry-remove-image{
|
88 |
width: 30px;
|
89 |
height: 30px;
|
90 |
-
color: $
|
91 |
display: block;
|
92 |
position: absolute;
|
93 |
top: 0;
|
@@ -96,63 +96,30 @@ label.cherry-label{
|
|
96 |
text-decoration: none;
|
97 |
outline: 0;
|
98 |
display: none;
|
99 |
-
i{
|
100 |
width: 30px;
|
101 |
height: 30px;
|
102 |
font-size: 30px;
|
103 |
}
|
104 |
-
&:hover{
|
105 |
-
color: $
|
106 |
}
|
107 |
}
|
108 |
-
.cherry-bgsetting{
|
109 |
float: left;
|
110 |
width: 32%;
|
111 |
margin-right: 1%;
|
112 |
-
&:nth-child(3n+1){
|
113 |
width: 34%;
|
114 |
margin-right: 0;
|
115 |
}
|
116 |
-
select{
|
117 |
margin-bottom: 10px;
|
118 |
}
|
119 |
}
|
120 |
}
|
121 |
|
122 |
-
.button-default_{
|
123 |
@include button_base();
|
124 |
-
@include
|
125 |
}
|
126 |
-
/*.button_{
|
127 |
-
display: inline-block;
|
128 |
-
cursor: pointer;
|
129 |
-
white-space: nowrap;
|
130 |
-
text-decoration: none;
|
131 |
-
box-sizing: border-box;
|
132 |
-
backface-visibility: hidden;
|
133 |
-
box-shadow: 0 0 1px rgba(0, 0, 0, 0);
|
134 |
-
position: relative;
|
135 |
-
transform: translateZ(0px);
|
136 |
-
transition-duration: 0.5s;
|
137 |
-
transition-property: color;
|
138 |
-
vertical-align: middle;
|
139 |
-
&:hover,
|
140 |
-
&:active,
|
141 |
-
&:focus {
|
142 |
-
outline: none;
|
143 |
-
}
|
144 |
-
}
|
145 |
-
|
146 |
-
.button-default_{
|
147 |
-
@extend .button_;
|
148 |
-
font-size: 13px;
|
149 |
-
background-color: #ffffff;
|
150 |
-
border: 1px solid #dddcdc;
|
151 |
-
border-radius: 3px;
|
152 |
-
line-height: 32px;
|
153 |
-
margin: 0;
|
154 |
-
padding: 0 14px;
|
155 |
-
box-shadow: none;
|
156 |
-
color: #464646;
|
157 |
-
height: auto;
|
158 |
-
}*/
|
1 |
@import "ui-kit/variables";
|
2 |
@import "ui-kit/mixins";
|
3 |
|
4 |
+
.cherry-ui-container {
|
5 |
margin: 10px 0 20px 0;
|
6 |
}
|
7 |
+
label.cherry-label {
|
8 |
margin: 0 0 5px 0;
|
9 |
display: block;
|
10 |
}
|
11 |
+
.cherry-ui-media-wrap {
|
12 |
.cherry-upload-preview{
|
13 |
display: block;
|
14 |
margin: 0 0 5px 0;
|
15 |
+
.cherry-image-wrap {
|
16 |
position: relative;
|
17 |
display: inline-block;
|
18 |
vertical-align: top;
|
19 |
width: 120px;
|
20 |
height: 120px;
|
21 |
+
.inner {
|
22 |
width: 110px;
|
23 |
height: 110px;
|
24 |
margin: 3px;
|
26 |
border: 2px solid $blue_color;
|
27 |
border-radius: $border_radius_extra_small;
|
28 |
overflow: hidden;
|
29 |
+
.preview-holder {
|
30 |
width: 100%;
|
31 |
height: 100%;
|
32 |
position: relative;
|
33 |
+
background: $bg_color;
|
34 |
box-sizing: border-box;
|
35 |
+
.centered {
|
36 |
position: absolute;
|
37 |
width: 100%;
|
38 |
height: 100%;
|
40 |
left: 0;
|
41 |
transform: translate(50%,50%);
|
42 |
}
|
43 |
+
img {
|
44 |
max-width: 100%;
|
45 |
height: auto;
|
46 |
transform: translate(-50%,-50%);
|
47 |
}
|
48 |
+
span {
|
49 |
width: auto;
|
50 |
height: auto;
|
51 |
font-size: 60px;
|
52 |
transform: translate(-50%,-50%);
|
53 |
}
|
54 |
}
|
55 |
+
.title {
|
56 |
position: absolute;
|
57 |
width: 100%;
|
58 |
padding: 5px 0;
|
65 |
overflow: hidden;
|
66 |
}
|
67 |
}
|
68 |
+
&:hover {
|
69 |
+
.cherry-remove-image {
|
70 |
display: block;
|
71 |
}
|
72 |
}
|
73 |
}
|
74 |
+
.cherry-media-thumb-sortable-placeholder {
|
75 |
width: 112px;
|
76 |
height: 112px;
|
77 |
margin: 3px;
|
78 |
vertical-align: top;
|
79 |
+
border: 1px dashed $border_color;
|
80 |
display: inline-block;
|
81 |
+
background-color: $bg_color;
|
82 |
}
|
83 |
}
|
84 |
+
.upload-button {
|
85 |
float: left;
|
86 |
}
|
87 |
+
.cherry-remove-image {
|
88 |
width: 30px;
|
89 |
height: 30px;
|
90 |
+
color: $remove_color;
|
91 |
display: block;
|
92 |
position: absolute;
|
93 |
top: 0;
|
96 |
text-decoration: none;
|
97 |
outline: 0;
|
98 |
display: none;
|
99 |
+
i {
|
100 |
width: 30px;
|
101 |
height: 30px;
|
102 |
font-size: 30px;
|
103 |
}
|
104 |
+
&:hover {
|
105 |
+
color: darken( $remove_color, 10% );
|
106 |
}
|
107 |
}
|
108 |
+
.cherry-bgsetting {
|
109 |
float: left;
|
110 |
width: 32%;
|
111 |
margin-right: 1%;
|
112 |
+
&:nth-child(3n+1) {
|
113 |
width: 34%;
|
114 |
margin-right: 0;
|
115 |
}
|
116 |
+
select {
|
117 |
margin-bottom: 10px;
|
118 |
}
|
119 |
}
|
120 |
}
|
121 |
|
122 |
+
.button-default_ {
|
123 |
@include button_base();
|
124 |
+
@include secondary_button();
|
125 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-media/ui-media.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
* @author Cherry Team <support@cherryframework.com>
|
8 |
* @copyright Copyright (c) 2012 - 2015, Cherry Team
|
9 |
* @link http://www.cherryframework.com/
|
10 |
-
* @license http://www.gnu.org/licenses/
|
11 |
*/
|
12 |
|
13 |
// If this file is called directly, abort.
|
@@ -23,8 +23,9 @@ if ( ! class_exists( 'UI_Media' ) ) {
|
|
23 |
class UI_Media extends UI_Element implements I_UI {
|
24 |
|
25 |
/**
|
26 |
-
* Default settings
|
27 |
*
|
|
|
28 |
* @var array
|
29 |
*/
|
30 |
private $defaults_settings = array(
|
@@ -32,7 +33,7 @@ if ( ! class_exists( 'UI_Media' ) ) {
|
|
32 |
'name' => 'cherry-ui-media-name',
|
33 |
'value' => '',
|
34 |
'multi_upload' => true,
|
35 |
-
'library_type' => '', // image, video
|
36 |
'upload_button_text' => 'Choose Media',
|
37 |
'label' => '',
|
38 |
'class' => '',
|
@@ -42,7 +43,7 @@ if ( ! class_exists( 'UI_Media' ) ) {
|
|
42 |
/**
|
43 |
* Constructor method for the UI_Media class.
|
44 |
*
|
45 |
-
* @since
|
46 |
*/
|
47 |
public function __construct( $args = array() ) {
|
48 |
|
@@ -55,7 +56,7 @@ if ( ! class_exists( 'UI_Media' ) ) {
|
|
55 |
/**
|
56 |
* Render html UI_Media.
|
57 |
*
|
58 |
-
* @since
|
59 |
*/
|
60 |
public function render() {
|
61 |
$html = '';
|
@@ -136,7 +137,7 @@ if ( ! class_exists( 'UI_Media' ) ) {
|
|
136 |
$html .= '</div>';
|
137 |
$html .= '<div class="cherry-element-wrap">';
|
138 |
$html .= '<input type="hidden" id="' . esc_attr( $this->settings['id'] ) . '" class="cherry-upload-input" name="' . esc_attr( $this->settings['name'] ) . '" value="' . esc_html( $this->settings['value'] ) . '" >';
|
139 |
-
$html .= '<
|
140 |
$html .= '<div class="clear"></div>';
|
141 |
$html .= '</div>';
|
142 |
$html .= '</div>';
|
@@ -147,9 +148,9 @@ if ( ! class_exists( 'UI_Media' ) ) {
|
|
147 |
}
|
148 |
|
149 |
/**
|
150 |
-
* Enqueue javascript and stylesheet UI_Media
|
151 |
*
|
152 |
-
* @since
|
153 |
*/
|
154 |
public static function enqueue_assets() {
|
155 |
if ( current_user_can( 'upload_files' ) ) {
|
@@ -159,7 +160,7 @@ if ( ! class_exists( 'UI_Media' ) ) {
|
|
159 |
'ui-media-min',
|
160 |
esc_url( Cherry_Core::base_url( 'assets/min/ui-media.min.js', __FILE__ ) ),
|
161 |
array( 'jquery', 'jquery-ui-sortable' ),
|
162 |
-
'1.
|
163 |
true
|
164 |
);
|
165 |
|
@@ -167,7 +168,7 @@ if ( ! class_exists( 'UI_Media' ) ) {
|
|
167 |
'ui-media-min',
|
168 |
esc_url( Cherry_Core::base_url( 'assets/min/ui-media.min.css', __FILE__ ) ),
|
169 |
array(),
|
170 |
-
'1.
|
171 |
'all'
|
172 |
);
|
173 |
}
|
7 |
* @author Cherry Team <support@cherryframework.com>
|
8 |
* @copyright Copyright (c) 2012 - 2015, Cherry Team
|
9 |
* @link http://www.cherryframework.com/
|
10 |
+
* @license http://www.gnu.org/licenses/gpl-3.0.en.html
|
11 |
*/
|
12 |
|
13 |
// If this file is called directly, abort.
|
23 |
class UI_Media extends UI_Element implements I_UI {
|
24 |
|
25 |
/**
|
26 |
+
* Default settings.
|
27 |
*
|
28 |
+
* @since 1.0.0
|
29 |
* @var array
|
30 |
*/
|
31 |
private $defaults_settings = array(
|
33 |
'name' => 'cherry-ui-media-name',
|
34 |
'value' => '',
|
35 |
'multi_upload' => true,
|
36 |
+
'library_type' => '', // image, video, sound
|
37 |
'upload_button_text' => 'Choose Media',
|
38 |
'label' => '',
|
39 |
'class' => '',
|
43 |
/**
|
44 |
* Constructor method for the UI_Media class.
|
45 |
*
|
46 |
+
* @since 1.0.0
|
47 |
*/
|
48 |
public function __construct( $args = array() ) {
|
49 |
|
56 |
/**
|
57 |
* Render html UI_Media.
|
58 |
*
|
59 |
+
* @since 1.0.0
|
60 |
*/
|
61 |
public function render() {
|
62 |
$html = '';
|
137 |
$html .= '</div>';
|
138 |
$html .= '<div class="cherry-element-wrap">';
|
139 |
$html .= '<input type="hidden" id="' . esc_attr( $this->settings['id'] ) . '" class="cherry-upload-input" name="' . esc_attr( $this->settings['name'] ) . '" value="' . esc_html( $this->settings['value'] ) . '" >';
|
140 |
+
$html .= '<button type="button" class="upload-button cherry-upload-button button-default_" value="' . esc_attr( $this->settings['upload_button_text'] ) . '" data-title="' . esc_attr( $this->settings['upload_button_text'] ) . '" data-multi-upload="' . esc_attr( $this->settings['multi_upload'] ) . '" data-library-type="' . esc_attr( $this->settings['library_type'] ) . '">' . esc_attr( $this->settings['upload_button_text'] ) . '</button>';
|
141 |
$html .= '<div class="clear"></div>';
|
142 |
$html .= '</div>';
|
143 |
$html .= '</div>';
|
148 |
}
|
149 |
|
150 |
/**
|
151 |
+
* Enqueue javascript and stylesheet UI_Media.
|
152 |
*
|
153 |
+
* @since 1.0.0
|
154 |
*/
|
155 |
public static function enqueue_assets() {
|
156 |
if ( current_user_can( 'upload_files' ) ) {
|
160 |
'ui-media-min',
|
161 |
esc_url( Cherry_Core::base_url( 'assets/min/ui-media.min.js', __FILE__ ) ),
|
162 |
array( 'jquery', 'jquery-ui-sortable' ),
|
163 |
+
'1.3.2',
|
164 |
true
|
165 |
);
|
166 |
|
168 |
'ui-media-min',
|
169 |
esc_url( Cherry_Core::base_url( 'assets/min/ui-media.min.css', __FILE__ ) ),
|
170 |
array(),
|
171 |
+
'1.3.2',
|
172 |
'all'
|
173 |
);
|
174 |
}
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-radio/assets/min/ui-radio.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.cherry-ui-container{margin:10px 0 20px 0}label.cherry-label{margin:0 0 5px 0;display:block}.hide{display:none !important}input.cherry-radio-input{display:none}.cherry-radio-item{margin-bottom:10px}.cherry-radio-item:last-child{margin-bottom:0}.cherry-radio-item label{display:inline-block;font-size:14px;line-height:22px;color:#23282d}.cherry-radio-item span{width:25px;height:25px;border-radius:25px;margin-right:10px;cursor:pointer;position:relative;background-color:#f1f1f1;display:inline-block;float:left}.cherry-radio-item span i{width:13px;height:13px;background-color:#298ffc;margin:6px;border-radius:20px;display:inline-block;-webkit-transform:scale(0)
|
1 |
+
.cherry-ui-container{margin:10px 0 20px 0}label.cherry-label{margin:0 0 5px 0;display:block}.hide{display:none !important}input.cherry-radio-input{display:none}.cherry-radio-item{margin-bottom:10px}.cherry-radio-item:last-child{margin-bottom:0}.cherry-radio-item label{display:inline-block;font-size:14px;line-height:22px;color:#23282d}.cherry-radio-item span{width:25px;height:25px;border-radius:25px;margin-right:10px;cursor:pointer;position:relative;background-color:#f1f1f1;display:inline-block;float:left}.cherry-radio-item span i{width:13px;height:13px;background-color:#298ffc;margin:6px;border-radius:20px;display:inline-block;-webkit-transform:scale(0);transform:scale(0);-webkit-transition:all 0.4s cubic-bezier(0.77, 0, 0.175, 1);transition:all 0.4s cubic-bezier(0.77, 0, 0.175, 1)}.cherry-radio-item .cherry-radio-input:checked+label span i{-webkit-transform:scale(1);transform:scale(1)}.cherry-radio-img{float:left;margin:10px 5px 0 5px;text-align:center;max-width:80px;position:relative}.cherry-radio-img label{display:inline-block}.cherry-radio-img img{width:100%;height:auto;margin:0 0 5px 0;pointer-events:none}.cherry-radio-img .cherry-radio-input:checked+label{font-weight:bold}.cherry-radio-img .cherry-radio-input:checked+label .check{display:block}.cherry-radio-img .cherry-radio-input:checked+label img{box-shadow:0 0 0 2px #fffeff,0 0 0 5px #298ffc}
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-radio/assets/min/ui-radio.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(t,e){"use strict";e.utilites.namespace("ui_elements.radio"),e.ui_elements.radio={inputClass:'.cherry-radio-input:not([name*="__i__"])',containerClass:".cherry-ui-container",wrapperClass:".widget, .postbox, .cherry-form",init:function(){t(document).on("ready.cherry-ui-elements-init",this.addEvent.bind(this)).on("cherry-ui-elements-init",this.setState.bind(this))},addEvent:function(){t("body").on("click.masterSlave",this.inputClass,this.switchState.bind(this)),this.setState({_target:t("body")})},setState:function(e){this.switchState({currentTarget:t(this.inputClass,e._target)})},switchState:function(e){for(var i,s,n,a=t(e.currentTarget).closest(this.containerClass),r=t(this.inputClass,a),c=r.length-1;c>=0;c--)i=t(r[c]),n=i.data(),s=i.closest(this.wrapperClass),jQuery.isEmptyObject(n)||t("."+n.slave,s)[i[0].checked?"removeClass":"addClass"]("hide")}},e.ui_elements.radio.init()}(jQuery,window.CherryJsCore);
|
1 |
+
!function(t,e){"use strict";e.utilites.namespace("ui_elements.radio"),e.ui_elements.radio={inputClass:'.cherry-radio-input:not([name*="__i__"])',containerClass:".cherry-ui-container",wrapperClass:".widget, .postbox, .cherry-form, .cherry-ui-repeater-item",init:function(){t(document).on("ready.cherry-ui-elements-init",this.addEvent.bind(this)).on("cherry-ui-elements-init",this.setState.bind(this))},addEvent:function(){t("body").on("click.masterSlave",this.inputClass,this.switchState.bind(this)),this.setState({_target:t("body")})},setState:function(e){this.switchState({currentTarget:t(this.inputClass,e._target)})},switchState:function(e){for(var i,s,n,a=t(e.currentTarget).closest(this.containerClass),r=t(this.inputClass,a),c=r.length-1;c>=0;c--)i=t(r[c]),n=i.data(),s=i.closest(this.wrapperClass),jQuery.isEmptyObject(n)||t("."+n.slave,s)[i[0].checked?"removeClass":"addClass"]("hide")}},e.ui_elements.radio.init()}(jQuery,window.CherryJsCore);
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-radio/assets/ui-kit/_mixins.scss
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
padding: 15px 20px;
|
8 |
color: #fff;
|
9 |
text-transform: uppercase;
|
10 |
-
border-radius: $
|
11 |
transition: all 200ms linear;
|
12 |
box-shadow: $box_shadow;
|
13 |
&:hover {
|
@@ -17,7 +17,8 @@
|
|
17 |
&:focus,
|
18 |
&:active {
|
19 |
outline: none;
|
20 |
-
|
|
|
21 |
color: #fff;
|
22 |
}
|
23 |
}
|
@@ -57,6 +58,22 @@
|
|
57 |
}
|
58 |
}
|
59 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
@mixin button_icon( $icon ) {
|
61 |
content: $icon;
|
62 |
display: inline-block;
|
@@ -109,7 +126,8 @@
|
|
109 |
&:focus,
|
110 |
&:active {
|
111 |
outline: none;
|
112 |
-
|
|
|
113 |
color: $blue_color;
|
114 |
}
|
115 |
}
|
@@ -131,12 +149,12 @@
|
|
131 |
padding: 30px;
|
132 |
border: 2px solid $grey_color_2;
|
133 |
background: $grey_color_3;
|
134 |
-
border-radius: $
|
135 |
}
|
136 |
|
137 |
@mixin container_heading() {
|
138 |
margin: -30px -30px 30px -30px;
|
139 |
-
border-radius: $
|
140 |
border-bottom: 1px solid $grey_color_2;
|
141 |
padding: 20px 30px;
|
142 |
font-weight: bold;
|
@@ -156,11 +174,11 @@
|
|
156 |
|
157 |
@mixin box_heading() {
|
158 |
margin: -20px -20px 20px -20px;
|
159 |
-
border-radius: $
|
160 |
border-bottom: 1px solid $grey_color_2;
|
161 |
padding: 20px 30px;
|
162 |
font-weight: bold;
|
163 |
font-size: 16px;
|
164 |
line-height: 18px;
|
165 |
background: #fff;
|
166 |
-
}
|
7 |
padding: 15px 20px;
|
8 |
color: #fff;
|
9 |
text-transform: uppercase;
|
10 |
+
border-radius: $border_radius_small;
|
11 |
transition: all 200ms linear;
|
12 |
box-shadow: $box_shadow;
|
13 |
&:hover {
|
17 |
&:focus,
|
18 |
&:active {
|
19 |
outline: none;
|
20 |
+
border-color: rgba(41, 143, 252, .6);
|
21 |
+
box-shadow: 0 0 2px rgba(41, 143, 252, .6);
|
22 |
color: #fff;
|
23 |
}
|
24 |
}
|
58 |
}
|
59 |
}
|
60 |
|
61 |
+
@mixin input() {
|
62 |
+
font-size: 14px;
|
63 |
+
line-height: 20px;
|
64 |
+
color: $dark_color_1;
|
65 |
+
background-color: $grey_color_3;
|
66 |
+
border-radius: $border_radius_extra_small;
|
67 |
+
padding: 10px 20px;
|
68 |
+
min-height: 50px;
|
69 |
+
border: 1px solid $grey_color_3;
|
70 |
+
box-shadow: none;
|
71 |
+
&:focus{
|
72 |
+
border-color: rgba(41, 143, 252, .6);
|
73 |
+
box-shadow: 0 0 2px rgba(41, 143, 252, .6);
|
74 |
+
}
|
75 |
+
}
|
76 |
+
|
77 |
@mixin button_icon( $icon ) {
|
78 |
content: $icon;
|
79 |
display: inline-block;
|
126 |
&:focus,
|
127 |
&:active {
|
128 |
outline: none;
|
129 |
+
border-color: rgba(41, 143, 252, .6);
|
130 |
+
box-shadow: 0 0 2px rgba(41, 143, 252, .6);
|
131 |
color: $blue_color;
|
132 |
}
|
133 |
}
|
149 |
padding: 30px;
|
150 |
border: 2px solid $grey_color_2;
|
151 |
background: $grey_color_3;
|
152 |
+
border-radius: $border_radius_large;
|
153 |
}
|
154 |
|
155 |
@mixin container_heading() {
|
156 |
margin: -30px -30px 30px -30px;
|
157 |
+
border-radius: $border_radius_large $border_radius_large 0 0;
|
158 |
border-bottom: 1px solid $grey_color_2;
|
159 |
padding: 20px 30px;
|
160 |
font-weight: bold;
|
174 |
|
175 |
@mixin box_heading() {
|
176 |
margin: -20px -20px 20px -20px;
|
177 |
+
border-radius: $border_radius_small $border_radius_small 0 0;
|
178 |
border-bottom: 1px solid $grey_color_2;
|
179 |
padding: 20px 30px;
|
180 |
font-weight: bold;
|
181 |
font-size: 16px;
|
182 |
line-height: 18px;
|
183 |
background: #fff;
|
184 |
+
}
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-radio/assets/ui-radio.js
CHANGED
@@ -8,7 +8,7 @@
|
|
8 |
CherryJsCore.ui_elements.radio = {
|
9 |
inputClass: '.cherry-radio-input:not([name*="__i__"])',
|
10 |
containerClass: '.cherry-ui-container',
|
11 |
-
wrapperClass: '.widget, .postbox, .cherry-form',
|
12 |
|
13 |
init: function () {
|
14 |
$( document )
|
8 |
CherryJsCore.ui_elements.radio = {
|
9 |
inputClass: '.cherry-radio-input:not([name*="__i__"])',
|
10 |
containerClass: '.cherry-ui-container',
|
11 |
+
wrapperClass: '.widget, .postbox, .cherry-form, .cherry-ui-repeater-item',
|
12 |
|
13 |
init: function () {
|
14 |
$( document )
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-radio/ui-radio.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
* @author Cherry Team <support@cherryframework.com>
|
8 |
* @copyright Copyright (c) 2012 - 2015, Cherry Team
|
9 |
* @link http://www.cherryframework.com/
|
10 |
-
* @license http://www.gnu.org/licenses/
|
11 |
*/
|
12 |
|
13 |
// If this file is called directly, abort.
|
@@ -21,45 +21,46 @@ if ( ! class_exists( 'UI_Radio' ) ) {
|
|
21 |
* Class for the building UI_Radio elements.
|
22 |
*/
|
23 |
class UI_Radio extends UI_Element implements I_UI {
|
|
|
24 |
/**
|
25 |
-
* Default settings
|
26 |
*
|
|
|
27 |
* @var array
|
28 |
*/
|
29 |
private $defaults_settings = array(
|
30 |
-
'id'
|
31 |
-
'name'
|
32 |
-
'value'
|
33 |
-
'options'
|
34 |
'radio-1' => array(
|
35 |
-
'label'
|
36 |
-
'img_src'
|
37 |
-
'slave'
|
38 |
),
|
39 |
'radio-2' => array(
|
40 |
-
'label'
|
41 |
-
'img_src'
|
42 |
-
'slave'
|
43 |
),
|
44 |
'radio-3' => array(
|
45 |
-
'label'
|
46 |
-
'img_src'
|
47 |
-
'slave'
|
48 |
),
|
49 |
),
|
50 |
-
'slave'
|
51 |
-
'label'
|
52 |
-
'class'
|
53 |
-
'master'
|
54 |
);
|
55 |
|
56 |
/**
|
57 |
* Constructor method for the UI_Radio class.
|
58 |
*
|
59 |
-
* @since
|
60 |
*/
|
61 |
function __construct( $args = array() ) {
|
62 |
-
|
63 |
$this->defaults_settings['id'] = 'cherry-ui-radio-' . uniqid();
|
64 |
$this->settings = wp_parse_args( $args, $this->defaults_settings );
|
65 |
|
@@ -71,7 +72,7 @@ if ( ! class_exists( 'UI_Radio' ) ) {
|
|
71 |
/**
|
72 |
* Render html UI_Radio.
|
73 |
*
|
74 |
-
* @since
|
75 |
*/
|
76 |
public function render() {
|
77 |
$html = '';
|
@@ -106,23 +107,24 @@ if ( ! class_exists( 'UI_Radio' ) ) {
|
|
106 |
}
|
107 |
|
108 |
/**
|
109 |
-
* Enqueue javascript and stylesheet UI_Radio
|
110 |
*
|
111 |
-
* @since
|
112 |
*/
|
113 |
public static function enqueue_assets() {
|
114 |
wp_enqueue_style(
|
115 |
'ui-radio-min',
|
116 |
esc_url( Cherry_Core::base_url( 'assets/min/ui-radio.min.css', __FILE__ ) ),
|
117 |
array(),
|
118 |
-
'1.
|
119 |
'all'
|
120 |
);
|
|
|
121 |
wp_enqueue_script(
|
122 |
'ui-radio-min',
|
123 |
esc_url( Cherry_Core::base_url( 'assets/min/ui-radio.min.js', __FILE__ ) ),
|
124 |
array( 'jquery' ),
|
125 |
-
'1.
|
126 |
true
|
127 |
);
|
128 |
}
|
7 |
* @author Cherry Team <support@cherryframework.com>
|
8 |
* @copyright Copyright (c) 2012 - 2015, Cherry Team
|
9 |
* @link http://www.cherryframework.com/
|
10 |
+
* @license http://www.gnu.org/licenses/gpl-3.0.en.html
|
11 |
*/
|
12 |
|
13 |
// If this file is called directly, abort.
|
21 |
* Class for the building UI_Radio elements.
|
22 |
*/
|
23 |
class UI_Radio extends UI_Element implements I_UI {
|
24 |
+
|
25 |
/**
|
26 |
+
* Default settings.
|
27 |
*
|
28 |
+
* @since 1.0.0
|
29 |
* @var array
|
30 |
*/
|
31 |
private $defaults_settings = array(
|
32 |
+
'id' => 'cherry-ui-radio-id',
|
33 |
+
'name' => 'cherry-ui-radio-name',
|
34 |
+
'value' => 'radio-2',
|
35 |
+
'options' => array(
|
36 |
'radio-1' => array(
|
37 |
+
'label' => 'Radio 1',
|
38 |
+
'img_src' => '',
|
39 |
+
'slave' => '',
|
40 |
),
|
41 |
'radio-2' => array(
|
42 |
+
'label' => 'Radio 2',
|
43 |
+
'img_src' => '',
|
44 |
+
'slave' => '',
|
45 |
),
|
46 |
'radio-3' => array(
|
47 |
+
'label' => 'Radio 3',
|
48 |
+
'img_src' => '',
|
49 |
+
'slave' => '',
|
50 |
),
|
51 |
),
|
52 |
+
'slave' => array(),
|
53 |
+
'label' => '',
|
54 |
+
'class' => '',
|
55 |
+
'master' => '',
|
56 |
);
|
57 |
|
58 |
/**
|
59 |
* Constructor method for the UI_Radio class.
|
60 |
*
|
61 |
+
* @since 1.0.0
|
62 |
*/
|
63 |
function __construct( $args = array() ) {
|
|
|
64 |
$this->defaults_settings['id'] = 'cherry-ui-radio-' . uniqid();
|
65 |
$this->settings = wp_parse_args( $args, $this->defaults_settings );
|
66 |
|
72 |
/**
|
73 |
* Render html UI_Radio.
|
74 |
*
|
75 |
+
* @since 1.0.0
|
76 |
*/
|
77 |
public function render() {
|
78 |
$html = '';
|
107 |
}
|
108 |
|
109 |
/**
|
110 |
+
* Enqueue javascript and stylesheet UI_Radio.
|
111 |
*
|
112 |
+
* @since 1.0.0
|
113 |
*/
|
114 |
public static function enqueue_assets() {
|
115 |
wp_enqueue_style(
|
116 |
'ui-radio-min',
|
117 |
esc_url( Cherry_Core::base_url( 'assets/min/ui-radio.min.css', __FILE__ ) ),
|
118 |
array(),
|
119 |
+
'1.3.2',
|
120 |
'all'
|
121 |
);
|
122 |
+
|
123 |
wp_enqueue_script(
|
124 |
'ui-radio-min',
|
125 |
esc_url( Cherry_Core::base_url( 'assets/min/ui-radio.min.js', __FILE__ ) ),
|
126 |
array( 'jquery' ),
|
127 |
+
'1.3.2',
|
128 |
true
|
129 |
);
|
130 |
}
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-repeater/assets/min/ui-repeater.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.cherry-ui-repeater-container label.cherry-label{margin:0 0 5px 0;display:block}.cherry-ui-repeater-add{display:inline-block;text-decoration:none;font-size:12px;line-height:20px;font-weight:bold;color:#298ffc;text-transform:uppercase
|
1 |
+
.cherry-ui-repeater-container label.cherry-label{margin:0 0 5px 0;display:block}.cherry-ui-repeater-add{display:inline-block;text-decoration:none;font-size:12px;line-height:20px;font-weight:bold;color:#298ffc;text-transform:uppercase;transition:all 200ms linear}.cherry-ui-repeater-add:hover{color:#23282d;box-shadow:none}.cherry-ui-repeater-add:focus,.cherry-ui-repeater-add:active{outline:none;border-color:rgba(41,143,252,0.6);box-shadow:0 0 2px rgba(41,143,252,0.6);color:#298ffc}.cherry-ui-repeater-add:before{content:"";display:inline-block;font-family:dashicons;font-size:16px;font-style:normal;font-weight:400;height:18px;line-height:18px;text-align:center;text-decoration:inherit;transition:all 200ms linear;vertical-align:middle;padding:0 5px 0 0;color:#b4b7ba}.cherry-ui-repeater-add:hover:before{color:#298ffc}.cherry-ui-repeater-item{padding:10px 10px 10px 30px;position:relative}.cherry-ui-repeater-remove{position:absolute;width:20px;height:20px;right:18px;top:13px;border-radius:50%;border:1px solid currentColor;color:red;font-size:18px;line-height:20px;text-align:center;cursor:pointer}.cherry-ui-repeater-remove:before{content:"\00D7"}.cherry-ui-repeater-remove:hover{color:black}.cherry-ui-kit.cherry-ui-repeater-container{padding:30px;border:2px solid #e5e5e5;background:#f1f1f1;border-radius:8px}.cherry-ui-kit>label.cherry-label{margin:-30px -30px 30px -30px;border-radius:8px 8px 0 0;border-bottom:1px solid #e5e5e5;padding:20px 30px;font-weight:bold;font-size:16px;line-height:18px;text-align:center;background:#fff}.cherry-ui-kit .cherry-ui-repeater-item{margin:0 0 30px;padding:20px;background:#fff;box-shadow:0 8px 21px rgba(0,0,0,0.1);border-radius:4px}.cherry-ui-kit .cherry-ui-repeater-actions-box{margin:-20px -20px 20px -20px;border-radius:4px 4px 0 0;border-bottom:1px solid #e5e5e5;padding:20px 30px;font-weight:bold;font-size:16px;line-height:18px;background:#fff;padding:15px 20px;cursor:move;position:relative;text-align:center;min-height:18px}.cherry-ui-kit .cherry-ui-repeater-toggle{position:absolute;color:#b4b7ba;width:20px;height:20px;font-size:22px;line-height:20px;text-align:center;vertical-align:middle;cursor:pointer;text-decoration:none;box-shadow:none;outline:none;top:13px;left:18px}.cherry-ui-kit .cherry-ui-repeater-toggle:before{content:"\f142";-webkit-transition:all 200ms linear;transition:all 200ms linear;font-family:dashicons;vertical-align:middle}.cherry-ui-kit .cherry-ui-repeater-toggle:hover{color:#23282d}.cherry-ui-kit .cherry-ui-repeater-remove{position:absolute;border:none;color:#b4b7ba;font-size:20px;line-height:20px;width:20px;height:20px;text-align:center;vertical-align:middle;text-decoration:none;box-shadow:none;outline:none;top:13px;right:18px}.cherry-ui-kit .cherry-ui-repeater-remove:before{content:"\f158";-webkit-transition:all 200ms linear;transition:all 200ms linear;font-family:dashicons;vertical-align:middle}.cherry-ui-kit .cherry-ui-repeater-remove:hover{color:#23282d}.cherry-ui-kit .cherry-ui-repeater-title{width:70%;overflow:hidden;text-overflow:ellipsis;display:inline-block;font-size:14px}.cherry-ui-kit .cherry-ui-repeater-add:focus{outline:none;box-shadow:none}.cherry-ui-kit .cherry-ui-repeater-min{padding-bottom:0}.cherry-ui-kit .cherry-ui-repeater-min>.cheryr-ui-repeater-content-box{display:none}.cherry-ui-kit .cherry-ui-repeater-min>.cherry-ui-repeater-actions-box{margin-bottom:0;border-bottom:none;background:none}.cherry-ui-kit .cherry-ui-repeater-min>.cherry-ui-repeater-actions-box .cherry-ui-repeater-toggle:before{content:"\f140"}
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-repeater/assets/ui-kit/_mixins.scss
CHANGED
@@ -17,7 +17,8 @@
|
|
17 |
&:focus,
|
18 |
&:active {
|
19 |
outline: none;
|
20 |
-
|
|
|
21 |
color: #fff;
|
22 |
}
|
23 |
}
|
@@ -57,6 +58,22 @@
|
|
57 |
}
|
58 |
}
|
59 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
@mixin button_icon( $icon ) {
|
61 |
content: $icon;
|
62 |
display: inline-block;
|
@@ -109,7 +126,8 @@
|
|
109 |
&:focus,
|
110 |
&:active {
|
111 |
outline: none;
|
112 |
-
|
|
|
113 |
color: $blue_color;
|
114 |
}
|
115 |
}
|
@@ -163,4 +181,4 @@
|
|
163 |
font-size: 16px;
|
164 |
line-height: 18px;
|
165 |
background: #fff;
|
166 |
-
}
|
17 |
&:focus,
|
18 |
&:active {
|
19 |
outline: none;
|
20 |
+
border-color: rgba(41, 143, 252, .6);
|
21 |
+
box-shadow: 0 0 2px rgba(41, 143, 252, .6);
|
22 |
color: #fff;
|
23 |
}
|
24 |
}
|
58 |
}
|
59 |
}
|
60 |
|
61 |
+
@mixin input() {
|
62 |
+
font-size: 14px;
|
63 |
+
line-height: 20px;
|
64 |
+
color: $dark_color_1;
|
65 |
+
background-color: $grey_color_3;
|
66 |
+
border-radius: $border_radius_extra_small;
|
67 |
+
padding: 10px 20px;
|
68 |
+
min-height: 50px;
|
69 |
+
border: 1px solid $grey_color_3;
|
70 |
+
box-shadow: none;
|
71 |
+
&:focus{
|
72 |
+
border-color: rgba(41, 143, 252, .6);
|
73 |
+
box-shadow: 0 0 2px rgba(41, 143, 252, .6);
|
74 |
+
}
|
75 |
+
}
|
76 |
+
|
77 |
@mixin button_icon( $icon ) {
|
78 |
content: $icon;
|
79 |
display: inline-block;
|
126 |
&:focus,
|
127 |
&:active {
|
128 |
outline: none;
|
129 |
+
border-color: rgba(41, 143, 252, .6);
|
130 |
+
box-shadow: 0 0 2px rgba(41, 143, 252, .6);
|
131 |
color: $blue_color;
|
132 |
}
|
133 |
}
|
181 |
font-size: 16px;
|
182 |
line-height: 18px;
|
183 |
background: #fff;
|
184 |
+
}
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-repeater/assets/ui-repeater.scss
CHANGED
@@ -116,6 +116,12 @@
|
|
116 |
display: inline-block;
|
117 |
font-size: 14px;
|
118 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
}
|
120 |
|
121 |
.cherry-ui-repeater-min {
|
116 |
display: inline-block;
|
117 |
font-size: 14px;
|
118 |
}
|
119 |
+
&-add {
|
120 |
+
&:focus {
|
121 |
+
outline: none;
|
122 |
+
box-shadow: none;
|
123 |
+
}
|
124 |
+
}
|
125 |
}
|
126 |
|
127 |
.cherry-ui-repeater-min {
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-repeater/ui-repeater.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
* @author Cherry Team <support@cherryframework.com>
|
8 |
* @copyright Copyright (c) 2012 - 2015, Cherry Team
|
9 |
* @link http://www.cherryframework.com/
|
10 |
-
* @license http://www.gnu.org/licenses/
|
11 |
*/
|
12 |
|
13 |
// If this file is called directly, abort.
|
@@ -78,9 +78,9 @@ if ( ! class_exists( 'UI_Repeater' ) ) {
|
|
78 |
public static $customizer_tmpl_printed = false;
|
79 |
|
80 |
/**
|
81 |
-
* Constructor method for the
|
82 |
*
|
83 |
-
* @since
|
84 |
*/
|
85 |
function __construct( $args = array() ) {
|
86 |
|
@@ -97,7 +97,7 @@ if ( ! class_exists( 'UI_Repeater' ) ) {
|
|
97 |
}
|
98 |
|
99 |
/**
|
100 |
-
* Get required attribute
|
101 |
*
|
102 |
* @return string required attribute
|
103 |
*/
|
@@ -111,7 +111,7 @@ if ( ! class_exists( 'UI_Repeater' ) ) {
|
|
111 |
/**
|
112 |
* Render html UI_Repeater.
|
113 |
*
|
114 |
-
* @since
|
115 |
*/
|
116 |
public function render() {
|
117 |
$html = '';
|
@@ -237,17 +237,16 @@ if ( ! class_exists( 'UI_Repeater' ) ) {
|
|
237 |
}
|
238 |
|
239 |
/**
|
240 |
-
* Enqueue javascript and stylesheet
|
241 |
*
|
242 |
-
* @since
|
243 |
*/
|
244 |
public static function enqueue_assets() {
|
245 |
-
|
246 |
wp_enqueue_style(
|
247 |
'ui-repeater',
|
248 |
esc_url( Cherry_Core::base_url( 'assets/min/ui-repeater.min.css', __FILE__ ) ),
|
249 |
array(),
|
250 |
-
'1.
|
251 |
'all'
|
252 |
);
|
253 |
|
@@ -255,7 +254,7 @@ if ( ! class_exists( 'UI_Repeater' ) ) {
|
|
255 |
'ui-repeater',
|
256 |
esc_url( Cherry_Core::base_url( 'assets/min/ui-repeater.min.js', __FILE__ ) ),
|
257 |
array( 'wp-util', 'jquery-ui-sortable' ),
|
258 |
-
'1.
|
259 |
true
|
260 |
);
|
261 |
|
7 |
* @author Cherry Team <support@cherryframework.com>
|
8 |
* @copyright Copyright (c) 2012 - 2015, Cherry Team
|
9 |
* @link http://www.cherryframework.com/
|
10 |
+
* @license http://www.gnu.org/licenses/gpl-3.0.en.html
|
11 |
*/
|
12 |
|
13 |
// If this file is called directly, abort.
|
78 |
public static $customizer_tmpl_printed = false;
|
79 |
|
80 |
/**
|
81 |
+
* Constructor method for the UI_Repeater class.
|
82 |
*
|
83 |
+
* @since 1.0.0
|
84 |
*/
|
85 |
function __construct( $args = array() ) {
|
86 |
|
97 |
}
|
98 |
|
99 |
/**
|
100 |
+
* Get required attribute.
|
101 |
*
|
102 |
* @return string required attribute
|
103 |
*/
|
111 |
/**
|
112 |
* Render html UI_Repeater.
|
113 |
*
|
114 |
+
* @since 1.0.1
|
115 |
*/
|
116 |
public function render() {
|
117 |
$html = '';
|
237 |
}
|
238 |
|
239 |
/**
|
240 |
+
* Enqueue javascript and stylesheet UI_Repeater.
|
241 |
*
|
242 |
+
* @since 1.0.0
|
243 |
*/
|
244 |
public static function enqueue_assets() {
|
|
|
245 |
wp_enqueue_style(
|
246 |
'ui-repeater',
|
247 |
esc_url( Cherry_Core::base_url( 'assets/min/ui-repeater.min.css', __FILE__ ) ),
|
248 |
array(),
|
249 |
+
'1.3.2',
|
250 |
'all'
|
251 |
);
|
252 |
|
254 |
'ui-repeater',
|
255 |
esc_url( Cherry_Core::base_url( 'assets/min/ui-repeater.min.js', __FILE__ ) ),
|
256 |
array( 'wp-util', 'jquery-ui-sortable' ),
|
257 |
+
'1.3.2',
|
258 |
true
|
259 |
);
|
260 |
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-select/assets/min/ui-select.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.cherry-ui-container{margin:10px 0 20px 0}label.cherry-label{margin:0 0 5px 0;display:block}.hide{display:none !important}select.cherry-ui-select{width:100%;outline:0 none;color:#23282d;font-size:14px;line-height:20px;color:#23282d;background-color:#f1f1f1;border-radius:2px;padding:10px 20px;height:50px;border:1px solid #
|
1 |
+
.cherry-ui-container{margin:10px 0 20px 0}label.cherry-label{margin:0 0 5px 0;display:block}.hide{display:none !important}select.cherry-ui-select{width:100%;outline:0 none;color:#23282d;font-size:14px;line-height:20px;color:#23282d;background-color:#f1f1f1;border-radius:2px;padding:10px 20px;min-height:50px;border:1px solid #dcdcdc;box-shadow:none}select.cherry-ui-select:focus{border-color:rgba(41,143,252,0.6);box-shadow:0 0 2px rgba(41,143,252,0.6)}select.cherry-ui-select:focus{border-color:none;box-shadow:none}select.select2-hidden-accessible{display:none}.select2{color:#23282d;background-color:#f1f1f1;border-radius:2px;border:1px solid #dcdcdc}.select2 .selection .select2-selection.select2-selection--single{background-color:transparent;border:none;border-radius:2px;height:50px}.select2 .selection .select2-selection.select2-selection--single .select2-selection__rendered{padding:15px 20px;font-size:14px;line-height:20px}.select2 .selection .select2-selection.select2-selection--single .select2-selection__arrow{height:50px}.select2 .selection .select2-selection.select2-selection--multiple{background-color:transparent;border:none;border-radius:2px}.select2 .selection .select2-selection.select2-selection--multiple .select2-selection__rendered{font-size:14px;line-height:20px;padding:0;display:block}.select2 .selection .select2-selection.select2-selection--multiple .select2-selection__rendered .select2-selection__choice{line-height:20px;margin:5px;border:none;background-color:#23282d;border-radius:2px;color:#fff;padding:10px}.select2 .selection .select2-selection.select2-selection--multiple .select2-selection__rendered .select2-selection__choice .select2-selection__choice__remove{color:#e64545;margin-right:10px}.select2 .selection .select2-selection.select2-selection--multiple .select2-selection__rendered .select2-search{margin:0}.select2 .selection .select2-selection.select2-selection--multiple .select2-selection__rendered .select2-search .select2-search__field{padding:0;margin:15px 10px;border:none;box-shadow:none;line-height:20px}.select2-container .select2-dropdown{background-color:#e5e5e5;border:none;border-radius:2px;margin:5px 0;box-shadow:0px 5px 21px rgba(0,0,0,0.1);z-index:500001}.select2-container .select2-dropdown .select2-search__field{border:none;box-shadow:none;border-radius:2px;margin:0}.select2-container .select2-dropdown .select2-search__field:focus{outline:none}.select2-container .select2-dropdown .select2-results .select2-results__options .select2-results__option[aria-selected=true]{color:#fff;background-color:#2a90fc}.select2-container .select2-dropdown .select2-results .select2-results__options .select2-results__option--highlighted{color:#fff;background-color:#23282d}.select2-container .select2-dropdown .select2-results .select2-results__options .li[aria-disabled=true]{display:none}
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-select/assets/min/ui-select.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(e,t){"use strict";t.utilites.namespace("ui_elements.select"),t.ui_elements.select={selectClass:'.cherry-ui-select[data-filter="true"]:not([name*="__i__"]), .cherry-ui-select[multiple]:not([name*="__i__"])',wrapperClass:".widget, .postbox, .cherry-form",init:function(){e(document).on("ready.cherry-ui-elements-init",this.render.bind(this)).on("cherry-ui-elements-init",this.render.bind(this))},render:function(t){var i=t._target?t._target:e("body");e(this.selectClass,i).each(this.select2Init.bind(this))},select2Init:function(t,i){var s=e(i),r={placeholder:s.attr("placeholder")};s.select2(r).on("change.cherrySelect2",this.changeEvent.bind(this)).trigger("change.cherrySelect2")},changeEvent:function(e){this.switchState(e.currentTarget)},switchState:function(t){for(var i,s,r,n=e(t),c=n[0].length;c>=0;c--)i=e(n[0][c]),s=i.data(),r=e(n[0]).closest(this.wrapperClass),jQuery.isEmptyObject(s)||e("."+s.slave,r)[i[0].selected?"removeClass":"addClass"]("hide")}},t.ui_elements.select.init()}(jQuery,window.CherryJsCore);
|
1 |
+
!function(e,t){"use strict";t.utilites.namespace("ui_elements.select"),t.ui_elements.select={selectClass:'.cherry-ui-select[data-filter="true"]:not([name*="__i__"]), .cherry-ui-select[multiple]:not([name*="__i__"])',wrapperClass:".widget, .postbox, .cherry-form, .cherry-ui-repeater-item",init:function(){e(document).on("ready.cherry-ui-elements-init",this.render.bind(this)).on("cherry-ui-elements-init",this.render.bind(this))},render:function(t){var i=t._target?t._target:e("body");e(this.selectClass,i).each(this.select2Init.bind(this))},select2Init:function(t,i){var s=e(i),r={placeholder:s.attr("placeholder")};s.select2(r).on("change.cherrySelect2",this.changeEvent.bind(this)).trigger("change.cherrySelect2")},changeEvent:function(e){this.switchState(e.currentTarget)},switchState:function(t){for(var i,s,r,n=e(t),c=n[0].length;c>=0;c--)i=e(n[0][c]),s=i.data(),r=e(n[0]).closest(this.wrapperClass),jQuery.isEmptyObject(s)||e("."+s.slave,r)[i[0].selected?"removeClass":"addClass"]("hide")}},t.ui_elements.select.init()}(jQuery,window.CherryJsCore);
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-select/assets/ui-kit/_mixins.scss
CHANGED
@@ -1,182 +1,15 @@
|
|
1 |
-
@mixin button_base() {
|
2 |
-
display: inline-block;
|
3 |
-
text-decoration: none;
|
4 |
-
font-size: 12px;
|
5 |
-
line-height: 20px;
|
6 |
-
font-weight: bold;
|
7 |
-
padding: 15px 20px;
|
8 |
-
color: #fff;
|
9 |
-
text-transform: uppercase;
|
10 |
-
border-radius: $border_radius_small;
|
11 |
-
transition: all 200ms linear;
|
12 |
-
box-shadow: $box_shadow;
|
13 |
-
&:hover {
|
14 |
-
color: #fff;
|
15 |
-
box-shadow: none;
|
16 |
-
}
|
17 |
-
&:focus,
|
18 |
-
&:active {
|
19 |
-
outline: none;
|
20 |
-
box-shadow: none;
|
21 |
-
color: #fff;
|
22 |
-
}
|
23 |
-
}
|
24 |
-
|
25 |
-
@mixin button_normal() {
|
26 |
-
background: $dark_color_2;
|
27 |
-
&:hover {
|
28 |
-
background: $dark_color_2_h;
|
29 |
-
}
|
30 |
-
}
|
31 |
-
|
32 |
-
@mixin button_primary() {
|
33 |
-
background: $blue_color;
|
34 |
-
&:hover {
|
35 |
-
background: $blue_color_h;
|
36 |
-
}
|
37 |
-
}
|
38 |
-
|
39 |
-
@mixin button_success() {
|
40 |
-
background: $green_color;
|
41 |
-
&:hover {
|
42 |
-
background: $green_color_h;
|
43 |
-
}
|
44 |
-
}
|
45 |
-
|
46 |
-
@mixin button_danger() {
|
47 |
-
background: $red_color;
|
48 |
-
&:hover {
|
49 |
-
background: $red_color_h;
|
50 |
-
}
|
51 |
-
}
|
52 |
-
|
53 |
-
@mixin button_warning() {
|
54 |
-
background: $orange_color;
|
55 |
-
&:hover {
|
56 |
-
background: $orange_color_h;
|
57 |
-
}
|
58 |
-
}
|
59 |
-
|
60 |
@mixin input() {
|
61 |
font-size: 14px;
|
62 |
line-height: 20px;
|
63 |
-
color: $
|
64 |
-
background-color: $
|
65 |
border-radius: $border_radius_extra_small;
|
66 |
padding: 10px 20px;
|
67 |
-
height: 50px;
|
68 |
-
border: 1px solid $
|
69 |
box-shadow: none;
|
70 |
&:focus{
|
71 |
-
border-color: rgba(
|
72 |
-
box-shadow: 0 0 2px rgba(
|
73 |
-
}
|
74 |
-
}
|
75 |
-
|
76 |
-
@mixin button_icon( $icon ) {
|
77 |
-
content: $icon;
|
78 |
-
display: inline-block;
|
79 |
-
font-family: dashicons;
|
80 |
-
font-size: 16px;
|
81 |
-
font-style: normal;
|
82 |
-
font-weight: 400;
|
83 |
-
height: 18px;
|
84 |
-
line-height: 18px;
|
85 |
-
text-align: center;
|
86 |
-
text-decoration: inherit;
|
87 |
-
transition: all 200ms linear;
|
88 |
-
vertical-align: middle;
|
89 |
-
}
|
90 |
-
|
91 |
-
@mixin button_icon_before( $icon ) {
|
92 |
-
&:before {
|
93 |
-
@include button_icon( $icon );
|
94 |
-
padding: 0 5px 0 0;
|
95 |
-
}
|
96 |
-
}
|
97 |
-
|
98 |
-
@mixin button_icon_after( $icon ) {
|
99 |
-
&:after {
|
100 |
-
@include button_icon( $icon );
|
101 |
-
padding: 0 0 0 5px;
|
102 |
-
}
|
103 |
-
}
|
104 |
-
|
105 |
-
@mixin button_icon_middle( $icon ) {
|
106 |
-
&:before {
|
107 |
-
@include button_icon( $icon );
|
108 |
-
margin: 0 -5px;
|
109 |
-
}
|
110 |
-
}
|
111 |
-
|
112 |
-
@mixin link() {
|
113 |
-
display: inline-block;
|
114 |
-
text-decoration: none;
|
115 |
-
font-size: 12px;
|
116 |
-
line-height: 20px;
|
117 |
-
font-weight: bold;
|
118 |
-
color: $blue_color;
|
119 |
-
text-transform: uppercase;
|
120 |
-
transition: all 200ms linear;
|
121 |
-
&:hover {
|
122 |
-
color: $dark_color_1;
|
123 |
-
box-shadow: none;
|
124 |
-
}
|
125 |
-
&:focus,
|
126 |
-
&:active {
|
127 |
-
outline: none;
|
128 |
-
box-shadow: none;
|
129 |
-
color: $blue_color;
|
130 |
-
}
|
131 |
-
}
|
132 |
-
|
133 |
-
@mixin link_icon_before( $icon ) {
|
134 |
-
&:before {
|
135 |
-
@include button_icon( $icon );
|
136 |
-
padding: 0 5px 0 0;
|
137 |
-
color: $grey_color_4;
|
138 |
-
}
|
139 |
-
&:hover {
|
140 |
-
&:before {
|
141 |
-
color: $blue_color;
|
142 |
}
|
143 |
-
}
|
144 |
-
}
|
145 |
-
|
146 |
-
@mixin container() {
|
147 |
-
padding: 30px;
|
148 |
-
border: 2px solid $grey_color_2;
|
149 |
-
background: $grey_color_3;
|
150 |
-
border-radius: $border_radius_large;
|
151 |
-
}
|
152 |
-
|
153 |
-
@mixin container_heading() {
|
154 |
-
margin: -30px -30px 30px -30px;
|
155 |
-
border-radius: $border_radius_large $border_radius_large 0 0;
|
156 |
-
border-bottom: 1px solid $grey_color_2;
|
157 |
-
padding: 20px 30px;
|
158 |
-
font-weight: bold;
|
159 |
-
font-size: 16px;
|
160 |
-
line-height: 18px;
|
161 |
-
text-align: center;
|
162 |
-
background: #fff;
|
163 |
-
}
|
164 |
-
|
165 |
-
@mixin box() {
|
166 |
-
margin: 0 0 30px;
|
167 |
-
padding: 20px;
|
168 |
-
background: #fff;
|
169 |
-
box-shadow: $box_shadow_box;
|
170 |
-
border-radius: $border_radius;
|
171 |
}
|
172 |
-
|
173 |
-
@mixin box_heading() {
|
174 |
-
margin: -20px -20px 20px -20px;
|
175 |
-
border-radius: $border_radius_small $border_radius_small 0 0;
|
176 |
-
border-bottom: 1px solid $grey_color_2;
|
177 |
-
padding: 20px 30px;
|
178 |
-
font-weight: bold;
|
179 |
-
font-size: 16px;
|
180 |
-
line-height: 18px;
|
181 |
-
background: #fff;
|
182 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
@mixin input() {
|
2 |
font-size: 14px;
|
3 |
line-height: 20px;
|
4 |
+
color: $dark_color;
|
5 |
+
background-color: $bg_color;
|
6 |
border-radius: $border_radius_extra_small;
|
7 |
padding: 10px 20px;
|
8 |
+
min-height: 50px;
|
9 |
+
border: 1px solid $border_color;
|
10 |
box-shadow: none;
|
11 |
&:focus{
|
12 |
+
border-color: rgba(41, 143, 252, .6);
|
13 |
+
box-shadow: 0 0 2px rgba(41, 143, 252, .6);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-select/assets/ui-kit/_variables.scss
CHANGED
@@ -1,23 +1,11 @@
|
|
1 |
-
$
|
2 |
-
$
|
3 |
-
$dark_color_2_h: #393f45;
|
4 |
-
$grey_color_1: #96989a;
|
5 |
-
$grey_color_2: #e5e5e5;
|
6 |
-
$grey_color_3: #f1f1f1;
|
7 |
-
$grey_color_4: #b4b7ba;
|
8 |
-
$blue_color: #298ffc;
|
9 |
-
$blue_color_h: #206ff4;
|
10 |
-
$green_color: #48c569;
|
11 |
-
$green_color_h: #3ba956;
|
12 |
-
$red_color: #e54343;
|
13 |
-
$red_color_h: #c73434;
|
14 |
-
$orange_color: #faa730;
|
15 |
-
$orange_color_h: #ee8425;
|
16 |
|
17 |
-
$
|
18 |
-
$
|
19 |
-
$
|
20 |
-
|
|
|
|
|
21 |
|
22 |
-
$
|
23 |
-
$box_shadow_box: 0 8px 21px rgba(0,0,0,.1);
|
1 |
+
$light_color: #ffffff;
|
2 |
+
$dark_color: #23282d;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
4 |
+
$bg_color: #f1f1f1;
|
5 |
+
$bg_color_2: #e5e5e5;
|
6 |
+
$border_color: #dcdcdc;
|
7 |
+
|
8 |
+
$remove_color: #e64545;
|
9 |
+
$primary_color: #2a90fc;
|
10 |
|
11 |
+
$border_radius_extra_small: 2px;
|
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-select/assets/ui-select.js
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
CherryJsCore.utilites.namespace('ui_elements.select');
|
8 |
CherryJsCore.ui_elements.select = {
|
9 |
selectClass: '.cherry-ui-select[data-filter="true"]:not([name*="__i__"]), .cherry-ui-select[multiple]:not([name*="__i__"])',
|
10 |
-
wrapperClass: '.widget, .postbox, .cherry-form',
|
11 |
|
12 |
init: function () {
|
13 |
$( document )
|
7 |
CherryJsCore.utilites.namespace('ui_elements.select');
|
8 |
CherryJsCore.ui_elements.select = {
|
9 |
selectClass: '.cherry-ui-select[data-filter="true"]:not([name*="__i__"]), .cherry-ui-select[multiple]:not([name*="__i__"])',
|
10 |
+
wrapperClass: '.widget, .postbox, .cherry-form, .cherry-ui-repeater-item',
|
11 |
|
12 |
init: function () {
|
13 |
$( document )
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-select/assets/ui-select.scss
CHANGED
@@ -14,7 +14,7 @@ label.cherry-label{
|
|
14 |
select.cherry-ui-select{
|
15 |
width: 100%;
|
16 |
outline: 0 none;
|
17 |
-
color: $
|
18 |
@include input();
|
19 |
&:focus{
|
20 |
border-color: none;
|
@@ -26,9 +26,10 @@ select.select2-hidden-accessible{
|
|
26 |
display: none;
|
27 |
}
|
28 |
.select2{
|
29 |
-
color: $
|
30 |
-
background-color: $
|
31 |
border-radius: $border_radius_extra_small;
|
|
|
32 |
.selection{
|
33 |
.select2-selection{
|
34 |
&.select2-selection--single{
|
@@ -58,12 +59,12 @@ select.select2-hidden-accessible{
|
|
58 |
line-height: 20px;
|
59 |
margin: 5px;
|
60 |
border: none;
|
61 |
-
background-color: $
|
62 |
border-radius: $border_radius_extra_small;
|
63 |
color: #fff;
|
64 |
padding: 10px;
|
65 |
.select2-selection__choice__remove{
|
66 |
-
color: $
|
67 |
margin-right: 10px;
|
68 |
}
|
69 |
}
|
@@ -87,7 +88,7 @@ select.select2-hidden-accessible{
|
|
87 |
}
|
88 |
.select2-container{
|
89 |
.select2-dropdown{
|
90 |
-
background-color: $
|
91 |
border: none;
|
92 |
border-radius: $border_radius_extra_small;
|
93 |
margin: 5px 0;
|
@@ -109,11 +110,11 @@ select.select2-hidden-accessible{
|
|
109 |
|
110 |
&[aria-selected=true]{
|
111 |
color: #fff;
|
112 |
-
background-color: $
|
113 |
}
|
114 |
&--highlighted{
|
115 |
color: #fff;
|
116 |
-
background-color: $
|
117 |
}
|
118 |
}
|
119 |
.li[aria-disabled=true]{
|
14 |
select.cherry-ui-select{
|
15 |
width: 100%;
|
16 |
outline: 0 none;
|
17 |
+
color: $dark_color;
|
18 |
@include input();
|
19 |
&:focus{
|
20 |
border-color: none;
|
26 |
display: none;
|
27 |
}
|
28 |
.select2{
|
29 |
+
color: $dark_color;
|
30 |
+
background-color: $bg_color;
|
31 |
border-radius: $border_radius_extra_small;
|
32 |
+
border: 1px solid $border_color;
|
33 |
.selection{
|
34 |
.select2-selection{
|
35 |
&.select2-selection--single{
|
59 |
line-height: 20px;
|
60 |
margin: 5px;
|
61 |
border: none;
|
62 |
+
background-color: $dark_color;
|
63 |
border-radius: $border_radius_extra_small;
|
64 |
color: #fff;
|
65 |
padding: 10px;
|
66 |
.select2-selection__choice__remove{
|
67 |
+
color: $remove_color;
|
68 |
margin-right: 10px;
|
69 |
}
|
70 |
}
|
88 |
}
|
89 |
.select2-container{
|
90 |
.select2-dropdown{
|
91 |
+
background-color: $bg_color_2;
|
92 |
border: none;
|
93 |
border-radius: $border_radius_extra_small;
|
94 |
margin: 5px 0;
|
110 |
|
111 |
&[aria-selected=true]{
|
112 |
color: #fff;
|
113 |
+
background-color: $primary_color;
|
114 |
}
|
115 |
&--highlighted{
|
116 |
color: #fff;
|
117 |
+
background-color: $dark_color;
|
118 |
}
|
119 |
}
|
120 |
.li[aria-disabled=true]{
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-select/ui-select.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
* @author Cherry Team <support@cherryframework.com>
|
8 |
* @copyright Copyright (c) 2012 - 2015, Cherry Team
|
9 |
* @link http://www.cherryframework.com/
|
10 |
-
* @license http://www.gnu.org/licenses/
|
11 |
*/
|
12 |
|
13 |
// If this file is called directly, abort.
|
@@ -21,69 +21,69 @@ if ( ! class_exists( 'UI_Select' ) ) {
|
|
21 |
* Class for the building UI_Select elements.
|
22 |
*/
|
23 |
class UI_Select extends UI_Element implements I_UI {
|
|
|
24 |
/**
|
25 |
-
* Default settings
|
26 |
*
|
|
|
27 |
* @var array
|
28 |
*/
|
29 |
private $defaults_settings = array(
|
30 |
-
'id'
|
31 |
-
'name'
|
32 |
-
'multiple'
|
33 |
-
'filter'
|
34 |
-
'size'
|
35 |
-
'inline_style'
|
36 |
-
'value'
|
37 |
-
'options'
|
38 |
-
'select-1'
|
39 |
-
'select-2'
|
40 |
-
'select-3'
|
41 |
-
'select-4'
|
42 |
-
'select-5'
|
43 |
-
'label'
|
44 |
-
'slave'
|
45 |
),
|
46 |
'optgroup-1' => array(
|
47 |
-
'label'
|
48 |
-
'group_options'
|
49 |
-
'select-6'
|
50 |
-
'select-7'
|
51 |
-
'select-8'
|
52 |
),
|
53 |
),
|
54 |
-
'optgroup-2'
|
55 |
-
'label'
|
56 |
-
'group_options'
|
57 |
-
'select-9'
|
58 |
-
'select-10'
|
59 |
-
'select-11'
|
60 |
),
|
61 |
),
|
62 |
),
|
63 |
-
'placeholder'
|
64 |
-
'label'
|
65 |
-
'class'
|
66 |
-
'master'
|
67 |
);
|
68 |
|
69 |
/**
|
70 |
* Constructor method for the UI_Select class.
|
71 |
*
|
72 |
-
* @since
|
73 |
*/
|
74 |
function __construct( $args = array() ) {
|
75 |
-
|
76 |
$this->defaults_settings['id'] = 'cherry-ui-select-' . uniqid();
|
77 |
$this->settings = wp_parse_args( $args, $this->defaults_settings );
|
78 |
|
79 |
add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
|
80 |
-
|
81 |
}
|
82 |
|
83 |
/**
|
84 |
* Render html UI_Select.
|
85 |
*
|
86 |
-
* @since
|
87 |
*/
|
88 |
public function render() {
|
89 |
$html = '';
|
@@ -154,7 +154,7 @@ if ( ! class_exists( 'UI_Select' ) ) {
|
|
154 |
/**
|
155 |
* Enqueue javascript and stylesheet UI_Select
|
156 |
*
|
157 |
-
* @since
|
158 |
*/
|
159 |
public static function enqueue_assets() {
|
160 |
wp_enqueue_script(
|
@@ -164,13 +164,15 @@ if ( ! class_exists( 'UI_Select' ) ) {
|
|
164 |
'4.0.3',
|
165 |
true
|
166 |
);
|
|
|
167 |
wp_enqueue_script(
|
168 |
'ui-select-min',
|
169 |
esc_url( Cherry_Core::base_url( 'assets/min/ui-select.min.js', __FILE__ ) ),
|
170 |
array( 'jquery' ),
|
171 |
-
'1.
|
172 |
true
|
173 |
);
|
|
|
174 |
wp_enqueue_style(
|
175 |
'ui-select-select2',
|
176 |
esc_url( Cherry_Core::base_url( 'assets/min/select2.min.css', __FILE__ ) ),
|
@@ -178,11 +180,12 @@ if ( ! class_exists( 'UI_Select' ) ) {
|
|
178 |
'4.0.3',
|
179 |
'all'
|
180 |
);
|
|
|
181 |
wp_enqueue_style(
|
182 |
'ui-select-min',
|
183 |
esc_url( Cherry_Core::base_url( 'assets/min/ui-select.min.css', __FILE__ ) ),
|
184 |
array(),
|
185 |
-
'1.
|
186 |
'all'
|
187 |
);
|
188 |
}
|
7 |
* @author Cherry Team <support@cherryframework.com>
|
8 |
* @copyright Copyright (c) 2012 - 2015, Cherry Team
|
9 |
* @link http://www.cherryframework.com/
|
10 |
+
* @license http://www.gnu.org/licenses/gpl-3.0.en.html
|
11 |
*/
|
12 |
|
13 |
// If this file is called directly, abort.
|
21 |
* Class for the building UI_Select elements.
|
22 |
*/
|
23 |
class UI_Select extends UI_Element implements I_UI {
|
24 |
+
|
25 |
/**
|
26 |
+
* Default settings.
|
27 |
*
|
28 |
+
* @since 1.0.0
|
29 |
* @var array
|
30 |
*/
|
31 |
private $defaults_settings = array(
|
32 |
+
'id' => 'cherry-ui-select-id',
|
33 |
+
'name' => 'cherry-ui-select-name',
|
34 |
+
'multiple' => false,
|
35 |
+
'filter' => false,
|
36 |
+
'size' => 1,
|
37 |
+
'inline_style' => 'width: 100%',
|
38 |
+
'value' => 'select-8',
|
39 |
+
'options' => array(
|
40 |
+
'select-1' => 'select 1',
|
41 |
+
'select-2' => 'select 2',
|
42 |
+
'select-3' => 'select 3',
|
43 |
+
'select-4' => 'select 4',
|
44 |
+
'select-5' => array(
|
45 |
+
'label' => 'Group 1',
|
46 |
+
'slave' => 'slave',
|
47 |
),
|
48 |
'optgroup-1' => array(
|
49 |
+
'label' => 'Group 1',
|
50 |
+
'group_options' => array(
|
51 |
+
'select-6' => 'select 6',
|
52 |
+
'select-7' => 'select 7',
|
53 |
+
'select-8' => 'select 8',
|
54 |
),
|
55 |
),
|
56 |
+
'optgroup-2' => array(
|
57 |
+
'label' => 'Group 2',
|
58 |
+
'group_options' => array(
|
59 |
+
'select-9' => 'select 9',
|
60 |
+
'select-10' => 'select 10',
|
61 |
+
'select-11' => 'select 11',
|
62 |
),
|
63 |
),
|
64 |
),
|
65 |
+
'placeholder' => 'Select',
|
66 |
+
'label' => '',
|
67 |
+
'class' => '',
|
68 |
+
'master' => '',
|
69 |
);
|
70 |
|
71 |
/**
|
72 |
* Constructor method for the UI_Select class.
|
73 |
*
|
74 |
+
* @since 1.0.0
|
75 |
*/
|
76 |
function __construct( $args = array() ) {
|
|
|
77 |
$this->defaults_settings['id'] = 'cherry-ui-select-' . uniqid();
|
78 |
$this->settings = wp_parse_args( $args, $this->defaults_settings );
|
79 |
|
80 |
add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
|
|
|
81 |
}
|
82 |
|
83 |
/**
|
84 |
* Render html UI_Select.
|
85 |
*
|
86 |
+
* @since 1.0.0
|
87 |
*/
|
88 |
public function render() {
|
89 |
$html = '';
|
154 |
/**
|
155 |
* Enqueue javascript and stylesheet UI_Select
|
156 |
*
|
157 |
+
* @since 1.0.0
|
158 |
*/
|
159 |
public static function enqueue_assets() {
|
160 |
wp_enqueue_script(
|
164 |
'4.0.3',
|
165 |
true
|
166 |
);
|
167 |
+
|
168 |
wp_enqueue_script(
|
169 |
'ui-select-min',
|
170 |
esc_url( Cherry_Core::base_url( 'assets/min/ui-select.min.js', __FILE__ ) ),
|
171 |
array( 'jquery' ),
|
172 |
+
'1.3.2',
|
173 |
true
|
174 |
);
|
175 |
+
|
176 |
wp_enqueue_style(
|
177 |
'ui-select-select2',
|
178 |
esc_url( Cherry_Core::base_url( 'assets/min/select2.min.css', __FILE__ ) ),
|
180 |
'4.0.3',
|
181 |
'all'
|
182 |
);
|
183 |
+
|
184 |
wp_enqueue_style(
|
185 |
'ui-select-min',
|
186 |
esc_url( Cherry_Core::base_url( 'assets/min/ui-select.min.css', __FILE__ ) ),
|
187 |
array(),
|
188 |
+
'1.3.2',
|
189 |
'all'
|
190 |
);
|
191 |
}
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-slider/assets/min/ui-slider.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.cherry-ui-container{margin:10px 0 20px 0}.cherry-ui-container .cherry-ui-container{margin:0}label.cherry-label{margin:0 0 5px 0;display:block}.cherry-slider-wrap{display:-webkit-box;display:-
|
1 |
+
.cherry-ui-container{margin:10px 0 20px 0}.cherry-ui-container .cherry-ui-container{margin:0}label.cherry-label{margin:0 0 5px 0;display:block}.cherry-slider-wrap{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.cherry-slider-wrap .cherry-slider-input{-webkit-box-flex:0;-ms-flex:0 1 10%;flex:0 1 10%;min-width:100px;max-width:200px}.cherry-slider-wrap .cherry-slider-holder{-webkit-box-flex:0;-ms-flex:0 1 90%;flex:0 1 90%;min-width:200px;max-width:300px;margin-right:20px}.cherry-slider-wrap .cherry-slider-holder input[type=range]{-webkit-appearance:none;width:100%;margin:20px 0}.cherry-slider-wrap .cherry-slider-holder input[type=range]:focus{outline:none}.cherry-slider-wrap .cherry-slider-holder input[type=range]::-webkit-slider-runnable-track{width:100%;height:5px;cursor:pointer;box-shadow:none;background:#48c569;border-radius:25px;border:none}.cherry-slider-wrap .cherry-slider-holder input[type=range]::-webkit-slider-thumb{box-shadow:5px 5px 13px rgba(0,0,0,0.18);border:5px solid #48c569;height:20px;width:20px;margin-top:-7px;border-radius:15px;background:#48c569;cursor:pointer;-webkit-appearance:none;-webkit-transition:all 250ms cubic-bezier(0.645, 0.045, 0.355, 1);transition:all 250ms cubic-bezier(0.645, 0.045, 0.355, 1)}.cherry-slider-wrap .cherry-slider-holder input[type=range]:focus::-webkit-slider-thumb{background:#f1f1f1;height:28px;width:28px;margin-top:-11.5px}.cherry-slider-wrap .cherry-slider-holder input[type=range]:hover::-webkit-slider-thumb{background:#f1f1f1;height:28px;width:28px;margin-top:-11.5px}.cherry-slider-wrap .cherry-slider-holder input[type=range]:focus::-webkit-slider-runnable-track{background:#48c569}.cherry-slider-wrap .cherry-slider-holder input[type=range]::-moz-range-track{width:100%;height:5px;cursor:pointer;box-shadow:none;background:#48c569;border-radius:25px;border:none}.cherry-slider-wrap .cherry-slider-holder input[type=range]::-moz-range-thumb{box-shadow:none;border:none;height:28px;width:28px;border-radius:15px;background:#48c569;cursor:pointer}.cherry-slider-wrap .cherry-slider-holder input[type=range]::-ms-track{width:100%;height:10px;cursor:pointer;background:#f1f1f1;border-color:transparent;color:transparent}.cherry-slider-wrap .cherry-slider-holder input[type=range]::-ms-fill-lower{background:#f1f1f1;border:none;border-radius:50px;box-shadow:none}.cherry-slider-wrap .cherry-slider-holder input[type=range]::-ms-fill-upper{background:#48c569;border:none;border-radius:50px;box-shadow:none}.cherry-slider-wrap .cherry-slider-holder input[type=range]::-ms-thumb{box-shadow:none;border:none;height:10px;width:10px;border-radius:15px;background:#495159;cursor:pointer}.cherry-slider-wrap .cherry-slider-holder input[type=range]:focus::-ms-fill-lower{background:#f1f1f1}.cherry-slider-wrap .cherry-slider-holder input[type=range]:focus::-ms-fill-upper{background:#48c569}.cherry-slider-wrap .cherry-input{margin:0;width:100%}
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-slider/assets/ui-kit/_mixins.scss
CHANGED
@@ -17,7 +17,8 @@
|
|
17 |
&:focus,
|
18 |
&:active {
|
19 |
outline: none;
|
20 |
-
|
|
|
21 |
color: #fff;
|
22 |
}
|
23 |
}
|
@@ -64,12 +65,12 @@
|
|
64 |
background-color: $grey_color_3;
|
65 |
border-radius: $border_radius_extra_small;
|
66 |
padding: 10px 20px;
|
67 |
-
height: 50px;
|
68 |
border: 1px solid $grey_color_3;
|
69 |
box-shadow: none;
|
70 |
&:focus{
|
71 |
-
border-color: rgba(
|
72 |
-
box-shadow: 0 0 2px rgba(
|
73 |
}
|
74 |
}
|
75 |
|
@@ -125,7 +126,8 @@
|
|
125 |
&:focus,
|
126 |
&:active {
|
127 |
outline: none;
|
128 |
-
|
|
|
129 |
color: $blue_color;
|
130 |
}
|
131 |
}
|
@@ -179,4 +181,4 @@
|
|
179 |
font-size: 16px;
|
180 |
line-height: 18px;
|
181 |
background: #fff;
|
182 |
-
}
|
17 |
&:focus,
|
18 |
&:active {
|
19 |
outline: none;
|
20 |
+
border-color: rgba(41, 143, 252, .6);
|
21 |
+
box-shadow: 0 0 2px rgba(41, 143, 252, .6);
|
22 |
color: #fff;
|
23 |
}
|
24 |
}
|
65 |
background-color: $grey_color_3;
|
66 |
border-radius: $border_radius_extra_small;
|
67 |
padding: 10px 20px;
|
68 |
+
min-height: 50px;
|
69 |
border: 1px solid $grey_color_3;
|
70 |
box-shadow: none;
|
71 |
&:focus{
|
72 |
+
border-color: rgba(41, 143, 252, .6);
|
73 |
+
box-shadow: 0 0 2px rgba(41, 143, 252, .6);
|
74 |
}
|
75 |
}
|
76 |
|
126 |
&:focus,
|
127 |
&:active {
|
128 |
outline: none;
|
129 |
+
border-color: rgba(41, 143, 252, .6);
|
130 |
+
box-shadow: 0 0 2px rgba(41, 143, 252, .6);
|
131 |
color: $blue_color;
|
132 |
}
|
133 |
}
|
181 |
font-size: 16px;
|
182 |
line-height: 18px;
|
183 |
background: #fff;
|
184 |
+
}
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-slider/ui-slider.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
* @author Cherry Team <support@cherryframework.com>
|
8 |
* @copyright Copyright (c) 2012 - 2015, Cherry Team
|
9 |
* @link http://www.cherryframework.com/
|
10 |
-
* @license http://www.gnu.org/licenses/
|
11 |
*/
|
12 |
|
13 |
// If this file is called directly, abort.
|
@@ -21,9 +21,11 @@ if ( ! class_exists( 'UI_Slider' ) ) {
|
|
21 |
* Class for the building UI_Slider elements.
|
22 |
*/
|
23 |
class UI_Slider extends UI_Element implements I_UI {
|
|
|
24 |
/**
|
25 |
-
* Default settings
|
26 |
*
|
|
|
27 |
* @var array
|
28 |
*/
|
29 |
private $defaults_settings = array(
|
@@ -41,7 +43,7 @@ if ( ! class_exists( 'UI_Slider' ) ) {
|
|
41 |
/**
|
42 |
* Constructor method for the UI_Slider class.
|
43 |
*
|
44 |
-
* @since
|
45 |
*/
|
46 |
function __construct( $args = array() ) {
|
47 |
$this->defaults_settings['id'] = 'cherry-ui-slider-' . uniqid();
|
@@ -53,7 +55,7 @@ if ( ! class_exists( 'UI_Slider' ) ) {
|
|
53 |
/**
|
54 |
* Render html UI_Slider.
|
55 |
*
|
56 |
-
* @since
|
57 |
*/
|
58 |
public function render() {
|
59 |
$html = '';
|
@@ -93,15 +95,14 @@ if ( ! class_exists( 'UI_Slider' ) ) {
|
|
93 |
/**
|
94 |
* Enqueue javascript and stylesheet UI_Slider.
|
95 |
*
|
96 |
-
* @since
|
97 |
*/
|
98 |
public static function enqueue_assets() {
|
99 |
-
|
100 |
wp_enqueue_script(
|
101 |
'ui-slider-min',
|
102 |
esc_url( Cherry_Core::base_url( 'assets/min/ui-slider.min.js', __FILE__ ) ),
|
103 |
array( 'jquery' ),
|
104 |
-
'1.
|
105 |
true
|
106 |
);
|
107 |
|
@@ -109,7 +110,7 @@ if ( ! class_exists( 'UI_Slider' ) ) {
|
|
109 |
'ui-slider-min',
|
110 |
esc_url( Cherry_Core::base_url( 'assets/min/ui-slider.min.css', __FILE__ ) ),
|
111 |
array(),
|
112 |
-
'1.
|
113 |
'all'
|
114 |
);
|
115 |
}
|
7 |
* @author Cherry Team <support@cherryframework.com>
|
8 |
* @copyright Copyright (c) 2012 - 2015, Cherry Team
|
9 |
* @link http://www.cherryframework.com/
|
10 |
+
* @license http://www.gnu.org/licenses/gpl-3.0.en.html
|
11 |
*/
|
12 |
|
13 |
// If this file is called directly, abort.
|
21 |
* Class for the building UI_Slider elements.
|
22 |
*/
|
23 |
class UI_Slider extends UI_Element implements I_UI {
|
24 |
+
|
25 |
/**
|
26 |
+
* Default settings.
|
27 |
*
|
28 |
+
* @since 1.0.0
|
29 |
* @var array
|
30 |
*/
|
31 |
private $defaults_settings = array(
|
43 |
/**
|
44 |
* Constructor method for the UI_Slider class.
|
45 |
*
|
46 |
+
* @since 1.0.0
|
47 |
*/
|
48 |
function __construct( $args = array() ) {
|
49 |
$this->defaults_settings['id'] = 'cherry-ui-slider-' . uniqid();
|
55 |
/**
|
56 |
* Render html UI_Slider.
|
57 |
*
|
58 |
+
* @since 1.0.0
|
59 |
*/
|
60 |
public function render() {
|
61 |
$html = '';
|
95 |
/**
|
96 |
* Enqueue javascript and stylesheet UI_Slider.
|
97 |
*
|
98 |
+
* @since 1.0.0
|
99 |
*/
|
100 |
public static function enqueue_assets() {
|
|
|
101 |
wp_enqueue_script(
|
102 |
'ui-slider-min',
|
103 |
esc_url( Cherry_Core::base_url( 'assets/min/ui-slider.min.js', __FILE__ ) ),
|
104 |
array( 'jquery' ),
|
105 |
+
'1.3.2',
|
106 |
true
|
107 |
);
|
108 |
|
110 |
'ui-slider-min',
|
111 |
esc_url( Cherry_Core::base_url( 'assets/min/ui-slider.min.css', __FILE__ ) ),
|
112 |
array(),
|
113 |
+
'1.3.2',
|
114 |
'all'
|
115 |
);
|
116 |
}
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-stepper/assets/min/ui-stepper.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.cherry-ui-container{margin:10px 0 20px 0}label.cherry-label{margin:0 0 5px 0;display:block}.cherry-ui-stepper{position:relative;max-width:100px}.cherry-ui-stepper input[type=number]{font-size:14px;line-height:20px;color:#23282d;background-color:#f1f1f1;border-radius:2px;padding:10px
|
1 |
+
.cherry-ui-container{margin:10px 0 20px 0}label.cherry-label{margin:0 0 5px 0;display:block}.cherry-ui-stepper{position:relative;max-width:100px}.cherry-ui-stepper input[type=number]{font-size:14px;line-height:20px;color:#23282d;background-color:#f1f1f1;border-radius:2px;padding:10px;min-height:50px;border:1px solid #dcdcdc;box-shadow:none}.cherry-ui-stepper input[type=number]:focus{border-color:rgba(41,143,252,0.6);box-shadow:0 0 2px rgba(41,143,252,0.6)}.cherry-ui-stepper-input{min-width:90px;max-width:90px;text-align:center}
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-stepper/assets/ui-kit/_mixins.scss
CHANGED
@@ -1,182 +1,15 @@
|
|
1 |
-
@mixin button_base() {
|
2 |
-
display: inline-block;
|
3 |
-
text-decoration: none;
|
4 |
-
font-size: 12px;
|
5 |
-
line-height: 20px;
|
6 |
-
font-weight: bold;
|
7 |
-
padding: 15px 20px;
|
8 |
-
color: #fff;
|
9 |
-
text-transform: uppercase;
|
10 |
-
border-radius: $border_radius_small;
|
11 |
-
transition: all 200ms linear;
|
12 |
-
box-shadow: $box_shadow;
|
13 |
-
&:hover {
|
14 |
-
color: #fff;
|
15 |
-
box-shadow: none;
|
16 |
-
}
|
17 |
-
&:focus,
|
18 |
-
&:active {
|
19 |
-
outline: none;
|
20 |
-
box-shadow: none;
|
21 |
-
color: #fff;
|
22 |
-
}
|
23 |
-
}
|
24 |
-
|
25 |
-
@mixin button_normal() {
|
26 |
-
background: $dark_color_2;
|
27 |
-
&:hover {
|
28 |
-
background: $dark_color_2_h;
|
29 |
-
}
|
30 |
-
}
|
31 |
-
|
32 |
-
@mixin button_primary() {
|
33 |
-
background: $blue_color;
|
34 |
-
&:hover {
|
35 |
-
background: $blue_color_h;
|
36 |
-
}
|
37 |
-
}
|
38 |
-
|
39 |
-
@mixin button_success() {
|
40 |
-
background: $green_color;
|
41 |
-
&:hover {
|
42 |
-
background: $green_color_h;
|
43 |
-
}
|
44 |
-
}
|
45 |
-
|
46 |
-
@mixin button_danger() {
|
47 |
-
background: $red_color;
|
48 |
-
&:hover {
|
49 |
-
background: $red_color_h;
|
50 |
-
}
|
51 |
-
}
|
52 |
-
|
53 |
-
@mixin button_warning() {
|
54 |
-
background: $orange_color;
|
55 |
-
&:hover {
|
56 |
-
background: $orange_color_h;
|
57 |
-
}
|
58 |
-
}
|
59 |
-
|
60 |
@mixin input() {
|
61 |
font-size: 14px;
|
62 |
line-height: 20px;
|
63 |
-
color: $
|
64 |
-
background-color: $
|
65 |
border-radius: $border_radius_extra_small;
|
66 |
-
padding: 10px
|
67 |
-
height: 50px;
|
68 |
-
border: 1px solid $
|
69 |
box-shadow: none;
|
70 |
&:focus{
|
71 |
-
border-color: rgba(
|
72 |
-
box-shadow: 0 0 2px rgba(
|
73 |
-
}
|
74 |
-
}
|
75 |
-
|
76 |
-
@mixin button_icon( $icon ) {
|
77 |
-
content: $icon;
|
78 |
-
display: inline-block;
|
79 |
-
font-family: dashicons;
|
80 |
-
font-size: 16px;
|
81 |
-
font-style: normal;
|
82 |
-
font-weight: 400;
|
83 |
-
height: 18px;
|
84 |
-
line-height: 18px;
|
85 |
-
text-align: center;
|
86 |
-
text-decoration: inherit;
|
87 |
-
transition: all 200ms linear;
|
88 |
-
vertical-align: middle;
|
89 |
-
}
|
90 |
-
|
91 |
-
@mixin button_icon_before( $icon ) {
|
92 |
-
&:before {
|
93 |
-
@include button_icon( $icon );
|
94 |
-
padding: 0 5px 0 0;
|
95 |
-
}
|
96 |
-
}
|
97 |
-
|
98 |
-
@mixin button_icon_after( $icon ) {
|
99 |
-
&:after {
|
100 |
-
@include button_icon( $icon );
|
101 |
-
padding: 0 0 0 5px;
|
102 |
-
}
|
103 |
-
}
|
104 |
-
|
105 |
-
@mixin button_icon_middle( $icon ) {
|
106 |
-
&:before {
|
107 |
-
@include button_icon( $icon );
|
108 |
-
margin: 0 -5px;
|
109 |
-
}
|
110 |
-
}
|
111 |
-
|
112 |
-
@mixin link() {
|
113 |
-
display: inline-block;
|
114 |
-
text-decoration: none;
|
115 |
-
font-size: 12px;
|
116 |
-
line-height: 20px;
|
117 |
-
font-weight: bold;
|
118 |
-
color: $blue_color;
|
119 |
-
text-transform: uppercase;
|
120 |
-
transition: all 200ms linear;
|
121 |
-
&:hover {
|
122 |
-
color: $dark_color_1;
|
123 |
-
box-shadow: none;
|
124 |
-
}
|
125 |
-
&:focus,
|
126 |
-
&:active {
|
127 |
-
outline: none;
|
128 |
-
box-shadow: none;
|
129 |
-
color: $blue_color;
|
130 |
-
}
|
131 |
-
}
|
132 |
-
|
133 |
-
@mixin link_icon_before( $icon ) {
|
134 |
-
&:before {
|
135 |
-
@include button_icon( $icon );
|
136 |
-
padding: 0 5px 0 0;
|
137 |
-
color: $grey_color_4;
|
138 |
-
}
|
139 |
-
&:hover {
|
140 |
-
&:before {
|
141 |
-
color: $blue_color;
|
142 |
}
|
143 |
-
}
|
144 |
-
}
|
145 |
-
|
146 |
-
@mixin container() {
|
147 |
-
padding: 30px;
|
148 |
-
border: 2px solid $grey_color_2;
|
149 |
-
background: $grey_color_3;
|
150 |
-
border-radius: $border_radius_large;
|
151 |
-
}
|
152 |
-
|
153 |
-
@mixin container_heading() {
|
154 |
-
margin: -30px -30px 30px -30px;
|
155 |
-
border-radius: $border_radius_large $border_radius_large 0 0;
|
156 |
-
border-bottom: 1px solid $grey_color_2;
|
157 |
-
padding: 20px 30px;
|
158 |
-
font-weight: bold;
|
159 |
-
font-size: 16px;
|
160 |
-
line-height: 18px;
|
161 |
-
text-align: center;
|
162 |
-
background: #fff;
|
163 |
-
}
|
164 |
-
|
165 |
-
@mixin box() {
|
166 |
-
margin: 0 0 30px;
|
167 |
-
padding: 20px;
|
168 |
-
background: #fff;
|
169 |
-
box-shadow: $box_shadow_box;
|
170 |
-
border-radius: $border_radius;
|
171 |
}
|
172 |
-
|
173 |
-
@mixin box_heading() {
|
174 |
-
margin: -20px -20px 20px -20px;
|
175 |
-
border-radius: $border_radius_small $border_radius_small 0 0;
|
176 |
-
border-bottom: 1px solid $grey_color_2;
|
177 |
-
padding: 20px 30px;
|
178 |
-
font-weight: bold;
|
179 |
-
font-size: 16px;
|
180 |
-
line-height: 18px;
|
181 |
-
background: #fff;
|
182 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
@mixin input() {
|
2 |
font-size: 14px;
|
3 |
line-height: 20px;
|
4 |
+
color: $dark_color;
|
5 |
+
background-color: $bg_color;
|
6 |
border-radius: $border_radius_extra_small;
|
7 |
+
padding: 10px;
|
8 |
+
min-height: 50px;
|
9 |
+
border: 1px solid $border_color;
|
10 |
box-shadow: none;
|
11 |
&:focus{
|
12 |
+
border-color: rgba(41, 143, 252, .6);
|
13 |
+
box-shadow: 0 0 2px rgba(41, 143, 252, .6);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-stepper/assets/ui-kit/_variables.scss
CHANGED
@@ -1,23 +1,7 @@
|
|
1 |
-
$
|
2 |
-
$
|
3 |
-
$dark_color_2_h: #393f45;
|
4 |
-
$grey_color_1: #96989a;
|
5 |
-
$grey_color_2: #e5e5e5;
|
6 |
-
$grey_color_3: #f1f1f1;
|
7 |
-
$grey_color_4: #b4b7ba;
|
8 |
-
$blue_color: #298ffc;
|
9 |
-
$blue_color_h: #206ff4;
|
10 |
-
$green_color: #48c569;
|
11 |
-
$green_color_h: #3ba956;
|
12 |
-
$red_color: #e54343;
|
13 |
-
$red_color_h: #c73434;
|
14 |
-
$orange_color: #faa730;
|
15 |
-
$orange_color_h: #ee8425;
|
16 |
|
17 |
-
$
|
18 |
-
$
|
19 |
-
$border_radius_medium: 6px;
|
20 |
-
$border_radius_large: 8px;
|
21 |
|
22 |
-
$
|
23 |
-
$box_shadow_box: 0 8px 21px rgba(0,0,0,.1);
|
1 |
+
$light_color: #ffffff;
|
2 |
+
$dark_color: #23282d;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
4 |
+
$bg_color: #f1f1f1;
|
5 |
+
$border_color: #dcdcdc;
|
|
|
|
|
6 |
|
7 |
+
$border_radius_extra_small: 2px;
|
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-stepper/assets/ui-stepper.scss
CHANGED
@@ -13,7 +13,6 @@ label.cherry-label{
|
|
13 |
max-width: 100px;
|
14 |
input[type=number]{
|
15 |
@include input();
|
16 |
-
padding: 10px 10px 10px 20px;
|
17 |
}
|
18 |
|
19 |
}
|
@@ -21,4 +20,4 @@ label.cherry-label{
|
|
21 |
min-width: 90px;
|
22 |
max-width: 90px;
|
23 |
text-align: center;
|
24 |
-
}
|
13 |
max-width: 100px;
|
14 |
input[type=number]{
|
15 |
@include input();
|
|
|
16 |
}
|
17 |
|
18 |
}
|
20 |
min-width: 90px;
|
21 |
max-width: 90px;
|
22 |
text-align: center;
|
23 |
+
}
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-stepper/ui-stepper.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
* @author Cherry Team <support@cherryframework.com>
|
8 |
* @copyright Copyright (c) 2012 - 2015, Cherry Team
|
9 |
* @link http://www.cherryframework.com/
|
10 |
-
* @license http://www.gnu.org/licenses/
|
11 |
*/
|
12 |
|
13 |
// If this file is called directly, abort.
|
@@ -23,26 +23,28 @@ if ( ! class_exists( 'UI_Stepper' ) ) {
|
|
23 |
class UI_Stepper extends UI_Element implements I_UI {
|
24 |
|
25 |
/**
|
26 |
-
* Default settings
|
27 |
*
|
|
|
28 |
* @var array
|
29 |
*/
|
30 |
private $defaults_settings = array(
|
31 |
-
'id'
|
32 |
-
'name'
|
33 |
-
'value'
|
34 |
-
'max_value'
|
35 |
-
'min_value'
|
36 |
-
'step_value'
|
37 |
-
'label'
|
38 |
-
'class'
|
39 |
-
'master'
|
40 |
-
'placeholder'
|
41 |
);
|
|
|
42 |
/**
|
43 |
* Constructor method for the UI_Stepper class.
|
44 |
*
|
45 |
-
* @since
|
46 |
*/
|
47 |
function __construct( $args = array() ) {
|
48 |
$this->defaults_settings['id'] = 'cherry-ui-stepper-' . uniqid();
|
@@ -55,7 +57,7 @@ if ( ! class_exists( 'UI_Stepper' ) ) {
|
|
55 |
/**
|
56 |
* Render html UI_Stepper.
|
57 |
*
|
58 |
-
* @since
|
59 |
*/
|
60 |
public function render() {
|
61 |
$html = '';
|
@@ -78,14 +80,14 @@ if ( ! class_exists( 'UI_Stepper' ) ) {
|
|
78 |
/**
|
79 |
* Enqueue javascript and stylesheet UI_Stepper.
|
80 |
*
|
81 |
-
* @since
|
82 |
*/
|
83 |
public static function enqueue_assets() {
|
84 |
wp_enqueue_style(
|
85 |
'ui-stepper-min',
|
86 |
esc_url( Cherry_Core::base_url( 'assets/min/ui-stepper.min.css', __FILE__ ) ),
|
87 |
array(),
|
88 |
-
'1.
|
89 |
'all'
|
90 |
);
|
91 |
}
|
7 |
* @author Cherry Team <support@cherryframework.com>
|
8 |
* @copyright Copyright (c) 2012 - 2015, Cherry Team
|
9 |
* @link http://www.cherryframework.com/
|
10 |
+
* @license http://www.gnu.org/licenses/gpl-3.0.en.html
|
11 |
*/
|
12 |
|
13 |
// If this file is called directly, abort.
|
23 |
class UI_Stepper extends UI_Element implements I_UI {
|
24 |
|
25 |
/**
|
26 |
+
* Default settings.
|
27 |
*
|
28 |
+
* @since 1.0.0
|
29 |
* @var array
|
30 |
*/
|
31 |
private $defaults_settings = array(
|
32 |
+
'id' => 'cherry-ui-stepper-id',
|
33 |
+
'name' => 'cherry-ui-stepper-name',
|
34 |
+
'value' => '0',
|
35 |
+
'max_value' => '100',
|
36 |
+
'min_value' => '0',
|
37 |
+
'step_value' => '1',
|
38 |
+
'label' => '',
|
39 |
+
'class' => '',
|
40 |
+
'master' => '',
|
41 |
+
'placeholder' => '',
|
42 |
);
|
43 |
+
|
44 |
/**
|
45 |
* Constructor method for the UI_Stepper class.
|
46 |
*
|
47 |
+
* @since 1.0.0
|
48 |
*/
|
49 |
function __construct( $args = array() ) {
|
50 |
$this->defaults_settings['id'] = 'cherry-ui-stepper-' . uniqid();
|
57 |
/**
|
58 |
* Render html UI_Stepper.
|
59 |
*
|
60 |
+
* @since 1.0.0
|
61 |
*/
|
62 |
public function render() {
|
63 |
$html = '';
|
80 |
/**
|
81 |
* Enqueue javascript and stylesheet UI_Stepper.
|
82 |
*
|
83 |
+
* @since 1.0.0
|
84 |
*/
|
85 |
public static function enqueue_assets() {
|
86 |
wp_enqueue_style(
|
87 |
'ui-stepper-min',
|
88 |
esc_url( Cherry_Core::base_url( 'assets/min/ui-stepper.min.css', __FILE__ ) ),
|
89 |
array(),
|
90 |
+
'1.3.2',
|
91 |
'all'
|
92 |
);
|
93 |
}
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-switcher/assets/min/ui-switcher.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.cherry-ui-container{margin:10px 0 20px 0}label.cherry-label{margin:0 0 5px 0;display:block}.hide{display:none !important}.cherry-switcher-wrap{height:
|
1 |
+
.cherry-ui-container{margin:10px 0 20px 0}label.cherry-label{margin:0 0 5px 0;display:block}.hide{display:none !important}.cherry-switcher-wrap{height:47px;border-radius:25px;display:inline-block;overflow:hidden;position:relative;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border:1px solid #dcdcdc}.cherry-switcher-wrap label{background-color:#f1f1f1;display:block;float:left;-webkit-transition:all 0.4s ease;transition:all 0.4s ease}.cherry-switcher-wrap label span{font-size:12px;line-height:18px;font-weight:900;text-transform:uppercase;color:#23282d;text-align:center;display:block;opacity:1;-webkit-transition:all 0.4s ease;transition:all 0.4s ease}.cherry-switcher-wrap .sw-enable{padding:15px 10px 15px 20px}.cherry-switcher-wrap .sw-enable span{opacity:0}.cherry-switcher-wrap .sw-disable{padding:15px 20px 15px 10px}.cherry-switcher-wrap .sw-disable span{opacity:1}.cherry-switcher-wrap .state-marker{background-color:#e64545;display:block;position:absolute;width:41px;height:41px;margin:3px;top:0;left:0;margin-left:4px;border-radius:25px;border-style:solid;border-width:1px;border-color:#e54545 #c13b3b #c13b3b #e54545;-webkit-transition:all 0.4s cubic-bezier(0.77, 0, 0.175, 1);transition:all 0.4s cubic-bezier(0.77, 0, 0.175, 1);box-sizing:border-box}.cherry-switcher-wrap .state-marker:before{position:absolute;display:block;width:100%;height:100%;top:0;left:0;border-radius:50%;background-image:-webkit-linear-gradient(top, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 100%);background-image:linear-gradient(180deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 100%);content:''}.cherry-switcher-wrap .cherry-input-switcher{display:none}.cherry-switcher-wrap .cherry-input-switcher-true:checked ~ .sw-enable span{opacity:1}.cherry-switcher-wrap .cherry-input-switcher-true:checked ~ .sw-disable span{opacity:0}.cherry-switcher-wrap .cherry-input-switcher-true:checked ~ .state-marker{left:100%;margin-left:-45px;border-color:#43b05f #3b9b54 #3b9b54 #43b05f;background-color:#49c66a}.cherry-switcher-wrap.size-small{height:23px}.cherry-switcher-wrap.size-small label{height:23px;padding:0}.cherry-switcher-wrap.size-small label span{font-size:10px;line-height:15px;padding:5px}.cherry-switcher-wrap.size-small .state-marker{width:17px;height:17px;margin-left:4px}.cherry-switcher-wrap.size-small .cherry-input-switcher-true:checked ~ .state-marker{margin-left:-22px}
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-switcher/assets/min/ui-switcher.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(t,e){"use strict";e.utilites.namespace("ui_elements.switcher"),e.ui_elements.switcher={switcherClass:".cherry-switcher-wrap",inputTrueClass:".cherry-input-switcher-true",inputFalseClass:".cherry-input-switcher-false",containerClass:".cherry-ui-container",wrapperClass:".widget, .postbox, .cherry-form",init:function(){t(document).on("ready.cherry-ui-elements-init",this.addEvent.bind(this)).on("cherry-ui-elements-init",this.initState.bind(this))},addEvent:function(){t("body").on("click",this.switcherClass,this.switchState.bind(this)),this.initState()},initState:function(){for(var e,i=t(this.switcherClass),s=i.length-1;s>=0;s--)e=t(i[s]),this.switchState({currentTarget:e,initState:!0})},switchState:function(e){var i,s=t(e.currentTarget),r=t(this.inputTrueClass,s),a=t(this.inputFalseClass,s),n=r.data(),c=a.data(),h=s.closest(this.wrapperClass);e.initState||this.checkedRadio(r,a,r[0].checked),i=r[0].checked,jQuery.isEmptyObject(n)||t("."+n.slave,h)[i?"removeClass":"addClass"]("hide"),jQuery.isEmptyObject(c)||t("."+c.slave,h)[i?"addClass":"removeClass"]("hide")},checkedRadio:function(t,e,i){t.attr("checked",i?!1:!0),e.attr("checked",i?!0:!1).trigger("change")}},e.ui_elements.switcher.init()}(jQuery,window.CherryJsCore);
|
1 |
+
!function(t,e){"use strict";e.utilites.namespace("ui_elements.switcher"),e.ui_elements.switcher={switcherClass:".cherry-switcher-wrap",inputTrueClass:".cherry-input-switcher-true",inputFalseClass:".cherry-input-switcher-false",containerClass:".cherry-ui-container",wrapperClass:".widget, .postbox, .cherry-form, .cherry-ui-repeater-item",init:function(){t(document).on("ready.cherry-ui-elements-init",this.addEvent.bind(this)).on("cherry-ui-elements-init",this.initState.bind(this))},addEvent:function(){t("body").on("click",this.switcherClass,this.switchState.bind(this)),this.initState()},initState:function(){for(var e,i=t(this.switcherClass),s=i.length-1;s>=0;s--)e=t(i[s]),this.switchState({currentTarget:e,initState:!0})},switchState:function(e){var i,s=t(e.currentTarget),r=t(this.inputTrueClass,s),a=t(this.inputFalseClass,s),n=r.data(),c=a.data(),h=s.closest(this.wrapperClass);e.initState||this.checkedRadio(r,a,r[0].checked),i=r[0].checked,jQuery.isEmptyObject(n)||t("."+n.slave,h)[i?"removeClass":"addClass"]("hide"),jQuery.isEmptyObject(c)||t("."+c.slave,h)[i?"addClass":"removeClass"]("hide")},checkedRadio:function(t,e,i){t.attr("checked",i?!1:!0),e.attr("checked",i?!0:!1).trigger("change")}},e.ui_elements.switcher.init()}(jQuery,window.CherryJsCore);
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-switcher/assets/ui-kit/_mixins.scss
DELETED
@@ -1,182 +0,0 @@
|
|
1 |
-
@mixin button_base() {
|
2 |
-
display: inline-block;
|
3 |
-
text-decoration: none;
|
4 |
-
font-size: 12px;
|
5 |
-
line-height: 20px;
|
6 |
-
font-weight: bold;
|
7 |
-
padding: 15px 20px;
|
8 |
-
color: #fff;
|
9 |
-
text-transform: uppercase;
|
10 |
-
border-radius: $border_radius_small;
|
11 |
-
transition: all 200ms linear;
|
12 |
-
box-shadow: $box_shadow;
|
13 |
-
&:hover {
|
14 |
-
color: #fff;
|
15 |
-
box-shadow: none;
|
16 |
-
}
|
17 |
-
&:focus,
|
18 |
-
&:active {
|
19 |
-
outline: none;
|
20 |
-
box-shadow: none;
|
21 |
-
color: #fff;
|
22 |
-
}
|
23 |
-
}
|
24 |
-
|
25 |
-
@mixin button_normal() {
|
26 |
-
background: $dark_color_2;
|
27 |
-
&:hover {
|
28 |
-
background: $dark_color_2_h;
|
29 |
-
}
|
30 |
-
}
|
31 |
-
|
32 |
-
@mixin button_primary() {
|
33 |
-
background: $blue_color;
|
34 |
-
&:hover {
|
35 |
-
background: $blue_color_h;
|
36 |
-
}
|
37 |
-
}
|
38 |
-
|
39 |
-
@mixin button_success() {
|
40 |
-
background: $green_color;
|
41 |
-
&:hover {
|
42 |
-
background: $green_color_h;
|
43 |
-
}
|
44 |
-
}
|
45 |
-
|
46 |
-
@mixin button_danger() {
|
47 |
-
background: $red_color;
|
48 |
-
&:hover {
|
49 |
-
background: $red_color_h;
|
50 |
-
}
|
51 |
-
}
|
52 |
-
|
53 |
-
@mixin button_warning() {
|
54 |
-
background: $orange_color;
|
55 |
-
&:hover {
|
56 |
-
background: $orange_color_h;
|
57 |
-
}
|
58 |
-
}
|
59 |
-
|
60 |
-
@mixin input() {
|
61 |
-
font-size: 14px;
|
62 |
-
line-height: 20px;
|
63 |
-
color: $dark_color_1;
|
64 |
-
background-color: $grey_color_3;
|
65 |
-
border-radius: $border_radius_extra_small;
|
66 |
-
padding: 10px 20px;
|
67 |
-
height: 50px;
|
68 |
-
border: 1px solid $grey_color_3;
|
69 |
-
box-shadow: none;
|
70 |
-
&:focus{
|
71 |
-
border-color: rgba(72,197,105,.6);
|
72 |
-
box-shadow: 0 0 2px rgba(72,197,105,.6);
|
73 |
-
}
|
74 |
-
}
|
75 |
-
|
76 |
-
@mixin button_icon( $icon ) {
|
77 |
-
content: $icon;
|
78 |
-
display: inline-block;
|
79 |
-
font-family: dashicons;
|
80 |
-
font-size: 16px;
|
81 |
-
font-style: normal;
|
82 |
-
font-weight: 400;
|
83 |
-
height: 18px;
|
84 |
-
line-height: 18px;
|
85 |
-
text-align: center;
|
86 |
-
text-decoration: inherit;
|
87 |
-
transition: all 200ms linear;
|
88 |
-
vertical-align: middle;
|
89 |
-
}
|
90 |
-
|
91 |
-
@mixin button_icon_before( $icon ) {
|
92 |
-
&:before {
|
93 |
-
@include button_icon( $icon );
|
94 |
-
padding: 0 5px 0 0;
|
95 |
-
}
|
96 |
-
}
|
97 |
-
|
98 |
-
@mixin button_icon_after( $icon ) {
|
99 |
-
&:after {
|
100 |
-
@include button_icon( $icon );
|
101 |
-
padding: 0 0 0 5px;
|
102 |
-
}
|
103 |
-
}
|
104 |
-
|
105 |
-
@mixin button_icon_middle( $icon ) {
|
106 |
-
&:before {
|
107 |
-
@include button_icon( $icon );
|
108 |
-
margin: 0 -5px;
|
109 |
-
}
|
110 |
-
}
|
111 |
-
|
112 |
-
@mixin link() {
|
113 |
-
display: inline-block;
|
114 |
-
text-decoration: none;
|
115 |
-
font-size: 12px;
|
116 |
-
line-height: 20px;
|
117 |
-
font-weight: bold;
|
118 |
-
color: $blue_color;
|
119 |
-
text-transform: uppercase;
|
120 |
-
transition: all 200ms linear;
|
121 |
-
&:hover {
|
122 |
-
color: $dark_color_1;
|
123 |
-
box-shadow: none;
|
124 |
-
}
|
125 |
-
&:focus,
|
126 |
-
&:active {
|
127 |
-
outline: none;
|
128 |
-
box-shadow: none;
|
129 |
-
color: $blue_color;
|
130 |
-
}
|
131 |
-
}
|
132 |
-
|
133 |
-
@mixin link_icon_before( $icon ) {
|
134 |
-
&:before {
|
135 |
-
@include button_icon( $icon );
|
136 |
-
padding: 0 5px 0 0;
|
137 |
-
color: $grey_color_4;
|
138 |
-
}
|
139 |
-
&:hover {
|
140 |
-
&:before {
|
141 |
-
color: $blue_color;
|
142 |
-
}
|
143 |
-
}
|
144 |
-
}
|
145 |
-
|
146 |
-
@mixin container() {
|
147 |
-
padding: 30px;
|
148 |
-
border: 2px solid $grey_color_2;
|
149 |
-
background: $grey_color_3;
|
150 |
-
border-radius: $border_radius_large;
|
151 |
-
}
|
152 |
-
|
153 |
-
@mixin container_heading() {
|
154 |
-
margin: -30px -30px 30px -30px;
|
155 |
-
border-radius: $border_radius_large $border_radius_large 0 0;
|
156 |
-
border-bottom: 1px solid $grey_color_2;
|
157 |
-
padding: 20px 30px;
|
158 |
-
font-weight: bold;
|
159 |
-
font-size: 16px;
|
160 |
-
line-height: 18px;
|
161 |
-
text-align: center;
|
162 |
-
background: #fff;
|
163 |
-
}
|
164 |
-
|
165 |
-
@mixin box() {
|
166 |
-
margin: 0 0 30px;
|
167 |
-
padding: 20px;
|
168 |
-
background: #fff;
|
169 |
-
box-shadow: $box_shadow_box;
|
170 |
-
border-radius: $border_radius;
|
171 |
-
}
|
172 |
-
|
173 |
-
@mixin box_heading() {
|
174 |
-
margin: -20px -20px 20px -20px;
|
175 |
-
border-radius: $border_radius_small $border_radius_small 0 0;
|
176 |
-
border-bottom: 1px solid $grey_color_2;
|
177 |
-
padding: 20px 30px;
|
178 |
-
font-weight: bold;
|
179 |
-
font-size: 16px;
|
180 |
-
line-height: 18px;
|
181 |
-
background: #fff;
|
182 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-switcher/assets/ui-kit/_variables.scss
CHANGED
@@ -1,23 +1,15 @@
|
|
1 |
-
$
|
2 |
-
$
|
3 |
-
$dark_color_2_h: #393f45;
|
4 |
-
$grey_color_1: #96989a;
|
5 |
-
$grey_color_2: #e5e5e5;
|
6 |
-
$grey_color_3: #f1f1f1;
|
7 |
-
$grey_color_4: #b4b7ba;
|
8 |
-
$blue_color: #298ffc;
|
9 |
-
$blue_color_h: #206ff4;
|
10 |
-
$green_color: #48c569;
|
11 |
-
$green_color_h: #3ba956;
|
12 |
-
$red_color: #e54343;
|
13 |
-
$red_color_h: #c73434;
|
14 |
-
$orange_color: #faa730;
|
15 |
-
$orange_color_h: #ee8425;
|
16 |
|
17 |
-
$
|
18 |
-
$
|
19 |
-
$border_radius_medium: 6px;
|
20 |
-
$border_radius_large: 8px;
|
21 |
|
22 |
-
$
|
23 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
$light_color: #ffffff;
|
2 |
+
$dark_color: #23282d;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
4 |
+
$switcher_bg_color: #f1f1f1;
|
5 |
+
$switcher_border_color: #dcdcdc;
|
|
|
|
|
6 |
|
7 |
+
$true_state_gradint_1: #71e18f;
|
8 |
+
$true_state_gradint_2: #49c66a;
|
9 |
+
$true_state_outset_1: #43b05f;
|
10 |
+
$true_state_outset_2: #3b9b54;
|
11 |
+
|
12 |
+
$false_state_gradint_1: #f98888;
|
13 |
+
$false_state_gradint_2: #e64545;
|
14 |
+
$false_state_outset_1: #e54545;
|
15 |
+
$false_state_outset_2: #c13b3b;
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-switcher/assets/ui-switcher.js
CHANGED
@@ -10,7 +10,7 @@
|
|
10 |
inputTrueClass: '.cherry-input-switcher-true',
|
11 |
inputFalseClass: '.cherry-input-switcher-false',
|
12 |
containerClass: '.cherry-ui-container',
|
13 |
-
wrapperClass: '.widget, .postbox, .cherry-form',
|
14 |
|
15 |
init: function () {
|
16 |
$( document )
|
10 |
inputTrueClass: '.cherry-input-switcher-true',
|
11 |
inputFalseClass: '.cherry-input-switcher-false',
|
12 |
containerClass: '.cherry-ui-container',
|
13 |
+
wrapperClass: '.widget, .postbox, .cherry-form, .cherry-ui-repeater-item',
|
14 |
|
15 |
init: function () {
|
16 |
$( document )
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-switcher/assets/ui-switcher.scss
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
@import "ui-kit/variables";
|
2 |
-
@import "ui-kit/mixins";
|
3 |
|
4 |
.cherry-ui-container{
|
5 |
margin: 10px 0 20px 0;
|
@@ -12,26 +11,25 @@ label.cherry-label{
|
|
12 |
display: none !important;
|
13 |
}
|
14 |
.cherry-switcher-wrap{
|
15 |
-
height:
|
16 |
border-radius: 25px;
|
17 |
display: inline-block;
|
18 |
overflow: hidden;
|
19 |
position: relative;
|
20 |
cursor: pointer;
|
21 |
user-select: none;
|
|
|
22 |
label{
|
23 |
-
|
24 |
-
background-color: $red_color;
|
25 |
display: block;
|
26 |
float: left;
|
27 |
transition: all 0.4s ease;
|
28 |
span{
|
29 |
font-size: 12px;
|
30 |
-
line-height:
|
31 |
-
font-weight:
|
32 |
text-transform: uppercase;
|
33 |
-
color:
|
34 |
-
padding: 15px;
|
35 |
text-align: center;
|
36 |
display: block;
|
37 |
opacity: 1;
|
@@ -39,40 +37,55 @@ label.cherry-label{
|
|
39 |
}
|
40 |
}
|
41 |
.sw-enable{
|
|
|
42 |
span{
|
43 |
opacity: 0;
|
44 |
}
|
45 |
}
|
46 |
.sw-disable{
|
|
|
47 |
span{
|
48 |
opacity: 1;
|
49 |
}
|
50 |
}
|
51 |
.state-marker{
|
52 |
-
background-color:
|
53 |
display: block;
|
54 |
position: absolute;
|
55 |
width: 41px;
|
56 |
height: 41px;
|
57 |
-
margin:
|
58 |
top: 0;
|
59 |
left: 0;
|
60 |
margin-left: 4px;
|
61 |
border-radius: 25px;
|
|
|
|
|
|
|
62 |
transition: all 0.4s cubic-bezier(0.77, 0, 0.175, 1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
}
|
64 |
.cherry-input-switcher{
|
65 |
display: none;
|
66 |
}
|
67 |
.cherry-input-switcher-true:checked{
|
68 |
~ .sw-enable{
|
69 |
-
background-color: $green_color;
|
70 |
span{
|
71 |
opacity: 1;
|
72 |
}
|
73 |
}
|
74 |
~ .sw-disable{
|
75 |
-
background-color: $green_color;
|
76 |
span{
|
77 |
opacity: 0;
|
78 |
}
|
@@ -80,13 +93,16 @@ label.cherry-label{
|
|
80 |
~ .state-marker{
|
81 |
left: 100%;
|
82 |
margin-left: -45px;
|
|
|
|
|
83 |
}
|
84 |
}
|
85 |
|
86 |
&.size-small{
|
87 |
-
height:
|
88 |
label{
|
89 |
-
height:
|
|
|
90 |
span{
|
91 |
font-size: 10px;
|
92 |
line-height: 15px;
|
1 |
@import "ui-kit/variables";
|
|
|
2 |
|
3 |
.cherry-ui-container{
|
4 |
margin: 10px 0 20px 0;
|
11 |
display: none !important;
|
12 |
}
|
13 |
.cherry-switcher-wrap{
|
14 |
+
height: 47px;
|
15 |
border-radius: 25px;
|
16 |
display: inline-block;
|
17 |
overflow: hidden;
|
18 |
position: relative;
|
19 |
cursor: pointer;
|
20 |
user-select: none;
|
21 |
+
border: 1px solid $switcher_border_color;
|
22 |
label{
|
23 |
+
background-color: $switcher_bg_color;
|
|
|
24 |
display: block;
|
25 |
float: left;
|
26 |
transition: all 0.4s ease;
|
27 |
span{
|
28 |
font-size: 12px;
|
29 |
+
line-height: 18px;
|
30 |
+
font-weight: 900;
|
31 |
text-transform: uppercase;
|
32 |
+
color: $dark_color;
|
|
|
33 |
text-align: center;
|
34 |
display: block;
|
35 |
opacity: 1;
|
37 |
}
|
38 |
}
|
39 |
.sw-enable{
|
40 |
+
padding: 15px 10px 15px 20px;
|
41 |
span{
|
42 |
opacity: 0;
|
43 |
}
|
44 |
}
|
45 |
.sw-disable{
|
46 |
+
padding: 15px 20px 15px 10px;
|
47 |
span{
|
48 |
opacity: 1;
|
49 |
}
|
50 |
}
|
51 |
.state-marker{
|
52 |
+
background-color: $false_state_gradint_2;
|
53 |
display: block;
|
54 |
position: absolute;
|
55 |
width: 41px;
|
56 |
height: 41px;
|
57 |
+
margin: 3px;
|
58 |
top: 0;
|
59 |
left: 0;
|
60 |
margin-left: 4px;
|
61 |
border-radius: 25px;
|
62 |
+
border-style: solid;
|
63 |
+
border-width: 1px;
|
64 |
+
border-color: $false_state_outset_1 $false_state_outset_2 $false_state_outset_2 $false_state_outset_1;
|
65 |
transition: all 0.4s cubic-bezier(0.77, 0, 0.175, 1);
|
66 |
+
box-sizing: border-box;
|
67 |
+
&:before {
|
68 |
+
position: absolute;
|
69 |
+
display: block;
|
70 |
+
width: 100%;
|
71 |
+
height: 100%;
|
72 |
+
top: 0;
|
73 |
+
left: 0;
|
74 |
+
border-radius: 50%;
|
75 |
+
background-image: linear-gradient(180deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 100%);
|
76 |
+
content: '';
|
77 |
+
}
|
78 |
}
|
79 |
.cherry-input-switcher{
|
80 |
display: none;
|
81 |
}
|
82 |
.cherry-input-switcher-true:checked{
|
83 |
~ .sw-enable{
|
|
|
84 |
span{
|
85 |
opacity: 1;
|
86 |
}
|
87 |
}
|
88 |
~ .sw-disable{
|
|
|
89 |
span{
|
90 |
opacity: 0;
|
91 |
}
|
93 |
~ .state-marker{
|
94 |
left: 100%;
|
95 |
margin-left: -45px;
|
96 |
+
border-color: $true_state_outset_1 $true_state_outset_2 $true_state_outset_2 $true_state_outset_1;
|
97 |
+
background-color: $true_state_gradint_2;
|
98 |
}
|
99 |
}
|
100 |
|
101 |
&.size-small{
|
102 |
+
height: 23px;
|
103 |
label{
|
104 |
+
height: 23px;
|
105 |
+
padding: 0;
|
106 |
span{
|
107 |
font-size: 10px;
|
108 |
line-height: 15px;
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-switcher/ui-switcher.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
* @author Cherry Team <support@cherryframework.com>
|
8 |
* @copyright Copyright (c) 2012 - 2015, Cherry Team
|
9 |
* @link http://www.cherryframework.com/
|
10 |
-
* @license http://www.gnu.org/licenses/
|
11 |
*/
|
12 |
|
13 |
// If this file is called directly, abort.
|
@@ -23,29 +23,31 @@ if ( ! class_exists( 'UI_Switcher' ) ) {
|
|
23 |
class UI_Switcher extends UI_Element implements I_UI {
|
24 |
|
25 |
/**
|
26 |
-
* Default settings
|
27 |
*
|
|
|
28 |
* @var array
|
29 |
*/
|
30 |
private $defaults_settings = array(
|
31 |
-
'id'
|
32 |
-
'name'
|
33 |
-
'value'
|
34 |
-
'toggle'
|
35 |
-
'true_toggle'
|
36 |
-
'false_toggle'
|
37 |
-
'true_slave'
|
38 |
-
'false_slave'
|
39 |
),
|
40 |
-
'style'
|
41 |
-
'label'
|
42 |
-
'class'
|
43 |
-
'master'
|
44 |
);
|
|
|
45 |
/**
|
46 |
* Constructor method for the UI_Switcher class.
|
47 |
*
|
48 |
-
* @since
|
49 |
*/
|
50 |
function __construct( $args = array() ) {
|
51 |
$this->defaults_settings['id'] = 'cherry-ui-swither-' . uniqid();
|
@@ -57,7 +59,7 @@ if ( ! class_exists( 'UI_Switcher' ) ) {
|
|
57 |
/**
|
58 |
* Render html UI_Switcher.
|
59 |
*
|
60 |
-
* @since
|
61 |
*/
|
62 |
public function render() {
|
63 |
$data_slave_true = ( ! empty( $this->settings['toggle']['true_slave'] ) ) ? 'data-slave="' . $this->settings['toggle']['true_slave'] . '" ' : '';
|
@@ -90,21 +92,22 @@ if ( ! class_exists( 'UI_Switcher' ) ) {
|
|
90 |
/**
|
91 |
* Enqueue javascript and stylesheet UI_Switcher.
|
92 |
*
|
93 |
-
* @since
|
94 |
*/
|
95 |
public static function enqueue_assets() {
|
96 |
wp_enqueue_script(
|
97 |
'ui-switcher-min',
|
98 |
esc_url( Cherry_Core::base_url( 'assets/min/ui-switcher.min.js', __FILE__ ) ),
|
99 |
array( 'jquery' ),
|
100 |
-
'1.
|
101 |
true
|
102 |
);
|
|
|
103 |
wp_enqueue_style(
|
104 |
'ui-switcher-min',
|
105 |
esc_url( Cherry_Core::base_url( 'assets/min/ui-switcher.min.css', __FILE__ ) ),
|
106 |
array(),
|
107 |
-
'1.
|
108 |
'all'
|
109 |
);
|
110 |
}
|
7 |
* @author Cherry Team <support@cherryframework.com>
|
8 |
* @copyright Copyright (c) 2012 - 2015, Cherry Team
|
9 |
* @link http://www.cherryframework.com/
|
10 |
+
* @license http://www.gnu.org/licenses/gpl-3.0.en.html
|
11 |
*/
|
12 |
|
13 |
// If this file is called directly, abort.
|
23 |
class UI_Switcher extends UI_Element implements I_UI {
|
24 |
|
25 |
/**
|
26 |
+
* Default settings.
|
27 |
*
|
28 |
+
* @since 1.0.0
|
29 |
* @var array
|
30 |
*/
|
31 |
private $defaults_settings = array(
|
32 |
+
'id' => 'cherry-ui-swither-id',
|
33 |
+
'name' => 'cherry-ui-swither-name',
|
34 |
+
'value' => 'true',
|
35 |
+
'toggle' => array(
|
36 |
+
'true_toggle' => 'On',
|
37 |
+
'false_toggle' => 'Off',
|
38 |
+
'true_slave' => '',
|
39 |
+
'false_slave' => '',
|
40 |
),
|
41 |
+
'style' => 'normal',
|
42 |
+
'label' => '',
|
43 |
+
'class' => '',
|
44 |
+
'master' => '',
|
45 |
);
|
46 |
+
|
47 |
/**
|
48 |
* Constructor method for the UI_Switcher class.
|
49 |
*
|
50 |
+
* @since 1.0.0
|
51 |
*/
|
52 |
function __construct( $args = array() ) {
|
53 |
$this->defaults_settings['id'] = 'cherry-ui-swither-' . uniqid();
|
59 |
/**
|
60 |
* Render html UI_Switcher.
|
61 |
*
|
62 |
+
* @since 1.0.0
|
63 |
*/
|
64 |
public function render() {
|
65 |
$data_slave_true = ( ! empty( $this->settings['toggle']['true_slave'] ) ) ? 'data-slave="' . $this->settings['toggle']['true_slave'] . '" ' : '';
|
92 |
/**
|
93 |
* Enqueue javascript and stylesheet UI_Switcher.
|
94 |
*
|
95 |
+
* @since 1.0.0
|
96 |
*/
|
97 |
public static function enqueue_assets() {
|
98 |
wp_enqueue_script(
|
99 |
'ui-switcher-min',
|
100 |
esc_url( Cherry_Core::base_url( 'assets/min/ui-switcher.min.js', __FILE__ ) ),
|
101 |
array( 'jquery' ),
|
102 |
+
'1.3.2',
|
103 |
true
|
104 |
);
|
105 |
+
|
106 |
wp_enqueue_style(
|
107 |
'ui-switcher-min',
|
108 |
esc_url( Cherry_Core::base_url( 'assets/min/ui-switcher.min.css', __FILE__ ) ),
|
109 |
array(),
|
110 |
+
'1.3.2',
|
111 |
'all'
|
112 |
);
|
113 |
}
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-text/assets/min/ui-text.min.css
CHANGED
@@ -1,20 +1 @@
|
|
1 |
-
.cherry-ui-container {
|
2 |
-
margin: 10px 0 20px 0; }
|
3 |
-
|
4 |
-
label.cherry-label {
|
5 |
-
margin: 0 0 5px 0;
|
6 |
-
display: block; }
|
7 |
-
|
8 |
-
input.cherry-ui-text {
|
9 |
-
font-size: 14px;
|
10 |
-
line-height: 20px;
|
11 |
-
color: #23282d;
|
12 |
-
background-color: #f1f1f1;
|
13 |
-
border-radius: 2px;
|
14 |
-
padding: 10px 20px;
|
15 |
-
min-height: 50px;
|
16 |
-
border: 1px solid #f1f1f1;
|
17 |
-
box-shadow: none; }
|
18 |
-
input.cherry-ui-text:focus {
|
19 |
-
border-color: rgba(72, 197, 105, 0.6);
|
20 |
-
box-shadow: 0 0 2px rgba(72, 197, 105, 0.6); }
|
1 |
+
.cherry-ui-container{margin:10px 0 20px 0}label.cherry-label{margin:0 0 5px 0;display:block}input.cherry-ui-text{font-size:14px;line-height:20px;color:#23282d;background-color:#f1f1f1;border-radius:2px;padding:10px 20px;min-height:50px;border:1px solid #dcdcdc;box-shadow:none}input.cherry-ui-text:focus{border-color:rgba(41,143,252,0.6);box-shadow:0 0 2px rgba(41,143,252,0.6)}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-text/assets/ui-kit/_mixins.scss
CHANGED
@@ -1,182 +1,15 @@
|
|
1 |
-
@mixin button_base() {
|
2 |
-
display: inline-block;
|
3 |
-
text-decoration: none;
|
4 |
-
font-size: 12px;
|
5 |
-
line-height: 20px;
|
6 |
-
font-weight: bold;
|
7 |
-
padding: 15px 20px;
|
8 |
-
color: #fff;
|
9 |
-
text-transform: uppercase;
|
10 |
-
border-radius: $border_radius_small;
|
11 |
-
transition: all 200ms linear;
|
12 |
-
box-shadow: $box_shadow;
|
13 |
-
&:hover {
|
14 |
-
color: #fff;
|
15 |
-
box-shadow: none;
|
16 |
-
}
|
17 |
-
&:focus,
|
18 |
-
&:active {
|
19 |
-
outline: none;
|
20 |
-
box-shadow: none;
|
21 |
-
color: #fff;
|
22 |
-
}
|
23 |
-
}
|
24 |
-
|
25 |
-
@mixin button_normal() {
|
26 |
-
background: $dark_color_2;
|
27 |
-
&:hover {
|
28 |
-
background: $dark_color_2_h;
|
29 |
-
}
|
30 |
-
}
|
31 |
-
|
32 |
-
@mixin button_primary() {
|
33 |
-
background: $blue_color;
|
34 |
-
&:hover {
|
35 |
-
background: $blue_color_h;
|
36 |
-
}
|
37 |
-
}
|
38 |
-
|
39 |
-
@mixin button_success() {
|
40 |
-
background: $green_color;
|
41 |
-
&:hover {
|
42 |
-
background: $green_color_h;
|
43 |
-
}
|
44 |
-
}
|
45 |
-
|
46 |
-
@mixin button_danger() {
|
47 |
-
background: $red_color;
|
48 |
-
&:hover {
|
49 |
-
background: $red_color_h;
|
50 |
-
}
|
51 |
-
}
|
52 |
-
|
53 |
-
@mixin button_warning() {
|
54 |
-
background: $orange_color;
|
55 |
-
&:hover {
|
56 |
-
background: $orange_color_h;
|
57 |
-
}
|
58 |
-
}
|
59 |
-
|
60 |
@mixin input() {
|
61 |
font-size: 14px;
|
62 |
line-height: 20px;
|
63 |
-
color: $
|
64 |
-
background-color: $
|
65 |
border-radius: $border_radius_extra_small;
|
66 |
padding: 10px 20px;
|
67 |
min-height: 50px;
|
68 |
-
border: 1px solid $
|
69 |
box-shadow: none;
|
70 |
&:focus{
|
71 |
-
border-color: rgba(
|
72 |
-
box-shadow: 0 0 2px rgba(
|
73 |
-
}
|
74 |
-
}
|
75 |
-
|
76 |
-
@mixin button_icon( $icon ) {
|
77 |
-
content: $icon;
|
78 |
-
display: inline-block;
|
79 |
-
font-family: dashicons;
|
80 |
-
font-size: 16px;
|
81 |
-
font-style: normal;
|
82 |
-
font-weight: 400;
|
83 |
-
height: 18px;
|
84 |
-
line-height: 18px;
|
85 |
-
text-align: center;
|
86 |
-
text-decoration: inherit;
|
87 |
-
transition: all 200ms linear;
|
88 |
-
vertical-align: middle;
|
89 |
-
}
|
90 |
-
|
91 |
-
@mixin button_icon_before( $icon ) {
|
92 |
-
&:before {
|
93 |
-
@include button_icon( $icon );
|
94 |
-
padding: 0 5px 0 0;
|
95 |
-
}
|
96 |
-
}
|
97 |
-
|
98 |
-
@mixin button_icon_after( $icon ) {
|
99 |
-
&:after {
|
100 |
-
@include button_icon( $icon );
|
101 |
-
padding: 0 0 0 5px;
|
102 |
-
}
|
103 |
-
}
|
104 |
-
|
105 |
-
@mixin button_icon_middle( $icon ) {
|
106 |
-
&:before {
|
107 |
-
@include button_icon( $icon );
|
108 |
-
margin: 0 -5px;
|
109 |
-
}
|
110 |
-
}
|
111 |
-
|
112 |
-
@mixin link() {
|
113 |
-
display: inline-block;
|
114 |
-
text-decoration: none;
|
115 |
-
font-size: 12px;
|
116 |
-
line-height: 20px;
|
117 |
-
font-weight: bold;
|
118 |
-
color: $blue_color;
|
119 |
-
text-transform: uppercase;
|
120 |
-
transition: all 200ms linear;
|
121 |
-
&:hover {
|
122 |
-
color: $dark_color_1;
|
123 |
-
box-shadow: none;
|
124 |
-
}
|
125 |
-
&:focus,
|
126 |
-
&:active {
|
127 |
-
outline: none;
|
128 |
-
box-shadow: none;
|
129 |
-
color: $blue_color;
|
130 |
-
}
|
131 |
-
}
|
132 |
-
|
133 |
-
@mixin link_icon_before( $icon ) {
|
134 |
-
&:before {
|
135 |
-
@include button_icon( $icon );
|
136 |
-
padding: 0 5px 0 0;
|
137 |
-
color: $grey_color_4;
|
138 |
-
}
|
139 |
-
&:hover {
|
140 |
-
&:before {
|
141 |
-
color: $blue_color;
|
142 |
}
|
143 |
-
}
|
144 |
-
}
|
145 |
-
|
146 |
-
@mixin container() {
|
147 |
-
padding: 30px;
|
148 |
-
border: 2px solid $grey_color_2;
|
149 |
-
background: $grey_color_3;
|
150 |
-
border-radius: $border_radius_large;
|
151 |
-
}
|
152 |
-
|
153 |
-
@mixin container_heading() {
|
154 |
-
margin: -30px -30px 30px -30px;
|
155 |
-
border-radius: $border_radius_large $border_radius_large 0 0;
|
156 |
-
border-bottom: 1px solid $grey_color_2;
|
157 |
-
padding: 20px 30px;
|
158 |
-
font-weight: bold;
|
159 |
-
font-size: 16px;
|
160 |
-
line-height: 18px;
|
161 |
-
text-align: center;
|
162 |
-
background: #fff;
|
163 |
-
}
|
164 |
-
|
165 |
-
@mixin box() {
|
166 |
-
margin: 0 0 30px;
|
167 |
-
padding: 20px;
|
168 |
-
background: #fff;
|
169 |
-
box-shadow: $box_shadow_box;
|
170 |
-
border-radius: $border_radius;
|
171 |
}
|
172 |
-
|
173 |
-
@mixin box_heading() {
|
174 |
-
margin: -20px -20px 20px -20px;
|
175 |
-
border-radius: $border_radius_small $border_radius_small 0 0;
|
176 |
-
border-bottom: 1px solid $grey_color_2;
|
177 |
-
padding: 20px 30px;
|
178 |
-
font-weight: bold;
|
179 |
-
font-size: 16px;
|
180 |
-
line-height: 18px;
|
181 |
-
background: #fff;
|
182 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
@mixin input() {
|
2 |
font-size: 14px;
|
3 |
line-height: 20px;
|
4 |
+
color: $dark_color;
|
5 |
+
background-color: $bg_color;
|
6 |
border-radius: $border_radius_extra_small;
|
7 |
padding: 10px 20px;
|
8 |
min-height: 50px;
|
9 |
+
border: 1px solid $border_color;
|
10 |
box-shadow: none;
|
11 |
&:focus{
|
12 |
+
border-color: rgba(41, 143, 252, .6);
|
13 |
+
box-shadow: 0 0 2px rgba(41, 143, 252, .6);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-text/assets/ui-kit/_variables.scss
CHANGED
@@ -1,23 +1,7 @@
|
|
1 |
-
$
|
2 |
-
$
|
3 |
-
$dark_color_2_h: #393f45;
|
4 |
-
$grey_color_1: #96989a;
|
5 |
-
$grey_color_2: #e5e5e5;
|
6 |
-
$grey_color_3: #f1f1f1;
|
7 |
-
$grey_color_4: #b4b7ba;
|
8 |
-
$blue_color: #298ffc;
|
9 |
-
$blue_color_h: #206ff4;
|
10 |
-
$green_color: #48c569;
|
11 |
-
$green_color_h: #3ba956;
|
12 |
-
$red_color: #e54343;
|
13 |
-
$red_color_h: #c73434;
|
14 |
-
$orange_color: #faa730;
|
15 |
-
$orange_color_h: #ee8425;
|
16 |
|
17 |
-
$
|
18 |
-
$
|
19 |
-
$border_radius_medium: 6px;
|
20 |
-
$border_radius_large: 8px;
|
21 |
|
22 |
-
$
|
23 |
-
$box_shadow_box: 0 8px 21px rgba(0,0,0,.1);
|
1 |
+
$light_color: #ffffff;
|
2 |
+
$dark_color: #23282d;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
4 |
+
$bg_color: #f1f1f1;
|
5 |
+
$border_color: #dcdcdc;
|
|
|
|
|
6 |
|
7 |
+
$border_radius_extra_small: 2px;
|
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-text/assets/ui-text.scss
CHANGED
@@ -10,4 +10,4 @@ label.cherry-label{
|
|
10 |
}
|
11 |
input.cherry-ui-text{
|
12 |
@include input();
|
13 |
-
}
|
10 |
}
|
11 |
input.cherry-ui-text{
|
12 |
@include input();
|
13 |
+
}
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-text/ui-text.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
* @author Cherry Team <support@cherryframework.com>
|
8 |
* @copyright Copyright (c) 2012 - 2015, Cherry Team
|
9 |
* @link http://www.cherryframework.com/
|
10 |
-
* @license http://www.gnu.org/licenses/
|
11 |
*/
|
12 |
|
13 |
// If this file is called directly, abort.
|
@@ -23,26 +23,27 @@ if ( ! class_exists( 'UI_Text' ) ) {
|
|
23 |
class UI_Text extends UI_Element implements I_UI {
|
24 |
|
25 |
/**
|
26 |
-
* Default settings
|
27 |
*
|
|
|
28 |
* @var array
|
29 |
*/
|
30 |
private $defaults_settings = array(
|
31 |
-
'type'
|
32 |
-
'id'
|
33 |
-
'name'
|
34 |
-
'value'
|
35 |
-
'placeholder'
|
36 |
-
'label'
|
37 |
-
'class'
|
38 |
-
'master'
|
39 |
-
'required'
|
40 |
);
|
41 |
|
42 |
/**
|
43 |
* Constructor method for the UI_Text class.
|
44 |
*
|
45 |
-
* @since
|
46 |
*/
|
47 |
function __construct( $args = array() ) {
|
48 |
$this->defaults_settings['id'] = 'cherry-ui-input-text-' . uniqid();
|
@@ -52,21 +53,24 @@ if ( ! class_exists( 'UI_Text' ) ) {
|
|
52 |
}
|
53 |
|
54 |
/**
|
55 |
-
* Get required attribute
|
56 |
*
|
57 |
-
* @
|
|
|
58 |
*/
|
59 |
public function get_required() {
|
|
|
60 |
if ( $this->settings['required'] ) {
|
61 |
return 'required="required"';
|
62 |
}
|
|
|
63 |
return '';
|
64 |
}
|
65 |
|
66 |
/**
|
67 |
* Render html UI_Text.
|
68 |
*
|
69 |
-
* @since
|
70 |
*/
|
71 |
public function render() {
|
72 |
$html = '';
|
@@ -83,17 +87,16 @@ if ( ! class_exists( 'UI_Text' ) ) {
|
|
83 |
}
|
84 |
|
85 |
/**
|
86 |
-
* Enqueue javascript and stylesheet UI_Text
|
87 |
*
|
88 |
-
* @since
|
89 |
*/
|
90 |
public static function enqueue_assets() {
|
91 |
-
|
92 |
wp_enqueue_style(
|
93 |
'ui-text',
|
94 |
esc_url( Cherry_Core::base_url( 'assets/min/ui-text.min.css', __FILE__ ) ),
|
95 |
array(),
|
96 |
-
'1.
|
97 |
'all'
|
98 |
);
|
99 |
}
|
7 |
* @author Cherry Team <support@cherryframework.com>
|
8 |
* @copyright Copyright (c) 2012 - 2015, Cherry Team
|
9 |
* @link http://www.cherryframework.com/
|
10 |
+
* @license http://www.gnu.org/licenses/gpl-3.0.en.html
|
11 |
*/
|
12 |
|
13 |
// If this file is called directly, abort.
|
23 |
class UI_Text extends UI_Element implements I_UI {
|
24 |
|
25 |
/**
|
26 |
+
* Default settings.
|
27 |
*
|
28 |
+
* @since 1.0.0
|
29 |
* @var array
|
30 |
*/
|
31 |
private $defaults_settings = array(
|
32 |
+
'type' => 'text',
|
33 |
+
'id' => 'cherry-ui-input-id',
|
34 |
+
'name' => 'cherry-ui-input-name',
|
35 |
+
'value' => '',
|
36 |
+
'placeholder' => '',
|
37 |
+
'label' => '',
|
38 |
+
'class' => '',
|
39 |
+
'master' => '',
|
40 |
+
'required' => false,
|
41 |
);
|
42 |
|
43 |
/**
|
44 |
* Constructor method for the UI_Text class.
|
45 |
*
|
46 |
+
* @since 1.0.0
|
47 |
*/
|
48 |
function __construct( $args = array() ) {
|
49 |
$this->defaults_settings['id'] = 'cherry-ui-input-text-' . uniqid();
|
53 |
}
|
54 |
|
55 |
/**
|
56 |
+
* Get required attribute.
|
57 |
*
|
58 |
+
* @since 1.0.0
|
59 |
+
* @return string
|
60 |
*/
|
61 |
public function get_required() {
|
62 |
+
|
63 |
if ( $this->settings['required'] ) {
|
64 |
return 'required="required"';
|
65 |
}
|
66 |
+
|
67 |
return '';
|
68 |
}
|
69 |
|
70 |
/**
|
71 |
* Render html UI_Text.
|
72 |
*
|
73 |
+
* @since 1.0.0
|
74 |
*/
|
75 |
public function render() {
|
76 |
$html = '';
|
87 |
}
|
88 |
|
89 |
/**
|
90 |
+
* Enqueue javascript and stylesheet UI_Text.
|
91 |
*
|
92 |
+
* @since 1.0.0
|
93 |
*/
|
94 |
public static function enqueue_assets() {
|
|
|
95 |
wp_enqueue_style(
|
96 |
'ui-text',
|
97 |
esc_url( Cherry_Core::base_url( 'assets/min/ui-text.min.css', __FILE__ ) ),
|
98 |
array(),
|
99 |
+
'1.3.2',
|
100 |
'all'
|
101 |
);
|
102 |
}
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-textarea/assets/min/ui-textarea.min.css
CHANGED
@@ -1,22 +1 @@
|
|
1 |
-
.cherry-ui-container {
|
2 |
-
margin: 10px 0 20px 0; }
|
3 |
-
|
4 |
-
label.cherry-label {
|
5 |
-
margin: 0 0 5px 0;
|
6 |
-
display: block; }
|
7 |
-
|
8 |
-
textarea.cherry-ui-textarea {
|
9 |
-
width: 100%;
|
10 |
-
font-size: 14px;
|
11 |
-
line-height: 20px;
|
12 |
-
color: #23282d;
|
13 |
-
background-color: #f1f1f1;
|
14 |
-
border-radius: 2px;
|
15 |
-
padding: 10px 20px;
|
16 |
-
min-height: 50px;
|
17 |
-
border: 1px solid #f1f1f1;
|
18 |
-
box-shadow: none;
|
19 |
-
height: 200px; }
|
20 |
-
textarea.cherry-ui-textarea:focus {
|
21 |
-
border-color: rgba(72, 197, 105, 0.6);
|
22 |
-
box-shadow: 0 0 2px rgba(72, 197, 105, 0.6); }
|
1 |
+
.cherry-ui-container{margin:10px 0 20px 0}label.cherry-label{margin:0 0 5px 0;display:block}textarea.cherry-ui-textarea{width:100%;font-size:14px;line-height:20px;color:#23282d;background-color:#f1f1f1;border-radius:2px;padding:10px 20px;min-height:50px;border:1px solid #dcdcdc;box-shadow:none;height:200px}textarea.cherry-ui-textarea:focus{border-color:rgba(41,143,252,0.6);box-shadow:0 0 2px rgba(41,143,252,0.6)}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-textarea/assets/ui-kit/_mixins.scss
CHANGED
@@ -1,182 +1,15 @@
|
|
1 |
-
@mixin button_base() {
|
2 |
-
display: inline-block;
|
3 |
-
text-decoration: none;
|
4 |
-
font-size: 12px;
|
5 |
-
line-height: 20px;
|
6 |
-
font-weight: bold;
|
7 |
-
padding: 15px 20px;
|
8 |
-
color: #fff;
|
9 |
-
text-transform: uppercase;
|
10 |
-
border-radius: $border_radius_small;
|
11 |
-
transition: all 200ms linear;
|
12 |
-
box-shadow: $box_shadow;
|
13 |
-
&:hover {
|
14 |
-
color: #fff;
|
15 |
-
box-shadow: none;
|
16 |
-
}
|
17 |
-
&:focus,
|
18 |
-
&:active {
|
19 |
-
outline: none;
|
20 |
-
box-shadow: none;
|
21 |
-
color: #fff;
|
22 |
-
}
|
23 |
-
}
|
24 |
-
|
25 |
-
@mixin button_normal() {
|
26 |
-
background: $dark_color_2;
|
27 |
-
&:hover {
|
28 |
-
background: $dark_color_2_h;
|
29 |
-
}
|
30 |
-
}
|
31 |
-
|
32 |
-
@mixin button_primary() {
|
33 |
-
background: $blue_color;
|
34 |
-
&:hover {
|
35 |
-
background: $blue_color_h;
|
36 |
-
}
|
37 |
-
}
|
38 |
-
|
39 |
-
@mixin button_success() {
|
40 |
-
background: $green_color;
|
41 |
-
&:hover {
|
42 |
-
background: $green_color_h;
|
43 |
-
}
|
44 |
-
}
|
45 |
-
|
46 |
-
@mixin button_danger() {
|
47 |
-
background: $red_color;
|
48 |
-
&:hover {
|
49 |
-
background: $red_color_h;
|
50 |
-
}
|
51 |
-
}
|
52 |
-
|
53 |
-
@mixin button_warning() {
|
54 |
-
background: $orange_color;
|
55 |
-
&:hover {
|
56 |
-
background: $orange_color_h;
|
57 |
-
}
|
58 |
-
}
|
59 |
-
|
60 |
@mixin input() {
|
61 |
font-size: 14px;
|
62 |
line-height: 20px;
|
63 |
-
color: $
|
64 |
-
background-color: $
|
65 |
border-radius: $border_radius_extra_small;
|
66 |
padding: 10px 20px;
|
67 |
min-height: 50px;
|
68 |
-
border: 1px solid $
|
69 |
box-shadow: none;
|
70 |
&:focus{
|
71 |
-
border-color: rgba(
|
72 |
-
box-shadow: 0 0 2px rgba(
|
73 |
-
}
|
74 |
-
}
|
75 |
-
|
76 |
-
@mixin button_icon( $icon ) {
|
77 |
-
content: $icon;
|
78 |
-
display: inline-block;
|
79 |
-
font-family: dashicons;
|
80 |
-
font-size: 16px;
|
81 |
-
font-style: normal;
|
82 |
-
font-weight: 400;
|
83 |
-
height: 18px;
|
84 |
-
line-height: 18px;
|
85 |
-
text-align: center;
|
86 |
-
text-decoration: inherit;
|
87 |
-
transition: all 200ms linear;
|
88 |
-
vertical-align: middle;
|
89 |
-
}
|
90 |
-
|
91 |
-
@mixin button_icon_before( $icon ) {
|
92 |
-
&:before {
|
93 |
-
@include button_icon( $icon );
|
94 |
-
padding: 0 5px 0 0;
|
95 |
-
}
|
96 |
-
}
|
97 |
-
|
98 |
-
@mixin button_icon_after( $icon ) {
|
99 |
-
&:after {
|
100 |
-
@include button_icon( $icon );
|
101 |
-
padding: 0 0 0 5px;
|
102 |
-
}
|
103 |
-
}
|
104 |
-
|
105 |
-
@mixin button_icon_middle( $icon ) {
|
106 |
-
&:before {
|
107 |
-
@include button_icon( $icon );
|
108 |
-
margin: 0 -5px;
|
109 |
-
}
|
110 |
-
}
|
111 |
-
|
112 |
-
@mixin link() {
|
113 |
-
display: inline-block;
|
114 |
-
text-decoration: none;
|
115 |
-
font-size: 12px;
|
116 |
-
line-height: 20px;
|
117 |
-
font-weight: bold;
|
118 |
-
color: $blue_color;
|
119 |
-
text-transform: uppercase;
|
120 |
-
transition: all 200ms linear;
|
121 |
-
&:hover {
|
122 |
-
color: $dark_color_1;
|
123 |
-
box-shadow: none;
|
124 |
-
}
|
125 |
-
&:focus,
|
126 |
-
&:active {
|
127 |
-
outline: none;
|
128 |
-
box-shadow: none;
|
129 |
-
color: $blue_color;
|
130 |
-
}
|
131 |
-
}
|
132 |
-
|
133 |
-
@mixin link_icon_before( $icon ) {
|
134 |
-
&:before {
|
135 |
-
@include button_icon( $icon );
|
136 |
-
padding: 0 5px 0 0;
|
137 |
-
color: $grey_color_4;
|
138 |
-
}
|
139 |
-
&:hover {
|
140 |
-
&:before {
|
141 |
-
color: $blue_color;
|
142 |
}
|
143 |
-
}
|
144 |
-
}
|
145 |
-
|
146 |
-
@mixin container() {
|
147 |
-
padding: 30px;
|
148 |
-
border: 2px solid $grey_color_2;
|
149 |
-
background: $grey_color_3;
|
150 |
-
border-radius: $border_radius_large;
|
151 |
-
}
|
152 |
-
|
153 |
-
@mixin container_heading() {
|
154 |
-
margin: -30px -30px 30px -30px;
|
155 |
-
border-radius: $border_radius_large $border_radius_large 0 0;
|
156 |
-
border-bottom: 1px solid $grey_color_2;
|
157 |
-
padding: 20px 30px;
|
158 |
-
font-weight: bold;
|
159 |
-
font-size: 16px;
|
160 |
-
line-height: 18px;
|
161 |
-
text-align: center;
|
162 |
-
background: #fff;
|
163 |
-
}
|
164 |
-
|
165 |
-
@mixin box() {
|
166 |
-
margin: 0 0 30px;
|
167 |
-
padding: 20px;
|
168 |
-
background: #fff;
|
169 |
-
box-shadow: $box_shadow_box;
|
170 |
-
border-radius: $border_radius;
|
171 |
}
|
172 |
-
|
173 |
-
@mixin box_heading() {
|
174 |
-
margin: -20px -20px 20px -20px;
|
175 |
-
border-radius: $border_radius_small $border_radius_small 0 0;
|
176 |
-
border-bottom: 1px solid $grey_color_2;
|
177 |
-
padding: 20px 30px;
|
178 |
-
font-weight: bold;
|
179 |
-
font-size: 16px;
|
180 |
-
line-height: 18px;
|
181 |
-
background: #fff;
|
182 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
@mixin input() {
|
2 |
font-size: 14px;
|
3 |
line-height: 20px;
|
4 |
+
color: $dark_color;
|
5 |
+
background-color: $bg_color;
|
6 |
border-radius: $border_radius_extra_small;
|
7 |
padding: 10px 20px;
|
8 |
min-height: 50px;
|
9 |
+
border: 1px solid $border_color;
|
10 |
box-shadow: none;
|
11 |
&:focus{
|
12 |
+
border-color: rgba(41, 143, 252, .6);
|
13 |
+
box-shadow: 0 0 2px rgba(41, 143, 252, .6);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-textarea/assets/ui-kit/_variables.scss
CHANGED
@@ -1,23 +1,7 @@
|
|
1 |
-
$
|
2 |
-
$
|
3 |
-
$dark_color_2_h: #393f45;
|
4 |
-
$grey_color_1: #96989a;
|
5 |
-
$grey_color_2: #e5e5e5;
|
6 |
-
$grey_color_3: #f1f1f1;
|
7 |
-
$grey_color_4: #b4b7ba;
|
8 |
-
$blue_color: #298ffc;
|
9 |
-
$blue_color_h: #206ff4;
|
10 |
-
$green_color: #48c569;
|
11 |
-
$green_color_h: #3ba956;
|
12 |
-
$red_color: #e54343;
|
13 |
-
$red_color_h: #c73434;
|
14 |
-
$orange_color: #faa730;
|
15 |
-
$orange_color_h: #ee8425;
|
16 |
|
17 |
-
$
|
18 |
-
$
|
19 |
-
$border_radius_medium: 6px;
|
20 |
-
$border_radius_large: 8px;
|
21 |
|
22 |
-
$
|
23 |
-
$box_shadow_box: 0 8px 21px rgba(0,0,0,.1);
|
1 |
+
$light_color: #ffffff;
|
2 |
+
$dark_color: #23282d;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
4 |
+
$bg_color: #f1f1f1;
|
5 |
+
$border_color: #dcdcdc;
|
|
|
|
|
6 |
|
7 |
+
$border_radius_extra_small: 2px;
|
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-textarea/assets/ui-textarea.scss
CHANGED
@@ -12,4 +12,4 @@ textarea.cherry-ui-textarea{
|
|
12 |
width: 100%;
|
13 |
@include input();
|
14 |
height: 200px;
|
15 |
-
}
|
12 |
width: 100%;
|
13 |
@include input();
|
14 |
height: 200px;
|
15 |
+
}
|
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-textarea/ui-textarea.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
* @author Cherry Team <support@cherryframework.com>
|
8 |
* @copyright Copyright (c) 2012 - 2015, Cherry Team
|
9 |
* @link http://www.cherryframework.com/
|
10 |
-
* @license http://www.gnu.org/licenses/
|
11 |
*/
|
12 |
|
13 |
// If this file is called directly, abort.
|
@@ -21,27 +21,29 @@ if ( ! class_exists( 'UI_Textarea' ) ) {
|
|
21 |
* Class for the building UI_Textarea elements.
|
22 |
*/
|
23 |
class UI_Textarea extends UI_Element implements I_UI {
|
|
|
24 |
/**
|
25 |
-
* Default settings
|
26 |
*
|
|
|
27 |
* @var array
|
28 |
*/
|
29 |
private $defaults_settings = array(
|
30 |
-
'id'
|
31 |
-
'name'
|
32 |
-
'value'
|
33 |
-
'placeholder'
|
34 |
-
'rows'
|
35 |
-
'cols'
|
36 |
-
'label'
|
37 |
-
'class'
|
38 |
-
'master'
|
39 |
);
|
40 |
|
41 |
/**
|
42 |
* Constructor method for the UI_Textarea class.
|
43 |
*
|
44 |
-
* @since
|
45 |
*/
|
46 |
function __construct( $args = array() ) {
|
47 |
$this->defaults_settings['id'] = 'cherry-ui-textarea-' . uniqid();
|
@@ -53,7 +55,7 @@ if ( ! class_exists( 'UI_Textarea' ) ) {
|
|
53 |
/**
|
54 |
* Render html UI_Textarea.
|
55 |
*
|
56 |
-
* @since
|
57 |
*/
|
58 |
public function render() {
|
59 |
$html = '';
|
@@ -73,14 +75,14 @@ if ( ! class_exists( 'UI_Textarea' ) ) {
|
|
73 |
/**
|
74 |
* Enqueue javascript and stylesheet UI_Textarea
|
75 |
*
|
76 |
-
* @since
|
77 |
*/
|
78 |
public static function enqueue_assets() {
|
79 |
wp_enqueue_style(
|
80 |
'ui-textarea',
|
81 |
esc_url( Cherry_Core::base_url( 'assets/min/ui-textarea.min.css', __FILE__ ) ),
|
82 |
array(),
|
83 |
-
'1.
|
84 |
'all'
|
85 |
);
|
86 |
}
|
7 |
* @author Cherry Team <support@cherryframework.com>
|
8 |
* @copyright Copyright (c) 2012 - 2015, Cherry Team
|
9 |
* @link http://www.cherryframework.com/
|
10 |
+
* @license http://www.gnu.org/licenses/gpl-3.0.en.html
|
11 |
*/
|
12 |
|
13 |
// If this file is called directly, abort.
|
21 |
* Class for the building UI_Textarea elements.
|
22 |
*/
|
23 |
class UI_Textarea extends UI_Element implements I_UI {
|
24 |
+
|
25 |
/**
|
26 |
+
* Default settings.
|
27 |
*
|
28 |
+
* @since 1.0.0
|
29 |
* @var array
|
30 |
*/
|
31 |
private $defaults_settings = array(
|
32 |
+
'id' => 'cherry-ui-textarea-id',
|
33 |
+
'name' => 'cherry-ui-textarea-name',
|
34 |
+
'value' => '',
|
35 |
+
'placeholder' => '',
|
36 |
+
'rows' => '10',
|
37 |
+
'cols' => '20',
|
38 |
+
'label' => '',
|
39 |
+
'class' => '',
|
40 |
+
'master' => '',
|
41 |
);
|
42 |
|
43 |
/**
|
44 |
* Constructor method for the UI_Textarea class.
|
45 |
*
|
46 |
+
* @since 1.0.0
|
47 |
*/
|
48 |
function __construct( $args = array() ) {
|
49 |
$this->defaults_settings['id'] = 'cherry-ui-textarea-' . uniqid();
|
55 |
/**
|
56 |
* Render html UI_Textarea.
|
57 |
*
|
58 |
+
* @since 1.0.0
|
59 |
*/
|
60 |
public function render() {
|
61 |
$html = '';
|
75 |
/**
|
76 |
* Enqueue javascript and stylesheet UI_Textarea
|
77 |
*
|
78 |
+
* @since 1.0.0
|
79 |
*/
|
80 |
public static function enqueue_assets() {
|
81 |
wp_enqueue_style(
|
82 |
'ui-textarea',
|
83 |
esc_url( Cherry_Core::base_url( 'assets/min/ui-textarea.min.css', __FILE__ ) ),
|
84 |
array(),
|
85 |
+
'1.3.2',
|
86 |
'all'
|
87 |
);
|
88 |
}
|
cherry-framework/modules/cherry-ui-elements/ui-element.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
* @author Cherry Team <cherryframework@gmail.com>
|
8 |
* @copyright Copyright (c) 2012 - 2016, Cherry Team
|
9 |
* @link http://www.cherryframework.com/
|
10 |
-
* @license http://www.gnu.org/licenses/
|
11 |
*/
|
12 |
|
13 |
/**
|
7 |
* @author Cherry Team <cherryframework@gmail.com>
|
8 |
* @copyright Copyright (c) 2012 - 2016, Cherry Team
|
9 |
* @link http://www.cherryframework.com/
|
10 |
+
* @license http://www.gnu.org/licenses/gpl-3.0.en.html
|
11 |
*/
|
12 |
|
13 |
/**
|
cherry-framework/modules/cherry-utility/cherry-utility.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/**
|
3 |
* Module Name: Utility
|
4 |
* Description: Multiple utility functions
|
5 |
-
* Version: 1.1.
|
6 |
* Author: Cherry Team
|
7 |
* Author URI: http://www.cherryframework.com/
|
8 |
* License: GPLv3
|
@@ -10,7 +10,7 @@
|
|
10 |
*
|
11 |
* @package Cherry_Framework
|
12 |
* @subpackage Modules
|
13 |
-
* @version 1.1.
|
14 |
* @author Cherry Team <cherryframework@gmail.com>
|
15 |
* @copyright Copyright (c) 2012 - 2016, Cherry Team
|
16 |
* @link http://www.cherryframework.com/
|
@@ -53,7 +53,7 @@ if ( ! class_exists( 'Cherry_Utility' ) ) {
|
|
53 |
'meta-data',
|
54 |
),
|
55 |
'meta_key' => array(
|
56 |
-
'term_thumb' => '
|
57 |
),
|
58 |
);
|
59 |
|
2 |
/**
|
3 |
* Module Name: Utility
|
4 |
* Description: Multiple utility functions
|
5 |
+
* Version: 1.1.6
|
6 |
* Author: Cherry Team
|
7 |
* Author URI: http://www.cherryframework.com/
|
8 |
* License: GPLv3
|
10 |
*
|
11 |
* @package Cherry_Framework
|
12 |
* @subpackage Modules
|
13 |
+
* @version 1.1.6
|
14 |
* @author Cherry Team <cherryframework@gmail.com>
|
15 |
* @copyright Copyright (c) 2012 - 2016, Cherry Team
|
16 |
* @link http://www.cherryframework.com/
|
53 |
'meta-data',
|
54 |
),
|
55 |
'meta_key' => array(
|
56 |
+
'term_thumb' => 'cherry_terms_thumbnails',
|
57 |
),
|
58 |
);
|
59 |
|
cherry-framework/modules/cherry-utility/inc/cherry-attributes-utilit.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
* @author Cherry Team <support@cherryframework.com>
|
8 |
* @copyright Copyright (c) 2012 - 2015, Cherry Team
|
9 |
* @link http://www.cherryframework.com/
|
10 |
-
* @license http://www.gnu.org/licenses/
|
11 |
*/
|
12 |
|
13 |
// If this file is called directly, abort.
|
@@ -92,11 +92,12 @@ if ( ! class_exists( 'Cherry_Attributes_Utilit' ) ) {
|
|
92 |
);
|
93 |
$args = wp_parse_args( $args, $default_args );
|
94 |
$html = '' ;
|
|
|
95 |
|
96 |
if ( filter_var( $args['visible'], FILTER_VALIDATE_BOOLEAN ) ) {
|
97 |
if ( 'term' === $type ) {
|
98 |
$text = $object->description;
|
99 |
-
} elseif ( 'post_content' === $
|
100 |
$text = get_the_content();
|
101 |
} else {
|
102 |
$text = get_the_excerpt();
|
7 |
* @author Cherry Team <support@cherryframework.com>
|
8 |
* @copyright Copyright (c) 2012 - 2015, Cherry Team
|
9 |
* @link http://www.cherryframework.com/
|
10 |
+
* @license http://www.gnu.org/licenses/gpl-3.0.en.html
|
11 |
*/
|
12 |
|
13 |
// If this file is called directly, abort.
|
92 |
);
|
93 |
$args = wp_parse_args( $args, $default_args );
|
94 |
$html = '' ;
|
95 |
+
$content_type = $args['content_type'];
|
96 |
|
97 |
if ( filter_var( $args['visible'], FILTER_VALIDATE_BOOLEAN ) ) {
|
98 |
if ( 'term' === $type ) {
|
99 |
$text = $object->description;
|
100 |
+
} elseif ( 'post_content' === $content_type || 'post_excerpt' === $content_type && empty( $object->$content_type ) ) {
|
101 |
$text = get_the_content();
|
102 |
} else {
|
103 |
$text = get_the_excerpt();
|
cherry-framework/modules/cherry-utility/inc/cherry-media-utilit.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
* @author Cherry Team <support@cherryframework.com>
|
8 |
* @copyright Copyright (c) 2012 - 2015, Cherry Team
|
9 |
* @link http://www.cherryframework.com/
|
10 |
-
* @license http://www.gnu.org/licenses/
|
11 |
*/
|
12 |
|
13 |
// If this file is called directly, abort.
|
@@ -37,28 +37,31 @@ if ( ! class_exists( 'Cherry_Media_Utilit' ) ) {
|
|
37 |
}
|
38 |
|
39 |
$default_args = array(
|
40 |
-
'visible'
|
41 |
-
'size'
|
42 |
-
'mobile_size'
|
43 |
-
'html'
|
44 |
-
'class'
|
45 |
-
'placeholder'
|
46 |
-
'placeholder_background'
|
47 |
-
'placeholder_foreground'
|
48 |
-
'placeholder_title'
|
49 |
-
'html_tag_suze'
|
50 |
-
'echo'
|
51 |
);
|
52 |
$args = wp_parse_args( $args, $default_args );
|
53 |
$html = '';
|
54 |
|
55 |
if ( filter_var( $args['visible'], FILTER_VALIDATE_BOOLEAN ) ) {
|
56 |
|
|
|
|
|
|
|
57 |
$size = wp_is_mobile() ? $args['mobile_size'] : $args['size'];
|
58 |
-
$size = in_array( $size,
|
59 |
|
60 |
-
//
|
61 |
-
$size_array
|
62 |
|
63 |
switch ( $type ) {
|
64 |
case 'post':
|
@@ -77,29 +80,31 @@ if ( ! class_exists( 'Cherry_Media_Utilit' ) ) {
|
|
77 |
|
78 |
case 'attachment':
|
79 |
$thumbnail_id = $id;
|
80 |
-
$alt
|
81 |
-
$link
|
82 |
break;
|
83 |
}
|
84 |
|
85 |
if ( $thumbnail_id ) {
|
86 |
$image_data = wp_get_attachment_image_src( $thumbnail_id, $size );
|
87 |
-
$src
|
88 |
-
|
|
|
89 |
$size_array['height'] = $image_data[2];
|
|
|
90 |
} elseif ( filter_var( $args['placeholder'], FILTER_VALIDATE_BOOLEAN ) ) {
|
91 |
-
$title = ( $args['placeholder_title'] ) ? $args['placeholder_title'] : $size_array['width'] . 'x' . $size_array['height']
|
92 |
$attr = array(
|
93 |
-
'width'
|
94 |
-
'height'
|
95 |
-
'background'
|
96 |
-
'foreground'
|
97 |
-
'title'
|
98 |
);
|
99 |
|
100 |
$attr = array_map( 'esc_attr', $attr );
|
101 |
|
102 |
-
$width = ( 4000 < intval( $attr['width'] ) )
|
103 |
$height = ( 4000 < intval( $attr['height'] ) ) ? 4000 : intval( $attr['height'] );
|
104 |
|
105 |
$src = $this->get_placeholder_url( array(
|
@@ -111,11 +116,11 @@ if ( ! class_exists( 'Cherry_Media_Utilit' ) ) {
|
|
111 |
) );
|
112 |
}
|
113 |
|
114 |
-
$class
|
115 |
-
$html_tag_suze
|
116 |
|
117 |
if ( isset( $src ) ) {
|
118 |
-
$html = sprintf( $args['html'], $link, $class, $src, $alt, $html_tag_suze );
|
119 |
}
|
120 |
}
|
121 |
|
7 |
* @author Cherry Team <support@cherryframework.com>
|
8 |
* @copyright Copyright (c) 2012 - 2015, Cherry Team
|
9 |
* @link http://www.cherryframework.com/
|
10 |
+
* @license http://www.gnu.org/licenses/gpl-3.0.en.html
|
11 |
*/
|
12 |
|
13 |
// If this file is called directly, abort.
|
37 |
}
|
38 |
|
39 |
$default_args = array(
|
40 |
+
'visible' => true,
|
41 |
+
'size' => apply_filters( 'cherry_normal_image_size', 'post-thumbnail' ),
|
42 |
+
'mobile_size' => apply_filters( 'cherry_mobile_image_size', 'post-thumbnail' ),
|
43 |
+
'html' => '<a href="%1$s" %2$s ><img src="%3$s" alt="%4$s" %5$s ></a>',
|
44 |
+
'class' => 'wp-image',
|
45 |
+
'placeholder' => true,
|
46 |
+
'placeholder_background' => '000',
|
47 |
+
'placeholder_foreground' => 'fff',
|
48 |
+
'placeholder_title' => '',
|
49 |
+
'html_tag_suze' => true,
|
50 |
+
'echo' => false,
|
51 |
);
|
52 |
$args = wp_parse_args( $args, $default_args );
|
53 |
$html = '';
|
54 |
|
55 |
if ( filter_var( $args['visible'], FILTER_VALIDATE_BOOLEAN ) ) {
|
56 |
|
57 |
+
$intermediate_image_sizes = get_intermediate_image_sizes();
|
58 |
+
$intermediate_image_sizes[] = 'full';
|
59 |
+
|
60 |
$size = wp_is_mobile() ? $args['mobile_size'] : $args['size'];
|
61 |
+
$size = in_array( $size, $intermediate_image_sizes ) ? $size : 'post-thumbnail';
|
62 |
|
63 |
+
// Placeholder defaults attr.
|
64 |
+
$size_array = $this->get_thumbnail_size_array( $size );
|
65 |
|
66 |
switch ( $type ) {
|
67 |
case 'post':
|
80 |
|
81 |
case 'attachment':
|
82 |
$thumbnail_id = $id;
|
83 |
+
$alt = get_the_title( $thumbnail_id );
|
84 |
+
$link = wp_get_attachment_image_url( $thumbnail_id, $size );
|
85 |
break;
|
86 |
}
|
87 |
|
88 |
if ( $thumbnail_id ) {
|
89 |
$image_data = wp_get_attachment_image_src( $thumbnail_id, $size );
|
90 |
+
$src = $image_data[0];
|
91 |
+
|
92 |
+
$size_array['width'] = $image_data[1];
|
93 |
$size_array['height'] = $image_data[2];
|
94 |
+
|
95 |
} elseif ( filter_var( $args['placeholder'], FILTER_VALIDATE_BOOLEAN ) ) {
|
96 |
+
$title = ( $args['placeholder_title'] ) ? $args['placeholder_title'] : $size_array['width'] . 'x' . $size_array['height'];
|
97 |
$attr = array(
|
98 |
+
'width' => $size_array['width'],
|
99 |
+
'height' => $size_array['height'],
|
100 |
+
'background' => $args['placeholder_background'],
|
101 |
+
'foreground' => $args['placeholder_foreground'],
|
102 |
+
'title' => $title,
|
103 |
);
|
104 |
|
105 |
$attr = array_map( 'esc_attr', $attr );
|
106 |
|
107 |
+
$width = ( 4000 < intval( $attr['width'] ) ) ? 4000 : intval( $attr['width'] );
|
108 |
$height = ( 4000 < intval( $attr['height'] ) ) ? 4000 : intval( $attr['height'] );
|
109 |
|
110 |
$src = $this->get_placeholder_url( array(
|
116 |
) );
|
117 |
}
|
118 |
|
119 |
+
$class = ( $args['class'] ) ? 'class="' . esc_attr( $args['class'] ) . '"' : '';
|
120 |
+
$html_tag_suze = ( filter_var( $args['html_tag_suze'], FILTER_VALIDATE_BOOLEAN ) ) ? 'width="' . $size_array['width'] . '" height="' . $size_array['height'] . '"' : '';
|
121 |
|
122 |
if ( isset( $src ) ) {
|
123 |
+
$html = sprintf( $args['html'], esc_url( $link ), $class, esc_url( $src ), esc_attr( $alt ), $html_tag_suze );
|
124 |
}
|
125 |
}
|
126 |
|
cherry-framework/modules/cherry-utility/inc/cherry-meta-data-utilit.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
* @author Cherry Team <support@cherryframework.com>
|
8 |
* @copyright Copyright (c) 2012 - 2015, Cherry Team
|
9 |
* @link http://www.cherryframework.com/
|
10 |
-
* @license http://www.gnu.org/licenses/
|
11 |
*/
|
12 |
|
13 |
// If this file is called directly, abort.
|
7 |
* @author Cherry Team <support@cherryframework.com>
|
8 |
* @copyright Copyright (c) 2012 - 2015, Cherry Team
|
9 |
* @link http://www.cherryframework.com/
|
10 |
+
* @license http://www.gnu.org/licenses/gpl-3.0.en.html
|
11 |
*/
|
12 |
|
13 |
// If this file is called directly, abort.
|
cherry-framework/modules/cherry-utility/inc/cherry-satellite-utilit.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
* @author Cherry Team <support@cherryframework.com>
|
8 |
* @copyright Copyright (c) 2012 - 2015, Cherry Team
|
9 |
* @link http://www.cherryframework.com/
|
10 |
-
* @license http://www.gnu.org/licenses/
|
11 |
*/
|
12 |
|
13 |
// If this file is called directly, abort.
|
@@ -114,17 +114,53 @@ if ( ! class_exists( 'Cherry_Satellite_Utilit' ) ) {
|
|
114 |
* @return array
|
115 |
*/
|
116 |
public function get_thumbnail_size_array( $size ) {
|
117 |
-
|
118 |
-
|
119 |
-
if (
|
120 |
-
$size_array = $
|
|
|
|
|
|
|
|
|
121 |
} else {
|
122 |
-
$size_array = $
|
123 |
}
|
124 |
|
125 |
return $size_array;
|
126 |
}
|
127 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
/**
|
129 |
* Output content method.
|
130 |
*
|
@@ -139,8 +175,6 @@ if ( ! class_exists( 'Cherry_Satellite_Utilit' ) ) {
|
|
139 |
}
|
140 |
}
|
141 |
|
142 |
-
|
143 |
-
|
144 |
/**
|
145 |
* Return post terms.
|
146 |
*
|
@@ -149,12 +183,23 @@ if ( ! class_exists( 'Cherry_Satellite_Utilit' ) ) {
|
|
149 |
* @param [type] $key - slug, term_id.
|
150 |
* @return array
|
151 |
*/
|
152 |
-
public function get_terms_array( $tax = 'category', $key = 'slug' ) {
|
153 |
$terms = array();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
154 |
$all_terms = (array) get_terms( $tax, array( 'hide_empty' => 0, 'hierarchical' => 0 ) );
|
|
|
|
|
|
|
155 |
|
156 |
foreach ( $all_terms as $term ) {
|
157 |
-
$terms[ $term
|
158 |
}
|
159 |
|
160 |
return $terms;
|
7 |
* @author Cherry Team <support@cherryframework.com>
|
8 |
* @copyright Copyright (c) 2012 - 2015, Cherry Team
|
9 |
* @link http://www.cherryframework.com/
|
10 |
+
* @license http://www.gnu.org/licenses/gpl-3.0.en.html
|
11 |
*/
|
12 |
|
13 |
// If this file is called directly, abort.
|
114 |
* @return array
|
115 |
*/
|
116 |
public function get_thumbnail_size_array( $size ) {
|
117 |
+
$sizes = $this->get_image_sizes();
|
118 |
+
|
119 |
+
if ( isset( $sizes[ $size ] ) ) {
|
120 |
+
$size_array = $sizes[ $size ];
|
121 |
+
|
122 |
+
} else if ( isset( $sizes['post-thumbnail'] ) ) {
|
123 |
+
$size_array = $sizes['post-thumbnail'];
|
124 |
+
|
125 |
} else {
|
126 |
+
$size_array = $sizes['thumbnail'];
|
127 |
}
|
128 |
|
129 |
return $size_array;
|
130 |
}
|
131 |
|
132 |
+
/**
|
133 |
+
* Get size information for all currently-registered image sizes.
|
134 |
+
*
|
135 |
+
* @global $_wp_additional_image_sizes
|
136 |
+
* @uses get_intermediate_image_sizes()
|
137 |
+
* @link https://codex.wordpress.org/Function_Reference/get_intermediate_image_sizes
|
138 |
+
* @since 1.1.6
|
139 |
+
* @return array $sizes Data for all currently-registered image sizes.
|
140 |
+
*/
|
141 |
+
function get_image_sizes() {
|
142 |
+
global $_wp_additional_image_sizes;
|
143 |
+
|
144 |
+
$sizes = array();
|
145 |
+
|
146 |
+
foreach ( get_intermediate_image_sizes() as $_size ) {
|
147 |
+
if ( in_array( $_size, array( 'thumbnail', 'medium', 'medium_large', 'large' ) ) ) {
|
148 |
+
$sizes[ $_size ]['width'] = get_option( "{$_size}_size_w" );
|
149 |
+
$sizes[ $_size ]['height'] = get_option( "{$_size}_size_h" );
|
150 |
+
$sizes[ $_size ]['crop'] = (bool) get_option( "{$_size}_crop" );
|
151 |
+
|
152 |
+
} elseif ( isset( $_wp_additional_image_sizes[ $_size ] ) ) {
|
153 |
+
$sizes[ $_size ] = array(
|
154 |
+
'width' => $_wp_additional_image_sizes[ $_size ]['width'],
|
155 |
+
'height' => $_wp_additional_image_sizes[ $_size ]['height'],
|
156 |
+
'crop' => $_wp_additional_image_sizes[ $_size ]['crop'],
|
157 |
+
);
|
158 |
+
}
|
159 |
+
}
|
160 |
+
|
161 |
+
return $sizes;
|
162 |
+
}
|
163 |
+
|
164 |
/**
|
165 |
* Output content method.
|
166 |
*
|
175 |
}
|
176 |
}
|
177 |
|
|
|
|
|
178 |
/**
|
179 |
* Return post terms.
|
180 |
*
|
183 |
* @param [type] $key - slug, term_id.
|
184 |
* @return array
|
185 |
*/
|
186 |
+
public function get_terms_array( $tax = array( 'category' ), $key = 'slug' ) {
|
187 |
$terms = array();
|
188 |
+
$tax = is_array( $tax ) ? $tax : array( $tax ) ;
|
189 |
+
|
190 |
+
foreach ( $tax as $key => $value ) {
|
191 |
+
if ( ! taxonomy_exists( $value ) ) {
|
192 |
+
unset( $tax[ $key ] );
|
193 |
+
}
|
194 |
+
}
|
195 |
+
|
196 |
$all_terms = (array) get_terms( $tax, array( 'hide_empty' => 0, 'hierarchical' => 0 ) );
|
197 |
+
if ( empty( $all_terms ) || is_wp_error( $all_terms ) ) {
|
198 |
+
return '';
|
199 |
+
}
|
200 |
|
201 |
foreach ( $all_terms as $term ) {
|
202 |
+
$terms[ $term->slug ] = $term->name;
|
203 |
}
|
204 |
|
205 |
return $terms;
|
cherry-framework/modules/cherry-widget-factory/inc/class-cherry-abstract-widget.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
* @author Cherry Team <cherryframework@gmail.com>
|
8 |
* @copyright Copyright (c) 2012 - 2016, Cherry Team
|
9 |
* @link http://www.cherryframework.com/
|
10 |
-
* @license http://www.gnu.org/licenses/
|
11 |
*/
|
12 |
|
13 |
// If this file is called directly, abort.
|
@@ -251,7 +251,7 @@ if ( ! class_exists( 'Cherry_Abstract_Widget' ) ) {
|
|
251 |
}
|
252 |
|
253 |
if ( isset( $cache[ $args['widget_id'] ] ) ) {
|
254 |
-
echo
|
255 |
return true;
|
256 |
}
|
257 |
|
7 |
* @author Cherry Team <cherryframework@gmail.com>
|
8 |
* @copyright Copyright (c) 2012 - 2016, Cherry Team
|
9 |
* @link http://www.cherryframework.com/
|
10 |
+
* @license http://www.gnu.org/licenses/gpl-3.0.en.html
|
11 |
*/
|
12 |
|
13 |
// If this file is called directly, abort.
|
251 |
}
|
252 |
|
253 |
if ( isset( $cache[ $args['widget_id'] ] ) ) {
|
254 |
+
echo $cache[ $args['widget_id'] ];
|
255 |
return true;
|
256 |
}
|
257 |
|
cherry-framework/modules/cherry5-insert-shortcode/assets/cherry-insert-shortcode.js
ADDED
@@ -0,0 +1,271 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery( document ).on( 'ready', function( /*$, CherryJsCore*/ ) {
|
2 |
+
var $ = jQuery,
|
3 |
+
CherryJsCore = window.CherryJsCore;
|
4 |
+
|
5 |
+
CherryJsCore.utilites.namespace( 'cherry5InsertShortcode' );
|
6 |
+
CherryJsCore.cherry5InsertShortcode = {
|
7 |
+
openPopUpButton: '.cherry5-is__open-button',
|
8 |
+
closePopUpButton: '.cherry5-is__close-button',
|
9 |
+
insertionWindow: '.cherry5-is__modal-window',
|
10 |
+
insertionPopUp: '.cherry5-is__popup',
|
11 |
+
insertionPopUpBg: '.cherry5-is__background',
|
12 |
+
shortcodeOptionHolder: '.cherry5-is__shortcodes-options',
|
13 |
+
shortcodeOptionHolderClass: '.cherry5-is__shortcode-form.show',
|
14 |
+
insertButton: '.cherry5-is__insert-button',
|
15 |
+
spinner: '.cherry-loader-wrapper',
|
16 |
+
contentArea: '.cherry5-is__shortcode-content',
|
17 |
+
sidebar: '.cherry5-is__popup-sidebar',
|
18 |
+
sidebarButton: '.cherry5-is__sidebar-button',
|
19 |
+
|
20 |
+
insertShortcodeId: 'cherry5_insert_shortcode',
|
21 |
+
getShortcodeOptionButton: '.cherry5-is__get-shotcode',
|
22 |
+
|
23 |
+
getShortcodeOptionInstance: null,
|
24 |
+
selectedContent: '',
|
25 |
+
openedShortcode: [],
|
26 |
+
|
27 |
+
devMode: false,
|
28 |
+
|
29 |
+
sessionStorage:{
|
30 |
+
optionsTemplate: {},
|
31 |
+
activeShortcode: {}
|
32 |
+
},
|
33 |
+
|
34 |
+
init: function() {
|
35 |
+
this.devMode = ( 'true' === window.cherry5InsertShortcode.devMode ) ? true : false ;
|
36 |
+
this.sessionStorage = ( ! this.devMode ) ? this.getState() || this.sessionStorage : this.sessionStorage ;
|
37 |
+
this.getShortcodeOptionInstance = new CherryJsCore.CherryAjaxHandler(
|
38 |
+
{
|
39 |
+
handlerId: this.insertShortcodeId,
|
40 |
+
successCallback: this.getShortcodeOptionCallback.bind( this )
|
41 |
+
}
|
42 |
+
);
|
43 |
+
|
44 |
+
this.addEvent();
|
45 |
+
this.switchFirstShortcode();
|
46 |
+
},
|
47 |
+
addEvent: function() {
|
48 |
+
$( 'body' )
|
49 |
+
.on( 'click.cherry5InsertShortcode', this.openPopUpButton, this.showPopUp.bind( this ) )
|
50 |
+
.on( 'click.cherry5InsertShortcode', this.closePopUpButton, this.hidePopUp.bind( this ) )
|
51 |
+
.on( 'click.cherry5InsertShortcode', this.insertionPopUpBg, this.hidePopUp.bind( this ) )
|
52 |
+
.on( 'click.cherry5InsertShortcode', this.insertButton, this.insertShortcode.bind( this ) )
|
53 |
+
.on( 'click.cherry5InsertShortcode', this.insertButton, this.hidePopUp.bind( this ) )
|
54 |
+
.on( 'click.cherry5InsertShortcode', this.getShortcodeOptionButton, this.getShortcodeOption.bind( this ) )
|
55 |
+
.on( 'click.cherry5InsertShortcode', this.sidebarButton, this.openSodebar.bind( this ) );
|
56 |
+
},
|
57 |
+
|
58 |
+
showPopUp: function() {
|
59 |
+
var activeShortcode;
|
60 |
+
|
61 |
+
if ( window.tinymce ) {
|
62 |
+
if ( window.tinymce.get( 'content' ) && window.tinymce.get( 'content' ).selection ) {
|
63 |
+
this.selectedContent = window.tinymce.get( 'content' ).selection.getContent( { format: 'text' } );
|
64 |
+
}
|
65 |
+
|
66 |
+
activeShortcode = this.sessionStorage.activeShortcode;
|
67 |
+
this.afterShowShortcode( activeShortcode.pluginSlug + '-' + activeShortcode.shortcodeSlug, activeShortcode.enclosing );
|
68 |
+
}
|
69 |
+
|
70 |
+
$( this.insertionWindow ).addClass( 'open show' );
|
71 |
+
$( this.insertionPopUp, this.insertionWindow ).off( 'animationend' );
|
72 |
+
},
|
73 |
+
hidePopUp: function() {
|
74 |
+
this.selectedContent = '';
|
75 |
+
this.openedShortcode = [];
|
76 |
+
|
77 |
+
$( this.insertionWindow ).removeClass( 'open' );
|
78 |
+
$( this.insertionPopUp, this.insertionWindow ).on( 'animationend', this.hideModalWindow.bind( this ) );
|
79 |
+
},
|
80 |
+
hideModalWindow: function() {
|
81 |
+
$( this.insertionWindow ).removeClass( 'show' );
|
82 |
+
},
|
83 |
+
|
84 |
+
switchFirstShortcode: function() {
|
85 |
+
var data = this.sessionStorage.activeShortcode,
|
86 |
+
target = null ;
|
87 |
+
|
88 |
+
if ( data.pluginSlug && data.shortcodeSlug ) {
|
89 |
+
target = $( '#button-' + data.pluginSlug + '-' + data.shortcodeSlug );
|
90 |
+
} else {
|
91 |
+
target = $( '.cherry5-is__shortcode-list:first > li:first .cherry5-is__get-shotcode' );
|
92 |
+
}
|
93 |
+
|
94 |
+
this.switchShortcode( target );
|
95 |
+
},
|
96 |
+
|
97 |
+
getShortcodeOption: function( event ) {
|
98 |
+
this.switchShortcode( $( event.target ) );
|
99 |
+
return false;
|
100 |
+
},
|
101 |
+
switchShortcode: function( targetButton ) {
|
102 |
+
var pluginSlug = targetButton.data( 'plugin-slug' ),
|
103 |
+
shortcodeSlug = targetButton.data( 'shortcode-slug' ),
|
104 |
+
shortcodeId = pluginSlug + '-' + shortcodeSlug,
|
105 |
+
shortcodeSection = $( '#' + shortcodeId ),
|
106 |
+
data;
|
107 |
+
|
108 |
+
$( this.insertButton, this.insertionPopUp ).attr( 'disabled', 'disabled' );
|
109 |
+
|
110 |
+
// Remove class to active button
|
111 |
+
this.hide( $( this.getShortcodeOptionButton + '.show' ) );
|
112 |
+
|
113 |
+
// Add class to active button
|
114 |
+
this.show( targetButton );
|
115 |
+
this.hide( $( this.shortcodeOptionHolderClass ) );
|
116 |
+
|
117 |
+
if ( shortcodeSection[0] ) {
|
118 |
+
data = this.sessionStorage.optionsTemplate[ shortcodeId ];
|
119 |
+
this.setProxyStorage( data, shortcodeId );
|
120 |
+
this.show( shortcodeSection );
|
121 |
+
this.afterShowShortcode( shortcodeId, data.enclosing );
|
122 |
+
return;
|
123 |
+
}
|
124 |
+
|
125 |
+
if ( ! this.devMode && this.sessionStorage.optionsTemplate[ shortcodeId ] ) {
|
126 |
+
this.getShortcodeOptionCallback( { data: this.sessionStorage.optionsTemplate[ shortcodeId ] } );
|
127 |
+
return;
|
128 |
+
}
|
129 |
+
|
130 |
+
this.show( $( this.spinner, this.shortcodeOptionHolder ) );
|
131 |
+
|
132 |
+
this.getShortcodeOptionInstance.sendData( { 'plugin_slug': pluginSlug, 'shortcode_slug': shortcodeSlug } );
|
133 |
+
},
|
134 |
+
getShortcodeOptionCallback: function( response ) {
|
135 |
+
var data = response.data,
|
136 |
+
holder = $( this.shortcodeOptionHolder, 'body' ),
|
137 |
+
shortcodeId;
|
138 |
+
|
139 |
+
if ( data.error ) {
|
140 |
+
window.console.log( data.message );
|
141 |
+
return;
|
142 |
+
}
|
143 |
+
|
144 |
+
shortcodeId = data.pluginSlug + '-' + data.shortcodeSlug;
|
145 |
+
|
146 |
+
this.setProxyStorage( data, shortcodeId );
|
147 |
+
|
148 |
+
this.hide( $( this.spinner, this.shortcodeOptionHolder ) );
|
149 |
+
holder.append( data.html );
|
150 |
+
|
151 |
+
this.afterShowShortcode( shortcodeId, data.enclosing );
|
152 |
+
|
153 |
+
$( document ).trigger( 'cherryInterfaceBuilder' );
|
154 |
+
$( 'body' ).trigger( { type: 'cherry-ui-elements-init', _target: $( '#' + shortcodeId, holder ) } );
|
155 |
+
},
|
156 |
+
setProxyStorage: function( data, id ) {
|
157 |
+
if ( data ) {
|
158 |
+
this.sessionStorage.optionsTemplate[ id ] = data;
|
159 |
+
this.sessionStorage.activeShortcode = data;
|
160 |
+
}
|
161 |
+
|
162 |
+
if ( ! this.devMode ) {
|
163 |
+
this.setState();
|
164 |
+
}
|
165 |
+
},
|
166 |
+
afterShowShortcode: function( shortcodeId, enclosing ) {
|
167 |
+
var defaultContent,
|
168 |
+
content = '';
|
169 |
+
|
170 |
+
if ( enclosing && -1 === this.openedShortcode.indexOf( shortcodeId ) ) {
|
171 |
+
defaultContent = this.sessionStorage.activeShortcode.defaultContent;
|
172 |
+
|
173 |
+
if ( this.selectedContent ) {
|
174 |
+
content = this.selectedContent;
|
175 |
+
} else if ( defaultContent ) {
|
176 |
+
content = defaultContent;
|
177 |
+
}
|
178 |
+
|
179 |
+
$( '#' + shortcodeId + '-content' ).val( content );
|
180 |
+
|
181 |
+
this.openedShortcode.push( shortcodeId );
|
182 |
+
}
|
183 |
+
|
184 |
+
$( this.insertButton, this.insertionPopUp ).removeAttr( 'disabled' );
|
185 |
+
},
|
186 |
+
|
187 |
+
insertShortcode: function() {
|
188 |
+
var activeShortcode = this.sessionStorage.activeShortcode,
|
189 |
+
slug = activeShortcode.shortcodeSlug,
|
190 |
+
pluginSlug = activeShortcode.pluginSlug,
|
191 |
+
shortcodeId = pluginSlug + '-' + slug,
|
192 |
+
enclosing = activeShortcode.enclosing,
|
193 |
+
tepmlate = ( enclosing ) ? '[$1$2]$3[/$1]' : '[$1$2]',
|
194 |
+
attrs = $( 'form#' + shortcodeId ).serializeArray(),
|
195 |
+
sortedAttra = {},
|
196 |
+
outputAttr = '',
|
197 |
+
content = '',
|
198 |
+
key,
|
199 |
+
attr,
|
200 |
+
attrName,
|
201 |
+
output;
|
202 |
+
|
203 |
+
if ( attrs[0] ) {
|
204 |
+
for ( key in attrs ) {
|
205 |
+
attr = attrs[ key ];
|
206 |
+
attrName = attr.name.replace( /\[\S*\]/g, '' );
|
207 |
+
|
208 |
+
if ( 'cherry5-is__shortcode-content' === attrName ) {
|
209 |
+
continue;
|
210 |
+
}
|
211 |
+
|
212 |
+
if ( ! sortedAttra[ attrName ] ) {
|
213 |
+
sortedAttra[ attrName ] = attr.value;
|
214 |
+
continue;
|
215 |
+
} else {
|
216 |
+
sortedAttra[ attrName ] += ',' + attr.value;
|
217 |
+
continue;
|
218 |
+
}
|
219 |
+
}
|
220 |
+
|
221 |
+
$.map( sortedAttra, function( elem, index ) {
|
222 |
+
if ( elem ) {
|
223 |
+
outputAttr += ' ' + index + '="' + elem + '"' ;
|
224 |
+
}
|
225 |
+
} );
|
226 |
+
}
|
227 |
+
|
228 |
+
if ( enclosing ) {
|
229 |
+
content = $( '#' + shortcodeId + '-content' ).val();
|
230 |
+
}
|
231 |
+
|
232 |
+
output = tepmlate
|
233 |
+
.replace( /\$1/g, slug )
|
234 |
+
.replace( /\$2/g, outputAttr )
|
235 |
+
.replace( /\$3/g, content );
|
236 |
+
|
237 |
+
window.wp.media.editor.insert( output );
|
238 |
+
},
|
239 |
+
|
240 |
+
getState: function() {
|
241 |
+
try {
|
242 |
+
return JSON.parse( sessionStorage.getItem( 'cherry5-insert-shortcode' ) );
|
243 |
+
} catch ( e ) {
|
244 |
+
return false;
|
245 |
+
}
|
246 |
+
},
|
247 |
+
setState: function() {
|
248 |
+
try {
|
249 |
+
sessionStorage.setItem( 'cherry5-insert-shortcode', JSON.stringify( this.sessionStorage ) );
|
250 |
+
} catch ( e ) {
|
251 |
+
return false;
|
252 |
+
}
|
253 |
+
},
|
254 |
+
|
255 |
+
show: function( target ) {
|
256 |
+
target.addClass( 'show' );
|
257 |
+
},
|
258 |
+
|
259 |
+
hide: function( target ) {
|
260 |
+
target.removeClass( 'show' );
|
261 |
+
},
|
262 |
+
|
263 |
+
openSodebar: function() {
|
264 |
+
$( this.sidebar ).toggleClass( 'open' );
|
265 |
+
}
|
266 |
+
|
267 |
+
};
|
268 |
+
|
269 |
+
CherryJsCore.cherry5InsertShortcode.init();
|
270 |
+
|
271 |
+
} );
|
cherry-framework/modules/cherry5-insert-shortcode/assets/cherry-insert-shortcode.scss
ADDED
@@ -0,0 +1,492 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
$border-color: #e5e5e5;
|
2 |
+
$link-color: #298ffc; // link color.
|
3 |
+
$link-color-2: #23282d; // link color.
|
4 |
+
$color-1: #206ff4; // Scrollbar track background
|
5 |
+
$color-2: #e5e5e5; // Scrollbar background.
|
6 |
+
$color-3: #fff; // Background color.
|
7 |
+
|
8 |
+
$br-radius: 5px; // Border radius.
|
9 |
+
$min_screen_width: '961px';
|
10 |
+
$middle_screen_width: '1200px';
|
11 |
+
$padding: 15px;
|
12 |
+
|
13 |
+
$shadow: 0px 5px 21px rgba(0, 0, 0, 0.1); //Shadow.
|
14 |
+
$border: 1px solid rgba(0, 0, 0, 0.1) ;
|
15 |
+
|
16 |
+
.cherry5-is{
|
17 |
+
&__open-button{
|
18 |
+
padding: 0 7px;
|
19 |
+
margin-right: 5px;
|
20 |
+
margin-bottom: 4px;
|
21 |
+
vertical-align: top;
|
22 |
+
text-transform: capitalize;
|
23 |
+
box-sizing: border-box;
|
24 |
+
white-space: nowrap;
|
25 |
+
//height: 28px;
|
26 |
+
text-decoration: none;
|
27 |
+
font-weight: normal;
|
28 |
+
line-height: 26px;
|
29 |
+
.cherry5-insert-shortcode-icon {
|
30 |
+
margin-right: 5px;
|
31 |
+
display: inline-block;
|
32 |
+
line-height: 1.1;
|
33 |
+
}
|
34 |
+
@media screen and (max-width: 782px) {
|
35 |
+
height: auto;
|
36 |
+
line-height: normal;
|
37 |
+
padding: 6px 14px;
|
38 |
+
vertical-align: middle;
|
39 |
+
}
|
40 |
+
}
|
41 |
+
&__icon{
|
42 |
+
width: 18px;
|
43 |
+
height: 18px;
|
44 |
+
margin-right: 10px;
|
45 |
+
line-height: 22px;
|
46 |
+
vertical-align: text-top;
|
47 |
+
}
|
48 |
+
&__modal-window{
|
49 |
+
position: fixed;
|
50 |
+
display: none;
|
51 |
+
top: 0px;
|
52 |
+
right: 0;
|
53 |
+
left: 0;
|
54 |
+
bottom: 0;
|
55 |
+
z-index: 99999;
|
56 |
+
justify-content: center;
|
57 |
+
align-items: center;
|
58 |
+
&.show{
|
59 |
+
display: flex;
|
60 |
+
}
|
61 |
+
@media ( min-width: 780px ) {
|
62 |
+
top: 32px;
|
63 |
+
}
|
64 |
+
}
|
65 |
+
&__background{
|
66 |
+
background-color: #000;
|
67 |
+
position: absolute;
|
68 |
+
width: 100%;
|
69 |
+
height: 100%;
|
70 |
+
top: 0;
|
71 |
+
left: 0;
|
72 |
+
|
73 |
+
animation-name: simple-fade-out;
|
74 |
+
animation-fill-mode: both;
|
75 |
+
animation-duration: 0.25s;
|
76 |
+
animation-timing-function: cubic-bezier(0.645, 0.045, 0.355, 1);
|
77 |
+
.open &{
|
78 |
+
animation-name: simple-fade-in;
|
79 |
+
animation-timing-function: cubic-bezier(0.445, 0.05, 0.55, 0.95);
|
80 |
+
}
|
81 |
+
}
|
82 |
+
&__popup{
|
83 |
+
background-color: $color-3;
|
84 |
+
order: 0;
|
85 |
+
align-self: center;
|
86 |
+
height: 100%;
|
87 |
+
flex: 0 1 100%;
|
88 |
+
width: 100%;
|
89 |
+
z-index: 1;
|
90 |
+
display: flex;
|
91 |
+
flex-direction: column;
|
92 |
+
transition: all 0.5s ease;
|
93 |
+
|
94 |
+
animation-name: close-pop-up;
|
95 |
+
animation-fill-mode: both;
|
96 |
+
animation-duration: 0.4s;
|
97 |
+
animation-timing-function: cubic-bezier(0.645, 0.045, 0.355, 1);
|
98 |
+
|
99 |
+
.open &{
|
100 |
+
animation-name: open-pop-up;
|
101 |
+
}
|
102 |
+
@media ( min-width: $min_screen_width ) {
|
103 |
+
height: 85%;
|
104 |
+
flex: 0 1 85%;
|
105 |
+
box-shadow:$shadow;
|
106 |
+
border-radius: $br-radius;
|
107 |
+
border: $border;
|
108 |
+
}
|
109 |
+
}
|
110 |
+
&__popup-header{
|
111 |
+
border-bottom: 1px solid $border-color;
|
112 |
+
}
|
113 |
+
&__popup-header-inner{
|
114 |
+
display: flex;
|
115 |
+
}
|
116 |
+
&__popup-title{
|
117 |
+
flex: 0 1 100%;
|
118 |
+
padding: $padding - 5;
|
119 |
+
margin: 0;
|
120 |
+
@media ( min-width: $min_screen_width ) {
|
121 |
+
padding: $padding;
|
122 |
+
}
|
123 |
+
}
|
124 |
+
&__close-button{
|
125 |
+
flex: 0 1 auto;
|
126 |
+
padding: $padding - 5;
|
127 |
+
border-left: 1px solid $border-color;
|
128 |
+
cursor: pointer;
|
129 |
+
box-sizing: border-box;
|
130 |
+
width: 43px;
|
131 |
+
padding: 10px;
|
132 |
+
transition: box-shadow .3s ease-in-out, color .3s ease-in-out;
|
133 |
+
box-shadow: inset 0px 0px 0px rgba(41,143,252,0.0);
|
134 |
+
&:hover{
|
135 |
+
color: $link-color;
|
136 |
+
outline: none;
|
137 |
+
box-shadow: inset 0px 0px 10px rgba(41,143,252,0.5);
|
138 |
+
};
|
139 |
+
@media ( min-width: $min_screen_width ) {
|
140 |
+
padding: $padding;
|
141 |
+
width: 50px;
|
142 |
+
}
|
143 |
+
}
|
144 |
+
&__popup-body{
|
145 |
+
display: flex;
|
146 |
+
height: 100%;
|
147 |
+
min-height: 50%;
|
148 |
+
position: relative;
|
149 |
+
}
|
150 |
+
&__popup-sidebar{
|
151 |
+
position: absolute;
|
152 |
+
width: 100%;
|
153 |
+
height: 100%;
|
154 |
+
z-index: 100;
|
155 |
+
display: flex;
|
156 |
+
flex-direction: row;
|
157 |
+
right: 100%;
|
158 |
+
margin-right: -41px;
|
159 |
+
transition: right .5s cubic-bezier(0.215, 0.61, 0.355, 1), margin-right .5s cubic-bezier(0.215, 0.61, 0.355, 1);
|
160 |
+
&.open{
|
161 |
+
right: 0%;
|
162 |
+
margin-right: -1px;
|
163 |
+
}
|
164 |
+
@media ( min-width: $min_screen_width ) {
|
165 |
+
position: relative;
|
166 |
+
flex: 0 1 50%;
|
167 |
+
align-self: stretch;
|
168 |
+
width: inherit;
|
169 |
+
right: inherit;
|
170 |
+
margin-right:0;
|
171 |
+
}
|
172 |
+
@media ( min-width: 1200px ) {
|
173 |
+
flex: 0 1 50%;
|
174 |
+
}
|
175 |
+
@media ( min-width: 1500px ) {
|
176 |
+
flex: 0 1 30%;
|
177 |
+
}
|
178 |
+
}
|
179 |
+
&__sidebar-button{
|
180 |
+
min-height: 100%;
|
181 |
+
flex: 0 1 44px;
|
182 |
+
border-top: none;
|
183 |
+
border-left: $border;
|
184 |
+
border-right: $border;
|
185 |
+
background: #fff;
|
186 |
+
cursor: pointer;
|
187 |
+
position: relative;
|
188 |
+
box-sizing: border-box;
|
189 |
+
.close, .open{
|
190 |
+
position: absolute;
|
191 |
+
top: 50%;
|
192 |
+
left: 50%;
|
193 |
+
font-size: 45px;
|
194 |
+
width: 38px;
|
195 |
+
height: 44px;
|
196 |
+
margin: -22px 0 0 -20px;
|
197 |
+
text-align: left;
|
198 |
+
}
|
199 |
+
.open{
|
200 |
+
display: block;
|
201 |
+
}
|
202 |
+
.close{
|
203 |
+
display: none;
|
204 |
+
}
|
205 |
+
.cherry5-is__popup-sidebar.open &{
|
206 |
+
.open{
|
207 |
+
display: none;
|
208 |
+
}
|
209 |
+
.close{
|
210 |
+
display: block;
|
211 |
+
}
|
212 |
+
}
|
213 |
+
@media ( min-width: $min_screen_width ) {
|
214 |
+
display: none;
|
215 |
+
}
|
216 |
+
}
|
217 |
+
&__sidebar-list{
|
218 |
+
background-color: $color-3;
|
219 |
+
box-sizing: border-box;
|
220 |
+
overflow-y: scroll;
|
221 |
+
flex: 0 1 100%;
|
222 |
+
align-self: stretch;
|
223 |
+
.cherry-component.cherry-accordion{
|
224 |
+
.cherry-component__title{
|
225 |
+
margin: 10px 15px 15px;
|
226 |
+
}
|
227 |
+
.cherry-accordion__title [class*="icon"], .cherry-settings ul [class*="icon"]{
|
228 |
+
float: left;
|
229 |
+
text-align: left;
|
230 |
+
margin-right: 10px;
|
231 |
+
line-height: 0.9;
|
232 |
+
}
|
233 |
+
.cherry-settings {
|
234 |
+
box-shadow: none;
|
235 |
+
border-radius: 0;
|
236 |
+
border-left: 0;
|
237 |
+
border-right: 0;
|
238 |
+
&__content{
|
239 |
+
background: $border-color;
|
240 |
+
overflow: hidden;
|
241 |
+
box-shadow: inset 0px 0px 10px rgba(163, 163, 163, 0.3);
|
242 |
+
}
|
243 |
+
ul{
|
244 |
+
margin: 15px 20px;
|
245 |
+
.cherry5-is__get-shotcode{
|
246 |
+
color: $link-color-2;
|
247 |
+
transition: color 350ms ease-in-out;
|
248 |
+
background: none;
|
249 |
+
display: block;
|
250 |
+
width: 100%;
|
251 |
+
text-align: left;
|
252 |
+
padding: 0;
|
253 |
+
margin: 0;
|
254 |
+
border: none;
|
255 |
+
line-height: 1.5;
|
256 |
+
&:hover, &.show{
|
257 |
+
color: $link-color;
|
258 |
+
};
|
259 |
+
}
|
260 |
+
li + li {
|
261 |
+
margin-top: 15px
|
262 |
+
}
|
263 |
+
}
|
264 |
+
& + .cherry-settings{
|
265 |
+
margin-top: 0;
|
266 |
+
border-top: 0;
|
267 |
+
}
|
268 |
+
|
269 |
+
}
|
270 |
+
}
|
271 |
+
}
|
272 |
+
&__popup-section{
|
273 |
+
box-sizing: border-box;
|
274 |
+
width: 100%;
|
275 |
+
flex: 0 1 100%;
|
276 |
+
padding-left: 30px;
|
277 |
+
display: flex;
|
278 |
+
flex-direction: column;
|
279 |
+
flex-wrap: nowrap;
|
280 |
+
justify-content: flex-start;
|
281 |
+
align-content: stretch;
|
282 |
+
align-items: stretch;
|
283 |
+
.cherry-component{
|
284 |
+
> .cherry-component__title, > .cherry-component__description{
|
285 |
+
margin: 20px;
|
286 |
+
}
|
287 |
+
}
|
288 |
+
.cherry-accordion, .cherry-toggle{
|
289 |
+
.cherry-component__content{
|
290 |
+
.cherry-settings{
|
291 |
+
border-radius: 0;
|
292 |
+
border-right: 0;
|
293 |
+
border-left: 0;
|
294 |
+
}
|
295 |
+
}
|
296 |
+
}
|
297 |
+
.cherry-tab{
|
298 |
+
>.cherry-tab__body{
|
299 |
+
border-radius: 0;
|
300 |
+
.cherry-tab__tabs{
|
301 |
+
border-radius: 0;
|
302 |
+
border-left:0;
|
303 |
+
border-bottom: 0;
|
304 |
+
}
|
305 |
+
.cherry-tab__content{
|
306 |
+
border-radius: 0;
|
307 |
+
border-bottom: 0;
|
308 |
+
border-right: 0;
|
309 |
+
}
|
310 |
+
}
|
311 |
+
}
|
312 |
+
@media ( min-width: $min_screen_width ) {
|
313 |
+
padding-left: 0;
|
314 |
+
}
|
315 |
+
}
|
316 |
+
&__shortcodes-options{
|
317 |
+
flex: 0 1 100%;
|
318 |
+
@media ( min-width: $min_screen_width ) {
|
319 |
+
position: relative;
|
320 |
+
flex: 0 1 100%;
|
321 |
+
}
|
322 |
+
}
|
323 |
+
&__content-area{
|
324 |
+
padding: $padding - 5 $padding - 5 $padding - 5 $padding + 5;
|
325 |
+
border-bottom: $border;
|
326 |
+
@media ( min-width: $min_screen_width ) {
|
327 |
+
padding: $padding;
|
328 |
+
}
|
329 |
+
}
|
330 |
+
&__content-area-title{
|
331 |
+
margin-top:0;
|
332 |
+
}
|
333 |
+
&__shortcode-form{
|
334 |
+
display: none;
|
335 |
+
&-header{
|
336 |
+
border-bottom: $border;
|
337 |
+
.cherry5-is__shortcode-title, .cherry5-is__shortcode-description{
|
338 |
+
margin: 20px;
|
339 |
+
}
|
340 |
+
}
|
341 |
+
&.show{
|
342 |
+
display: flex;
|
343 |
+
flex-direction: column;
|
344 |
+
min-height: 100%;
|
345 |
+
}
|
346 |
+
}
|
347 |
+
&__popup-footer{
|
348 |
+
flex: 0 1 auto;
|
349 |
+
align-self: auto;
|
350 |
+
border-top: 1px solid $border-color;
|
351 |
+
padding: $padding - 5;
|
352 |
+
background: $color-3;
|
353 |
+
@media ( min-width: $min_screen_width ) {
|
354 |
+
padding: $padding;
|
355 |
+
}
|
356 |
+
}
|
357 |
+
&__insert-button{
|
358 |
+
float: right;
|
359 |
+
transition: all .5s ease;
|
360 |
+
@media ( max-width: $min_screen_width ) {
|
361 |
+
padding: $padding - 6 $padding - 3;
|
362 |
+
}
|
363 |
+
&[disabled]{
|
364 |
+
opacity: 0.8;
|
365 |
+
cursor: default;
|
366 |
+
pointer-events: none;
|
367 |
+
}
|
368 |
+
}
|
369 |
+
&.cherry-ui-kit {
|
370 |
+
.cherry-component{
|
371 |
+
padding: 0;
|
372 |
+
}
|
373 |
+
}
|
374 |
+
&__has-not-option{
|
375 |
+
font-size: 1.5rem;
|
376 |
+
text-align: center;
|
377 |
+
flex: 1 1 100%;
|
378 |
+
|
379 |
+
display: flex;
|
380 |
+
flex-direction: row;
|
381 |
+
justify-content: center;
|
382 |
+
align-content: stretch;
|
383 |
+
align-items: center;
|
384 |
+
&-text{
|
385 |
+
|
386 |
+
}
|
387 |
+
}
|
388 |
+
}
|
389 |
+
.cherry-scroll{
|
390 |
+
overflow-y: scroll;
|
391 |
+
&::-webkit-scrollbar {
|
392 |
+
width: 10px;
|
393 |
+
height: 10px;
|
394 |
+
margin: -5px;
|
395 |
+
&-button {
|
396 |
+
width: 0px;
|
397 |
+
height: 0px;
|
398 |
+
}
|
399 |
+
&-thumb {
|
400 |
+
background-color: $link-color;
|
401 |
+
border: none;
|
402 |
+
border-radius: $br-radius;
|
403 |
+
&:hover, &:active {
|
404 |
+
background: $color-1;
|
405 |
+
}
|
406 |
+
}
|
407 |
+
&-track {
|
408 |
+
background-color: $color-2;
|
409 |
+
border: none;
|
410 |
+
border-radius: $br-radius;
|
411 |
+
}
|
412 |
+
&-corner {
|
413 |
+
background: transparent;
|
414 |
+
}
|
415 |
+
}
|
416 |
+
}
|
417 |
+
.cherry-loader {
|
418 |
+
display: block;
|
419 |
+
|
420 |
+
width: 20px;
|
421 |
+
height: 20px;
|
422 |
+
|
423 |
+
animation: spin .7s linear infinite;
|
424 |
+
|
425 |
+
border: 3px solid $border-color;
|
426 |
+
border-top: 3px solid #3498DB;
|
427 |
+
border-radius: 50%;
|
428 |
+
&-wrapper {
|
429 |
+
transition: opacity .5s ease, transform .5s ease;
|
430 |
+
transform: scale(0);
|
431 |
+
opacity: 0;
|
432 |
+
|
433 |
+
position: absolute;
|
434 |
+
top: 50%;
|
435 |
+
left: 50%;
|
436 |
+
|
437 |
+
width: 20px;
|
438 |
+
height: 20px;
|
439 |
+
margin: -13px 0 0 -13px;
|
440 |
+
&.show{
|
441 |
+
display: block;
|
442 |
+
transform: scale(1);
|
443 |
+
opacity: 1;
|
444 |
+
}
|
445 |
+
}
|
446 |
+
}
|
447 |
+
@keyframes spin {
|
448 |
+
0% {
|
449 |
+
transform: rotate(0deg);
|
450 |
+
}
|
451 |
+
100% {
|
452 |
+
transform: rotate(360deg);
|
453 |
+
}
|
454 |
+
}
|
455 |
+
@keyframes open-pop-up {
|
456 |
+
0% {
|
457 |
+
transform: scale( 0.5 );
|
458 |
+
opacity: 0;
|
459 |
+
}
|
460 |
+
100%{
|
461 |
+
transform: scale( 1 );
|
462 |
+
opacity: 1;
|
463 |
+
}
|
464 |
+
}
|
465 |
+
@keyframes close-pop-up {
|
466 |
+
0% {
|
467 |
+
transform: scale( 1 );
|
468 |
+
opacity: 1;
|
469 |
+
}
|
470 |
+
100%{
|
471 |
+
transform: scale( 0.5 );
|
472 |
+
opacity: 0;
|
473 |
+
}
|
474 |
+
}
|
475 |
+
|
476 |
+
@keyframes simple-fade-in {
|
477 |
+
0% {
|
478 |
+
opacity: 0;
|
479 |
+
}
|
480 |
+
100% {
|
481 |
+
opacity: 0.7;
|
482 |
+
}
|
483 |
+
}
|
484 |
+
|
485 |
+
@keyframes simple-fade-out {
|
486 |
+
0% {
|
487 |
+
opacity: 0.7;
|
488 |
+
}
|
489 |
+
100% {
|
490 |
+
opacity: 0;
|
491 |
+
}
|
492 |
+
}
|
cherry-framework/modules/cherry5-insert-shortcode/assets/min/cherry-insert-shortcode.min.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.cherry5-is__open-button{padding:0 7px;margin-right:5px;margin-bottom:4px;vertical-align:top;text-transform:capitalize;box-sizing:border-box;white-space:nowrap;text-decoration:none;font-weight:normal;line-height:26px}.cherry5-is__open-button .cherry5-insert-shortcode-icon{margin-right:5px;display:inline-block;line-height:1.1}@media screen and (max-width: 782px){.cherry5-is__open-button{height:auto;line-height:normal;padding:6px 14px;vertical-align:middle}}.cherry5-is__icon{width:18px;height:18px;margin-right:10px;line-height:22px;vertical-align:text-top}.cherry5-is__modal-window{position:fixed;display:none;top:0px;right:0;left:0;bottom:0;z-index:99999;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.cherry5-is__modal-window.show{display:-webkit-box;display:-ms-flexbox;display:flex}@media (min-width: 780px){.cherry5-is__modal-window{top:32px}}.cherry5-is__background{background-color:#000;position:absolute;width:100%;height:100%;top:0;left:0;-webkit-animation-name:simple-fade-out;animation-name:simple-fade-out;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:0.25s;animation-duration:0.25s;-webkit-animation-timing-function:cubic-bezier(0.645, 0.045, 0.355, 1);animation-timing-function:cubic-bezier(0.645, 0.045, 0.355, 1)}.open .cherry5-is__background{-webkit-animation-name:simple-fade-in;animation-name:simple-fade-in;-webkit-animation-timing-function:cubic-bezier(0.445, 0.05, 0.55, 0.95);animation-timing-function:cubic-bezier(0.445, 0.05, 0.55, 0.95)}.cherry5-is__popup{background-color:#fff;-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0;-ms-flex-item-align:center;align-self:center;height:100%;-webkit-box-flex:0;-ms-flex:0 1 100%;flex:0 1 100%;width:100%;z-index:1;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-transition:all 0.5s ease;transition:all 0.5s ease;-webkit-animation-name:close-pop-up;animation-name:close-pop-up;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:0.4s;animation-duration:0.4s;-webkit-animation-timing-function:cubic-bezier(0.645, 0.045, 0.355, 1);animation-timing-function:cubic-bezier(0.645, 0.045, 0.355, 1)}.open .cherry5-is__popup{-webkit-animation-name:open-pop-up;animation-name:open-pop-up}@media (min-width: 961px){.cherry5-is__popup{height:85%;-webkit-box-flex:0;-ms-flex:0 1 85%;flex:0 1 85%;box-shadow:0px 5px 21px rgba(0,0,0,0.1);border-radius:5px;border:1px solid rgba(0,0,0,0.1)}}.cherry5-is__popup-header{border-bottom:1px solid #e5e5e5}.cherry5-is__popup-header-inner{display:-webkit-box;display:-ms-flexbox;display:flex}.cherry5-is__popup-title{-webkit-box-flex:0;-ms-flex:0 1 100%;flex:0 1 100%;padding:10px;margin:0}@media (min-width: 961px){.cherry5-is__popup-title{padding:15px}}.cherry5-is__close-button{-webkit-box-flex:0;-ms-flex:0 1 auto;flex:0 1 auto;padding:10px;border-left:1px solid #e5e5e5;cursor:pointer;box-sizing:border-box;width:43px;padding:10px;-webkit-transition:box-shadow .3s ease-in-out, color .3s ease-in-out;transition:box-shadow .3s ease-in-out, color .3s ease-in-out;box-shadow:inset 0px 0px 0px rgba(41,143,252,0)}.cherry5-is__close-button:hover{color:#298ffc;outline:none;box-shadow:inset 0px 0px 10px rgba(41,143,252,0.5)}@media (min-width: 961px){.cherry5-is__close-button{padding:15px;width:50px}}.cherry5-is__popup-body{display:-webkit-box;display:-ms-flexbox;display:flex;height:100%;min-height:50%;position:relative}.cherry5-is__popup-sidebar{position:absolute;width:100%;height:100%;z-index:100;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;right:100%;margin-right:-41px;-webkit-transition:right 0.5s cubic-bezier(0.215, 0.61, 0.355, 1),margin-right 0.5s cubic-bezier(0.215, 0.61, 0.355, 1);transition:right 0.5s cubic-bezier(0.215, 0.61, 0.355, 1),margin-right 0.5s cubic-bezier(0.215, 0.61, 0.355, 1)}.cherry5-is__popup-sidebar.open{right:0%;margin-right:-1px}@media (min-width: 961px){.cherry5-is__popup-sidebar{position:relative;-webkit-box-flex:0;-ms-flex:0 1 50%;flex:0 1 50%;-ms-flex-item-align:stretch;-ms-grid-row-align:stretch;align-self:stretch;width:inherit;right:inherit;margin-right:0}}@media (min-width: 1200px){.cherry5-is__popup-sidebar{-webkit-box-flex:0;-ms-flex:0 1 50%;flex:0 1 50%}}@media (min-width: 1500px){.cherry5-is__popup-sidebar{-webkit-box-flex:0;-ms-flex:0 1 30%;flex:0 1 30%}}.cherry5-is__sidebar-button{min-height:100%;-webkit-box-flex:0;-ms-flex:0 1 44px;flex:0 1 44px;border-top:none;border-left:1px solid rgba(0,0,0,0.1);border-right:1px solid rgba(0,0,0,0.1);background:#fff;cursor:pointer;position:relative;box-sizing:border-box}.cherry5-is__sidebar-button .close,.cherry5-is__sidebar-button .open{position:absolute;top:50%;left:50%;font-size:45px;width:38px;height:44px;margin:-22px 0 0 -20px;text-align:left}.cherry5-is__sidebar-button .open{display:block}.cherry5-is__sidebar-button .close{display:none}.cherry5-is__popup-sidebar.open .cherry5-is__sidebar-button .open{display:none}.cherry5-is__popup-sidebar.open .cherry5-is__sidebar-button .close{display:block}@media (min-width: 961px){.cherry5-is__sidebar-button{display:none}}.cherry5-is__sidebar-list{background-color:#fff;box-sizing:border-box;overflow-y:scroll;-webkit-box-flex:0;-ms-flex:0 1 100%;flex:0 1 100%;-ms-flex-item-align:stretch;-ms-grid-row-align:stretch;align-self:stretch}.cherry5-is__sidebar-list .cherry-component.cherry-accordion .cherry-component__title{margin:10px 15px 15px}.cherry5-is__sidebar-list .cherry-component.cherry-accordion .cherry-accordion__title [class*="icon"],.cherry5-is__sidebar-list .cherry-component.cherry-accordion .cherry-settings ul [class*="icon"]{float:left;text-align:left;margin-right:10px;line-height:0.9}.cherry5-is__sidebar-list .cherry-component.cherry-accordion .cherry-settings{box-shadow:none;border-radius:0;border-left:0;border-right:0}.cherry5-is__sidebar-list .cherry-component.cherry-accordion .cherry-settings__content{background:#e5e5e5;overflow:hidden;box-shadow:inset 0px 0px 10px rgba(163,163,163,0.3)}.cherry5-is__sidebar-list .cherry-component.cherry-accordion .cherry-settings ul{margin:15px 20px}.cherry5-is__sidebar-list .cherry-component.cherry-accordion .cherry-settings ul .cherry5-is__get-shotcode{color:#23282d;-webkit-transition:color 350ms ease-in-out;transition:color 350ms ease-in-out;background:none;display:block;width:100%;text-align:left;padding:0;margin:0;border:none;line-height:1.5}.cherry5-is__sidebar-list .cherry-component.cherry-accordion .cherry-settings ul .cherry5-is__get-shotcode:hover,.cherry5-is__sidebar-list .cherry-component.cherry-accordion .cherry-settings ul .cherry5-is__get-shotcode.show{color:#298ffc}.cherry5-is__sidebar-list .cherry-component.cherry-accordion .cherry-settings ul li+li{margin-top:15px}.cherry5-is__sidebar-list .cherry-component.cherry-accordion .cherry-settings+.cherry-settings{margin-top:0;border-top:0}.cherry5-is__popup-section{box-sizing:border-box;width:100%;-webkit-box-flex:0;-ms-flex:0 1 100%;flex:0 1 100%;padding-left:30px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;-ms-flex-line-pack:stretch;align-content:stretch;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch}.cherry5-is__popup-section .cherry-component>.cherry-component__title,.cherry5-is__popup-section .cherry-component>.cherry-component__description{margin:20px}.cherry5-is__popup-section .cherry-accordion .cherry-component__content .cherry-settings,.cherry5-is__popup-section .cherry-toggle .cherry-component__content .cherry-settings{border-radius:0;border-right:0;border-left:0}.cherry5-is__popup-section .cherry-tab>.cherry-tab__body{border-radius:0}.cherry5-is__popup-section .cherry-tab>.cherry-tab__body .cherry-tab__tabs{border-radius:0;border-left:0;border-bottom:0}.cherry5-is__popup-section .cherry-tab>.cherry-tab__body .cherry-tab__content{border-radius:0;border-bottom:0;border-right:0}@media (min-width: 961px){.cherry5-is__popup-section{padding-left:0}}.cherry5-is__shortcodes-options{-webkit-box-flex:0;-ms-flex:0 1 100%;flex:0 1 100%}@media (min-width: 961px){.cherry5-is__shortcodes-options{position:relative;-webkit-box-flex:0;-ms-flex:0 1 100%;flex:0 1 100%}}.cherry5-is__content-area{padding:10px 10px 10px 20px;border-bottom:1px solid rgba(0,0,0,0.1)}@media (min-width: 961px){.cherry5-is__content-area{padding:15px}}.cherry5-is__content-area-title{margin-top:0}.cherry5-is__shortcode-form{display:none}.cherry5-is__shortcode-form-header{border-bottom:1px solid rgba(0,0,0,0.1)}.cherry5-is__shortcode-form-header .cherry5-is__shortcode-title,.cherry5-is__shortcode-form-header .cherry5-is__shortcode-description{margin:20px}.cherry5-is__shortcode-form.show{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;min-height:100%}.cherry5-is__popup-footer{-webkit-box-flex:0;-ms-flex:0 1 auto;flex:0 1 auto;-ms-flex-item-align:auto;-ms-grid-row-align:auto;align-self:auto;border-top:1px solid #e5e5e5;padding:10px;background:#fff}@media (min-width: 961px){.cherry5-is__popup-footer{padding:15px}}.cherry5-is__insert-button{float:right;-webkit-transition:all .5s ease;transition:all .5s ease}@media (max-width: 961px){.cherry5-is__insert-button{padding:9px 12px}}.cherry5-is__insert-button[disabled]{opacity:0.8;cursor:default;pointer-events:none}.cherry5-is.cherry-ui-kit .cherry-component{padding:0}.cherry5-is__has-not-option{font-size:1.5rem;text-align:center;-webkit-box-flex:1;-ms-flex:1 1 100%;flex:1 1 100%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-ms-flex-line-pack:stretch;align-content:stretch;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.cherry-scroll{overflow-y:scroll}.cherry-scroll::-webkit-scrollbar{width:10px;height:10px;margin:-5px}.cherry-scroll::-webkit-scrollbar-button{width:0px;height:0px}.cherry-scroll::-webkit-scrollbar-thumb{background-color:#298ffc;border:none;border-radius:5px}.cherry-scroll::-webkit-scrollbar-thumb:hover,.cherry-scroll::-webkit-scrollbar-thumb:active{background:#206ff4}.cherry-scroll::-webkit-scrollbar-track{background-color:#e5e5e5;border:none;border-radius:5px}.cherry-scroll::-webkit-scrollbar-corner{background:transparent}.cherry-loader{display:block;width:20px;height:20px;-webkit-animation:spin .7s linear infinite;animation:spin .7s linear infinite;border:3px solid #e5e5e5;border-top:3px solid #3498DB;border-radius:50%}.cherry-loader-wrapper{-webkit-transition:opacity .5s ease, -webkit-transform .5s ease;transition:opacity .5s ease, -webkit-transform .5s ease;transition:opacity .5s ease, transform .5s ease;transition:opacity .5s ease, transform .5s ease, -webkit-transform .5s ease;-webkit-transform:scale(0);transform:scale(0);opacity:0;position:absolute;top:50%;left:50%;width:20px;height:20px;margin:-13px 0 0 -13px}.cherry-loader-wrapper.show{display:block;-webkit-transform:scale(1);transform:scale(1);opacity:1}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-webkit-keyframes open-pop-up{0%{-webkit-transform:scale(0.5);transform:scale(0.5);opacity:0}100%{-webkit-transform:scale(1);transform:scale(1);opacity:1}}@keyframes open-pop-up{0%{-webkit-transform:scale(0.5);transform:scale(0.5);opacity:0}100%{-webkit-transform:scale(1);transform:scale(1);opacity:1}}@-webkit-keyframes close-pop-up{0%{-webkit-transform:scale(1);transform:scale(1);opacity:1}100%{-webkit-transform:scale(0.5);transform:scale(0.5);opacity:0}}@keyframes close-pop-up{0%{-webkit-transform:scale(1);transform:scale(1);opacity:1}100%{-webkit-transform:scale(0.5);transform:scale(0.5);opacity:0}}@-webkit-keyframes simple-fade-in{0%{opacity:0}100%{opacity:0.7}}@keyframes simple-fade-in{0%{opacity:0}100%{opacity:0.7}}@-webkit-keyframes simple-fade-out{0%{opacity:0.7}100%{opacity:0}}@keyframes simple-fade-out{0%{opacity:0.7}100%{opacity:0}}
|
cherry-framework/modules/cherry5-insert-shortcode/assets/min/cherry-insert-shortcode.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery(document).on("ready",function(){var t=jQuery,e=window.CherryJsCore;e.utilites.namespace("cherry5InsertShortcode"),e.cherry5InsertShortcode={openPopUpButton:".cherry5-is__open-button",closePopUpButton:".cherry5-is__close-button",insertionWindow:".cherry5-is__modal-window",insertionPopUp:".cherry5-is__popup",insertionPopUpBg:".cherry5-is__background",shortcodeOptionHolder:".cherry5-is__shortcodes-options",shortcodeOptionHolderClass:".cherry5-is__shortcode-form.show",insertButton:".cherry5-is__insert-button",spinner:".cherry-loader-wrapper",contentArea:".cherry5-is__shortcode-content",sidebar:".cherry5-is__popup-sidebar",sidebarButton:".cherry5-is__sidebar-button",insertShortcodeId:"cherry5_insert_shortcode",getShortcodeOptionButton:".cherry5-is__get-shotcode",getShortcodeOptionInstance:null,selectedContent:"",openedShortcode:[],devMode:!1,sessionStorage:{optionsTemplate:{},activeShortcode:{}},init:function(){this.devMode="true"===window.cherry5InsertShortcode.devMode,this.sessionStorage=this.devMode?this.sessionStorage:this.getState()||this.sessionStorage,this.getShortcodeOptionInstance=new e.CherryAjaxHandler({handlerId:this.insertShortcodeId,successCallback:this.getShortcodeOptionCallback.bind(this)}),this.addEvent(),this.switchFirstShortcode()},addEvent:function(){t("body").on("click.cherry5InsertShortcode",this.openPopUpButton,this.showPopUp.bind(this)).on("click.cherry5InsertShortcode",this.closePopUpButton,this.hidePopUp.bind(this)).on("click.cherry5InsertShortcode",this.insertionPopUpBg,this.hidePopUp.bind(this)).on("click.cherry5InsertShortcode",this.insertButton,this.insertShortcode.bind(this)).on("click.cherry5InsertShortcode",this.insertButton,this.hidePopUp.bind(this)).on("click.cherry5InsertShortcode",this.getShortcodeOptionButton,this.getShortcodeOption.bind(this)).on("click.cherry5InsertShortcode",this.sidebarButton,this.openSodebar.bind(this))},showPopUp:function(){var e;window.tinymce&&(window.tinymce.get("content")&&window.tinymce.get("content").selection&&(this.selectedContent=window.tinymce.get("content").selection.getContent({format:"text"})),e=this.sessionStorage.activeShortcode,this.afterShowShortcode(e.pluginSlug+"-"+e.shortcodeSlug,e.enclosing)),t(this.insertionWindow).addClass("open show"),t(this.insertionPopUp,this.insertionWindow).off("animationend")},hidePopUp:function(){this.selectedContent="",this.openedShortcode=[],t(this.insertionWindow).removeClass("open"),t(this.insertionPopUp,this.insertionWindow).on("animationend",this.hideModalWindow.bind(this))},hideModalWindow:function(){t(this.insertionWindow).removeClass("show")},switchFirstShortcode:function(){var e=this.sessionStorage.activeShortcode,o=null;o=t(e.pluginSlug&&e.shortcodeSlug?"#button-"+e.pluginSlug+"-"+e.shortcodeSlug:".cherry5-is__shortcode-list:first > li:first .cherry5-is__get-shotcode"),this.switchShortcode(o)},getShortcodeOption:function(e){return this.switchShortcode(t(e.target)),!1},switchShortcode:function(e){var o,i=e.data("plugin-slug"),s=e.data("shortcode-slug"),n=i+"-"+s,r=t("#"+n);return t(this.insertButton,this.insertionPopUp).attr("disabled","disabled"),this.hide(t(this.getShortcodeOptionButton+".show")),this.show(e),this.hide(t(this.shortcodeOptionHolderClass)),r[0]?(o=this.sessionStorage.optionsTemplate[n],this.setProxyStorage(o,n),this.show(r),void this.afterShowShortcode(n,o.enclosing)):!this.devMode&&this.sessionStorage.optionsTemplate[n]?void this.getShortcodeOptionCallback({data:this.sessionStorage.optionsTemplate[n]}):(this.show(t(this.spinner,this.shortcodeOptionHolder)),void this.getShortcodeOptionInstance.sendData({plugin_slug:i,shortcode_slug:s}))},getShortcodeOptionCallback:function(e){var o,i=e.data,s=t(this.shortcodeOptionHolder,"body");return i.error?void window.console.log(i.message):(o=i.pluginSlug+"-"+i.shortcodeSlug,this.setProxyStorage(i,o),this.hide(t(this.spinner,this.shortcodeOptionHolder)),s.append(i.html),this.afterShowShortcode(o,i.enclosing),t(document).trigger("cherryInterfaceBuilder"),void t("body").trigger({type:"cherry-ui-elements-init",_target:t("#"+o,s)}))},setProxyStorage:function(t,e){t&&(this.sessionStorage.optionsTemplate[e]=t,this.sessionStorage.activeShortcode=t),this.devMode||this.setState()},afterShowShortcode:function(e,o){var i,s="";o&&-1===this.openedShortcode.indexOf(e)&&(i=this.sessionStorage.activeShortcode.defaultContent,this.selectedContent?s=this.selectedContent:i&&(s=i),t("#"+e+"-content").val(s),this.openedShortcode.push(e)),t(this.insertButton,this.insertionPopUp).removeAttr("disabled")},insertShortcode:function(){var e,o,i,s,n=this.sessionStorage.activeShortcode,r=n.shortcodeSlug,h=n.pluginSlug,c=h+"-"+r,d=n.enclosing,a=d?"[$1$2]$3[/$1]":"[$1$2]",p=t("form#"+c).serializeArray(),l={},S="",u="";if(p[0]){for(e in p)o=p[e],i=o.name.replace(/\[\S*\]/g,""),"cherry5-is__shortcode-content"!==i&&(l[i]?l[i]+=","+o.value:l[i]=o.value);t.map(l,function(t,e){t&&(S+=" "+e+'="'+t+'"')})}d&&(u=t("#"+c+"-content").val()),s=a.replace(/\$1/g,r).replace(/\$2/g,S).replace(/\$3/g,u),window.wp.media.editor.insert(s)},getState:function(){try{return JSON.parse(sessionStorage.getItem("cherry5-insert-shortcode"))}catch(t){return!1}},setState:function(){try{sessionStorage.setItem("cherry5-insert-shortcode",JSON.stringify(this.sessionStorage))}catch(t){return!1}},show:function(t){t.addClass("show")},hide:function(t){t.removeClass("show")},openSodebar:function(){t(this.sidebar).toggleClass("open")}},e.cherry5InsertShortcode.init()});
|
cherry-framework/modules/cherry5-insert-shortcode/cherry5-insert-shortcode.php
ADDED
@@ -0,0 +1,266 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Module Name: Insert Shortcode
|
4 |
+
* Description: The module allows you to add shortcodes from editor tinyMCE.
|
5 |
+
* Version: 1.0.1
|
6 |
+
* Author: Cherry Team
|
7 |
+
* Author URI: http://www.cherryframework.com/
|
8 |
+
* License: GPLv3
|
9 |
+
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
+
*
|
11 |
+
* @package Cherry_Framework
|
12 |
+
* @subpackage Modules
|
13 |
+
* @version 1.0.1
|
14 |
+
* @author Cherry Team <cherryframework@gmail.com>
|
15 |
+
* @copyright Copyright (c) 2012 - 2016, Cherry Team
|
16 |
+
* @link http://www.cherryframework.com/
|
17 |
+
* @license http://www.gnu.org/licenses/gpl-3.0.html
|
18 |
+
*/
|
19 |
+
|
20 |
+
// If this file is called directly, abort.
|
21 |
+
if ( ! defined( 'WPINC' ) ) {
|
22 |
+
die;
|
23 |
+
}
|
24 |
+
|
25 |
+
// If class `Cherry5_Insert_Shortcode` doesn't exists yet.
|
26 |
+
if ( ! class_exists( 'Cherry5_Insert_Shortcode' ) ) {
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Cherry5_Insert_Shortcode class.
|
30 |
+
*/
|
31 |
+
class Cherry5_Insert_Shortcode {
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Module version.
|
35 |
+
*
|
36 |
+
* @since 1.0.0
|
37 |
+
* @var string
|
38 |
+
*/
|
39 |
+
private $module_version = '1.0.1';
|
40 |
+
|
41 |
+
/**
|
42 |
+
* A reference to an instance of this class.
|
43 |
+
*
|
44 |
+
* @since 1.0.0
|
45 |
+
* @var object
|
46 |
+
* @access private
|
47 |
+
*/
|
48 |
+
private static $instance = null;
|
49 |
+
|
50 |
+
/**
|
51 |
+
* Module arguments
|
52 |
+
*
|
53 |
+
* @since 1.0.0
|
54 |
+
* @var array
|
55 |
+
* @access private
|
56 |
+
*/
|
57 |
+
private $args = array();
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Core instance
|
61 |
+
*
|
62 |
+
* @since 1.0.0
|
63 |
+
* @var object
|
64 |
+
* @access private
|
65 |
+
*/
|
66 |
+
private $core = null;
|
67 |
+
|
68 |
+
/**
|
69 |
+
* UI element instance.
|
70 |
+
*
|
71 |
+
* @since 1.0.0
|
72 |
+
* @var object
|
73 |
+
* @access public
|
74 |
+
*/
|
75 |
+
public $ui_elements = null;
|
76 |
+
|
77 |
+
/**
|
78 |
+
* Cherry Interface Builder instance.
|
79 |
+
*
|
80 |
+
* @since 1.0.0
|
81 |
+
* @var object
|
82 |
+
* @access public
|
83 |
+
*/
|
84 |
+
public $cherry_interface_builder = null;
|
85 |
+
|
86 |
+
/**
|
87 |
+
* A reference to an instance of this class Cherry_Insert_Admin_Button.
|
88 |
+
*
|
89 |
+
* @since 1.0.0
|
90 |
+
* @var object
|
91 |
+
* @access private
|
92 |
+
*/
|
93 |
+
private $shortcodes_button = null;
|
94 |
+
|
95 |
+
/**
|
96 |
+
* A reference to an instance of this class Cherry5_Insertion_Popup.
|
97 |
+
*
|
98 |
+
* @since 1.0.0
|
99 |
+
* @var object
|
100 |
+
* @access private
|
101 |
+
*/
|
102 |
+
private $shortcodes_popup = null;
|
103 |
+
|
104 |
+
/**
|
105 |
+
* Shortcode list.
|
106 |
+
*
|
107 |
+
* @since 1.0.0
|
108 |
+
* @var object
|
109 |
+
* @access private
|
110 |
+
*/
|
111 |
+
private $added_shortcodes = array();
|
112 |
+
|
113 |
+
/**
|
114 |
+
* Class constructor.
|
115 |
+
*
|
116 |
+
* @since 1.0.0
|
117 |
+
* @access public
|
118 |
+
* @return void
|
119 |
+
*/
|
120 |
+
public function __construct( $core = null, $args = array(), $init = true ) {
|
121 |
+
if ( $init ) {
|
122 |
+
$this->core = $core;
|
123 |
+
$this->args = array_merge_recursive(
|
124 |
+
$args,
|
125 |
+
array(
|
126 |
+
'module_dir' => trailingslashit( dirname( __FILE__ ) ),
|
127 |
+
'in_screen' => array( 'post' ),
|
128 |
+
)
|
129 |
+
);
|
130 |
+
|
131 |
+
$this->ui_elements = $this->core->init_module( 'cherry-ui-elements' );
|
132 |
+
$this->cherry_interface_builder = $this->core->init_module( 'cherry-interface-builder' );
|
133 |
+
|
134 |
+
// Include libraries from the `inc/`.
|
135 |
+
$this->includes();
|
136 |
+
|
137 |
+
// Initializing child classes.
|
138 |
+
$this->shortcodes_button = new Cherry5_Insertion_Button( $this->core, $this->args, $this );
|
139 |
+
$this->shortcodes_popup = new Cherry5_Insertion_Popup( $this->core, $this->args, $this );
|
140 |
+
|
141 |
+
// Register admin assets.
|
142 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'register_assets' ), 0 );
|
143 |
+
|
144 |
+
// Load admin assets.
|
145 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_assets' ), 11 );
|
146 |
+
}
|
147 |
+
}
|
148 |
+
|
149 |
+
/**
|
150 |
+
* Include libraries from the `inc/`.
|
151 |
+
*
|
152 |
+
* @since 1.0.0
|
153 |
+
* @access private
|
154 |
+
* @return void
|
155 |
+
*/
|
156 |
+
private function includes() {
|
157 |
+
require_once( dirname( __FILE__ ) . '/inc/class-cherry5-insertion-button.php' );
|
158 |
+
require_once( dirname( __FILE__ ) . '/inc/class-cherry5-insertion-popup.php' );
|
159 |
+
}
|
160 |
+
|
161 |
+
/**
|
162 |
+
* Register assets.
|
163 |
+
*
|
164 |
+
* @since 1.0.0
|
165 |
+
* @access public
|
166 |
+
* @return void
|
167 |
+
*/
|
168 |
+
public function register_assets() {
|
169 |
+
// Register stylesheets.
|
170 |
+
wp_register_style( 'cherry5-insert-shortcode', esc_url( Cherry_Core::base_url( 'assets/min/cherry-insert-shortcode.min.css', __FILE__ ) ), array(), $this->module_version, 'all' );
|
171 |
+
|
172 |
+
// Register JavaScripts.
|
173 |
+
wp_register_script( 'cherry5-insert-shortcode-js', esc_url( Cherry_Core::base_url( 'assets/min/cherry-insert-shortcode.min.js', __FILE__ ) ), array( 'cherry-js-core' ), $this->module_version, true );
|
174 |
+
}
|
175 |
+
|
176 |
+
/**
|
177 |
+
* Enqueue admin stylesheets.
|
178 |
+
*
|
179 |
+
* @since 1.0.0
|
180 |
+
* @access public
|
181 |
+
* @return void
|
182 |
+
*/
|
183 |
+
public function enqueue_assets() {
|
184 |
+
$screen = get_current_screen();
|
185 |
+
|
186 |
+
if ( in_array( $screen->base, $this->args['in_screen'] ) ) {
|
187 |
+
wp_enqueue_style( 'cherry5-insert-shortcode' );
|
188 |
+
wp_enqueue_script( 'cherry5-insert-shortcode-js' );
|
189 |
+
|
190 |
+
$dev_mode = ( constant( 'WP_DEBUG' ) ) ? 'true' : 'false' ;
|
191 |
+
wp_localize_script( 'cherry-js-core', 'cherry5InsertShortcode', array( 'devMode' => $dev_mode ) );
|
192 |
+
}
|
193 |
+
}
|
194 |
+
|
195 |
+
/**
|
196 |
+
* The function is called a filter to add shortcode.
|
197 |
+
*
|
198 |
+
* @since 1.0.0
|
199 |
+
* @access public
|
200 |
+
* @return void
|
201 |
+
*/
|
202 |
+
public function register_shortcode( $args = array() ) {
|
203 |
+
$this->added_shortcodes = $args;
|
204 |
+
add_filter( 'cherry5-is__shortcode_list', array( $this, 'add_new_shortcode' ), 10, 1 );
|
205 |
+
}
|
206 |
+
|
207 |
+
/**
|
208 |
+
* Function add new shortcode.
|
209 |
+
*
|
210 |
+
* @since 1.0.0
|
211 |
+
* @access public
|
212 |
+
* @return array
|
213 |
+
*/
|
214 |
+
public function add_new_shortcode( $shortcodes = array() ) {
|
215 |
+
$plugin_slug = $this->added_shortcodes['slug'];
|
216 |
+
$new_shortcodes = $this->added_shortcodes['shortcodes'];
|
217 |
+
$this->added_shortcodes['shortcodes'] = array();
|
218 |
+
|
219 |
+
if ( ! array_key_exists( $plugin_slug, $shortcodes ) ) {
|
220 |
+
$shortcodes[ $plugin_slug ] = $this->added_shortcodes;
|
221 |
+
}
|
222 |
+
|
223 |
+
foreach ( $new_shortcodes as $value ) {
|
224 |
+
$shortcode_slug = $value['slug'];
|
225 |
+
|
226 |
+
if ( array_key_exists( $shortcode_slug, $shortcodes[ $plugin_slug ]['shortcodes'] ) ) {
|
227 |
+
continue;
|
228 |
+
}
|
229 |
+
|
230 |
+
$shortcodes[ $plugin_slug ]['shortcodes'][ $shortcode_slug ] = $value;
|
231 |
+
}
|
232 |
+
|
233 |
+
return $shortcodes;
|
234 |
+
}
|
235 |
+
|
236 |
+
/**
|
237 |
+
* Returns the instance.
|
238 |
+
*
|
239 |
+
* @since 1.0.0
|
240 |
+
* @access public
|
241 |
+
* @return object
|
242 |
+
*/
|
243 |
+
public static function get_instance( $core = null, $args = array() ) {
|
244 |
+
|
245 |
+
// If the single instance hasn't been set, set it now.
|
246 |
+
if ( null == self::$instance ) {
|
247 |
+
self::$instance = new self( $core, $args );
|
248 |
+
}
|
249 |
+
|
250 |
+
return self::$instance;
|
251 |
+
}
|
252 |
+
}
|
253 |
+
// If class `Cherry5_Insert_Shortcode` doesn't exists yet.
|
254 |
+
if ( ! function_exists( 'cherry5_register_shortcode' ) ) {
|
255 |
+
|
256 |
+
/**
|
257 |
+
* The function registers a new shortcode.
|
258 |
+
*
|
259 |
+
* @since 1.0.0
|
260 |
+
*/
|
261 |
+
function cherry5_register_shortcode( $args = array() ) {
|
262 |
+
$cherry5_insert_shortcode = new Cherry5_Insert_Shortcode( null, array(), false );
|
263 |
+
$cherry5_insert_shortcode->register_shortcode( $args );
|
264 |
+
}
|
265 |
+
}
|
266 |
+
}
|
cherry-framework/modules/cherry5-insert-shortcode/inc/class-cherry5-insertion-button.php
ADDED
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Sets up the admin functionality for the plugin.
|
4 |
+
*
|
5 |
+
* @package Cherry_Framework
|
6 |
+
* @subpackage Modules
|
7 |
+
* @author Cherry Team <cherryframework@gmail.com>
|
8 |
+
* @copyright Copyright (c) 2012 - 2016, Cherry Team
|
9 |
+
* @link http://www.cherryframework.com/
|
10 |
+
* @license http://www.gnu.org/licenses/gpl-3.0.html
|
11 |
+
*/
|
12 |
+
|
13 |
+
// If class `Cherry5_Insertion_Button` doesn't exists yet.
|
14 |
+
if ( ! class_exists( 'Cherry5_Insertion_Button' ) ) {
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Cherry5_Insertion_Button class.
|
18 |
+
*/
|
19 |
+
class Cherry5_Insertion_Button {
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Module arguments
|
23 |
+
*
|
24 |
+
* @var array
|
25 |
+
*/
|
26 |
+
public $args = array();
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Core instance
|
30 |
+
*
|
31 |
+
* @var object
|
32 |
+
*/
|
33 |
+
public $core = null;
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Class constructor.
|
37 |
+
*
|
38 |
+
* @since 1.0.0
|
39 |
+
* @access public
|
40 |
+
* @return void
|
41 |
+
*/
|
42 |
+
public function __construct( $core = null, $args = array(), $parent_self = null ) {
|
43 |
+
$this->core = $core;
|
44 |
+
$this->args = $args;
|
45 |
+
$this->parent_self = $parent_self;
|
46 |
+
|
47 |
+
add_action( 'media_buttons', array( $this, 'add_button' ) );
|
48 |
+
add_action( 'cherry5-insert-shortcode', array( $this, 'add_button' ) );
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Function add button into tinymce editor.
|
53 |
+
*
|
54 |
+
* @since 1.0.0
|
55 |
+
* @access public
|
56 |
+
* @return void
|
57 |
+
*/
|
58 |
+
public function add_button() {
|
59 |
+
$args = apply_filters( 'cherry5-is__open-button', array(
|
60 |
+
'id' => '',
|
61 |
+
'name' => '',
|
62 |
+
'style' => 'primary',
|
63 |
+
'content' => '<span class="cherry5-is__icon dashicons dashicons-plus"></span>' . esc_html__( 'Cherry shortcodes', 'cherry-framework' ),
|
64 |
+
'class' => 'cherry5-is__open-button',
|
65 |
+
) );
|
66 |
+
|
67 |
+
echo $this->parent_self->ui_elements->get_ui_element_instance( 'button', $args )->render();
|
68 |
+
}
|
69 |
+
}
|
70 |
+
}
|
71 |
+
|
cherry-framework/modules/cherry5-insert-shortcode/inc/class-cherry5-insertion-popup.php
ADDED
@@ -0,0 +1,285 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Sets up the admin functionality for the plugin.
|
4 |
+
*
|
5 |
+
* @package Cherry_Framework
|
6 |
+
* @subpackage Modules
|
7 |
+
* @author Cherry Team <cherryframework@gmail.com>
|
8 |
+
* @copyright Copyright (c) 2012 - 2016, Cherry Team
|
9 |
+
* @link http://www.cherryframework.com/
|
10 |
+
* @license http://www.gnu.org/licenses/gpl-3.0.html
|
11 |
+
*/
|
12 |
+
|
13 |
+
// If class `Cherry5_Insertion_Popup` doesn't exists yet.
|
14 |
+
if ( ! class_exists( 'Cherry5_Insertion_Popup' ) ) {
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Cherry5_Insertion_Popup class.
|
18 |
+
*/
|
19 |
+
class Cherry5_Insertion_Popup {
|
20 |
+
|
21 |
+
/**
|
22 |
+
* A reference to an instance of parent class.
|
23 |
+
*
|
24 |
+
* @since 1.0.0
|
25 |
+
* @var object
|
26 |
+
* @access private
|
27 |
+
*/
|
28 |
+
private static $instance = null;
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Module arguments
|
32 |
+
*
|
33 |
+
* @since 1.0.0
|
34 |
+
* @var array
|
35 |
+
* @access private
|
36 |
+
*/
|
37 |
+
private $args = array();
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Core instance
|
41 |
+
*
|
42 |
+
* @since 1.0.0
|
43 |
+
* @var object
|
44 |
+
* @access private
|
45 |
+
*/
|
46 |
+
private $core = null;
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Shortcode list.
|
50 |
+
*
|
51 |
+
* @since 1.0.0
|
52 |
+
* @var array
|
53 |
+
* @access private
|
54 |
+
*/
|
55 |
+
private $shortcode_list = array(
|
56 |
+
array(
|
57 |
+
'title' => '',
|
58 |
+
'description' => '',
|
59 |
+
'icon' => '',
|
60 |
+
'slug' => '',
|
61 |
+
'shortcodes' => array(
|
62 |
+
array(
|
63 |
+
'title' => '',
|
64 |
+
'description' => '',
|
65 |
+
'icon' => '',
|
66 |
+
'slug' => '',
|
67 |
+
'enclosing ' => false,
|
68 |
+
'options' => array(),
|
69 |
+
),
|
70 |
+
),
|
71 |
+
),
|
72 |
+
);
|
73 |
+
|
74 |
+
/**
|
75 |
+
* Class constructor.
|
76 |
+
*
|
77 |
+
* @since 1.0.0
|
78 |
+
* @access public
|
79 |
+
* @return void
|
80 |
+
*/
|
81 |
+
public function __construct( $core = null, $args = array(), $parent_self = null ) {
|
82 |
+
$this->core = $core;
|
83 |
+
$this->args = $args;
|
84 |
+
$this->parent_self = $parent_self;
|
85 |
+
|
86 |
+
$this->core->init_module(
|
87 |
+
'cherry-handler',
|
88 |
+
array(
|
89 |
+
'id' => 'cherry5_insert_shortcode',
|
90 |
+
'action' => 'cherry5_insert_shortcode',
|
91 |
+
'type' => 'GET',
|
92 |
+
'capability' => 'manage_options',
|
93 |
+
'callback' => array( $this , 'get_shortcode_options' ),
|
94 |
+
'sys_messages' => array(
|
95 |
+
'invalid_base_data' => '',
|
96 |
+
'no_right' => '',
|
97 |
+
'invalid_nonce' => '',
|
98 |
+
'access_is_allowed' => '',
|
99 |
+
),
|
100 |
+
)
|
101 |
+
);
|
102 |
+
|
103 |
+
if ( ! defined( 'DOING_AJAX' ) ) {
|
104 |
+
add_action( 'admin_print_footer_scripts', array( $this, 'render_popup' ), 99 );
|
105 |
+
}
|
106 |
+
}
|
107 |
+
|
108 |
+
/**
|
109 |
+
* Add popup into page.
|
110 |
+
*
|
111 |
+
* @since 1.0.0
|
112 |
+
* @access public
|
113 |
+
* @return void
|
114 |
+
*/
|
115 |
+
public function render_popup( $hook ) {
|
116 |
+
$screen = get_current_screen();
|
117 |
+
|
118 |
+
if ( in_array( $screen->base, $this->args['in_screen'] ) ) {
|
119 |
+
|
120 |
+
$this->shortcode_list = apply_filters( 'cherry5-is__shortcode_list', array() );
|
121 |
+
$popup_title = esc_html( 'Insert Cherry Shortcode', 'cherry' );
|
122 |
+
$sidebar_list = $this->get_sidebar_list( $this->shortcode_list );
|
123 |
+
|
124 |
+
$args = apply_filters( 'cherry5-is__insert-button', array(
|
125 |
+
'id' => '',
|
126 |
+
'name' => '',
|
127 |
+
'style' => 'primary',
|
128 |
+
'content' => esc_html__( 'insert shortcode', 'cherry-framework' ),
|
129 |
+
'class' => 'cherry5-is__insert-button',
|
130 |
+
) );
|
131 |
+
|
132 |
+
$insert_button = $this->parent_self->ui_elements->get_ui_element_instance( 'button', $args )->render();
|
133 |
+
|
134 |
+
require_once( apply_filters( 'cherry5-is__popup-template', $this->args['module_dir'] . 'inc/views/insert-shortcode-pop-up.php' ) );
|
135 |
+
}
|
136 |
+
}
|
137 |
+
|
138 |
+
/**
|
139 |
+
* The function returns a HTML structure of registered shortcodes.
|
140 |
+
*
|
141 |
+
* @since 1.0.0
|
142 |
+
* @access private
|
143 |
+
* @return string
|
144 |
+
*/
|
145 |
+
private function get_sidebar_list( $plugins = array() ) {
|
146 |
+
$structure['shortcode-list'] = array(
|
147 |
+
'type' => 'component-accordion',
|
148 |
+
'title' => esc_html__( 'Shortcode List', 'cherry-framework' ),
|
149 |
+
);
|
150 |
+
$defaults = array(
|
151 |
+
'icon' => '',
|
152 |
+
'title' => '',
|
153 |
+
'description' => '',
|
154 |
+
);
|
155 |
+
|
156 |
+
$list_items_template = apply_filters( 'cherry5-is__list-items-template', '<li><button id="button-%1$s-%2$s" class="cherry5-is__get-shotcode" data-plugin-slug="%1$s" data-shortcode-slug="%2$s" title="%3$s">%4$s%5$s</button></li>' );
|
157 |
+
|
158 |
+
foreach ( $plugins as $plugin_slug => $plugin_value ) {
|
159 |
+
$plugin_value = wp_parse_args( $plugin_value, $defaults );
|
160 |
+
|
161 |
+
$structure[ $plugin_slug ] = array(
|
162 |
+
'id' => $plugin_slug,
|
163 |
+
'type' => 'settings',
|
164 |
+
'parent' => 'shortcode-list',
|
165 |
+
'title' => $plugin_value['icon'] . $plugin_value['title'],
|
166 |
+
'description' => $plugin_value['description'],
|
167 |
+
);
|
168 |
+
|
169 |
+
$output_html = '<ul class="cherry5-is__shortcode-list">';
|
170 |
+
|
171 |
+
foreach ( $plugin_value['shortcodes'] as $shortcode_slug => $shortcode_value ) {
|
172 |
+
$shortcode_value = wp_parse_args( $shortcode_value, $defaults );
|
173 |
+
|
174 |
+
$output_html .= sprintf( $list_items_template, $plugin_slug, $shortcode_slug, $shortcode_value['description'], $shortcode_value['icon'], $shortcode_value['title'] );
|
175 |
+
}
|
176 |
+
|
177 |
+
$output_html .= '</ul>';
|
178 |
+
|
179 |
+
$structure[ $plugin_slug . '-shortcodes' ] = array(
|
180 |
+
'id' => $plugin_slug . '-shortcodes',
|
181 |
+
'type' => 'html',
|
182 |
+
'parent' => $plugin_slug,
|
183 |
+
'html' => $output_html,
|
184 |
+
);
|
185 |
+
}
|
186 |
+
return $this->parent_self->cherry_interface_builder->render( false, $structure );
|
187 |
+
}
|
188 |
+
|
189 |
+
/**
|
190 |
+
* The function returns option was shortcode.
|
191 |
+
*
|
192 |
+
* @since 1.0.0
|
193 |
+
* @access public
|
194 |
+
* @return array
|
195 |
+
*/
|
196 |
+
public function get_shortcode_options() {
|
197 |
+
$shortcode_list = apply_filters( 'cherry5-is__shortcode_list', array() );
|
198 |
+
|
199 |
+
$plugin_slug = ( ! empty( $_GET['data']['plugin_slug'] ) )? $_GET['data']['plugin_slug'] : '' ;
|
200 |
+
$shortcode_slug = ( ! empty( $_GET['data']['shortcode_slug'] ) )? $_GET['data']['shortcode_slug'] : '' ;
|
201 |
+
$shortcode_attr = isset( $shortcode_list[ $plugin_slug ]['shortcodes'][ $shortcode_slug ] ) ? $shortcode_list[ $plugin_slug ]['shortcodes'][ $shortcode_slug ] : false;
|
202 |
+
|
203 |
+
if ( ! $shortcode_attr ) {
|
204 |
+
return array(
|
205 |
+
'error' => true,
|
206 |
+
'message' => esc_html__( 'Shortcode not found.', 'cherry-framework' ),
|
207 |
+
);
|
208 |
+
} else {
|
209 |
+
$defaults = array(
|
210 |
+
'content_area' => '',
|
211 |
+
'enclosing' => false,
|
212 |
+
'title' => '',
|
213 |
+
'description' => '',
|
214 |
+
'defaultContent' => '',
|
215 |
+
'options' => false,
|
216 |
+
);
|
217 |
+
|
218 |
+
$shortcode_attr = wp_parse_args( $shortcode_attr, $defaults );
|
219 |
+
|
220 |
+
if ( $shortcode_attr['enclosing'] ) {
|
221 |
+
$shortcode_attr['content_area'] = $this->get_shortcode_content_editor( $default_content, $plugin_slug, $shortcode_slug );
|
222 |
+
}
|
223 |
+
|
224 |
+
if ( ! empty( $shortcode_attr['options'] ) ) {
|
225 |
+
|
226 |
+
foreach ( $shortcode_attr['options'] as $key => $settings ) {
|
227 |
+
|
228 |
+
if ( ! array_key_exists( 'id', $settings ) ) {
|
229 |
+
$shortcode_attr['options'][ $key ]['id'] = $shortcode_slug . '_' . $key;
|
230 |
+
}
|
231 |
+
}
|
232 |
+
|
233 |
+
$shortcode_options_html = $this->parent_self->cherry_interface_builder->render( false, $shortcode_attr['options'] );
|
234 |
+
} else {
|
235 |
+
$shortcode_options_html = $this->get_empty_layer();
|
236 |
+
}
|
237 |
+
|
238 |
+
$shortcode_option_template = apply_filters( 'cherry5-is__options-template', Cherry_Toolkit::get_file( $this->args['module_dir'] . 'inc/views/shortcode-options.php' ) );
|
239 |
+
$output_html = sprintf( $shortcode_option_template, $plugin_slug, $shortcode_slug, $shortcode_attr['title'], $shortcode_attr['description'], $shortcode_attr['content_area'], $shortcode_options_html );
|
240 |
+
|
241 |
+
return array(
|
242 |
+
'error' => false,
|
243 |
+
'pluginSlug' => $plugin_slug,
|
244 |
+
'shortcodeSlug' => $shortcode_slug,
|
245 |
+
'enclosing' => $shortcode_attr['enclosing'],
|
246 |
+
'defaultContent' => $shortcode_attr['defaultContent'],
|
247 |
+
'html' => $output_html,
|
248 |
+
);
|
249 |
+
}
|
250 |
+
}
|
251 |
+
|
252 |
+
/**
|
253 |
+
* The function returns content area HTML.
|
254 |
+
*
|
255 |
+
* @since 1.0.0
|
256 |
+
* @access private
|
257 |
+
* @return string
|
258 |
+
*/
|
259 |
+
private function get_shortcode_content_editor( $content = '', $plugin_slug = '', $shortcode_slug = '' ) {
|
260 |
+
$template = apply_filters( 'cherry5-is__content-area-template', Cherry_Toolkit::get_file( $this->args['module_dir'] . 'inc/views/shortcode-content-area.php' ) );
|
261 |
+
$title = apply_filters( 'cherry5-is__content-title', esc_html__( 'Shortcode content.', 'cherry-framework' ) );
|
262 |
+
$placeholder = apply_filters( 'cherry5-is__content-placeholder', esc_html__( 'Input shortcode content.', 'cherry-framework' ) );
|
263 |
+
|
264 |
+
$output = sprintf( $template, $plugin_slug, $shortcode_slug, $title, $placeholder, $content );
|
265 |
+
|
266 |
+
return $output;
|
267 |
+
}
|
268 |
+
|
269 |
+
/**
|
270 |
+
* The function returns empty layer HTML.
|
271 |
+
*
|
272 |
+
* @since 1.0.0
|
273 |
+
* @access private
|
274 |
+
* @return string
|
275 |
+
*/
|
276 |
+
private function get_empty_layer() {
|
277 |
+
$text = apply_filters( 'cherry5-is__empty_layer-text', esc_html__( 'Shortcode not a have options.', 'cherry-framework' ) );
|
278 |
+
$template = apply_filters( 'cherry5-is__empty_layer-template', Cherry_Toolkit::get_file( $this->args['module_dir'] . 'inc/views/shortcode-has-not-option.php' ) );
|
279 |
+
$output = sprintf( $template, $text );
|
280 |
+
|
281 |
+
return $output;
|
282 |
+
}
|
283 |
+
}
|
284 |
+
}
|
285 |
+
|
cherry-framework/modules/cherry5-insert-shortcode/inc/views/insert-shortcode-pop-up.php
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Popup view.
|
4 |
+
*
|
5 |
+
* @package cherry5_insert_shortcode
|
6 |
+
* @subpackage Views
|
7 |
+
* @author Cherry Team <cherryframework@gmail.com>
|
8 |
+
* @copyright Copyright (c) 2012 - 2016, Cherry Team
|
9 |
+
* @link http://www.cherryframework.com/
|
10 |
+
* @license http://www.gnu.org/licenses/gpl-3.0.html
|
11 |
+
*/
|
12 |
+
|
13 |
+
// If this file is called directly, abort.
|
14 |
+
if ( ! defined( 'WPINC' ) ) {
|
15 |
+
die;
|
16 |
+
}
|
17 |
+
?>
|
18 |
+
<div class="cherry5-is cherry5-is__modal-window cherry-ui-kit">
|
19 |
+
<div class="cherry5-is__popup">
|
20 |
+
<div class="cherry5-is__popup-header">
|
21 |
+
<div class="cherry5-is__popup-header-inner">
|
22 |
+
<h3 class="cherry5-is__popup-title"><?php echo $popup_title ?></h3>
|
23 |
+
<div class="cherry5-is__close-button">
|
24 |
+
<span class="dashicons dashicons-no"></span>
|
25 |
+
</div>
|
26 |
+
</div>
|
27 |
+
</div>
|
28 |
+
<div class="cherry5-is__popup-body">
|
29 |
+
<div class="cherry5-is__popup-sidebar">
|
30 |
+
<div class="cherry5-is__sidebar-list cherry-scroll">
|
31 |
+
<?php echo $sidebar_list ?>
|
32 |
+
</div>
|
33 |
+
<div class="cherry5-is__sidebar-button">
|
34 |
+
<span class="dashicons dashicons-arrow-left-alt2 close"></span>
|
35 |
+
<span class="dashicons dashicons-arrow-right-alt2 open"></span>
|
36 |
+
</div>
|
37 |
+
</div>
|
38 |
+
<div class="cherry5-is__popup-section">
|
39 |
+
<div class="cherry5-is__shortcodes-options cherry-scroll">
|
40 |
+
<span class="cherry-loader-wrapper"><span class="cherry-loader"></span></span>
|
41 |
+
</div>
|
42 |
+
<div class="cherry5-is__popup-footer">
|
43 |
+
<?php echo $insert_button ?>
|
44 |
+
</div>
|
45 |
+
</div>
|
46 |
+
</div>
|
47 |
+
</div>
|
48 |
+
<div class="cherry5-is__background"></div>
|
49 |
+
</div>
|
cherry-framework/modules/cherry5-insert-shortcode/inc/views/shortcode-content-area.php
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Shortcode options view.
|
4 |
+
*
|
5 |
+
* @package cherry5_insert_shortcode
|
6 |
+
* @subpackage Views
|
7 |
+
* @author Cherry Team <cherryframework@gmail.com>
|
8 |
+
* @copyright Copyright (c) 2012 - 2016, Cherry Team
|
9 |
+
* @link http://www.cherryframework.com/
|
10 |
+
* @license http://www.gnu.org/licenses/gpl-3.0.html
|
11 |
+
*/
|
12 |
+
|
13 |
+
// If this file is called directly, abort.
|
14 |
+
if ( ! defined( 'WPINC' ) ) {
|
15 |
+
die;
|
16 |
+
}
|
17 |
+
?>
|
18 |
+
<div class="cherry5-is__content-area">
|
19 |
+
<header class="cherry5-is__content-area-header">
|
20 |
+
<h3 class="cherry5-is__content-area-title" role="banner">%3$s</h3>
|
21 |
+
</header>
|
22 |
+
<textarea id="%1$s-%2$s-content" name="cherry5-is__shortcode-content" class="cherry5-is__shortcode-content cherry-ui-textarea" rows="10" cols="20" placeholder="%4$s">%5$s</textarea>
|
23 |
+
</div>
|
cherry-framework/modules/cherry5-insert-shortcode/inc/views/shortcode-has-not-option.php
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Shortcode has not option view.
|
4 |
+
*
|
5 |
+
* @package cherry5_insert_shortcode
|
6 |
+
* @subpackage Views
|
7 |
+
* @author Cherry Team <cherryframework@gmail.com>
|
8 |
+
* @copyright Copyright (c) 2012 - 2016, Cherry Team
|
9 |
+
* @link http://www.cherryframework.com/
|
10 |
+
* @license http://www.gnu.org/licenses/gpl-3.0.html
|
11 |
+
*/
|
12 |
+
|
13 |
+
// If this file is called directly, abort.
|
14 |
+
if ( ! defined( 'WPINC' ) ) {
|
15 |
+
die;
|
16 |
+
}
|
17 |
+
?>
|
18 |
+
<div class="cherry5-is__has-not-option">
|
19 |
+
<span class="cherry5-is__has-not-option-text">
|
20 |
+
%1$s
|
21 |
+
<span>
|
22 |
+
</div>
|
cherry-framework/modules/cherry5-insert-shortcode/inc/views/shortcode-options.php
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Shortcode options view.
|
4 |
+
*
|
5 |
+
* @package cherry5_insert_shortcode
|
6 |
+
* @subpackage Views
|
7 |
+
* @author Cherry Team <cherryframework@gmail.com>
|
8 |
+
* @copyright Copyright (c) 2012 - 2016, Cherry Team
|
9 |
+
* @link http://www.cherryframework.com/
|
10 |
+
* @license http://www.gnu.org/licenses/gpl-3.0.html
|
11 |
+
*/
|
12 |
+
|
13 |
+
// If this file is called directly, abort.
|
14 |
+
if ( ! defined( 'WPINC' ) ) {
|
15 |
+
die;
|
16 |
+
}
|
17 |
+
?>
|
18 |
+
<form id="%1$s-%2$s" name="%1$s-%2$s" class="cherry5-is__shortcode-form show" >
|
19 |
+
<header class="cherry5-is__shortcode-form-header">
|
20 |
+
<h2 class="cherry5-is__shortcode-title" role="banner">%3$s</h2>
|
21 |
+
<div class="cherry5-is__shortcode-description" role="note">%4$s</div>
|
22 |
+
</header>
|
23 |
+
%5$s
|
24 |
+
%6$s
|
25 |
+
<form>
|
cherry-framework/setup.php
CHANGED
@@ -8,7 +8,7 @@
|
|
8 |
* @author Cherry Team <cherryframework@gmail.com>
|
9 |
* @copyright Copyright (c) 2012 - 2016, Cherry Team
|
10 |
* @link http://www.cherryframework.com/
|
11 |
-
* @license http://www.gnu.org/licenses/
|
12 |
*/
|
13 |
|
14 |
return create_function( '', '
|
8 |
* @author Cherry Team <cherryframework@gmail.com>
|
9 |
* @copyright Copyright (c) 2012 - 2016, Cherry Team
|
10 |
* @link http://www.cherryframework.com/
|
11 |
+
* @license http://www.gnu.org/licenses/gpl-3.0.en.html
|
12 |
*/
|
13 |
|
14 |
return create_function( '', '
|
cherry-search.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Cherry Search
|
4 |
* Plugin URI: http://www.cherryframework.com/
|
5 |
* Description: A plugin for WordPress.
|
6 |
-
* Version: 1.
|
7 |
* Author: Cherry Team
|
8 |
* Text Domain: cherry-search
|
9 |
* License: GPL-3.0+
|
@@ -12,7 +12,7 @@
|
|
12 |
*
|
13 |
* @package Cherry_Search
|
14 |
* @author Cherry Team
|
15 |
-
* @version 1.
|
16 |
* @license GPL-3.0+
|
17 |
* @copyright 2012-2016, Cherry Team
|
18 |
*/
|
@@ -72,7 +72,7 @@ if ( ! class_exists( 'Cherry_Search' ) ) {
|
|
72 |
add_action( 'after_setup_theme', array( 'Cherry_Core', 'load_all_modules' ), 2 );
|
73 |
|
74 |
// Load the include files.
|
75 |
-
add_action( 'after_setup_theme', array( $this, 'includes' ),
|
76 |
|
77 |
// Register public assets.
|
78 |
add_action( 'wp_enqueue_scripts', array( $this, 'register_assets' ), 10 );
|
@@ -92,7 +92,7 @@ if ( ! class_exists( 'Cherry_Search' ) ) {
|
|
92 |
*
|
93 |
* @since 1.0.0
|
94 |
*/
|
95 |
-
define( 'CHERRY_SEARCH_VERSION', '1.
|
96 |
|
97 |
/**
|
98 |
* Set the slug of the plugin.
|
@@ -174,6 +174,9 @@ if ( ! class_exists( 'Cherry_Search' ) ) {
|
|
174 |
'cherry-dynamic-css' => array(
|
175 |
'autoload' => false,
|
176 |
),
|
|
|
|
|
|
|
177 |
),
|
178 |
) );
|
179 |
|
3 |
* Plugin Name: Cherry Search
|
4 |
* Plugin URI: http://www.cherryframework.com/
|
5 |
* Description: A plugin for WordPress.
|
6 |
+
* Version: 1.1.0
|
7 |
* Author: Cherry Team
|
8 |
* Text Domain: cherry-search
|
9 |
* License: GPL-3.0+
|
12 |
*
|
13 |
* @package Cherry_Search
|
14 |
* @author Cherry Team
|
15 |
+
* @version 1.1.0
|
16 |
* @license GPL-3.0+
|
17 |
* @copyright 2012-2016, Cherry Team
|
18 |
*/
|
72 |
add_action( 'after_setup_theme', array( 'Cherry_Core', 'load_all_modules' ), 2 );
|
73 |
|
74 |
// Load the include files.
|
75 |
+
add_action( 'after_setup_theme', array( $this, 'includes' ), 11 );
|
76 |
|
77 |
// Register public assets.
|
78 |
add_action( 'wp_enqueue_scripts', array( $this, 'register_assets' ), 10 );
|
92 |
*
|
93 |
* @since 1.0.0
|
94 |
*/
|
95 |
+
define( 'CHERRY_SEARCH_VERSION', '1.1.0' );
|
96 |
|
97 |
/**
|
98 |
* Set the slug of the plugin.
|
174 |
'cherry-dynamic-css' => array(
|
175 |
'autoload' => false,
|
176 |
),
|
177 |
+
'cherry5-insert-shortcode' => array(
|
178 |
+
'autoload' => false,
|
179 |
+
),
|
180 |
),
|
181 |
) );
|
182 |
|
includes/admin/class-cherry-search-admin.php
CHANGED
@@ -38,7 +38,7 @@ if ( ! class_exists( 'Cherry_Search_Admin' ) ) {
|
|
38 |
$this->init_modules();
|
39 |
|
40 |
// Include libraries from the `includes/admin`
|
41 |
-
$this
|
42 |
|
43 |
// Load the admin menu.
|
44 |
add_action( 'admin_menu', array( $this, 'menu' ) );
|
@@ -68,6 +68,9 @@ if ( ! class_exists( 'Cherry_Search_Admin' ) ) {
|
|
68 |
|
69 |
// Include plugin pages.
|
70 |
require_once( trailingslashit( CHERRY_SEARCH_DIR ) . 'includes/admin/pages/class-cherry-search-settings-page.php' );
|
|
|
|
|
|
|
71 |
}
|
72 |
|
73 |
/**
|
38 |
$this->init_modules();
|
39 |
|
40 |
// Include libraries from the `includes/admin`
|
41 |
+
add_action( 'init', array( $this, 'includes' ), 9999 );
|
42 |
|
43 |
// Load the admin menu.
|
44 |
add_action( 'admin_menu', array( $this, 'menu' ) );
|
68 |
|
69 |
// Include plugin pages.
|
70 |
require_once( trailingslashit( CHERRY_SEARCH_DIR ) . 'includes/admin/pages/class-cherry-search-settings-page.php' );
|
71 |
+
|
72 |
+
// Include plugin shortcode.
|
73 |
+
require_once( trailingslashit( CHERRY_SEARCH_DIR ) . 'includes/admin/class-cherry-search-register-shortcodes.php' );
|
74 |
}
|
75 |
|
76 |
/**
|
includes/admin/class-cherry-search-register-shortcodes.php
ADDED
@@ -0,0 +1,115 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Registered plugins shortcodes.
|
4 |
+
*
|
5 |
+
* @package Blank_Plugin
|
6 |
+
* @subpackage Admin
|
7 |
+
* @author Cherry Team
|
8 |
+
* @license GPL-3.0+
|
9 |
+
* @copyright 2012-2016, Cherry Team
|
10 |
+
*/
|
11 |
+
|
12 |
+
// If class `Cherry_Search_Register_Shortcodes` doesn't exists yet.
|
13 |
+
if ( ! class_exists( 'Cherry_Search_Register_Shortcodes' ) ) {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Cherry_Search_Register_Shortcodes class.
|
17 |
+
*/
|
18 |
+
class Cherry_Search_Register_Shortcodes extends Cherry_Search_Settings {
|
19 |
+
|
20 |
+
/**
|
21 |
+
* A reference to an instance of this class.
|
22 |
+
*
|
23 |
+
* @since 1.0.0
|
24 |
+
* @var object
|
25 |
+
* @access private
|
26 |
+
*/
|
27 |
+
private static $instance = null;
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Class constructor.
|
31 |
+
*
|
32 |
+
* @since 1.0.0
|
33 |
+
* @access public
|
34 |
+
* @return void
|
35 |
+
*/
|
36 |
+
public function __construct() {
|
37 |
+
parent::__construct();
|
38 |
+
cherry_search()->get_core()->init_module( 'cherry5-insert-shortcode', array() );
|
39 |
+
|
40 |
+
$this->register_shortcodes();
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Render plugin options page.
|
45 |
+
*
|
46 |
+
* @since 1.0.0
|
47 |
+
* @access private
|
48 |
+
* @return void
|
49 |
+
*/
|
50 |
+
private function register_shortcodes() {
|
51 |
+
unset(
|
52 |
+
$this->settings['change_standard_search'],
|
53 |
+
$this->tabs['notices'],
|
54 |
+
$this->tabs['submite_buttons'],
|
55 |
+
$this->settings['negative_search'],
|
56 |
+
$this->settings['server_error']
|
57 |
+
);
|
58 |
+
|
59 |
+
foreach ( $this->tabs as $key => $value ) {
|
60 |
+
unset( $value['scroll'] );
|
61 |
+
|
62 |
+
$this->tabs[ $key ] = $value;
|
63 |
+
}
|
64 |
+
|
65 |
+
if ( function_exists( 'cherry5_register_shortcode' ) ) {
|
66 |
+
cherry5_register_shortcode(
|
67 |
+
array(
|
68 |
+
'title' => esc_html__( 'Cherry Search', 'cherry-search' ),
|
69 |
+
'icon' => '<span class="dashicons dashicons-search"></span>',
|
70 |
+
'slug' => CHERRY_SEARCH_SLUG,
|
71 |
+
'shortcodes' => array(
|
72 |
+
array(
|
73 |
+
'title' => esc_html__( 'Search Form', 'cherry-search' ),
|
74 |
+
'icon' => '<span class="dashicons dashicons-menu"></span>',
|
75 |
+
'slug' => 'cherry_search_form',
|
76 |
+
'options' => array_merge( $this->component_tab, $this->tabs, $this->settings ),
|
77 |
+
),
|
78 |
+
),
|
79 |
+
)
|
80 |
+
);
|
81 |
+
}
|
82 |
+
}
|
83 |
+
|
84 |
+
/**
|
85 |
+
* Returns the instance.
|
86 |
+
*
|
87 |
+
* @since 1.0.0
|
88 |
+
* @access public
|
89 |
+
* @return object
|
90 |
+
*/
|
91 |
+
public static function get_instance() {
|
92 |
+
|
93 |
+
// If the single instance hasn't been set, set it now.
|
94 |
+
if ( null == self::$instance ) {
|
95 |
+
self::$instance = new self;
|
96 |
+
}
|
97 |
+
|
98 |
+
return self::$instance;
|
99 |
+
}
|
100 |
+
}
|
101 |
+
if ( ! function_exists( 'cherry_search_register_shortcodes' ) ) {
|
102 |
+
|
103 |
+
/**
|
104 |
+
* Returns instanse of the plugin class.
|
105 |
+
*
|
106 |
+
* @since 1.0.0
|
107 |
+
* @return object
|
108 |
+
*/
|
109 |
+
function cherry_search_register_shortcodes() {
|
110 |
+
return Cherry_Search_Register_Shortcodes::get_instance();
|
111 |
+
}
|
112 |
+
|
113 |
+
cherry_search_register_shortcodes();
|
114 |
+
}
|
115 |
+
}
|
includes/admin/class-cherry-search-settings.php
CHANGED
@@ -133,6 +133,7 @@ if ( ! class_exists( 'Cherry_Search_Settings' ) ) {
|
|
133 |
* @return void
|
134 |
*/
|
135 |
public function __construct() {
|
|
|
136 |
$this->utility = cherry_search()->get_core()->modules['cherry-utility']->utility;
|
137 |
|
138 |
$this->set_settings();
|
@@ -168,26 +169,31 @@ if ( ! class_exists( 'Cherry_Search_Settings' ) ) {
|
|
168 |
|
169 |
$this->tabs = array(
|
170 |
'main' => array(
|
|
|
171 |
'parent' => 'search_settings_tab',
|
172 |
'scroll' => true,
|
173 |
'title' => esc_html__( 'Main settings', 'cherry-search' ),
|
174 |
),
|
175 |
'query_settings' => array(
|
|
|
176 |
'parent' => 'search_settings_tab',
|
177 |
'scroll' => true,
|
178 |
'title' => esc_html__( 'Search results settings', 'cherry-search' ),
|
179 |
),
|
180 |
'visual_settings' => array(
|
|
|
181 |
'parent' => 'search_settings_tab',
|
182 |
'scroll' => true,
|
183 |
'title' => esc_html__( 'Visual settings', 'cherry-search' ),
|
184 |
),
|
185 |
'notices' => array(
|
|
|
186 |
'parent' => 'search_settings_tab',
|
187 |
'scroll' => true,
|
188 |
'title' => esc_html__( 'Notifications', 'cherry-search' ),
|
189 |
),
|
190 |
'submite_buttons' => array(
|
|
|
191 |
'parent' => 'search_settings_section',
|
192 |
),
|
193 |
);
|
@@ -264,8 +270,8 @@ if ( ! class_exists( 'Cherry_Search_Settings' ) ) {
|
|
264 |
'description' => esc_html__( 'This option allows to set categories in which search will not be made.', 'cherry-search' ),
|
265 |
'multiple' => true,
|
266 |
'filter' => true,
|
267 |
-
'value' => $this->get_setting( 'exclude_source_category', '' ),
|
268 |
-
'options' => $this->utility->satellite->get_terms_array(),
|
269 |
'placeholder' => esc_html__( 'Not selected categories.', 'cherry-search' ),
|
270 |
),
|
271 |
'exclude_source_tags' => array(
|
@@ -276,7 +282,7 @@ if ( ! class_exists( 'Cherry_Search_Settings' ) ) {
|
|
276 |
'multiple' => true,
|
277 |
'filter' => true,
|
278 |
'value' => $this->get_setting( 'exclude_source_tags', '' ),
|
279 |
-
'options' => $this->utility->satellite->get_terms_array(
|
280 |
'placeholder' => esc_html__( 'Not selected tags.', 'cherry-search' ),
|
281 |
),
|
282 |
'exclude_source_post_format' => array(
|
@@ -466,7 +472,7 @@ if ( ! class_exists( 'Cherry_Search_Settings' ) ) {
|
|
466 |
}
|
467 |
|
468 |
/**
|
469 |
-
* Get
|
470 |
*
|
471 |
* @since 1.0.0
|
472 |
* @access private
|
@@ -474,18 +480,38 @@ if ( ! class_exists( 'Cherry_Search_Settings' ) ) {
|
|
474 |
*/
|
475 |
private function get_search_source() {
|
476 |
$sources = get_post_types( '', 'objects' );
|
477 |
-
$exude
|
478 |
-
|
479 |
if ( $sources ) {
|
480 |
foreach ( $sources as $key => $value ) {
|
481 |
-
if ( in_array( $key, $exude ) ) {
|
482 |
-
|
483 |
-
} else {
|
484 |
-
$sources[ $value->name ] = ucfirst( $value->label );
|
485 |
}
|
486 |
}
|
487 |
}
|
488 |
-
return $
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
489 |
}
|
490 |
|
491 |
/**
|
133 |
* @return void
|
134 |
*/
|
135 |
public function __construct() {
|
136 |
+
cherry_search()->get_core()->init_module( 'cherry-utility', array() );
|
137 |
$this->utility = cherry_search()->get_core()->modules['cherry-utility']->utility;
|
138 |
|
139 |
$this->set_settings();
|
169 |
|
170 |
$this->tabs = array(
|
171 |
'main' => array(
|
172 |
+
'type' => 'settings',
|
173 |
'parent' => 'search_settings_tab',
|
174 |
'scroll' => true,
|
175 |
'title' => esc_html__( 'Main settings', 'cherry-search' ),
|
176 |
),
|
177 |
'query_settings' => array(
|
178 |
+
'type' => 'settings',
|
179 |
'parent' => 'search_settings_tab',
|
180 |
'scroll' => true,
|
181 |
'title' => esc_html__( 'Search results settings', 'cherry-search' ),
|
182 |
),
|
183 |
'visual_settings' => array(
|
184 |
+
'type' => 'settings',
|
185 |
'parent' => 'search_settings_tab',
|
186 |
'scroll' => true,
|
187 |
'title' => esc_html__( 'Visual settings', 'cherry-search' ),
|
188 |
),
|
189 |
'notices' => array(
|
190 |
+
'type' => 'settings',
|
191 |
'parent' => 'search_settings_tab',
|
192 |
'scroll' => true,
|
193 |
'title' => esc_html__( 'Notifications', 'cherry-search' ),
|
194 |
),
|
195 |
'submite_buttons' => array(
|
196 |
+
'type' => 'settings',
|
197 |
'parent' => 'search_settings_section',
|
198 |
),
|
199 |
);
|
270 |
'description' => esc_html__( 'This option allows to set categories in which search will not be made.', 'cherry-search' ),
|
271 |
'multiple' => true,
|
272 |
'filter' => true,
|
273 |
+
'value' => $this->get_setting( 'exclude_source_category', 'projects' ),
|
274 |
+
'options' => $this->utility->satellite->get_terms_array( $this->get_categories() ),
|
275 |
'placeholder' => esc_html__( 'Not selected categories.', 'cherry-search' ),
|
276 |
),
|
277 |
'exclude_source_tags' => array(
|
282 |
'multiple' => true,
|
283 |
'filter' => true,
|
284 |
'value' => $this->get_setting( 'exclude_source_tags', '' ),
|
285 |
+
'options' => $this->utility->satellite->get_terms_array( $this->get_tags() ),
|
286 |
'placeholder' => esc_html__( 'Not selected tags.', 'cherry-search' ),
|
287 |
),
|
288 |
'exclude_source_post_format' => array(
|
472 |
}
|
473 |
|
474 |
/**
|
475 |
+
* Get search source.
|
476 |
*
|
477 |
* @since 1.0.0
|
478 |
* @access private
|
480 |
*/
|
481 |
private function get_search_source() {
|
482 |
$sources = get_post_types( '', 'objects' );
|
483 |
+
$exude = array( 'revision', 'nav_menu_item' );
|
484 |
+
$output = array();
|
485 |
if ( $sources ) {
|
486 |
foreach ( $sources as $key => $value ) {
|
487 |
+
if ( ! in_array( $key, $exude ) ) {
|
488 |
+
$output[ $value->name ] = ucfirst( $value->label );
|
|
|
|
|
489 |
}
|
490 |
}
|
491 |
}
|
492 |
+
return $output;
|
493 |
+
}
|
494 |
+
|
495 |
+
/**
|
496 |
+
* .
|
497 |
+
*
|
498 |
+
* @since 1.0.0
|
499 |
+
* @access private
|
500 |
+
* @return array
|
501 |
+
*/
|
502 |
+
private function get_categories() {
|
503 |
+
return apply_filters( 'cherry_search_support_categories', array( 'category', 'projects_category', 'product_cat' ) );
|
504 |
+
}
|
505 |
+
|
506 |
+
/**
|
507 |
+
* .
|
508 |
+
*
|
509 |
+
* @since 1.0.0
|
510 |
+
* @access private
|
511 |
+
* @return array
|
512 |
+
*/
|
513 |
+
private function get_tags() {
|
514 |
+
return apply_filters( 'cherry_search_support_tags', array( 'post_tag', 'projects_tag', 'product_tag' ) );
|
515 |
}
|
516 |
|
517 |
/**
|
includes/public/class-cherry-search-form-public.php
CHANGED
@@ -20,11 +20,37 @@ if ( ! class_exists( 'Cherry_Search_Form_Public' ) ) {
|
|
20 |
/**
|
21 |
* A reference to an instance of this class.
|
22 |
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
* @since 1.0.0
|
24 |
* @access private
|
25 |
-
* @var
|
26 |
*/
|
27 |
-
private static $
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
|
29 |
/**
|
30 |
* Module сherry template мanager.
|
@@ -40,7 +66,7 @@ if ( ! class_exists( 'Cherry_Search_Form_Public' ) ) {
|
|
40 |
*
|
41 |
* @since 1.0.0
|
42 |
* @access private
|
43 |
-
* @var
|
44 |
*/
|
45 |
private $messages = array();
|
46 |
|
@@ -49,26 +75,29 @@ if ( ! class_exists( 'Cherry_Search_Form_Public' ) ) {
|
|
49 |
*
|
50 |
* @since 1.0.0
|
51 |
* @access private
|
52 |
-
* @var
|
53 |
*/
|
54 |
-
private $search_button_icon =
|
55 |
|
56 |
/**
|
57 |
* Class constructor.
|
58 |
*
|
59 |
-
* @since
|
60 |
* @access public
|
61 |
* @return void
|
62 |
*/
|
63 |
public function __construct() {
|
64 |
add_action( 'pre_get_posts', array( $this, 'set_search_query' ) );
|
65 |
|
66 |
-
$change_standard_search
|
67 |
-
$this->search_button_icon = $this->get_setting( 'search_button_icon' );
|
68 |
|
69 |
if ( $change_standard_search ) {
|
70 |
add_filter( 'get_search_form', array( $this, 'build_search_form' ), 0 );
|
|
|
71 |
}
|
|
|
|
|
|
|
72 |
}
|
73 |
|
74 |
/**
|
@@ -79,8 +108,14 @@ if ( ! class_exists( 'Cherry_Search_Form_Public' ) ) {
|
|
79 |
* @return void
|
80 |
*/
|
81 |
public function set_search_query( $query ) {
|
|
|
82 |
if ( ! is_admin() && $query->is_search ) {
|
83 |
-
$
|
|
|
|
|
|
|
|
|
|
|
84 |
$query->query_vars = array_merge( $query->query_vars, $this->search_query );
|
85 |
}
|
86 |
}
|
@@ -92,23 +127,31 @@ if ( ! class_exists( 'Cherry_Search_Form_Public' ) ) {
|
|
92 |
* @access public
|
93 |
* @return string
|
94 |
*/
|
95 |
-
public function build_search_form( $search_form = null ) {
|
|
|
96 |
if ( null === $this->template_manager ) {
|
97 |
-
$this->template_manager = Cherry_Template_Manager
|
98 |
}
|
99 |
|
100 |
-
$this->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
|
102 |
// Load public-facing StyleSheets.
|
103 |
$this->enqueue_styles();
|
|
|
104 |
|
105 |
-
|
106 |
-
add_action( 'wp_print_footer_scripts', array( $this, 'enqueue_scripts' ), 0 );
|
107 |
-
add_action( 'wp_print_footer_scripts', array( $this, 'print_js_template' ), 0 );
|
108 |
-
|
109 |
-
return $this->template_manager->parser->parsed_template( 'search-form', Cherry_Search_Macros_Callback::get_instance() );
|
110 |
}
|
111 |
-
|
112 |
/**
|
113 |
* Generate search form style.
|
114 |
*
|
@@ -116,23 +159,38 @@ if ( ! class_exists( 'Cherry_Search_Form_Public' ) ) {
|
|
116 |
* @access public
|
117 |
* @return void
|
118 |
*/
|
119 |
-
public function
|
120 |
-
$enable_scroll = filter_var( $
|
121 |
-
|
122 |
if ( $enable_scroll ) {
|
123 |
-
$
|
124 |
-
$max_height = $
|
125 |
|
126 |
-
$
|
127 |
-
'.cherry-search__results-list',
|
128 |
-
array(
|
129 |
'overflow-y' => 'auto',
|
130 |
'max-height' => $max_height . 'px',
|
131 |
-
)
|
132 |
);
|
133 |
}
|
134 |
}
|
135 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
/**
|
137 |
* Get JS template to print.
|
138 |
*
|
@@ -140,24 +198,31 @@ if ( ! class_exists( 'Cherry_Search_Form_Public' ) ) {
|
|
140 |
* @access public
|
141 |
* @return void
|
142 |
*/
|
143 |
-
public function
|
144 |
-
$
|
145 |
-
'search-form-results-item'
|
146 |
-
);
|
147 |
$output = '';
|
148 |
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
}
|
157 |
|
158 |
-
|
159 |
}
|
160 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
161 |
/**
|
162 |
* Enqueue public-facing stylesheets.
|
163 |
*
|
@@ -225,8 +290,8 @@ if ( ! function_exists( 'cherry_get_search_form' ) ) {
|
|
225 |
* @since 1.0.0
|
226 |
* @return string
|
227 |
*/
|
228 |
-
function cherry_get_search_form( $echo = true ) {
|
229 |
-
$form = cherry_search_form_public()->build_search_form();
|
230 |
if ( $echo ) {
|
231 |
echo $form;
|
232 |
} else {
|
20 |
/**
|
21 |
* A reference to an instance of this class.
|
22 |
*
|
23 |
+
* @since 1.0.0
|
24 |
+
* @var object
|
25 |
+
*/
|
26 |
+
private static $instance = null;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* The number of search forms on the page.
|
30 |
+
*
|
31 |
* @since 1.0.0
|
32 |
* @access private
|
33 |
+
* @var number
|
34 |
*/
|
35 |
+
private static $count = 0;
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Templates for search list.
|
39 |
+
*
|
40 |
+
* @since 1.0.0
|
41 |
+
* @access private
|
42 |
+
* @var string
|
43 |
+
*/
|
44 |
+
private static $js_templates = '';
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Styles for the search form.
|
48 |
+
*
|
49 |
+
* @since 1.0.0
|
50 |
+
* @access private
|
51 |
+
* @var array
|
52 |
+
*/
|
53 |
+
private static $dinamic_css = array();
|
54 |
|
55 |
/**
|
56 |
* Module сherry template мanager.
|
66 |
*
|
67 |
* @since 1.0.0
|
68 |
* @access private
|
69 |
+
* @var array
|
70 |
*/
|
71 |
private $messages = array();
|
72 |
|
75 |
*
|
76 |
* @since 1.0.0
|
77 |
* @access private
|
78 |
+
* @var string
|
79 |
*/
|
80 |
+
private $search_button_icon = '';
|
81 |
|
82 |
/**
|
83 |
* Class constructor.
|
84 |
*
|
85 |
+
* @since 1.0.0
|
86 |
* @access public
|
87 |
* @return void
|
88 |
*/
|
89 |
public function __construct() {
|
90 |
add_action( 'pre_get_posts', array( $this, 'set_search_query' ) );
|
91 |
|
92 |
+
$change_standard_search = filter_var( $this->get_setting( 'change_standard_search' ), FILTER_VALIDATE_BOOLEAN );
|
|
|
93 |
|
94 |
if ( $change_standard_search ) {
|
95 |
add_filter( 'get_search_form', array( $this, 'build_search_form' ), 0 );
|
96 |
+
add_filter( 'get_product_search_form', array( $this, 'build_search_form' ), 11 );
|
97 |
}
|
98 |
+
|
99 |
+
add_action( 'get_footer', array( $this, 'set_css_style' ) );
|
100 |
+
add_action( 'wp_print_footer_scripts', array( $this, 'print_js_template' ), 0 );
|
101 |
}
|
102 |
|
103 |
/**
|
108 |
* @return void
|
109 |
*/
|
110 |
public function set_search_query( $query ) {
|
111 |
+
|
112 |
if ( ! is_admin() && $query->is_search ) {
|
113 |
+
$form_settings = stripcslashes( $_GET['settings'] );
|
114 |
+
$form_settings = json_decode( $form_settings );
|
115 |
+
$form_settings = get_object_vars( $form_settings );
|
116 |
+
|
117 |
+
$this->set_query_settings( $form_settings );
|
118 |
+
|
119 |
$query->query_vars = array_merge( $query->query_vars, $this->search_query );
|
120 |
}
|
121 |
}
|
127 |
* @access public
|
128 |
* @return string
|
129 |
*/
|
130 |
+
public function build_search_form( $search_form = null, $args = array() ) {
|
131 |
+
|
132 |
if ( null === $this->template_manager ) {
|
133 |
+
$this->template_manager = new Cherry_Template_Manager( cherry_search()->get_core() );
|
134 |
}
|
135 |
|
136 |
+
$this->get_settings();
|
137 |
+
$this->settings['id'] = ++self::$count;
|
138 |
+
$this->settings = ! empty( $args ) ? wp_parse_args( $args, $this->settings ) : $this->settings ;
|
139 |
+
|
140 |
+
$wrapper_html = apply_filters( 'cherry_search_shortcode_wrapper', '<div id="cherry-search-wrapper-%1$s" class="cherry-search-wrapper" data-args=\'' . json_encode( $this->settings ) . '\'>%2$s</div>' );
|
141 |
+
$form_html = $this->template_manager->parser->parsed_template( 'search-form', new Cherry_Search_Macros_Callback( $this->settings ) );
|
142 |
+
|
143 |
+
$this->search_button_icon = $this->settings['search_button_icon'];
|
144 |
+
$this->messages['serverError'] = esc_html( $this->settings['server_error'] );
|
145 |
+
|
146 |
+
$this->add_js_template( $this->settings );
|
147 |
+
$this->add_css_style( $this->settings );
|
148 |
|
149 |
// Load public-facing StyleSheets.
|
150 |
$this->enqueue_styles();
|
151 |
+
$this->enqueue_scripts();
|
152 |
|
153 |
+
return sprintf( $wrapper_html, $this->settings['id'], $form_html );
|
|
|
|
|
|
|
|
|
154 |
}
|
|
|
155 |
/**
|
156 |
* Generate search form style.
|
157 |
*
|
159 |
* @access public
|
160 |
* @return void
|
161 |
*/
|
162 |
+
public function add_css_style( $args = array() ) {
|
163 |
+
$enable_scroll = filter_var( $args['enable_scroll'], FILTER_VALIDATE_BOOLEAN );
|
|
|
164 |
if ( $enable_scroll ) {
|
165 |
+
$id = $args['id'];
|
166 |
+
$max_height = $args['result_area_height'];
|
167 |
|
168 |
+
self::$dinamic_css[ $id ] = array(
|
169 |
+
'selector' => '#cherry-search-wrapper-' . $id . ' .cherry-search__results-list',
|
170 |
+
'options' => array(
|
171 |
'overflow-y' => 'auto',
|
172 |
'max-height' => $max_height . 'px',
|
173 |
+
),
|
174 |
);
|
175 |
}
|
176 |
}
|
177 |
|
178 |
+
/**
|
179 |
+
* Generate search form style.
|
180 |
+
*
|
181 |
+
* @since 1.0.0
|
182 |
+
* @access public
|
183 |
+
* @return void
|
184 |
+
*/
|
185 |
+
public function set_css_style() {
|
186 |
+
if ( ! empty( self::$dinamic_css ) ) {
|
187 |
+
$dynamic_css = cherry_search()->get_core()->init_module( 'cherry-dynamic-css', array() );
|
188 |
+
foreach ( self::$dinamic_css as $value ) {
|
189 |
+
$dynamic_css->add_style( $value['selector'], $value['options'] );
|
190 |
+
}
|
191 |
+
}
|
192 |
+
}
|
193 |
+
|
194 |
/**
|
195 |
* Get JS template to print.
|
196 |
*
|
198 |
* @access public
|
199 |
* @return void
|
200 |
*/
|
201 |
+
public function add_js_template( $args = array() ) {
|
202 |
+
$name = 'search-form-results-item';
|
|
|
|
|
203 |
$output = '';
|
204 |
|
205 |
+
$content = trim( $this->template_manager->parser->parsed_template( $name, new Cherry_Search_Macros_Callback( $args ) ) );
|
206 |
+
$output .= sprintf(
|
207 |
+
'<script type="text/html" id="tmpl-%1$s-%2$s">%3$s</script>',
|
208 |
+
$name,
|
209 |
+
$args['id'],
|
210 |
+
$content
|
211 |
+
);
|
|
|
212 |
|
213 |
+
self::$js_templates .= $output;
|
214 |
}
|
215 |
|
216 |
+
/**
|
217 |
+
* Get JS template to print.
|
218 |
+
*
|
219 |
+
* @since 1.0.0
|
220 |
+
* @access public
|
221 |
+
* @return void
|
222 |
+
*/
|
223 |
+
public function print_js_template() {
|
224 |
+
echo self::$js_templates;
|
225 |
+
}
|
226 |
/**
|
227 |
* Enqueue public-facing stylesheets.
|
228 |
*
|
290 |
* @since 1.0.0
|
291 |
* @return string
|
292 |
*/
|
293 |
+
function cherry_get_search_form( $echo = true, $args = array() ) {
|
294 |
+
$form = cherry_search_form_public()->build_search_form( null, $args );
|
295 |
if ( $echo ) {
|
296 |
echo $form;
|
297 |
} else {
|
includes/public/class-cherry-search-form-shortcode.php
CHANGED
@@ -69,8 +69,8 @@ if ( ! class_exists( 'Cherry_Search_Shortcode' ) ) {
|
|
69 |
* @access public
|
70 |
* @return string
|
71 |
*/
|
72 |
-
public function do_shortcode( $
|
73 |
-
return cherry_get_search_form( false );
|
74 |
}
|
75 |
/**
|
76 |
* Returns the instance.
|
69 |
* @access public
|
70 |
* @return string
|
71 |
*/
|
72 |
+
public function do_shortcode( $args = array(), $content = null, $shortcode = '' ) {
|
73 |
+
return cherry_get_search_form( false, $args );
|
74 |
}
|
75 |
/**
|
76 |
* Returns the instance.
|
includes/public/class-cherry-search-macros-callback.php
CHANGED
@@ -18,13 +18,13 @@ if ( ! class_exists( 'Cherry_Search_Macros_Callback' ) ) {
|
|
18 |
class Cherry_Search_Macros_Callback extends Cherry_Search_Settings_Manager {
|
19 |
|
20 |
/**
|
21 |
-
*
|
22 |
*
|
23 |
* @since 1.0.0
|
24 |
* @access private
|
25 |
* @var object
|
26 |
*/
|
27 |
-
private
|
28 |
|
29 |
/**
|
30 |
* The array contains the values that will replace the macros..
|
@@ -33,14 +33,17 @@ if ( ! class_exists( 'Cherry_Search_Macros_Callback' ) ) {
|
|
33 |
* @var array
|
34 |
*/
|
35 |
public $variable = array(
|
36 |
-
'thumbnail'
|
37 |
-
'title'
|
38 |
-
'content'
|
39 |
-
'author'
|
40 |
-
'link'
|
41 |
-
'placeholder'
|
42 |
-
'reader_text'
|
43 |
-
'
|
|
|
|
|
|
|
44 |
);
|
45 |
|
46 |
/**
|
@@ -58,8 +61,10 @@ if ( ! class_exists( 'Cherry_Search_Macros_Callback' ) ) {
|
|
58 |
* @access public
|
59 |
* @return void
|
60 |
*/
|
61 |
-
public function __construct() {
|
62 |
-
$this->
|
|
|
|
|
63 |
$this->set_variable();
|
64 |
}
|
65 |
|
@@ -72,11 +77,19 @@ if ( ! class_exists( 'Cherry_Search_Macros_Callback' ) ) {
|
|
72 |
*/
|
73 |
private function set_variable() {
|
74 |
// Value macro $$ACTION$$
|
75 |
-
$this->variable['action']
|
76 |
// Value macro $$PLACEHOLDER$$
|
77 |
-
$this->variable['placeholder']
|
78 |
// Value macro $$READER_TEXT$$
|
79 |
-
$this->variable['reader_text']
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
}
|
81 |
|
82 |
/**
|
@@ -98,9 +111,9 @@ if ( ! class_exists( 'Cherry_Search_Macros_Callback' ) ) {
|
|
98 |
* @return string
|
99 |
*/
|
100 |
public function get_submit() {
|
101 |
-
if ( $this->
|
102 |
|
103 |
-
return $this->template_manager->parser->parsed_template( 'search-form-submit', self
|
104 |
} else {
|
105 |
return;
|
106 |
}
|
@@ -114,7 +127,7 @@ if ( ! class_exists( 'Cherry_Search_Macros_Callback' ) ) {
|
|
114 |
* @return string
|
115 |
*/
|
116 |
public function get_icon() {
|
117 |
-
$class = $this->
|
118 |
|
119 |
if ( $class ) {
|
120 |
|
@@ -138,7 +151,7 @@ if ( ! class_exists( 'Cherry_Search_Macros_Callback' ) ) {
|
|
138 |
* @return string
|
139 |
*/
|
140 |
public function get_submit_text() {
|
141 |
-
$text = $this->
|
142 |
|
143 |
if ( $text ) {
|
144 |
|
@@ -156,7 +169,7 @@ if ( ! class_exists( 'Cherry_Search_Macros_Callback' ) ) {
|
|
156 |
* @return string
|
157 |
*/
|
158 |
public function get_results_list() {
|
159 |
-
return $this->template_manager->parser->parsed_template( 'search-form-results-list', self
|
160 |
}
|
161 |
|
162 |
/**
|
@@ -182,7 +195,7 @@ if ( ! class_exists( 'Cherry_Search_Macros_Callback' ) ) {
|
|
182 |
*/
|
183 |
public function get_thumbnail() {
|
184 |
$output = '';
|
185 |
-
$thumbnail_visible = filter_var( $this->
|
186 |
|
187 |
if ( $thumbnail_visible ) {
|
188 |
$thumbnail_html = apply_filters( 'cherry_search_thumbnail_html', '<span class="cherry-search__item-thumbnail">%s</span>' );
|
@@ -193,21 +206,66 @@ if ( ! class_exists( 'Cherry_Search_Macros_Callback' ) ) {
|
|
193 |
}
|
194 |
|
195 |
/**
|
196 |
-
*
|
197 |
*
|
198 |
* @since 1.0.0
|
199 |
* @access public
|
200 |
-
* @return
|
201 |
*/
|
202 |
-
public
|
|
|
|
|
|
|
203 |
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
208 |
|
209 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
210 |
}
|
211 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
212 |
}
|
213 |
}
|
18 |
class Cherry_Search_Macros_Callback extends Cherry_Search_Settings_Manager {
|
19 |
|
20 |
/**
|
21 |
+
* The attributes of the shortcode.
|
22 |
*
|
23 |
* @since 1.0.0
|
24 |
* @access private
|
25 |
* @var object
|
26 |
*/
|
27 |
+
private $args = array();
|
28 |
|
29 |
/**
|
30 |
* The array contains the values that will replace the macros..
|
33 |
* @var array
|
34 |
*/
|
35 |
public $variable = array(
|
36 |
+
'thumbnail' => '{{{data.thumbnail}}}',
|
37 |
+
'title' => '{{{data.title}}}',
|
38 |
+
'content' => '{{{data.content}}}',
|
39 |
+
'author' => '{{{data.author}}}',
|
40 |
+
'link' => '{{{data.link}}}',
|
41 |
+
'placeholder' => '',
|
42 |
+
'reader_text' => '',
|
43 |
+
'wrapper_class' => '',
|
44 |
+
'form_class' => '',
|
45 |
+
'input_id' => '',
|
46 |
+
'action' => '',
|
47 |
);
|
48 |
|
49 |
/**
|
61 |
* @access public
|
62 |
* @return void
|
63 |
*/
|
64 |
+
public function __construct( $args = array() ) {
|
65 |
+
$this->args = $args;
|
66 |
+
$this->template_manager = new Cherry_Template_Manager( cherry_search()->get_core() );
|
67 |
+
|
68 |
$this->set_variable();
|
69 |
}
|
70 |
|
77 |
*/
|
78 |
private function set_variable() {
|
79 |
// Value macro $$ACTION$$
|
80 |
+
$this->variable['action'] = get_home_url();
|
81 |
// Value macro $$PLACEHOLDER$$
|
82 |
+
$this->variable['placeholder'] = $this->args['search_placeholder_text'];
|
83 |
// Value macro $$READER_TEXT$$
|
84 |
+
$this->variable['reader_text'] = apply_filters( 'cherry_search_reader_text', esc_html__( 'Search for:', 'cherry-search' ) );
|
85 |
+
// Value macro $$WRAPPER_CLASS$$
|
86 |
+
$this->variable['wrapper_class'] = apply_filters( 'cherry_search_wrapper_class', $this->get_wrapper_class() );
|
87 |
+
// Value macro $$WRAPPER_CLASS$$
|
88 |
+
$this->variable['form_class'] = apply_filters( 'cherry_search_form_class', $this->get_form_class() );
|
89 |
+
// Value macro $$INPUT_ID$$
|
90 |
+
$this->variable['input_id'] = apply_filters( 'cherry_search_input_id', $this->get_input_id() );
|
91 |
+
// Value macro $$SETTINGS$$
|
92 |
+
$this->variable['settings'] = apply_filters( 'cherry_search_query_settings', $this->get_query_settings() );
|
93 |
}
|
94 |
|
95 |
/**
|
111 |
* @return string
|
112 |
*/
|
113 |
public function get_submit() {
|
114 |
+
if ( $this->args['search_button_icon'] || $this->args['search_button_text'] ) {
|
115 |
|
116 |
+
return $this->template_manager->parser->parsed_template( 'search-form-submit', new self( $this->args ) );
|
117 |
} else {
|
118 |
return;
|
119 |
}
|
127 |
* @return string
|
128 |
*/
|
129 |
public function get_icon() {
|
130 |
+
$class = $this->args['search_button_icon'];
|
131 |
|
132 |
if ( $class ) {
|
133 |
|
151 |
* @return string
|
152 |
*/
|
153 |
public function get_submit_text() {
|
154 |
+
$text = $this->args['search_button_text'];
|
155 |
|
156 |
if ( $text ) {
|
157 |
|
169 |
* @return string
|
170 |
*/
|
171 |
public function get_results_list() {
|
172 |
+
return $this->template_manager->parser->parsed_template( 'search-form-results-list', new self( $this->args ) );
|
173 |
}
|
174 |
|
175 |
/**
|
195 |
*/
|
196 |
public function get_thumbnail() {
|
197 |
$output = '';
|
198 |
+
$thumbnail_visible = filter_var( $this->args['thumbnail_visible'], FILTER_VALIDATE_BOOLEAN );
|
199 |
|
200 |
if ( $thumbnail_visible ) {
|
201 |
$thumbnail_html = apply_filters( 'cherry_search_thumbnail_html', '<span class="cherry-search__item-thumbnail">%s</span>' );
|
206 |
}
|
207 |
|
208 |
/**
|
209 |
+
* Handler macro $$WRAPPER_CLASS$$.
|
210 |
*
|
211 |
* @since 1.0.0
|
212 |
* @access public
|
213 |
+
* @return string
|
214 |
*/
|
215 |
+
public function get_wrapper_class() {
|
216 |
+
$output = ( 'get_product_search_form' === current_filter() ) ? 'wc-search-form' : '' ;
|
217 |
+
return $output;
|
218 |
+
}
|
219 |
|
220 |
+
/**
|
221 |
+
* Handler macro $$FORM_CLASS$$.
|
222 |
+
*
|
223 |
+
* @since 1.0.0
|
224 |
+
* @access public
|
225 |
+
* @return string
|
226 |
+
*/
|
227 |
+
public function get_form_class() {
|
228 |
+
$output = ( 'get_product_search_form' === current_filter() ) ? 'woocommerce-product-search' : '' ;
|
229 |
+
return $output;
|
230 |
+
}
|
231 |
|
232 |
+
/**
|
233 |
+
* Handler macro $$INPUT_ID$$.
|
234 |
+
*
|
235 |
+
* @since 1.0.0
|
236 |
+
* @access public
|
237 |
+
* @return string
|
238 |
+
*/
|
239 |
+
public function get_input_id() {
|
240 |
+
$output = ( 'get_product_search_form' === current_filter() ) ? 'id="woocommerce-product-search-field"' : '' ;
|
241 |
+
return $output;
|
242 |
}
|
243 |
|
244 |
+
/**
|
245 |
+
* Handler macro $$SETTINGS$$.
|
246 |
+
*
|
247 |
+
* @since 1.0.0
|
248 |
+
* @access public
|
249 |
+
* @return string
|
250 |
+
*/
|
251 |
+
public function get_query_settings() {
|
252 |
+
$query_key = array(
|
253 |
+
'search_source',
|
254 |
+
'results_order',
|
255 |
+
'results_order_by',
|
256 |
+
'exclude_source_post_format',
|
257 |
+
'exclude_source_category',
|
258 |
+
'exclude_source_tags',
|
259 |
+
);
|
260 |
+
$query_settings = array();
|
261 |
+
|
262 |
+
foreach ( $query_key as $key ) {
|
263 |
+
if ( ! empty( $this->args[ $key ] ) ) {
|
264 |
+
$query_settings[ $key ] = $this->args[ $key ];
|
265 |
+
}
|
266 |
+
}
|
267 |
+
|
268 |
+
return json_encode( $query_settings );
|
269 |
+
}
|
270 |
}
|
271 |
}
|
includes/public/class-cherry-search-public-ajax-handlers.php
CHANGED
@@ -42,7 +42,6 @@ if ( ! class_exists( 'Cherry_Search_Public_Ajax_Handlers' ) ) {
|
|
42 |
* @return void
|
43 |
*/
|
44 |
public function __construct() {
|
45 |
-
$this->set_query_settings();
|
46 |
$this->init_handlers();
|
47 |
}
|
48 |
|
@@ -78,12 +77,13 @@ if ( ! class_exists( 'Cherry_Search_Public_Ajax_Handlers' ) ) {
|
|
78 |
return;
|
79 |
}
|
80 |
|
81 |
-
$data =
|
82 |
-
$limit_query = ( int ) $
|
83 |
|
84 |
-
$this->search_query['s'] = urldecode( $data );
|
85 |
$this->search_query['nopaging'] = false;
|
86 |
$this->search_query['posts_per_page'] = $limit_query + 1;
|
|
|
87 |
|
88 |
$search = new WP_Query( $this->search_query );
|
89 |
$response = array(
|
@@ -95,28 +95,28 @@ if ( ! class_exists( 'Cherry_Search_Public_Ajax_Handlers' ) ) {
|
|
95 |
|
96 |
if ( is_wp_error( $search ) ) {
|
97 |
$response['error'] = true;
|
98 |
-
$response['message'] = esc_html( $
|
99 |
|
100 |
return $response;
|
101 |
}
|
102 |
|
103 |
if ( empty( $search->post_count ) ) {
|
104 |
-
$response['message'] = esc_html( $
|
105 |
|
106 |
return $response;
|
107 |
}
|
108 |
|
109 |
$after = '…';
|
110 |
-
$length = ( int ) $
|
111 |
-
$thumbnail_visible = filter_var( $
|
112 |
-
$title_visible = filter_var( $
|
113 |
-
$author_visible = filter_var( $
|
114 |
|
115 |
-
$author_prefix = esc_html( $
|
116 |
$author_html = apply_filters( 'cherry_search_author_html', '<span>%1$s </span> <em>%2$s</em>' );
|
117 |
|
118 |
$more_button_html = apply_filters( 'cherry_search_more_button_html', '<li class="cherry-search__more-button">%s</li>' );
|
119 |
-
$more_button_text = esc_html( $
|
120 |
$more_button = sprintf( $more_button_html, $more_button_text );
|
121 |
|
122 |
$response['posts'] = array();
|
@@ -198,7 +198,6 @@ if ( ! class_exists( 'Cherry_Search_Public_Ajax_Handlers' ) ) {
|
|
198 |
return self::$instance;
|
199 |
}
|
200 |
}
|
201 |
-
|
202 |
}
|
203 |
|
204 |
if ( ! function_exists( 'cherry_search_public_ajax_handlers' ) ) {
|
42 |
* @return void
|
43 |
*/
|
44 |
public function __construct() {
|
|
|
45 |
$this->init_handlers();
|
46 |
}
|
47 |
|
77 |
return;
|
78 |
}
|
79 |
|
80 |
+
$data = $_GET['data'];
|
81 |
+
$limit_query = ( int ) $data['limit_query'];
|
82 |
|
83 |
+
$this->search_query['s'] = urldecode( $data['value'] );
|
84 |
$this->search_query['nopaging'] = false;
|
85 |
$this->search_query['posts_per_page'] = $limit_query + 1;
|
86 |
+
$this->set_query_settings( $data );
|
87 |
|
88 |
$search = new WP_Query( $this->search_query );
|
89 |
$response = array(
|
95 |
|
96 |
if ( is_wp_error( $search ) ) {
|
97 |
$response['error'] = true;
|
98 |
+
$response['message'] = esc_html( $data['server_error'] );
|
99 |
|
100 |
return $response;
|
101 |
}
|
102 |
|
103 |
if ( empty( $search->post_count ) ) {
|
104 |
+
$response['message'] = esc_html( $data['negative_search'] );
|
105 |
|
106 |
return $response;
|
107 |
}
|
108 |
|
109 |
$after = '…';
|
110 |
+
$length = ( int ) $data['limit_content_word'];
|
111 |
+
$thumbnail_visible = filter_var( $data['thumbnail_visible'], FILTER_VALIDATE_BOOLEAN );
|
112 |
+
$title_visible = filter_var( $data['title_visible'], FILTER_VALIDATE_BOOLEAN );
|
113 |
+
$author_visible = filter_var( $data['author_visible'], FILTER_VALIDATE_BOOLEAN );
|
114 |
|
115 |
+
$author_prefix = esc_html( $data['author_prefix'] );
|
116 |
$author_html = apply_filters( 'cherry_search_author_html', '<span>%1$s </span> <em>%2$s</em>' );
|
117 |
|
118 |
$more_button_html = apply_filters( 'cherry_search_more_button_html', '<li class="cherry-search__more-button">%s</li>' );
|
119 |
+
$more_button_text = esc_html( $data['more_button'] );
|
120 |
$more_button = sprintf( $more_button_html, $more_button_text );
|
121 |
|
122 |
$response['posts'] = array();
|
198 |
return self::$instance;
|
199 |
}
|
200 |
}
|
|
|
201 |
}
|
202 |
|
203 |
if ( ! function_exists( 'cherry_search_public_ajax_handlers' ) ) {
|
includes/public/class-cherry-search-settings-manager.php
CHANGED
@@ -83,36 +83,43 @@ if ( ! class_exists( 'Cherry_Search_Settings_Manager' ) ) {
|
|
83 |
* @access private
|
84 |
* @return void
|
85 |
*/
|
86 |
-
protected function set_query_settings() {
|
87 |
-
|
|
|
88 |
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
array(
|
97 |
'taxonomy' => 'post_format',
|
98 |
'field' => 'slug',
|
99 |
'operator' => 'NOT IN',
|
100 |
-
'terms' => $
|
101 |
-
)
|
102 |
-
|
103 |
-
|
|
|
|
|
|
|
104 |
'field' => 'slug',
|
105 |
'operator' => 'NOT IN',
|
106 |
-
'terms' => $
|
107 |
-
)
|
108 |
-
|
109 |
-
|
|
|
|
|
|
|
110 |
'field' => 'slug',
|
111 |
'operator' => 'NOT IN',
|
112 |
-
'terms' => $
|
113 |
-
)
|
114 |
-
|
115 |
-
|
116 |
}
|
117 |
}
|
118 |
}
|
83 |
* @access private
|
84 |
* @return void
|
85 |
*/
|
86 |
+
protected function set_query_settings( $args = array() ) {
|
87 |
+
if ( $args ) {
|
88 |
+
$search_source = is_array( $args['search_source'] ) ? $args['search_source'] : explode( ',', $args['search_source'] );
|
89 |
|
90 |
+
$this->search_query['cache_results'] = true;
|
91 |
+
$this->search_query['post_type'] = ! $search_source ? 'any' : $search_source ;
|
92 |
+
$this->search_query['order'] = $args['results_order'];
|
93 |
+
$this->search_query['orderby'] = $args['results_order_by'];
|
94 |
+
$this->search_query['tax_query'] = array( array( 'relation' => 'AND' ) );
|
95 |
+
|
96 |
+
if ( ! empty( $args['exclude_source_post_format'] ) ) {
|
97 |
+
$this->search_query['tax_query'][0][0] = array(
|
98 |
'taxonomy' => 'post_format',
|
99 |
'field' => 'slug',
|
100 |
'operator' => 'NOT IN',
|
101 |
+
'terms' => $args['exclude_source_post_format'],
|
102 |
+
);
|
103 |
+
}
|
104 |
+
|
105 |
+
if ( ! empty( $args['exclude_source_category'] ) ) {
|
106 |
+
$this->search_query['tax_query'][0][1] = array(
|
107 |
+
'taxonomy' => 'post_format',
|
108 |
'field' => 'slug',
|
109 |
'operator' => 'NOT IN',
|
110 |
+
'terms' => $args['exclude_source_category'],
|
111 |
+
);
|
112 |
+
}
|
113 |
+
|
114 |
+
if ( ! empty( $args['exclude_source_tags'] ) ) {
|
115 |
+
$this->search_query['tax_query'][0][2] = array(
|
116 |
+
'taxonomy' => 'category',
|
117 |
'field' => 'slug',
|
118 |
'operator' => 'NOT IN',
|
119 |
+
'terms' => $args['exclude_source_tags'],
|
120 |
+
);
|
121 |
+
}
|
122 |
+
}
|
123 |
}
|
124 |
}
|
125 |
}
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: TemplateMonster 2002
|
3 |
Tags: search, ajax search, quick search, fast search, ajax, cherry framework, widget search, shortcode search, custom search, cherry search
|
4 |
Requires at least: 4.4
|
5 |
-
Tested up to: 4.
|
6 |
-
Stable tag: 1.
|
7 |
License: GPLv3 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
9 |
|
@@ -17,6 +17,9 @@ The plugin is based on AJAX, which means that the results will be displayed dyna
|
|
17 |
|
18 |
[Github Repository]( https://github.com/CherryFramework/cherry-search )
|
19 |
|
|
|
|
|
|
|
20 |
== Installation ==
|
21 |
1. Upload cherry-testi folder to the /wp-content/plugins/ directory, or install the plugin through the WordPress plugins screen directly.
|
22 |
2. Activate the plugin through the 'Plugins' screen in WordPress
|
@@ -38,13 +41,35 @@ There are several ways to enable the plugin on your website. You can either:
|
|
38 |
1. Cherry search form in sidebar.
|
39 |
2. Cherry search form on page.
|
40 |
3. Plugin main settings.
|
41 |
-
|
|
|
42 |
|
43 |
== Changelog ==
|
44 |
= 1.0.0 =
|
45 |
|
46 |
* Initial release
|
47 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
== Arbitrary section ==
|
49 |
|
50 |
= Plugin Settings =
|
@@ -138,6 +163,22 @@ Macro works with **cherry_search_reader_text** filter
|
|
138 |
|
139 |
**$$PLACEHOLDER$$** - Returns *Main Settings -> Placeholder text option value*
|
140 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
141 |
|
142 |
= Filters =
|
143 |
|
@@ -210,3 +251,21 @@ Filter contains an array with the following values:
|
|
210 |
* Type - *string*
|
211 |
* By default: `<li class="cherry-search__more-button">%s</li>`
|
212 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
Contributors: TemplateMonster 2002
|
3 |
Tags: search, ajax search, quick search, fast search, ajax, cherry framework, widget search, shortcode search, custom search, cherry search
|
4 |
Requires at least: 4.4
|
5 |
+
Tested up to: 4.7.2
|
6 |
+
Stable tag: 1.1.0
|
7 |
License: GPLv3 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
9 |
|
17 |
|
18 |
[Github Repository]( https://github.com/CherryFramework/cherry-search )
|
19 |
|
20 |
+
[Plugin website]( http://www.cherryframework.com/plugins "Plugin website" )
|
21 |
+
|
22 |
+
|
23 |
== Installation ==
|
24 |
1. Upload cherry-testi folder to the /wp-content/plugins/ directory, or install the plugin through the WordPress plugins screen directly.
|
25 |
2. Activate the plugin through the 'Plugins' screen in WordPress
|
41 |
1. Cherry search form in sidebar.
|
42 |
2. Cherry search form on page.
|
43 |
3. Plugin main settings.
|
44 |
+
4. Plugin search results settings.
|
45 |
+
5. Search form shortcode.
|
46 |
|
47 |
== Changelog ==
|
48 |
= 1.0.0 =
|
49 |
|
50 |
* Initial release
|
51 |
|
52 |
+
= 1.1.0 =
|
53 |
+
|
54 |
+
**Added :**
|
55 |
+
|
56 |
+
* Compatibility with WooCommerce
|
57 |
+
* Search field shortcode
|
58 |
+
* Macro
|
59 |
+
- $$WRAPPER_CLASS$$
|
60 |
+
- $$FORM_CLASS$$
|
61 |
+
- $$INPUT_ID$$
|
62 |
+
- $$SETTINGS$$
|
63 |
+
* Filters
|
64 |
+
- cherry_search_wrapper_class
|
65 |
+
- cherry_search_form_class
|
66 |
+
- cherry_search_input_id
|
67 |
+
- cherry_search_query_settings
|
68 |
+
|
69 |
+
**Fixed :**
|
70 |
+
|
71 |
+
* WooCommerce issue in the product page.
|
72 |
+
|
73 |
== Arbitrary section ==
|
74 |
|
75 |
= Plugin Settings =
|
163 |
|
164 |
**$$PLACEHOLDER$$** - Returns *Main Settings -> Placeholder text option value*
|
165 |
|
166 |
+
**$$WRAPPER_CLASS$$** - Returns search form wrapper class. Empty by default. If Woocommerce plugin is active the macro contains **wc-search-form** class.
|
167 |
+
|
168 |
+
Macro works with **cherry_search_wrapper_class** filter
|
169 |
+
|
170 |
+
**$$FORM_CLASS$$** - Macro returns search form class. Empty by default. If Woocommerce plugin is active the macro contains **woocommerce-product-search** class.
|
171 |
+
|
172 |
+
Macro works with **cherry_search_form_class** filter
|
173 |
+
|
174 |
+
**$$INPUT_ID$$** - Macro returns search form field ID. Empty by default. If Woocommerce plugin is active the macro contains **id="woocommerce-product-search-field** class.
|
175 |
+
|
176 |
+
Macro works with **cherry_search_input_id** filter
|
177 |
+
|
178 |
+
**$$SETTINGS$$** - Macro returns search query settings for a particular search form.
|
179 |
+
|
180 |
+
Macro works with **cherry_search_query_settings**
|
181 |
+
|
182 |
|
183 |
= Filters =
|
184 |
|
251 |
* Type - *string*
|
252 |
* By default: `<li class="cherry-search__more-button">%s</li>`
|
253 |
|
254 |
+
**cherry_search_wrapper_class** - The filter allows to add or replace new class to the search form wrapper.
|
255 |
+
|
256 |
+
* Type - *string*
|
257 |
+
* By default: ` ` ( If WooCommerce is activated "wc-search-form" is used by default )
|
258 |
+
|
259 |
+
**cherry_search_form_class** - The filter allows to add or replace new class to the search form.
|
260 |
+
|
261 |
+
* Type - *string*
|
262 |
+
* By default: ` ` ( If WooCommerce is activated "woocommerce-product-search" is used by default )
|
263 |
+
|
264 |
+
**cherry_search_input_id** - The filter allows to change or add new ID to the search form input field.
|
265 |
+
|
266 |
+
* Type - *string*
|
267 |
+
* By default: ` ` ( If WooCommerce is activated "id="woocommerce-product-search-field" is used by default )
|
268 |
+
|
269 |
+
**cherry_search_query_settings** - The filter allows to change search query settings.
|
270 |
+
|
271 |
+
* Type - *string*
|
templates/cherry-search/search-form-input.tmpl
CHANGED
@@ -1,2 +1,3 @@
|
|
1 |
<span class="screen-reader-text">$$READER_TEXT$$</span>
|
2 |
-
<input type="search" class="search-field cherry-search__field" placeholder="$$PLACEHOLDER$$…" value="" name="s" autocomplete="off"/>
|
|
1 |
<span class="screen-reader-text">$$READER_TEXT$$</span>
|
2 |
+
<input type="search" $$INPUT_ID$$ class="search-field cherry-search__field search-form__field" placeholder="$$PLACEHOLDER$$…" value="" name="s" autocomplete="off"/>
|
3 |
+
<input type="hidden" value='$$SETTINGS$$' name="settings" />
|
templates/cherry-search/search-form.tmpl
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
-
<div class="cherry-search">
|
2 |
-
<form role="search" method="get" class="search-form cherry-search__form" action="$$ACTION$$">
|
3 |
<label class="cherry-search__label">
|
4 |
%%INPUT%%
|
5 |
</label>
|
1 |
+
<div class="cherry-search $$WRAPPER_CLASS$$">
|
2 |
+
<form role="search" method="get" class="search-form cherry-search__form $$FORM_CLASS$$" action="$$ACTION$$">
|
3 |
<label class="cherry-search__label">
|
4 |
%%INPUT%%
|
5 |
</label>
|
wpml-config.xml
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<wpml-config>
|
2 |
+
<admin-texts>
|
3 |
+
<key name="cherry-search-default">
|
4 |
+
<key name="search_button_text"/>
|
5 |
+
<key name="search_placeholder_text"/>
|
6 |
+
<key name="author_prefix"/>
|
7 |
+
<key name="more_button"/>
|
8 |
+
<key name="negative_search"/>
|
9 |
+
<key name="server_error"/>
|
10 |
+
</key>
|
11 |
+
<key name="cherry-search">
|
12 |
+
<key name="search_button_text"/>
|
13 |
+
<key name="search_placeholder_text"/>
|
14 |
+
<key name="author_prefix"/>
|
15 |
+
<key name="more_button"/>
|
16 |
+
<key name="negative_search"/>
|
17 |
+
<key name="server_error"/>
|
18 |
+
</key>
|
19 |
+
</admin-texts>
|
20 |
+
</wpml-config>
|