Version Description
- Hantus Theme Functionality Added
Download this release
Release Info
Developer | nayrathemes |
Plugin | Clever Fox |
Version | 1.1.4 |
Comparing to | |
See all releases |
Code changes from version 1.1.3 to 1.1.4
- clever-fox.php +76 -29
- inc/custom-controls/Tabs/class/cleverfox-customize-control-tabs.php +198 -0
- inc/custom-controls/Tabs/css/style.css +60 -0
- inc/custom-controls/Tabs/js/customizer-addon-script.js +30 -0
- inc/custom-controls/Tabs/js/script.js +72 -0
- inc/custom-controls/category/category-dropdown-custom-control.php +47 -0
- inc/custom-controls/controls/icon-picker/README.md +48 -0
- inc/custom-controls/controls/icon-picker/assets/js/icon-picker-control.js +27 -0
- inc/custom-controls/controls/icon-picker/assets/js/jquery.ddslick.js +331 -0
- inc/custom-controls/controls/icon-picker/assets/js/jquery.ddslick.min.js +1 -0
- inc/custom-controls/controls/icon-picker/icon-picker-control.php +65 -0
- inc/custom-controls/controls/icon-picker/inc/dashicons-icons.php +66 -0
- inc/custom-controls/controls/icon-picker/inc/fa-icons.php +645 -0
- inc/custom-controls/controls/icon-picker/inc/genericons-icons.php +160 -0
- inc/custom-controls/controls/range-validator/assets/css/range-control.css +97 -0
- inc/custom-controls/controls/range-validator/assets/js/range-control.js +23 -0
- inc/custom-controls/controls/range-validator/range-control.php +47 -0
- inc/custom-controls/controls/select/assets/js/select-control.js +17 -0
- inc/custom-controls/controls/select/assets/js/selectize.js +3667 -0
- inc/custom-controls/controls/select/assets/js/selectize.min.js +3 -0
- inc/custom-controls/controls/select/select-control.php +35 -0
- inc/custom-controls/controls/select/selectize.default.css +387 -0
- inc/custom-controls/layout/LICENSE.txt +340 -0
- inc/custom-controls/layout/assets/customizer-control.css +12 -0
- inc/custom-controls/layout/assets/customizer-control.js +45 -0
- inc/custom-controls/layout/assets/fx-share-icons/fonts/fx-share.eot +0 -0
- inc/custom-controls/layout/assets/fx-share-icons/fonts/fx-share.svg +13 -0
- inc/custom-controls/layout/assets/fx-share-icons/fonts/fx-share.ttf +0 -0
- inc/custom-controls/layout/assets/fx-share-icons/fonts/fx-share.woff +0 -0
- inc/custom-controls/layout/assets/fx-share-icons/fx-share-icons.css +49 -0
- inc/custom-controls/layout/assets/fx-share.css +60 -0
- inc/custom-controls/layout/fx-share.php +52 -0
- inc/custom-controls/layout/includes/customizer-controls.php +173 -0
- inc/custom-controls/layout/includes/customizer.php +163 -0
- inc/custom-controls/layout/includes/functions.php +219 -0
- inc/custom-controls/layout/includes/sanitize.php +116 -0
- inc/custom-controls/layout/includes/setup.php +62 -0
- inc/custom-controls/layout/readme.txt +113 -0
- inc/hantus/default-pages/home-page.php +24 -0
- inc/hantus/default-pages/upload-media.php +34 -0
- inc/hantus/default-widgets/default-widget.php +35 -0
- inc/hantus/features/navigation.php +207 -0
- inc/hantus/features/section-info.php +410 -0
- inc/hantus/features/section-service.php +247 -0
- inc/hantus/features/section-slider.php +237 -0
- inc/hantus/features/section-testimonial.php +187 -0
- inc/hantus/features/section-typography.php +966 -0
- inc/hantus/images/footerlogo.png +0 -0
- inc/hantus/images/icons/icon01.png +0 -0
- inc/hantus/images/icons/icon02.png +0 -0
- inc/hantus/images/icons/icon03.png +0 -0
- inc/hantus/images/logo.png +0 -0
- inc/hantus/images/service/service01.png +0 -0
- inc/hantus/images/service/service02.png +0 -0
- inc/hantus/images/service/service03.png +0 -0
- inc/hantus/images/service/service04.png +0 -0
- inc/hantus/images/slider/slider.jpg +0 -0
- inc/hantus/images/testimonial/testimonial-bg.jpg +0 -0
- inc/hantus/images/testimonial/testimonial01.png +0 -0
- inc/hantus/images/testimonial/testimonial02.png +0 -0
- inc/hantus/images/testimonial/testimonial03.png +0 -0
- inc/hantus/sections/section-info.php +51 -0
- inc/hantus/sections/section-service.php +114 -0
- inc/hantus/sections/section-slider.php +53 -0
- inc/hantus/sections/section-testimonial.php +97 -0
- inc/hantus/typography_style.php +615 -0
- readme.txt +3 -0
clever-fox.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Clever Fox
|
4 |
Plugin URI:
|
5 |
Description: The Clever Fox plugin adds sections functionality to the Startkit theme and Others Nayra's Themes. This plugin for only startkit themes. Clever Fox is a plugin build to enhance the functionality of WordPress Theme made by Nayra Themes.
|
6 |
-
Version: 1.1.
|
7 |
Author: nayrathemes
|
8 |
Author URI: https://nayrathemes.com
|
9 |
Text Domain: clever-fox
|
@@ -13,7 +13,7 @@ define( 'CLEVERFOX_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
|
|
13 |
|
14 |
function cleverfox_activate() {
|
15 |
$theme = wp_get_theme(); // gets the current theme
|
16 |
-
|
17 |
require_once('inc/startkit/features/section-slider.php');
|
18 |
require_once('inc/startkit/features/section-info.php');
|
19 |
require_once('inc/startkit/features/section-service.php');
|
@@ -25,36 +25,83 @@ function cleverfox_activate() {
|
|
25 |
require_once('inc/startkit/sections/section-testimonial.php');
|
26 |
require_once('inc/startkit/typography_style.php');
|
27 |
require_once('inc/startkit/features/section-typography.php');
|
28 |
-
/**
|
29 |
-
|
30 |
-
|
31 |
-
define( 'OUR_DIRECTORY', plugin_dir_url( __FILE__ ) . '/inc/startkit/custom-controls/' );
|
32 |
-
define( 'OUR_DIRECTORY_URI', plugin_dir_url( __FILE__ ) . '/inc/startkit/custom-controls/' );
|
33 |
-
if ( class_exists( 'WP_Customize_Control' ) ) {
|
34 |
-
require_once('inc/startkit/custom-controls/controls/range-validator/range-control.php');
|
35 |
-
require_once('inc/startkit/custom-controls/controls/select/select-control.php');
|
36 |
-
require_once('inc/startkit/custom-controls/Tabs/class/startkit-customize-control-tabs.php');
|
37 |
-
require_once('inc/startkit/custom-controls/category/category-dropdown-custom-control.php');
|
38 |
-
}
|
39 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
add_action( 'init', 'cleverfox_activate' );
|
41 |
|
42 |
-
$theme = wp_get_theme();
|
43 |
-
register_activation_hook( __FILE__, 'cleverfox_install_function');
|
44 |
-
function cleverfox_install_function()
|
45 |
-
{
|
46 |
-
$item_details_page = get_option('item_details_page');
|
47 |
-
if(!$item_details_page){
|
48 |
-
require_once('inc/startkit/default-pages/upload-media.php');
|
49 |
-
require_once('inc/startkit/default-pages/home-page.php');
|
50 |
-
require_once('inc/startkit/default-widgets/default-widget.php');
|
51 |
-
update_option( 'item_details_page', 'Done' );
|
52 |
-
}
|
53 |
-
}
|
54 |
-
//Sanatize text
|
55 |
-
function cleverfox_startkit_home_page_sanitize_text( $input ) {
|
56 |
|
57 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
?>
|
3 |
Plugin Name: Clever Fox
|
4 |
Plugin URI:
|
5 |
Description: The Clever Fox plugin adds sections functionality to the Startkit theme and Others Nayra's Themes. This plugin for only startkit themes. Clever Fox is a plugin build to enhance the functionality of WordPress Theme made by Nayra Themes.
|
6 |
+
Version: 1.1.4
|
7 |
Author: nayrathemes
|
8 |
Author URI: https://nayrathemes.com
|
9 |
Text Domain: clever-fox
|
13 |
|
14 |
function cleverfox_activate() {
|
15 |
$theme = wp_get_theme(); // gets the current theme
|
16 |
+
if ( 'StartKit' == $theme->name){
|
17 |
require_once('inc/startkit/features/section-slider.php');
|
18 |
require_once('inc/startkit/features/section-info.php');
|
19 |
require_once('inc/startkit/features/section-service.php');
|
25 |
require_once('inc/startkit/sections/section-testimonial.php');
|
26 |
require_once('inc/startkit/typography_style.php');
|
27 |
require_once('inc/startkit/features/section-typography.php');
|
28 |
+
/**
|
29 |
+
* Load Custom select control in Customizer
|
30 |
+
*/
|
31 |
+
define( 'OUR_DIRECTORY', plugin_dir_url( __FILE__ ) . '/inc/startkit/custom-controls/' );
|
32 |
+
define( 'OUR_DIRECTORY_URI', plugin_dir_url( __FILE__ ) . '/inc/startkit/custom-controls/' );
|
33 |
+
if ( class_exists( 'WP_Customize_Control' ) ) {
|
34 |
+
require_once('inc/startkit/custom-controls/controls/range-validator/range-control.php');
|
35 |
+
require_once('inc/startkit/custom-controls/controls/select/select-control.php');
|
36 |
+
require_once('inc/startkit/custom-controls/Tabs/class/startkit-customize-control-tabs.php');
|
37 |
+
require_once('inc/startkit/custom-controls/category/category-dropdown-custom-control.php');
|
38 |
+
}
|
39 |
+
}
|
40 |
+
if( 'Hantus' == $theme->name){
|
41 |
+
require_once('inc/hantus/features/navigation.php');
|
42 |
+
require_once('inc/hantus/features/section-slider.php');
|
43 |
+
require_once('inc/hantus/features/section-info.php');
|
44 |
+
require_once('inc/hantus/features/section-service.php');
|
45 |
+
require_once('inc/hantus/features/section-testimonial.php');
|
46 |
+
require_once('inc/hantus/sections/section-slider.php');
|
47 |
+
require_once('inc/hantus/sections/section-info.php');
|
48 |
+
require_once('inc/hantus/sections/section-service.php');
|
49 |
+
require_once('inc/hantus/sections/section-testimonial.php');
|
50 |
+
require_once('inc/hantus/features/section-typography.php');
|
51 |
+
require_once('inc/hantus/typography_style.php');
|
52 |
+
/**
|
53 |
+
* Load Custom select control in Customizer
|
54 |
+
*/
|
55 |
+
define( 'OUR_DIRECTORY', plugin_dir_url( __FILE__ ) . '/inc/custom-controls/' );
|
56 |
+
define( 'OUR_DIRECTORY_URI', plugin_dir_url( __FILE__ ) . '/inc/custom-controls/' );
|
57 |
+
if ( class_exists( 'WP_Customize_Control' ) ) {
|
58 |
+
require_once('inc/custom-controls/controls/range-validator/range-control.php');
|
59 |
+
require_once('inc/custom-controls/controls/select/select-control.php');
|
60 |
+
require_once('inc/custom-controls/Tabs/class/cleverfox-customize-control-tabs.php');
|
61 |
+
require_once('inc/custom-controls/category/category-dropdown-custom-control.php');
|
62 |
+
}
|
63 |
+
}
|
64 |
+
}
|
65 |
add_action( 'init', 'cleverfox_activate' );
|
66 |
|
67 |
+
$theme = wp_get_theme();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
|
69 |
+
//Startkit
|
70 |
+
if ( 'StartKit' == $theme->name){
|
71 |
+
register_activation_hook( __FILE__, 'cleverfox_install_function');
|
72 |
+
function cleverfox_install_function()
|
73 |
+
{
|
74 |
+
$item_details_page = get_option('item_details_page');
|
75 |
+
if(!$item_details_page){
|
76 |
+
require_once('inc/startkit/default-pages/upload-media.php');
|
77 |
+
require_once('inc/startkit/default-pages/home-page.php');
|
78 |
+
require_once('inc/startkit/default-widgets/default-widget.php');
|
79 |
+
update_option( 'item_details_page', 'Done' );
|
80 |
+
}
|
81 |
+
}
|
82 |
+
}
|
83 |
|
84 |
+
//Hantus
|
85 |
+
if ( 'Hantus' == $theme->name){
|
86 |
+
register_activation_hook( __FILE__, 'cleverfox_install_function');
|
87 |
+
function cleverfox_install_function()
|
88 |
+
{
|
89 |
+
$item_details_page = get_option('item_details_page');
|
90 |
+
if(!$item_details_page){
|
91 |
+
require_once('inc/hantus/default-pages/upload-media.php');
|
92 |
+
require_once('inc/hantus/default-pages/home-page.php');
|
93 |
+
require_once('inc/hantus/default-widgets/default-widget.php');
|
94 |
+
update_option( 'item_details_page', 'Done' );
|
95 |
+
}
|
96 |
+
}
|
97 |
}
|
98 |
+
|
99 |
+
//Startkit Sainitize text
|
100 |
+
function cleverfox_startkit_home_page_sanitize_text( $input ) {
|
101 |
+
return wp_kses_post( force_balance_tags( $input ) );
|
102 |
+
}
|
103 |
+
//Hantus Sainitize text
|
104 |
+
function cleverfox_hantus_home_page_sanitize_text( $input ) {
|
105 |
+
return wp_kses_post( force_balance_tags( $input ) );
|
106 |
+
}
|
107 |
?>
|
inc/custom-controls/Tabs/class/cleverfox-customize-control-tabs.php
ADDED
@@ -0,0 +1,198 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* The tabs customize control extends the WP_Customize_Control class. This class allows
|
4 |
+
* developers to create tabs and hide the sections' settings easily.
|
5 |
+
*
|
6 |
+
* @package Cleverfox
|
7 |
+
*/
|
8 |
+
|
9 |
+
if ( ! class_exists( 'WP_Customize_Control' ) ) {
|
10 |
+
return;
|
11 |
+
}
|
12 |
+
|
13 |
+
class Cleverfox_Customize_Control_Tabs extends WP_Customize_Control {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* cleverfox_Customize_Control_Tabs constructor.
|
17 |
+
*
|
18 |
+
* @param WP_Customize_Manager $manager wp_customize manager.
|
19 |
+
* @param string $id control id.
|
20 |
+
* @param array $args public parameters for control.
|
21 |
+
*/
|
22 |
+
public function __construct( WP_Customize_Manager $manager, $id, array $args = array() ) {
|
23 |
+
parent::__construct( $manager, $id, $args );
|
24 |
+
|
25 |
+
add_action( 'customize_preview_init', array( $this, 'partials_helper_script_enqueue' ) );
|
26 |
+
|
27 |
+
if ( ! empty( $this->tabs ) ) {
|
28 |
+
foreach ( $this->tabs as $value => $args ) {
|
29 |
+
$this->controls[ $value ] = $args['controls'];
|
30 |
+
}
|
31 |
+
}
|
32 |
+
}
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Controls array from tabs.
|
36 |
+
*
|
37 |
+
* @var array
|
38 |
+
*/
|
39 |
+
public $controls = array();
|
40 |
+
|
41 |
+
/**
|
42 |
+
* The type of customize control being rendered.
|
43 |
+
*
|
44 |
+
* @since 1.1.45
|
45 |
+
* @var string
|
46 |
+
*/
|
47 |
+
public $type = 'interface-tabs';
|
48 |
+
|
49 |
+
/**
|
50 |
+
* The type refresh being used.
|
51 |
+
*
|
52 |
+
* @since 1.1.45
|
53 |
+
* @var string
|
54 |
+
*/
|
55 |
+
public $transport = 'postMessage';
|
56 |
+
|
57 |
+
/**
|
58 |
+
* The priority of the control.
|
59 |
+
*
|
60 |
+
* @since 1.1.45
|
61 |
+
* @var string
|
62 |
+
*/
|
63 |
+
public $priority = -10;
|
64 |
+
|
65 |
+
/**
|
66 |
+
* The tabs with keys of the controls that are under each tab.
|
67 |
+
*
|
68 |
+
* @since 1.1.45
|
69 |
+
* @var array
|
70 |
+
*/
|
71 |
+
public $tabs;
|
72 |
+
|
73 |
+
/**
|
74 |
+
* Displays the control content.
|
75 |
+
*
|
76 |
+
* @since 1.1.45
|
77 |
+
* @access public
|
78 |
+
* @return void
|
79 |
+
*/
|
80 |
+
public function render_content() {
|
81 |
+
/* If no tabs are provided, bail. */
|
82 |
+
if ( empty( $this->tabs ) || ! $this->more_than_one_valid_tab() ) {
|
83 |
+
return;
|
84 |
+
}
|
85 |
+
|
86 |
+
$output = '';
|
87 |
+
$i = 0;
|
88 |
+
|
89 |
+
$output .= '<div class="cleverfox-tabs-control" id="input_' . esc_attr( $this->id ) . '">';
|
90 |
+
foreach ( $this->tabs as $value => $args ) {
|
91 |
+
if ( ! empty( $args['controls'] ) && ( $this->tab_has_controls( $args['controls'] ) ) ) {
|
92 |
+
$controls_attribute = json_encode( $args['controls'] );
|
93 |
+
|
94 |
+
$output .= '<div class="cleverfox-customizer-tab">';
|
95 |
+
|
96 |
+
$output .= '<input type="radio"';
|
97 |
+
$output .= 'value="' . esc_attr( $value ) . '" ';
|
98 |
+
$output .= 'name="' . esc_attr( "_customize-radio-{$this->id}" ) . '" ';
|
99 |
+
$output .= 'id="' . esc_attr( "{$this->id}-{$value}" ) . '" ';
|
100 |
+
$output .= 'data-controls="' . esc_attr( $controls_attribute ) . '" ';
|
101 |
+
if ( $i === 0 ) {
|
102 |
+
$output .= 'checked="true" ';
|
103 |
+
}
|
104 |
+
$i ++;
|
105 |
+
$output .= '/><!-- /input -->';
|
106 |
+
|
107 |
+
$label_classes = '';
|
108 |
+
foreach ( $args['controls'] as $control_id ) {
|
109 |
+
$label_classes .= esc_attr( $control_id . ' ' );
|
110 |
+
}
|
111 |
+
|
112 |
+
$output .= '<label class = "' . $label_classes . '" ';
|
113 |
+
$output .= 'for="' . esc_attr( "{$this->id}-{$value}" ) . '">';
|
114 |
+
if ( ! empty( $args['nicename'] ) ) {
|
115 |
+
$output .= '<span class="screen-reader-text">' . esc_html( $args['nicename'] ) . '</span>';
|
116 |
+
}
|
117 |
+
if ( ! empty( $args['icon'] ) ) {
|
118 |
+
$output .= '<i class="fa fa-' . esc_attr( $args['icon'] ) . '"></i>';
|
119 |
+
}
|
120 |
+
if ( ! empty( $args['nicename'] ) ) {
|
121 |
+
$output .= $args['nicename'];
|
122 |
+
}
|
123 |
+
$output .= '</label>';
|
124 |
+
$output .= '</div><!-- /.cleverfox-customizer-tab -->';
|
125 |
+
}
|
126 |
+
}
|
127 |
+
$output .= '</div><!-- /.cleverfox-tabs-control -->';
|
128 |
+
|
129 |
+
echo $output;
|
130 |
+
}
|
131 |
+
/**
|
132 |
+
* Loads the scripts and hooks our custom styles in.
|
133 |
+
*
|
134 |
+
* @since 1.1.45
|
135 |
+
* @access public
|
136 |
+
* @return void
|
137 |
+
*/
|
138 |
+
public function enqueue() {
|
139 |
+
|
140 |
+
if ( empty( $this->tabs ) || ! $this->more_than_one_valid_tab() ) {
|
141 |
+
return;
|
142 |
+
}
|
143 |
+
|
144 |
+
wp_enqueue_script( 'cleverfox-tabs-control-script', CLEVERFOX_PLUGIN_URL . '/inc/custom-controls/Tabs/js/script.js', array( 'jquery' ), 'cleverfox', true );
|
145 |
+
wp_enqueue_style( 'cleverfox-tabs-control-style', CLEVERFOX_PLUGIN_URL . '/inc/custom-controls/Tabs/css/style.css', null,'cleverfox');
|
146 |
+
|
147 |
+
}
|
148 |
+
|
149 |
+
/**
|
150 |
+
* Enqueue the partials handler script that works synchronously with the cleverfox-tabs-control-script
|
151 |
+
*/
|
152 |
+
public function partials_helper_script_enqueue() {
|
153 |
+
wp_enqueue_script( 'cleverfox-tabs-addon-script', CLEVERFOX_PLUGIN_URL . '/inc/custom-controls/Tabs/js/customizer-addon-script.js', array( 'jquery' ),true );
|
154 |
+
}
|
155 |
+
|
156 |
+
/**
|
157 |
+
* Verify if the tab has valid controls.
|
158 |
+
*
|
159 |
+
* Meant to foolproof the control if a tab has no valid controls.
|
160 |
+
* Returns false if there are no valid controls inside the tab.
|
161 |
+
*
|
162 |
+
* @param controls array $controls_array the array of controls.
|
163 |
+
*
|
164 |
+
* @return bool
|
165 |
+
*/
|
166 |
+
protected final function tab_has_controls( $controls_array ) {
|
167 |
+
$i = 0;
|
168 |
+
foreach ( $controls_array as $control ) {
|
169 |
+
$setting = $this->manager->get_setting( $control );
|
170 |
+
if ( ! empty( $setting ) ) {
|
171 |
+
$i++;
|
172 |
+
}
|
173 |
+
}
|
174 |
+
if ( $i === 0 ) {
|
175 |
+
return false;
|
176 |
+
}
|
177 |
+
return true;
|
178 |
+
}
|
179 |
+
|
180 |
+
/**
|
181 |
+
* Verify if there's more than one valid tab.
|
182 |
+
*
|
183 |
+
* @return bool
|
184 |
+
*/
|
185 |
+
protected final function more_than_one_valid_tab() {
|
186 |
+
$i = 0;
|
187 |
+
foreach ( $this->tabs as $tab ) {
|
188 |
+
if ( $this->tab_has_controls( $tab['controls'] ) ) {
|
189 |
+
$i++;
|
190 |
+
}
|
191 |
+
}
|
192 |
+
if ( $i > 1 ) {
|
193 |
+
return true;
|
194 |
+
}
|
195 |
+
return false;
|
196 |
+
}
|
197 |
+
}
|
198 |
+
|
inc/custom-controls/Tabs/css/style.css
ADDED
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
.customize-control-interface-tabs {
|
3 |
+
display: list-item !important;
|
4 |
+
}
|
5 |
+
|
6 |
+
.cleverfox-tabs-control {
|
7 |
+
border-bottom: 1px solid #ddd;
|
8 |
+
width: calc(100% + 28px);
|
9 |
+
margin: -15px 0 0 -12px;
|
10 |
+
table-layout: fixed;
|
11 |
+
display: table;
|
12 |
+
}
|
13 |
+
|
14 |
+
.cleverfox-tabs-control .cleverfox-customizer-tab {
|
15 |
+
border-right: 1px solid #ddd;
|
16 |
+
display: table-cell;
|
17 |
+
text-align: center;
|
18 |
+
width: 100%;
|
19 |
+
}
|
20 |
+
|
21 |
+
.cleverfox-tabs-control .cleverfox-customizer-tab:last-child {
|
22 |
+
border-right: none;
|
23 |
+
}
|
24 |
+
|
25 |
+
.cleverfox-tabs-control .cleverfox-customizer-tab label{
|
26 |
+
text-transform: capitalize;
|
27 |
+
background: #fff;
|
28 |
+
box-shadow: inset 0 0 0 0 #0085ba;
|
29 |
+
transition: all .3s ease;
|
30 |
+
display: block;
|
31 |
+
width: 100%;
|
32 |
+
padding: 10px 0;
|
33 |
+
text-decoration: none;
|
34 |
+
font-weight: 600;
|
35 |
+
color: #333;
|
36 |
+
}
|
37 |
+
|
38 |
+
.cleverfox-tabs-control .cleverfox-customizer-tab label i {
|
39 |
+
color: #333;
|
40 |
+
margin-right: 4px;
|
41 |
+
}
|
42 |
+
|
43 |
+
.cleverfox-tabs-control .cleverfox-customizer-tab label:hover {
|
44 |
+
color: #0085ba;
|
45 |
+
background: #f3f3f5;
|
46 |
+
}
|
47 |
+
|
48 |
+
.cleverfox-tabs-control .cleverfox-customizer-tab label:hover i {
|
49 |
+
color: #333;
|
50 |
+
}
|
51 |
+
|
52 |
+
.cleverfox-tabs-control .cleverfox-customizer-tab input[type="radio"]:checked ~ label {
|
53 |
+
box-shadow: inset 0 -3px 0 0 #0085ba;
|
54 |
+
color: #0085ba;
|
55 |
+
background-color: #fff;
|
56 |
+
}
|
57 |
+
|
58 |
+
.cleverfox-tabs-control input[type="radio"] {
|
59 |
+
display: none !important;
|
60 |
+
}
|
inc/custom-controls/Tabs/js/customizer-addon-script.js
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
*
|
3 |
+
*
|
4 |
+
* @package hantus
|
5 |
+
*
|
6 |
+
* @author Nayra Theme
|
7 |
+
*/
|
8 |
+
var hantus_customize_tabs_focus = function ( $ ) {
|
9 |
+
'use strict';
|
10 |
+
$( function () {
|
11 |
+
var customize = wp.customize;
|
12 |
+
$( '.customize-partial-edit-shortcut' ).live( 'DOMNodeInserted', function () {
|
13 |
+
$( this ).on( 'click', function() {
|
14 |
+
var controlId = $( this ).attr( 'class' );
|
15 |
+
var tabToActivate = '';
|
16 |
+
|
17 |
+
if ( controlId.indexOf( 'widget' ) !== -1 ) {
|
18 |
+
tabToActivate = $( '.cleverfox-customizer-tab>.widgets' );
|
19 |
+
} else {
|
20 |
+
var controlFinalId = controlId.split( ' ' ).pop().split( '-' ).pop();
|
21 |
+
tabToActivate = $( '.cleverfox-customizer-tab>.' + controlFinalId );
|
22 |
+
}
|
23 |
+
|
24 |
+
customize.preview.send( 'tab-previewer-edit', tabToActivate );
|
25 |
+
} );
|
26 |
+
} );
|
27 |
+
} );
|
28 |
+
};
|
29 |
+
|
30 |
+
hantus_customize_tabs_focus( jQuery );
|
inc/custom-controls/Tabs/js/script.js
ADDED
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
|
3 |
+
/**
|
4 |
+
*
|
5 |
+
*
|
6 |
+
* @package Cleverfox
|
7 |
+
*
|
8 |
+
* @author Nayra Theme
|
9 |
+
*/
|
10 |
+
var cleverfox_customize_control_tabs = function ( $ ) {
|
11 |
+
'use strict';
|
12 |
+
|
13 |
+
$( function () {
|
14 |
+
var customize = wp.customize;
|
15 |
+
|
16 |
+
// Switch tab based on customizer partial edit links.
|
17 |
+
customize.previewer.bind( 'tab-previewer-edit', function( data ) {
|
18 |
+
$( data.selector ).trigger( 'click' );
|
19 |
+
} );
|
20 |
+
|
21 |
+
// Hide all controls
|
22 |
+
$( '.cleverfox-tabs-control' ).each( function () {
|
23 |
+
var customizerSection = $( this ).closest( '.accordion-section' );
|
24 |
+
//Hide all controls in section.
|
25 |
+
hideAllExceptCurrent( customizerSection );
|
26 |
+
|
27 |
+
//Show controls under first radio button.
|
28 |
+
var shownCtrls = $( this ).find( '.cleverfox-customizer-tab > input:checked' ).data( 'controls' );
|
29 |
+
showControls( customizerSection, shownCtrls );
|
30 |
+
} );
|
31 |
+
|
32 |
+
$( '.cleverfox-customizer-tab > label' ).on( 'click', function () {
|
33 |
+
var customizerSection = $( this ).closest( '.accordion-section' );
|
34 |
+
var controls = $( this ).prev().data( 'controls' );
|
35 |
+
|
36 |
+
//Hide all controls in section
|
37 |
+
hideAllExceptCurrent( customizerSection );
|
38 |
+
showControls( customizerSection, controls );
|
39 |
+
} );
|
40 |
+
} );
|
41 |
+
};
|
42 |
+
|
43 |
+
cleverfox_customize_control_tabs( jQuery );
|
44 |
+
|
45 |
+
/**
|
46 |
+
* Handles showing the controls when the tab is clicked.
|
47 |
+
*
|
48 |
+
* @param customizerSection
|
49 |
+
* @param controlsToShowArray
|
50 |
+
*/
|
51 |
+
function showControls( customizerSection, controlsToShowArray ) {
|
52 |
+
'use strict';
|
53 |
+
jQuery.each( controlsToShowArray, function ( index, controlId ) {
|
54 |
+
var parentSection = customizerSection[ 0 ];
|
55 |
+
if ( controlId === 'widgets' ) {
|
56 |
+
jQuery( parentSection ).children( 'li[class*="widget"]' ).css( 'display', 'list-item' );
|
57 |
+
return true;
|
58 |
+
}
|
59 |
+
jQuery( '#customize-control-' + controlId ).css( 'display', 'list-item' );
|
60 |
+
} );
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Utility function that hides all the controls in the panel except the tabs control.
|
65 |
+
*
|
66 |
+
* @param customizerSection
|
67 |
+
* @param controlId
|
68 |
+
*/
|
69 |
+
function hideAllExceptCurrent( customizerSection ) {
|
70 |
+
'use strict';
|
71 |
+
jQuery( customizerSection ).children( 'li.customize-control' ).css( 'display', 'none' );
|
72 |
+
}
|
inc/custom-controls/category/category-dropdown-custom-control.php
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if ( ! class_exists( 'WP_Customize_Control' ) )
|
4 |
+
return NULL;
|
5 |
+
|
6 |
+
/**
|
7 |
+
* A class to create a dropdown for all categories in your wordpress site
|
8 |
+
*/
|
9 |
+
class Category_Dropdown_Custom_Control extends WP_Customize_Control
|
10 |
+
{
|
11 |
+
private $cats = false;
|
12 |
+
|
13 |
+
public function __construct($manager, $id, $args = array(), $options = array())
|
14 |
+
{
|
15 |
+
$this->cats = get_categories($options);
|
16 |
+
|
17 |
+
parent::__construct( $manager, $id, $args );
|
18 |
+
}
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Render the content of the category dropdown
|
22 |
+
*
|
23 |
+
* @return HTML
|
24 |
+
*/
|
25 |
+
public function render_content()
|
26 |
+
{
|
27 |
+
if(!empty($this->cats))
|
28 |
+
{
|
29 |
+
?>
|
30 |
+
<label>
|
31 |
+
<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
|
32 |
+
<select multiple <?php $this->link(); ?>>
|
33 |
+
<?php
|
34 |
+
foreach ( $this->cats as $cat )
|
35 |
+
{
|
36 |
+
printf('<option value="%s" %s>%s</option>', $cat->term_id, selected($this->value(), $cat->term_id, false), $cat->name);
|
37 |
+
|
38 |
+
|
39 |
+
}
|
40 |
+
?>
|
41 |
+
</select>
|
42 |
+
</label>
|
43 |
+
<?php
|
44 |
+
}
|
45 |
+
}
|
46 |
+
}
|
47 |
+
?>
|
inc/custom-controls/controls/icon-picker/README.md
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Icon Picker control for WordPress
|
2 |
+
|
3 |
+
## Installing and Setting up
|
4 |
+
|
5 |
+
- [Download and Install O2 on your theme](../../README.md). If you have installed that, then you may proceed for further steps.
|
6 |
+
|
7 |
+
## Icon Picker For WordPress Customizer
|
8 |
+
|
9 |
+
Install the Icon-Picker toolkit by adding this line of code to functions.php file.
|
10 |
+
```
|
11 |
+
require get_template_directory() . '/inc/o2/controls/icon-picker/icon-picker-control.php';
|
12 |
+
```
|
13 |
+
And that’s all you need to do.
|
14 |
+
|
15 |
+
You can add it to your customizer by dumping this code into the `inc/customizer.php` or `functions.php` if you don't have customizer.php file:
|
16 |
+
```
|
17 |
+
$wp_customize->add_setting( 'o2_fa_icon_picker', array(
|
18 |
+
'default' => 'fa-facebook',
|
19 |
+
'capability' => 'edit_theme_options'
|
20 |
+
));
|
21 |
+
|
22 |
+
$wp_customize->add_control(new Hantus_Icon_Picker_Control($wp_customize, 'o2_fa_icon_picker', array(
|
23 |
+
'label' => __('Icons', 'textdomain'),
|
24 |
+
'description' => __('Choose an icon', 'textdomain'),
|
25 |
+
'iconset' => 'fa',
|
26 |
+
'section' => 'your_section',
|
27 |
+
'priority' => 5,
|
28 |
+
'settings' => 'o2_fa_icon_picker'
|
29 |
+
)));
|
30 |
+
```
|
31 |
+
It will a list of all the icons. If only want to list few icons then you can do it like this:
|
32 |
+
```
|
33 |
+
$wp_customize->add_control(new Hantus_Icon_Picker_Control($wp_customize, 'o2_fa_icon_picker', array(
|
34 |
+
'label' => __('Icons', 'textdomain'),
|
35 |
+
'description' => __('Choose an icon', 'textdomain'),
|
36 |
+
'iconset' => 'fa',
|
37 |
+
'section' => 'your_section',
|
38 |
+
'priority' => 5,
|
39 |
+
'settings' => 'o2_fa_icon_picker',
|
40 |
+
'choices' => array(
|
41 |
+
'fa-facebook' => __('Facebook', 'textdomain'),
|
42 |
+
'fa-twitter' => __('Twitter', 'textdomain'),
|
43 |
+
'fa-dribbble' => __('Dribbble', 'textdomain'),
|
44 |
+
'fa-wordpress' => __('WordPress', 'textdomain'),
|
45 |
+
'fa-github' => __('Github', 'textdomain'),
|
46 |
+
)
|
47 |
+
)));
|
48 |
+
```
|
inc/custom-controls/controls/icon-picker/assets/js/icon-picker-control.js
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
wp.customize.controlConstructor['hantus-icon-picker'] = wp.customize.Control.extend({
|
2 |
+
|
3 |
+
ready: function() {
|
4 |
+
'use strict';
|
5 |
+
|
6 |
+
var control = this,
|
7 |
+
element = control.id,
|
8 |
+
icons = control.params.iconset;
|
9 |
+
|
10 |
+
if ( control.params.iconset === 'fontawesome' ) {
|
11 |
+
icons = 'fa';
|
12 |
+
} else if ( control.params.iconset === 'genericons' ) {
|
13 |
+
icons = 'genericon';
|
14 |
+
} else if ( control.params.iconset === 'dashicon' ) {
|
15 |
+
icons = 'dashicons';
|
16 |
+
}
|
17 |
+
|
18 |
+
jQuery( '#' + element ).ddslick({
|
19 |
+
iconset:icons
|
20 |
+
});
|
21 |
+
jQuery( '#' + element ).on( 'click', function() {
|
22 |
+
var value = jQuery( this ).find( '.dd-selected-value' ).val();
|
23 |
+
control.setting.set( value );
|
24 |
+
});
|
25 |
+
}
|
26 |
+
|
27 |
+
});
|
inc/custom-controls/controls/icon-picker/assets/js/jquery.ddslick.js
ADDED
@@ -0,0 +1,331 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
Title: A custom DDSlick for O2
|
3 |
+
Documentation: http://designwithpc.com/Plugins/ddslick
|
4 |
+
Author: PC, Hardeep Asrani
|
5 |
+
Website: http://designwithpc.com
|
6 |
+
Twitter: http://twitter.com/chaudharyp
|
7 |
+
*/
|
8 |
+
|
9 |
+
(function ($) {
|
10 |
+
|
11 |
+
$.fn.ddslick = function (method) {
|
12 |
+
if (methods[method]) {
|
13 |
+
return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
|
14 |
+
} else if (typeof method === 'object' || !method) {
|
15 |
+
return methods.init.apply(this, arguments);
|
16 |
+
} else {
|
17 |
+
$.error('Method ' + method + ' does not exists.');
|
18 |
+
}
|
19 |
+
};
|
20 |
+
|
21 |
+
var methods = {},
|
22 |
+
|
23 |
+
//Set defauls for the control
|
24 |
+
defaults = {
|
25 |
+
data: [],
|
26 |
+
keepJSONItemsOnTop: false,
|
27 |
+
width: 260,
|
28 |
+
height: null,
|
29 |
+
background: "#eee",
|
30 |
+
selectText: "",
|
31 |
+
defaultSelectedIndex: null,
|
32 |
+
truncateDescription: true,
|
33 |
+
iconPosition: "left",
|
34 |
+
showSelectedHTML: true,
|
35 |
+
clickOffToClose: true,
|
36 |
+
iconset: "fa",
|
37 |
+
onSelected: function () { }
|
38 |
+
},
|
39 |
+
|
40 |
+
ddSelectHtml = '<div class="dd-select"><input class="dd-selected-value" type="hidden" /><a class="dd-selected"></a><span class="dd-pointer dd-pointer-down"></span></div>',
|
41 |
+
ddOptionsHtml = '<ul class="dd-options"></ul>',
|
42 |
+
|
43 |
+
//CSS for ddSlick
|
44 |
+
ddslickCSS = '<style id="css-ddslick" type="text/css">' +
|
45 |
+
'.dd-select{ border-radius:2px; border:solid 1px #ccc; position:relative; cursor:pointer;}' +
|
46 |
+
'.dd-desc { color:#aaa; display:block; overflow: hidden; font-weight:normal; line-height: 1.4em; }' +
|
47 |
+
'.dd-selected{ overflow:hidden; display:block; padding:10px; font-weight:bold;}' +
|
48 |
+
'.dd-pointer{ width:0; height:0; position:absolute; right:10px; top:50%; margin-top:-3px;}' +
|
49 |
+
'.dd-pointer-down{ border:solid 5px transparent; border-top:solid 5px #000; }' +
|
50 |
+
'.dd-pointer-up{border:solid 5px transparent !important; border-bottom:solid 5px #000 !important; margin-top:-8px;}' +
|
51 |
+
'.dd-options{ border:solid 1px #ccc; border-top:none; list-style:none; box-shadow:0px 1px 5px #ddd; display:none; position:absolute; z-index:2000; margin:0; padding:0;background:#fff; overflow:auto;}' +
|
52 |
+
'.dd-option{ padding:10px; display:block; border-bottom:solid 1px #ddd; overflow:hidden; text-decoration:none; color:#333; cursor:pointer;-webkit-transition: all 0.25s ease-in-out; -moz-transition: all 0.25s ease-in-out;-o-transition: all 0.25s ease-in-out;-ms-transition: all 0.25s ease-in-out; }' +
|
53 |
+
'.dd-options > li:last-child > .dd-option{ border-bottom:none;}' +
|
54 |
+
'.dd-option:hover{ background:#f3f3f3; color:#000;}' +
|
55 |
+
'.dd-selected-description-truncated { text-overflow: ellipsis; white-space:nowrap; }' +
|
56 |
+
'.dd-option-selected { background:#f6f6f6; }' +
|
57 |
+
'.dd-option-icon, .dd-selected-icon { width:36px; text-align:center; vertical-align:middle; float:left; margin-right:10px; font-size:34px;}' +
|
58 |
+
'.dd-icon-right { float:right; margin-right:15px; margin-left:5px;}' +
|
59 |
+
'.dd-container{ position:relative;} .dd-selected-text { font-weight:bold}</style>';
|
60 |
+
|
61 |
+
//CSS styles are only added once.
|
62 |
+
if ($('#css-ddslick').length <= 0) {
|
63 |
+
$(ddslickCSS).appendTo('head');
|
64 |
+
}
|
65 |
+
|
66 |
+
//Public methods
|
67 |
+
methods.init = function (options) {
|
68 |
+
//Preserve the original defaults by passing an empty object as the target
|
69 |
+
options = $.extend({}, defaults, options);
|
70 |
+
|
71 |
+
//Apply on all selected elements
|
72 |
+
return this.each(function () {
|
73 |
+
var obj = $(this),
|
74 |
+
data = obj.data('ddslick');
|
75 |
+
//If the plugin has not been initialized yet
|
76 |
+
if (!data) {
|
77 |
+
|
78 |
+
var ddSelect = [], ddJson = options.data;
|
79 |
+
|
80 |
+
//Get data from HTML select options
|
81 |
+
obj.find('option').each(function () {
|
82 |
+
var $this = $(this), thisData = $this.data();
|
83 |
+
ddSelect.push({
|
84 |
+
text: $.trim($this.text()),
|
85 |
+
value: $this.val(),
|
86 |
+
selected: $this.is(':selected'),
|
87 |
+
description: thisData.description,
|
88 |
+
iconSrc: thisData.iconsrc //keep it lowercase for HTML5 data-attributes
|
89 |
+
});
|
90 |
+
});
|
91 |
+
|
92 |
+
//Update Plugin data merging both HTML select data and JSON data for the dropdown
|
93 |
+
if (options.keepJSONItemsOnTop)
|
94 |
+
$.merge(options.data, ddSelect);
|
95 |
+
else options.data = $.merge(ddSelect, options.data);
|
96 |
+
|
97 |
+
//Replace HTML select with empty placeholder, keep the original
|
98 |
+
var original = obj, placeholder = $('<div id="' + obj.attr('id') + '"></div>');
|
99 |
+
obj.replaceWith(placeholder);
|
100 |
+
obj = placeholder;
|
101 |
+
|
102 |
+
//Add classes and append ddSelectHtml & ddOptionsHtml to the container
|
103 |
+
obj.addClass('dd-container').append(ddSelectHtml).append(ddOptionsHtml);
|
104 |
+
|
105 |
+
//Get newly created ddOptions and ddSelect to manipulate
|
106 |
+
ddSelect = obj.find('.dd-select');
|
107 |
+
ddOptions = obj.find('.dd-options');
|
108 |
+
|
109 |
+
//Set widths
|
110 |
+
ddOptions.css({ width: options.width });
|
111 |
+
ddSelect.css({ width: options.width, background: options.background });
|
112 |
+
obj.css({ width: options.width });
|
113 |
+
|
114 |
+
//Set height
|
115 |
+
if (options.height != null)
|
116 |
+
ddOptions.css({ height: options.height, overflow: 'auto' });
|
117 |
+
|
118 |
+
//Add ddOptions to the container. Replace with template engine later.
|
119 |
+
$.each(options.data, function (index, item) {
|
120 |
+
if (item.selected) options.defaultSelectedIndex = index;
|
121 |
+
ddOptions.append('<li>' +
|
122 |
+
'<a class="dd-option">' +
|
123 |
+
(item.value ? ' <input class="dd-option-value" type="hidden" value="' + item.value + '" />' : '') +
|
124 |
+
(item.iconSrc ? ' <i class="dd-option-icon' + (options.iconPosition == "right" ? ' dd-icon-right' : '') + ' ' + options.iconset + ' ' + item.iconSrc + '" ></i>' : '') +
|
125 |
+
(item.text ? ' <label class="dd-option-text">' + item.text + '</label>' : '') +
|
126 |
+
(item.description ? ' <small class="dd-option-description dd-desc">' + item.description + '</small>' : '') +
|
127 |
+
'</a>' +
|
128 |
+
'</li>');
|
129 |
+
});
|
130 |
+
|
131 |
+
//Save plugin data.
|
132 |
+
var pluginData = {
|
133 |
+
settings: options,
|
134 |
+
original: original,
|
135 |
+
selectedIndex: -1,
|
136 |
+
selectedItem: null,
|
137 |
+
selectedData: null
|
138 |
+
};
|
139 |
+
obj.data('ddslick', pluginData);
|
140 |
+
|
141 |
+
//Check if needs to show the select text, otherwise show selected or default selection
|
142 |
+
if (options.selectText.length > 0 && options.defaultSelectedIndex == null) {
|
143 |
+
obj.find('.dd-selected').html(options.selectText);
|
144 |
+
}
|
145 |
+
else {
|
146 |
+
var index = (options.defaultSelectedIndex != null && options.defaultSelectedIndex >= 0 && options.defaultSelectedIndex < options.data.length) ? options.defaultSelectedIndex
|
147 |
+
: 0;
|
148 |
+
selectIndex(obj, index);
|
149 |
+
}
|
150 |
+
|
151 |
+
//EVENTS
|
152 |
+
//Displaying options
|
153 |
+
obj.find('.dd-select').on('click.ddslick', function () {
|
154 |
+
open(obj);
|
155 |
+
});
|
156 |
+
|
157 |
+
//Selecting an option
|
158 |
+
obj.find('.dd-option').on('click.ddslick', function () {
|
159 |
+
selectIndex(obj, $(this).closest('li').index());
|
160 |
+
});
|
161 |
+
|
162 |
+
//Click anywhere to close
|
163 |
+
if (options.clickOffToClose) {
|
164 |
+
ddOptions.addClass('dd-click-off-close');
|
165 |
+
obj.on('click.ddslick', function (e) { e.stopPropagation(); });
|
166 |
+
$('body').on('click', function () {
|
167 |
+
$('.dd-click-off-close').slideUp(50).siblings('.dd-select').find('.dd-pointer').removeClass('dd-pointer-up');
|
168 |
+
});
|
169 |
+
}
|
170 |
+
}
|
171 |
+
});
|
172 |
+
};
|
173 |
+
|
174 |
+
//Public method to select an option by its index
|
175 |
+
methods.select = function (options) {
|
176 |
+
return this.each(function () {
|
177 |
+
if (options.index)
|
178 |
+
selectIndex($(this), options.index);
|
179 |
+
});
|
180 |
+
};
|
181 |
+
|
182 |
+
//Public method to open drop down
|
183 |
+
methods.open = function () {
|
184 |
+
return this.each(function () {
|
185 |
+
var $this = $(this),
|
186 |
+
pluginData = $this.data('ddslick');
|
187 |
+
|
188 |
+
//Check if plugin is initialized
|
189 |
+
if (pluginData)
|
190 |
+
open($this);
|
191 |
+
});
|
192 |
+
};
|
193 |
+
|
194 |
+
//Public method to close drop down
|
195 |
+
methods.close = function () {
|
196 |
+
return this.each(function () {
|
197 |
+
var $this = $(this),
|
198 |
+
pluginData = $this.data('ddslick');
|
199 |
+
|
200 |
+
//Check if plugin is initialized
|
201 |
+
if (pluginData)
|
202 |
+
close($this);
|
203 |
+
});
|
204 |
+
};
|
205 |
+
|
206 |
+
//Public method to destroy. Unbind all events and restore the original Html select/options
|
207 |
+
methods.destroy = function () {
|
208 |
+
return this.each(function () {
|
209 |
+
var $this = $(this),
|
210 |
+
pluginData = $this.data('ddslick');
|
211 |
+
|
212 |
+
//Check if already destroyed
|
213 |
+
if (pluginData) {
|
214 |
+
var originalElement = pluginData.original;
|
215 |
+
$this.removeData('ddslick').unbind('.ddslick').replaceWith(originalElement);
|
216 |
+
}
|
217 |
+
});
|
218 |
+
};
|
219 |
+
|
220 |
+
//Private: Select index
|
221 |
+
function selectIndex(obj, index) {
|
222 |
+
|
223 |
+
//Get plugin data
|
224 |
+
var pluginData = obj.data('ddslick');
|
225 |
+
|
226 |
+
//Get required elements
|
227 |
+
var ddSelected = obj.find('.dd-selected'),
|
228 |
+
ddSelectedValue = ddSelected.siblings('.dd-selected-value'),
|
229 |
+
ddOptions = obj.find('.dd-options'),
|
230 |
+
ddPointer = ddSelected.siblings('.dd-pointer'),
|
231 |
+
selectedOption = obj.find('.dd-option').eq(index),
|
232 |
+
selectedLiItem = selectedOption.closest('li'),
|
233 |
+
settings = pluginData.settings,
|
234 |
+
selectedData = pluginData.settings.data[index];
|
235 |
+
|
236 |
+
//Highlight selected option
|
237 |
+
obj.find('.dd-option').removeClass('dd-option-selected');
|
238 |
+
selectedOption.addClass('dd-option-selected');
|
239 |
+
|
240 |
+
//Update or Set plugin data with new selection
|
241 |
+
pluginData.selectedIndex = index;
|
242 |
+
pluginData.selectedItem = selectedLiItem;
|
243 |
+
pluginData.selectedData = selectedData;
|
244 |
+
|
245 |
+
//If set to display to full html, add html
|
246 |
+
if (settings.showSelectedHTML) {
|
247 |
+
ddSelected.html(
|
248 |
+
(selectedData.iconSrc ? '<i class="dd-selected-icon' + (settings.iconPosition == "right" ? ' dd-icon-right' : '') + ' ' + settings.iconset + ' ' + selectedData.iconSrc + '" ></i>' : '') +
|
249 |
+
(selectedData.text ? '<label class="dd-selected-text">' + selectedData.text + '</label>' : '') +
|
250 |
+
(selectedData.description ? '<small class="dd-selected-description dd-desc' + (settings.truncateDescription ? ' dd-selected-description-truncated' : '') + '" >' + selectedData.description + '</small>' : '')
|
251 |
+
);
|
252 |
+
|
253 |
+
}
|
254 |
+
//Else only display text as selection
|
255 |
+
else ddSelected.html(selectedData.text);
|
256 |
+
|
257 |
+
//Updating selected option value
|
258 |
+
ddSelectedValue.val(selectedData.value);
|
259 |
+
|
260 |
+
//BONUS! Update the original element attribute with the new selection
|
261 |
+
pluginData.original.val(selectedData.value);
|
262 |
+
obj.data('ddslick', pluginData);
|
263 |
+
|
264 |
+
//Close options on selection
|
265 |
+
close(obj);
|
266 |
+
|
267 |
+
//Adjust appearence for selected option
|
268 |
+
adjustSelectedHeight(obj);
|
269 |
+
|
270 |
+
//Callback function on selection
|
271 |
+
if (typeof settings.onSelected == 'function') {
|
272 |
+
settings.onSelected.call(this, pluginData);
|
273 |
+
}
|
274 |
+
}
|
275 |
+
|
276 |
+
//Private: Close the drop down options
|
277 |
+
function open(obj) {
|
278 |
+
|
279 |
+
var $this = obj.find('.dd-select'),
|
280 |
+
ddOptions = $this.siblings('.dd-options'),
|
281 |
+
ddPointer = $this.find('.dd-pointer'),
|
282 |
+
wasOpen = ddOptions.is(':visible');
|
283 |
+
|
284 |
+
//Close all open options (multiple plugins) on the page
|
285 |
+
$('.dd-click-off-close').not(ddOptions).slideUp(50);
|
286 |
+
$('.dd-pointer').removeClass('dd-pointer-up');
|
287 |
+
|
288 |
+
if (wasOpen) {
|
289 |
+
ddOptions.slideUp('fast');
|
290 |
+
ddPointer.removeClass('dd-pointer-up');
|
291 |
+
}
|
292 |
+
else {
|
293 |
+
ddOptions.slideDown('fast');
|
294 |
+
ddPointer.addClass('dd-pointer-up');
|
295 |
+
}
|
296 |
+
|
297 |
+
//Fix text height (i.e. display title in center), if there is no description
|
298 |
+
adjustOptionsHeight(obj);
|
299 |
+
}
|
300 |
+
|
301 |
+
//Private: Close the drop down options
|
302 |
+
function close(obj) {
|
303 |
+
//Close drop down and adjust pointer direction
|
304 |
+
obj.find('.dd-options').slideUp(50);
|
305 |
+
obj.find('.dd-pointer').removeClass('dd-pointer-up').removeClass('dd-pointer-up');
|
306 |
+
}
|
307 |
+
|
308 |
+
//Private: Adjust appearence for drop down options (move title to middle), when no desripction
|
309 |
+
function adjustOptionsHeight(obj) {
|
310 |
+
obj.find('.dd-option').each(function () {
|
311 |
+
var $this = $(this);
|
312 |
+
var descriptionOption = $this.find('.dd-option-description');
|
313 |
+
var imgOption = obj.find('.dd-option-icon');
|
314 |
+
if (descriptionOption.length <= 0 && imgOption.length > 0) {
|
315 |
+
$this.find('.dd-option-text').css('lineHeight', '34px');
|
316 |
+
}
|
317 |
+
});
|
318 |
+
}
|
319 |
+
|
320 |
+
function adjustSelectedHeight(obj) {
|
321 |
+
obj.find('.dd-selected').each(function () {
|
322 |
+
var $this = $(this);
|
323 |
+
var descriptionSelected = $this.find('.dd-selected-description');
|
324 |
+
var imgSelected = obj.find('.dd-selected-icon');
|
325 |
+
if (descriptionSelected.length <= 0 && imgSelected.length > 0) {
|
326 |
+
$this.find('.dd-selected-text').css('lineHeight', '34px');
|
327 |
+
}
|
328 |
+
});
|
329 |
+
}
|
330 |
+
|
331 |
+
})(jQuery);
|
inc/custom-controls/controls/icon-picker/assets/js/jquery.ddslick.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(e){function d(e,d){var t=e.data("ddslick"),n=e.find(".dd-selected"),s=n.siblings(".dd-selected-value"),l=(e.find(".dd-options"),n.siblings(".dd-pointer"),e.find(".dd-option").eq(d)),c=l.closest("li"),a=t.settings,r=t.settings.data[d];e.find(".dd-option").removeClass("dd-option-selected"),l.addClass("dd-option-selected"),t.selectedIndex=d,t.selectedItem=c,t.selectedData=r,a.showSelectedHTML?n.html((r.iconSrc?'<i class="dd-selected-icon'+("right"==a.iconPosition?" dd-icon-right":"")+" "+a.iconset+" "+r.iconSrc+'" ></i>':"")+(r.text?'<label class="dd-selected-text">'+r.text+"</label>":"")+(r.description?'<small class="dd-selected-description dd-desc'+(a.truncateDescription?" dd-selected-description-truncated":"")+'" >'+r.description+"</small>":"")):n.html(r.text),s.val(r.value),t.original.val(r.value),e.data("ddslick",t),i(e),o(e),"function"==typeof a.onSelected&&a.onSelected.call(this,t)}function t(d){var t=d.find(".dd-select"),i=t.siblings(".dd-options"),o=t.find(".dd-pointer"),s=i.is(":visible");e(".dd-click-off-close").not(i).slideUp(50),e(".dd-pointer").removeClass("dd-pointer-up"),s?(i.slideUp("fast"),o.removeClass("dd-pointer-up")):(i.slideDown("fast"),o.addClass("dd-pointer-up")),n(d)}function i(e){e.find(".dd-options").slideUp(50),e.find(".dd-pointer").removeClass("dd-pointer-up").removeClass("dd-pointer-up")}function n(d){d.find(".dd-option").each(function(){var t=e(this),i=t.find(".dd-option-description"),n=d.find(".dd-option-icon");i.length<=0&&n.length>0&&t.find(".dd-option-text").css("lineHeight","34px")})}function o(d){d.find(".dd-selected").each(function(){var t=e(this),i=t.find(".dd-selected-description"),n=d.find(".dd-selected-icon");i.length<=0&&n.length>0&&t.find(".dd-selected-text").css("lineHeight","34px")})}e.fn.ddslick=function(d){return s[d]?s[d].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof d&&d?void e.error("Method "+d+" does not exists."):s.init.apply(this,arguments)};var s={},l={data:[],keepJSONItemsOnTop:!1,width:260,height:null,background:"#eee",selectText:"",defaultSelectedIndex:null,truncateDescription:!0,iconPosition:"left",showSelectedHTML:!0,clickOffToClose:!0,iconset:"fa",onSelected:function(){}};e("#css-ddslick").length<=0&&e('<style id="css-ddslick" type="text/css">.dd-select{ border-radius:2px; border:solid 1px #ccc; position:relative; cursor:pointer;}.dd-desc { color:#aaa; display:block; overflow: hidden; font-weight:normal; line-height: 1.4em; }.dd-selected{ overflow:hidden; display:block; padding:10px; font-weight:bold;}.dd-pointer{ width:0; height:0; position:absolute; right:10px; top:50%; margin-top:-3px;}.dd-pointer-down{ border:solid 5px transparent; border-top:solid 5px #000; }.dd-pointer-up{border:solid 5px transparent !important; border-bottom:solid 5px #000 !important; margin-top:-8px;}.dd-options{ border:solid 1px #ccc; border-top:none; list-style:none; box-shadow:0px 1px 5px #ddd; display:none; position:absolute; z-index:2000; margin:0; padding:0;background:#fff; overflow:auto;}.dd-option{ padding:10px; display:block; border-bottom:solid 1px #ddd; overflow:hidden; text-decoration:none; color:#333; cursor:pointer;-webkit-transition: all 0.25s ease-in-out; -moz-transition: all 0.25s ease-in-out;-o-transition: all 0.25s ease-in-out;-ms-transition: all 0.25s ease-in-out; }.dd-options > li:last-child > .dd-option{ border-bottom:none;}.dd-option:hover{ background:#f3f3f3; color:#000;}.dd-selected-description-truncated { text-overflow: ellipsis; white-space:nowrap; }.dd-option-selected { background:#f6f6f6; }.dd-option-icon, .dd-selected-icon { width:36px; text-align:center; vertical-align:middle; float:left; margin-right:10px; font-size:34px;}.dd-icon-right { float:right; margin-right:15px; margin-left:5px;}.dd-container{ position:relative;} .dd-selected-text { font-weight:bold}</style>').appendTo("head"),s.init=function(i){return i=e.extend({},l,i),this.each(function(){var n=e(this);if(!n.data("ddslick")){var o=[];i.data;n.find("option").each(function(){var d=e(this),t=d.data();o.push({text:e.trim(d.text()),value:d.val(),selected:d.is(":selected"),description:t.description,iconSrc:t.iconsrc})}),i.keepJSONItemsOnTop?e.merge(i.data,o):i.data=e.merge(o,i.data);var s=n,l=e('<div id="'+n.attr("id")+'"></div>');n.replaceWith(l),(n=l).addClass("dd-container").append('<div class="dd-select"><input class="dd-selected-value" type="hidden" /><a class="dd-selected"></a><span class="dd-pointer dd-pointer-down"></span></div>').append('<ul class="dd-options"></ul>'),o=n.find(".dd-select"),ddOptions=n.find(".dd-options"),ddOptions.css({width:i.width}),o.css({width:i.width,background:i.background}),n.css({width:i.width}),null!=i.height&&ddOptions.css({height:i.height,overflow:"auto"}),e.each(i.data,function(e,d){d.selected&&(i.defaultSelectedIndex=e),ddOptions.append('<li><a class="dd-option">'+(d.value?' <input class="dd-option-value" type="hidden" value="'+d.value+'" />':"")+(d.iconSrc?' <i class="dd-option-icon'+("right"==i.iconPosition?" dd-icon-right":"")+" "+i.iconset+" "+d.iconSrc+'" ></i>':"")+(d.text?' <label class="dd-option-text">'+d.text+"</label>":"")+(d.description?' <small class="dd-option-description dd-desc">'+d.description+"</small>":"")+"</a></li>")});var c={settings:i,original:s,selectedIndex:-1,selectedItem:null,selectedData:null};if(n.data("ddslick",c),i.selectText.length>0&&null==i.defaultSelectedIndex)n.find(".dd-selected").html(i.selectText);else{var a=null!=i.defaultSelectedIndex&&i.defaultSelectedIndex>=0&&i.defaultSelectedIndex<i.data.length?i.defaultSelectedIndex:0;d(n,a)}n.find(".dd-select").on("click.ddslick",function(){t(n)}),n.find(".dd-option").on("click.ddslick",function(){d(n,e(this).closest("li").index())}),i.clickOffToClose&&(ddOptions.addClass("dd-click-off-close"),n.on("click.ddslick",function(e){e.stopPropagation()}),e("body").on("click",function(){e(".dd-click-off-close").slideUp(50).siblings(".dd-select").find(".dd-pointer").removeClass("dd-pointer-up")}))}})},s.select=function(t){return this.each(function(){t.index&&d(e(this),t.index)})},s.open=function(){return this.each(function(){var d=e(this);d.data("ddslick")&&t(d)})},s.close=function(){return this.each(function(){var d=e(this);d.data("ddslick")&&i(d)})},s.destroy=function(){return this.each(function(){var d=e(this),t=d.data("ddslick");if(t){var i=t.original;d.removeData("ddslick").unbind(".ddslick").replaceWith(i)}})}}(jQuery);
|
inc/custom-controls/controls/icon-picker/icon-picker-control.php
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* hantus icon picker
|
4 |
+
*/
|
5 |
+
if ( ! class_exists( 'WP_Customize_Control' ) ) {
|
6 |
+
return;
|
7 |
+
}
|
8 |
+
class Hantus_Icon_Picker_Control extends WP_Customize_Control {
|
9 |
+
|
10 |
+
public $type = 'hantus-icon-picker';
|
11 |
+
|
12 |
+
public $iconset = array();
|
13 |
+
|
14 |
+
public function to_json() {
|
15 |
+
if ( empty( $this->iconset ) ) {
|
16 |
+
$this->iconset = 'fa';
|
17 |
+
}
|
18 |
+
$iconset = $this->iconset;
|
19 |
+
$this->json['iconset'] = $iconset;
|
20 |
+
parent::to_json();
|
21 |
+
}
|
22 |
+
|
23 |
+
public function enqueue() {
|
24 |
+
wp_enqueue_script( 'hantus-icon-picker-ddslick-min', OUR_DIRECTORY_URI . 'controls/icon-picker/assets/js/jquery.ddslick.min.js', array( 'jquery' ) );
|
25 |
+
wp_enqueue_script( 'hantus-icon-picker-control', OUR_DIRECTORY_URI . 'controls/icon-picker/assets/js/icon-picker-control.js', array( 'jquery', 'hantus-icon-picker-ddslick-min' ), '', true );
|
26 |
+
if ( in_array( $this->iconset, array( 'genericon', 'genericons' ) ) ) {
|
27 |
+
wp_enqueue_style( 'genericons', OUR_DIRECTORY_URI . 'assets/genericons/genericons.css' );
|
28 |
+
} elseif ( in_array( $this->iconset, array( 'dashicon', 'dashicons' ) ) ) {
|
29 |
+
wp_enqueue_style( 'dashicons' );
|
30 |
+
} else {
|
31 |
+
wp_enqueue_style( 'font-awesome', OUR_DIRECTORY_URI . 'assets/font-awesome/css/font-awesome.min.css' );
|
32 |
+
}
|
33 |
+
}
|
34 |
+
|
35 |
+
public function render_content() {
|
36 |
+
if ( empty( $this->choices ) ) {
|
37 |
+
if ( in_array( $this->iconset, array( 'genericon', 'genericons' ) ) ) {
|
38 |
+
require_once OUR_DIRECTORY . 'controls/icon-picker/inc/genericons-icons.php';
|
39 |
+
$this->choices = hantus_genericons_list();
|
40 |
+
} elseif ( in_array( $this->iconset, array( 'dashicon', 'dashicons' ) ) ) {
|
41 |
+
require_once OUR_DIRECTORY . 'controls/icon-picker/inc/dashicons-icons.php';
|
42 |
+
$this->choices = hantus_dashicons_list();
|
43 |
+
} else {
|
44 |
+
require_once OUR_DIRECTORY . 'controls/icon-picker/inc/fa-icons.php';
|
45 |
+
$this->choices = hantus_font_awesome_list();
|
46 |
+
}
|
47 |
+
}
|
48 |
+
?>
|
49 |
+
<label>
|
50 |
+
<?php if ( ! empty( $this->label ) ) : ?>
|
51 |
+
<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
|
52 |
+
<?php endif;
|
53 |
+
if ( ! empty( $this->description ) ) : ?>
|
54 |
+
<span class="description customize-control-description"><?php echo esc_html( $this->description ); ?></span>
|
55 |
+
<?php endif; ?>
|
56 |
+
<select class="startkit-icon-picker-icon-control" id="<?php echo esc_attr( $this->id ); ?>">
|
57 |
+
<?php foreach ( $this->choices as $value => $label ) : ?>
|
58 |
+
<option value="<?php echo esc_attr( $value ); ?>" <?php echo selected( $this->value(), $value, false ); ?> data-iconsrc="<?php echo esc_attr( $value ); ?>"><?php echo esc_html( $label ); ?></option>
|
59 |
+
<?php endforeach; ?>
|
60 |
+
</select>
|
61 |
+
</label>
|
62 |
+
<?php }
|
63 |
+
|
64 |
+
}
|
65 |
+
|
inc/custom-controls/controls/icon-picker/inc/dashicons-icons.php
ADDED
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* This is a list of all the Dashiconss icons.
|
4 |
+
*
|
5 |
+
* @package O2 Customizer Library
|
6 |
+
* @subpackage Icon Picker
|
7 |
+
* @since 0.1
|
8 |
+
*/
|
9 |
+
function hantus_dashicons_list() {
|
10 |
+
$icons = array(
|
11 |
+
'dashicons-menu' => 'dashicons-menu',
|
12 |
+
'dashicons-admin-site' => 'dashicons-admin-site',
|
13 |
+
'dashicons-dashboard' => 'dashicons-dashboard',
|
14 |
+
'dashicons-admin-media' => 'dashicons-admin-media',
|
15 |
+
'dashicons-admin-page' => 'dashicons-admin-page',
|
16 |
+
'dashicons-admin-comments' => 'dashicons-admin-comments',
|
17 |
+
'dashicons-admin-appearance' => 'dashicons-admin-appearance',
|
18 |
+
'dashicons-admin-plugins' => 'dashicons-admin-plugins',
|
19 |
+
'dashicons-admin-users' => 'dashicons-admin-users',
|
20 |
+
'dashicons-admin-tools' => 'dashicons-admin-tools',
|
21 |
+
'dashicons-admin-settings' => 'dashicons-admin-settings',
|
22 |
+
'dashicons-admin-network' => 'dashicons-admin-network',
|
23 |
+
'dashicons-admin-generic' => 'dashicons-admin-generic',
|
24 |
+
'dashicons-admin-home' => 'dashicons-admin-home',
|
25 |
+
'dashicons-admin-collapse' => 'dashicons-admin-collapse',
|
26 |
+
'dashicons-filter' => 'dashicons-filter',
|
27 |
+
'dashicons-admin-customizer' => 'dashicons-admin-customizer',
|
28 |
+
'dashicons-admin-multisite' => 'dashicons-admin-multisite',
|
29 |
+
'dashicons-format-links' => 'dashicons-format-links',
|
30 |
+
'dashicons-format-standard' => 'dashicons-format-standard',
|
31 |
+
'dashicons-format-image' => 'dashicons-format-image',
|
32 |
+
'dashicons-format-gallery' => 'dashicons-format-gallery',
|
33 |
+
'dashicons-format-audio' => 'dashicons-format-audio',
|
34 |
+
'dashicons-format-video' => 'dashicons-format-video',
|
35 |
+
'dashicons-format-chat' => 'dashicons-format-chat',
|
36 |
+
'dashicons-format-status' => 'dashicons-format-status',
|
37 |
+
'dashicons-format-aside' => 'dashicons-format-aside',
|
38 |
+
'dashicons-format-quote' => 'dashicons-format-quote',
|
39 |
+
'dashicons-welcome-edit-page' => 'dashicons-welcome-edit-page',
|
40 |
+
'dashicons-welcome-add-page' => 'dashicons-welcome-add-page',
|
41 |
+
'dashicons-welcome-view-site' => 'dashicons-welcome-view-site',
|
42 |
+
'dashicons-welcome-widgets-menus' => 'dashicons-welcome-widgets-menus',
|
43 |
+
'dashicons-welcome-comments' => 'dashicons-welcome-comments',
|
44 |
+
'dashicons-welcome-learn-more' => 'dashicons-welcome-learn-more',
|
45 |
+
'dashicons-image-crop' => 'dashicons-image-crop',
|
46 |
+
'dashicons-image-rotate' => 'dashicons-image-rotate',
|
47 |
+
'dashicons-image-rotate-left' => 'dashicons-image-rotate-left',
|
48 |
+
'dashicons-image-rotate-right' => 'dashicons-image-rotate-right',
|
49 |
+
'dashicons-image-flip-vertical' => 'dashicons-image-flip-vertical',
|
50 |
+
'dashicons-image-flip-horizontal' => 'dashicons-image-flip-horizontal',
|
51 |
+
'dashicons-image-filter' => 'dashicons-image-filter',
|
52 |
+
'dashicons-undo' => 'dashicons-undo',
|
53 |
+
'dashicons-redo' => 'dashicons-redo',
|
54 |
+
'dashicons-editor-bold' => 'dashicons-editor-bold',
|
55 |
+
'dashicons-editor-italic' => 'dashicons-editor-italic',
|
56 |
+
'dashicons-editor-ul' => 'dashicons-editor-ul',
|
57 |
+
'dashicons-editor-ol' => 'dashicons-editor-ol',
|
58 |
+
'dashicons-editor-quote' => 'dashicons-editor-quote',
|
59 |
+
'dashicons-editor-alignleft' => 'dashicons-editor-alignleft',
|
60 |
+
'dashicons-editor-aligncenter' => 'dashicons-editor-aligncenter',
|
61 |
+
'dashicons-editor-alignright' => 'dashicons-editor-alignright',
|
62 |
+
'dashicons-editor-insertmore' => 'dashicons-editor-insertmore',
|
63 |
+
'dashicons-editor-spellcheck' => 'dashicons-editor-spellcheck'
|
64 |
+
);
|
65 |
+
return $icons;
|
66 |
+
}
|
inc/custom-controls/controls/icon-picker/inc/fa-icons.php
ADDED
@@ -0,0 +1,645 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* This is a list of all the Font Awesome icons.
|
4 |
+
*
|
5 |
+
* @package O2 Customizer Library
|
6 |
+
* @subpackage Icon Picker
|
7 |
+
* @since 0.1
|
8 |
+
*/
|
9 |
+
function hantus_font_awesome_list() {
|
10 |
+
$icons = array(
|
11 |
+
'fa-glass' => 'fa-glass',
|
12 |
+
'fa-music' => 'fa-music',
|
13 |
+
'fa-search' => 'fa-search',
|
14 |
+
'fa-envelope-o' => 'fa-envelope-o',
|
15 |
+
'fa-heart' => 'fa-heart',
|
16 |
+
'fa-star' => 'fa-star',
|
17 |
+
'fa-star-o' => 'fa-star-o',
|
18 |
+
'fa-user' => 'fa-user',
|
19 |
+
'fa-film' => 'fa-film',
|
20 |
+
'fa-th-large' => 'fa-th-large',
|
21 |
+
'fa-th' => 'fa-th',
|
22 |
+
'fa-th-list' => 'fa-th-list',
|
23 |
+
'fa-check' => 'fa-check',
|
24 |
+
'fa-times' => 'fa-times',
|
25 |
+
'fa-search-plus' => 'fa-search-plus',
|
26 |
+
'fa-search-minus' => 'fa-search-minus',
|
27 |
+
'fa-power-off' => 'fa-power-off',
|
28 |
+
'fa-signal' => 'fa-signal',
|
29 |
+
'fa-cog' => 'fa-cog',
|
30 |
+
'fa-trash-o' => 'fa-trash-o',
|
31 |
+
'fa-home' => 'fa-home',
|
32 |
+
'fa-file-o' => 'fa-file-o',
|
33 |
+
'fa-clock-o' => 'fa-clock-o',
|
34 |
+
'fa-road' => 'fa-road',
|
35 |
+
'fa-download' => 'fa-download',
|
36 |
+
'fa-arrow-circle-o-down' => 'fa-arrow-circle-o-down',
|
37 |
+
'fa-arrow-circle-o-up' => 'fa-arrow-circle-o-up',
|
38 |
+
'fa-inbox' => 'fa-inbox',
|
39 |
+
'fa-play-circle-o' => 'fa-play-circle-o',
|
40 |
+
'fa-repeat' => 'fa-repeat',
|
41 |
+
'fa-refresh' => 'fa-refresh',
|
42 |
+
'fa-list-alt' => 'fa-list-alt',
|
43 |
+
'fa-lock' => 'fa-lock',
|
44 |
+
'fa-flag' => 'fa-flag',
|
45 |
+
'fa-headphones' => 'fa-headphones',
|
46 |
+
'fa-volume-off' => 'fa-volume-off',
|
47 |
+
'fa-volume-down' => 'fa-volume-down',
|
48 |
+
'fa-volume-up' => 'fa-volume-up',
|
49 |
+
'fa-qrcode' => 'fa-qrcode',
|
50 |
+
'fa-barcode' => 'fa-barcode',
|
51 |
+
'fa-tag' => 'fa-tag',
|
52 |
+
'fa-tags' => 'fa-tags',
|
53 |
+
'fa-book' => 'fa-book',
|
54 |
+
'fa-bookmark' => 'fa-bookmark',
|
55 |
+
'fa-print' => 'fa-print',
|
56 |
+
'fa-camera' => 'fa-camera',
|
57 |
+
'fa-font' => 'fa-font',
|
58 |
+
'fa-bold' => 'fa-bold',
|
59 |
+
'fa-italic' => 'fa-italic',
|
60 |
+
'fa-text-height' => 'fa-text-height',
|
61 |
+
'fa-text-width' => 'fa-text-width',
|
62 |
+
'fa-align-left' => 'fa-align-left',
|
63 |
+
'fa-align-center' => 'fa-align-center',
|
64 |
+
'fa-align-right' => 'fa-align-right',
|
65 |
+
'fa-align-justify' => 'fa-align-justify',
|
66 |
+
'fa-list' => 'fa-list',
|
67 |
+
'fa-outdent' => 'fa-outdent',
|
68 |
+
'fa-indent' => 'fa-indent',
|
69 |
+
'fa-video-camera' => 'fa-video-camera',
|
70 |
+
'fa-picture-o' => 'fa-picture-o',
|
71 |
+
'fa-pencil' => 'fa-pencil',
|
72 |
+
'fa-map-marker' => 'fa-map-marker',
|
73 |
+
'fa-adjust' => 'fa-adjust',
|
74 |
+
'fa-tint' => 'fa-tint',
|
75 |
+
'fa-pencil-square-o' => 'fa-pencil-square-o',
|
76 |
+
'fa-share-square-o' => 'fa-share-square-o',
|
77 |
+
'fa-check-square-o' => 'fa-check-square-o',
|
78 |
+
'fa-arrows' => 'fa-arrows',
|
79 |
+
'fa-step-backward' => 'fa-step-backward',
|
80 |
+
'fa-fast-backward' => 'fa-fast-backward',
|
81 |
+
'fa-backward' => 'fa-backward',
|
82 |
+
'fa-play' => 'fa-play',
|
83 |
+
'fa-pause' => 'fa-pause',
|
84 |
+
'fa-stop' => 'fa-stop',
|
85 |
+
'fa-forward' => 'fa-forward',
|
86 |
+
'fa-fast-forward' => 'fa-fast-forward',
|
87 |
+
'fa-step-forward' => 'fa-step-forward',
|
88 |
+
'fa-eject' => 'fa-eject',
|
89 |
+
'fa-chevron-left' => 'fa-chevron-left',
|
90 |
+
'fa-chevron-right' => 'fa-chevron-right',
|
91 |
+
'fa-plus-circle' => 'fa-plus-circle',
|
92 |
+
'fa-minus-circle' => 'fa-minus-circle',
|
93 |
+
'fa-times-circle' => 'fa-times-circle',
|
94 |
+
'fa-check-circle' => 'fa-check-circle',
|
95 |
+
'fa-question-circle' => 'fa-question-circle',
|
96 |
+
'fa-info-circle' => 'fa-info-circle',
|
97 |
+
'fa-crosshairs' => 'fa-crosshairs',
|
98 |
+
'fa-times-circle-o' => 'fa-times-circle-o',
|
99 |
+
'fa-check-circle-o' => 'fa-check-circle-o',
|
100 |
+
'fa-ban' => 'fa-ban',
|
101 |
+
'fa-arrow-left' => 'fa-arrow-left',
|
102 |
+
'fa-arrow-right' => 'fa-arrow-right',
|
103 |
+
'fa-arrow-up' => 'fa-arrow-up',
|
104 |
+
'fa-arrow-down' => 'fa-arrow-down',
|
105 |
+
'fa-share' => 'fa-share',
|
106 |
+
'fa-expand' => 'fa-expand',
|
107 |
+
'fa-compress' => 'fa-compress',
|
108 |
+
'fa-plus' => 'fa-plus',
|
109 |
+
'fa-minus' => 'fa-minus',
|
110 |
+
'fa-asterisk' => 'fa-asterisk',
|
111 |
+
'fa-exclamation-circle' => 'fa-exclamation-circle',
|
112 |
+
'fa-gift' => 'fa-gift',
|
113 |
+
'fa-leaf' => 'fa-leaf',
|
114 |
+
'fa-fire' => 'fa-fire',
|
115 |
+
'fa-eye' => 'fa-eye',
|
116 |
+
'fa-eye-slash' => 'fa-eye-slash',
|
117 |
+
'fa-exclamation-triangle' => 'fa-exclamation-triangle',
|
118 |
+
'fa-plane' => 'fa-plane',
|
119 |
+
'fa-calendar' => 'fa-calendar',
|
120 |
+
'fa-random' => 'fa-random',
|
121 |
+
'fa-comment' => 'fa-comment',
|
122 |
+
'fa-magnet' => 'fa-magnet',
|
123 |
+
'fa-chevron-up' => 'fa-chevron-up',
|
124 |
+
'fa-chevron-down' => 'fa-chevron-down',
|
125 |
+
'fa-retweet' => 'fa-retweet',
|
126 |
+
'fa-shopping-cart' => 'fa-shopping-cart',
|
127 |
+
'fa-folder' => 'fa-folder',
|
128 |
+
'fa-folder-open' => 'fa-folder-open',
|
129 |
+
'fa-arrows-v' => 'fa-arrows-v',
|
130 |
+
'fa-arrows-h' => 'fa-arrows-h',
|
131 |
+
'fa-bar-chart' => 'fa-bar-chart',
|
132 |
+
'fa-twitter-square' => 'fa-twitter-square',
|
133 |
+
'fa-facebook-square' => 'fa-facebook-square',
|
134 |
+
'fa-camera-retro' => 'fa-camera-retro',
|
135 |
+
'fa-key' => 'fa-key',
|
136 |
+
'fa-cogs' => 'fa-cogs',
|
137 |
+
'fa-comments' => 'fa-comments',
|
138 |
+
'fa-thumbs-o-up' => 'fa-thumbs-o-up',
|
139 |
+
'fa-thumbs-o-down' => 'fa-thumbs-o-down',
|
140 |
+
'fa-star-half' => 'fa-star-half',
|
141 |
+
'fa-heart-o' => 'fa-heart-o',
|
142 |
+
'fa-sign-out' => 'fa-sign-out',
|
143 |
+
'fa-linkedin-square' => 'fa-linkedin-square',
|
144 |
+
'fa-thumb-tack' => 'fa-thumb-tack',
|
145 |
+
'fa-external-link' => 'fa-external-link',
|
146 |
+
'fa-sign-in' => 'fa-sign-in',
|
147 |
+
'fa-trophy' => 'fa-trophy',
|
148 |
+
'fa-github-square' => 'fa-github-square',
|
149 |
+
'fa-upload' => 'fa-upload',
|
150 |
+
'fa-lemon-o' => 'fa-lemon-o',
|
151 |
+
'fa-phone' => 'fa-phone',
|
152 |
+
'fa-square-o' => 'fa-square-o',
|
153 |
+
'fa-bookmark-o' => 'fa-bookmark-o',
|
154 |
+
'fa-phone-square' => 'fa-phone-square',
|
155 |
+
'fa-twitter' => 'fa-twitter',
|
156 |
+
'fa-facebook' => 'fa-facebook',
|
157 |
+
'fa-github' => 'fa-github',
|
158 |
+
'fa-unlock' => 'fa-unlock',
|
159 |
+
'fa-credit-card' => 'fa-credit-card',
|
160 |
+
'fa-rss' => 'fa-rss',
|
161 |
+
'fa-hdd-o' => 'fa-hdd-o',
|
162 |
+
'fa-bullhorn' => 'fa-bullhorn',
|
163 |
+
'fa-bell' => 'fa-bell',
|
164 |
+
'fa-certificate' => 'fa-certificate',
|
165 |
+
'fa-hand-o-right' => 'fa-hand-o-right',
|
166 |
+
'fa-hand-o-left' => 'fa-hand-o-left',
|
167 |
+
'fa-hand-o-up' => 'fa-hand-o-up',
|
168 |
+
'fa-hand-o-down' => 'fa-hand-o-down',
|
169 |
+
'fa-arrow-circle-left' => 'fa-arrow-circle-left',
|
170 |
+
'fa-arrow-circle-right' => 'fa-arrow-circle-right',
|
171 |
+
'fa-arrow-circle-up' => 'fa-arrow-circle-up',
|
172 |
+
'fa-arrow-circle-down' => 'fa-arrow-circle-down',
|
173 |
+
'fa-globe' => 'fa-globe',
|
174 |
+
'fa-wrench' => 'fa-wrench',
|
175 |
+
'fa-tasks' => 'fa-tasks',
|
176 |
+
'fa-filter' => 'fa-filter',
|
177 |
+
'fa-briefcase' => 'fa-briefcase',
|
178 |
+
'fa-arrows-alt' => 'fa-arrows-alt',
|
179 |
+
'fa-users' => 'fa-users',
|
180 |
+
'fa-link' => 'fa-link',
|
181 |
+
'fa-cloud' => 'fa-cloud',
|
182 |
+
'fa-flask' => 'fa-flask',
|
183 |
+
'fa-scissors' => 'fa-scissors',
|
184 |
+
'fa-files-o' => 'fa-files-o',
|
185 |
+
'fa-paperclip' => 'fa-paperclip',
|
186 |
+
'fa-floppy-o' => 'fa-floppy-o',
|
187 |
+
'fa-square' => 'fa-square',
|
188 |
+
'fa-bars' => 'fa-bars',
|
189 |
+
'fa-list-ul' => 'fa-list-ul',
|
190 |
+
'fa-list-ol' => 'fa-list-ol',
|
191 |
+
'fa-strikethrough' => 'fa-strikethrough',
|
192 |
+
'fa-underline' => 'fa-underline',
|
193 |
+
'fa-table' => 'fa-table',
|
194 |
+
'fa-magic' => 'fa-magic',
|
195 |
+
'fa-truck' => 'fa-truck',
|
196 |
+
'fa-pinterest' => 'fa-pinterest',
|
197 |
+
'fa-pinterest-square' => 'fa-pinterest-square',
|
198 |
+
'fa-google-plus-square' => 'fa-google-plus-square',
|
199 |
+
'fa-google-plus' => 'fa-google-plus',
|
200 |
+
'fa-money' => 'fa-money',
|
201 |
+
'fa-caret-down' => 'fa-caret-down',
|
202 |
+
'fa-caret-up' => 'fa-caret-up',
|
203 |
+
'fa-caret-left' => 'fa-caret-left',
|
204 |
+
'fa-caret-right' => 'fa-caret-right',
|
205 |
+
'fa-columns' => 'fa-columns',
|
206 |
+
'fa-sort' => 'fa-sort',
|
207 |
+
'fa-sort-desc' => 'fa-sort-desc',
|
208 |
+
'fa-sort-asc' => 'fa-sort-asc',
|
209 |
+
'fa-envelope' => 'fa-envelope',
|
210 |
+
'fa-linkedin' => 'fa-linkedin',
|
211 |
+
'fa-undo' => 'fa-undo',
|
212 |
+
'fa-gavel' => 'fa-gavel',
|
213 |
+
'fa-tachometer' => 'fa-tachometer',
|
214 |
+
'fa-comment-o' => 'fa-comment-o',
|
215 |
+
'fa-comments-o' => 'fa-comments-o',
|
216 |
+
'fa-bolt' => 'fa-bolt',
|
217 |
+
'fa-sitemap' => 'fa-sitemap',
|
218 |
+
'fa-umbrella' => 'fa-umbrella',
|
219 |
+
'fa-clipboard' => 'fa-clipboard',
|
220 |
+
'fa-lightbulb-o' => 'fa-lightbulb-o',
|
221 |
+
'fa-exchange' => 'fa-exchange',
|
222 |
+
'fa-cloud-download' => 'fa-cloud-download',
|
223 |
+
'fa-cloud-upload' => 'fa-cloud-upload',
|
224 |
+
'fa-user-md' => 'fa-user-md',
|
225 |
+
'fa-stethoscope' => 'fa-stethoscope',
|
226 |
+
'fa-suitcase' => 'fa-suitcase',
|
227 |
+
'fa-bell-o' => 'fa-bell-o',
|
228 |
+
'fa-coffee' => 'fa-coffee',
|
229 |
+
'fa-cutlery' => 'fa-cutlery',
|
230 |
+
'fa-file-text-o' => 'fa-file-text-o',
|
231 |
+
'fa-building-o' => 'fa-building-o',
|
232 |
+
'fa-hospital-o' => 'fa-hospital-o',
|
233 |
+
'fa-ambulance' => 'fa-ambulance',
|
234 |
+
'fa-medkit' => 'fa-medkit',
|
235 |
+
'fa-fighter-jet' => 'fa-fighter-jet',
|
236 |
+
'fa-beer' => 'fa-beer',
|
237 |
+
'fa-h-square' => 'fa-h-square',
|
238 |
+
'fa-plus-square' => 'fa-plus-square',
|
239 |
+
'fa-angle-double-left' => 'fa-angle-double-left',
|
240 |
+
'fa-angle-double-right' => 'fa-angle-double-right',
|
241 |
+
'fa-angle-double-up' => 'fa-angle-double-up',
|
242 |
+
'fa-angle-double-down' => 'fa-angle-double-down',
|
243 |
+
'fa-angle-left' => 'fa-angle-left',
|
244 |
+
'fa-angle-right' => 'fa-angle-right',
|
245 |
+
'fa-angle-up' => 'fa-angle-up',
|
246 |
+
'fa-angle-down' => 'fa-angle-down',
|
247 |
+
'fa-desktop' => 'fa-desktop',
|
248 |
+
'fa-laptop' => 'fa-laptop',
|
249 |
+
'fa-tablet' => 'fa-tablet',
|
250 |
+
'fa-mobile' => 'fa-mobile',
|
251 |
+
'fa-circle-o' => 'fa-circle-o',
|
252 |
+
'fa-quote-left' => 'fa-quote-left',
|
253 |
+
'fa-quote-right' => 'fa-quote-right',
|
254 |
+
'fa-spinner' => 'fa-spinner',
|
255 |
+
'fa-circle' => 'fa-circle',
|
256 |
+
'fa-reply' => 'fa-reply',
|
257 |
+
'fa-github-alt' => 'fa-github-alt',
|
258 |
+
'fa-folder-o' => 'fa-folder-o',
|
259 |
+
'fa-folder-open-o' => 'fa-folder-open-o',
|
260 |
+
'fa-smile-o' => 'fa-smile-o',
|
261 |
+
'fa-frown-o' => 'fa-frown-o',
|
262 |
+
'fa-meh-o' => 'fa-meh-o',
|
263 |
+
'fa-gamepad' => 'fa-gamepad',
|
264 |
+
'fa-keyboard-o' => 'fa-keyboard-o',
|
265 |
+
'fa-flag-o' => 'fa-flag-o',
|
266 |
+
'fa-flag-checkered' => 'fa-flag-checkered',
|
267 |
+
'fa-terminal' => 'fa-terminal',
|
268 |
+
'fa-code' => 'fa-code',
|
269 |
+
'fa-reply-all' => 'fa-reply-all',
|
270 |
+
'fa-star-half-o' => 'fa-star-half-o',
|
271 |
+
'fa-location-arrow' => 'fa-location-arrow',
|
272 |
+
'fa-crop' => 'fa-crop',
|
273 |
+
'fa-code-fork' => 'fa-code-fork',
|
274 |
+
'fa-chain-broken' => 'fa-chain-broken',
|
275 |
+
'fa-question' => 'fa-question',
|
276 |
+
'fa-info' => 'fa-info',
|
277 |
+
'fa-exclamation' => 'fa-exclamation',
|
278 |
+
'fa-superscript' => 'fa-superscript',
|
279 |
+
'fa-subscript' => 'fa-subscript',
|
280 |
+
'fa-eraser' => 'fa-eraser',
|
281 |
+
'fa-puzzle-piece' => 'fa-puzzle-piece',
|
282 |
+
'fa-microphone' => 'fa-microphone',
|
283 |
+
'fa-microphone-slash' => 'fa-microphone-slash',
|
284 |
+
'fa-shield' => 'fa-shield',
|
285 |
+
'fa-calendar-o' => 'fa-calendar-o',
|
286 |
+
'fa-fire-extinguisher' => 'fa-fire-extinguisher',
|
287 |
+
'fa-rocket' => 'fa-rocket',
|
288 |
+
'fa-maxcdn' => 'fa-maxcdn',
|
289 |
+
'fa-chevron-circle-left' => 'fa-chevron-circle-left',
|
290 |
+
'fa-chevron-circle-right' => 'fa-chevron-circle-right',
|
291 |
+
'fa-chevron-circle-up' => 'fa-chevron-circle-up',
|
292 |
+
'fa-chevron-circle-down' => 'fa-chevron-circle-down',
|
293 |
+
'fa-html5' => 'fa-html5',
|
294 |
+
'fa-css3' => 'fa-css3',
|
295 |
+
'fa-anchor' => 'fa-anchor',
|
296 |
+
'fa-unlock-alt' => 'fa-unlock-alt',
|
297 |
+
'fa-bullseye' => 'fa-bullseye',
|
298 |
+
'fa-ellipsis-h' => 'fa-ellipsis-h',
|
299 |
+
'fa-ellipsis-v' => 'fa-ellipsis-v',
|
300 |
+
'fa-rss-square' => 'fa-rss-square',
|
301 |
+
'fa-play-circle' => 'fa-play-circle',
|
302 |
+
'fa-ticket' => 'fa-ticket',
|
303 |
+
'fa-minus-square' => 'fa-minus-square',
|
304 |
+
'fa-minus-square-o' => 'fa-minus-square-o',
|
305 |
+
'fa-level-up' => 'fa-level-up',
|
306 |
+
'fa-level-down' => 'fa-level-down',
|
307 |
+
'fa-check-square' => 'fa-check-square',
|
308 |
+
'fa-pencil-square' => 'fa-pencil-square',
|
309 |
+
'fa-external-link-square' => 'fa-external-link-square',
|
310 |
+
'fa-share-square' => 'fa-share-square',
|
311 |
+
'fa-compass' => 'fa-compass',
|
312 |
+
'fa-caret-square-o-down' => 'fa-caret-square-o-down',
|
313 |
+
'fa-caret-square-o-up' => 'fa-caret-square-o-up',
|
314 |
+
'fa-caret-square-o-right' => 'fa-caret-square-o-right',
|
315 |
+
'fa-eur' => 'fa-eur',
|
316 |
+
'fa-gbp' => 'fa-gbp',
|
317 |
+
'fa-usd' => 'fa-usd',
|
318 |
+
'fa-inr' => 'fa-inr',
|
319 |
+
'fa-jpy' => 'fa-jpy',
|
320 |
+
'fa-rub' => 'fa-rub',
|
321 |
+
'fa-krw' => 'fa-krw',
|
322 |
+
'fa-btc' => 'fa-btc',
|
323 |
+
'fa-file' => 'fa-file',
|
324 |
+
'fa-file-text' => 'fa-file-text',
|
325 |
+
'fa-sort-alpha-asc' => 'fa-sort-alpha-asc',
|
326 |
+
'fa-sort-alpha-desc' => 'fa-sort-alpha-desc',
|
327 |
+
'fa-sort-amount-asc' => 'fa-sort-amount-asc',
|
328 |
+
'fa-sort-amount-desc' => 'fa-sort-amount-desc',
|
329 |
+
'fa-sort-numeric-asc' => 'fa-sort-numeric-asc',
|
330 |
+
'fa-sort-numeric-desc' => 'fa-sort-numeric-desc',
|
331 |
+
'fa-thumbs-up' => 'fa-thumbs-up',
|
332 |
+
'fa-thumbs-down' => 'fa-thumbs-down',
|
333 |
+
'fa-youtube-square' => 'fa-youtube-square',
|
334 |
+
'fa-youtube' => 'fa-youtube',
|
335 |
+
'fa-xing' => 'fa-xing',
|
336 |
+
'fa-xing-square' => 'fa-xing-square',
|
337 |
+
'fa-youtube-play' => 'fa-youtube-play',
|
338 |
+
'fa-dropbox' => 'fa-dropbox',
|
339 |
+
'fa-stack-overflow' => 'fa-stack-overflow',
|
340 |
+
'fa-instagram' => 'fa-instagram',
|
341 |
+
'fa-flickr' => 'fa-flickr',
|
342 |
+
'fa-adn' => 'fa-adn',
|
343 |
+
'fa-bitbucket' => 'fa-bitbucket',
|
344 |
+
'fa-bitbucket-square' => 'fa-bitbucket-square',
|
345 |
+
'fa-tumblr' => 'fa-tumblr',
|
346 |
+
'fa-tumblr-square' => 'fa-tumblr-square',
|
347 |
+
'fa-long-arrow-down' => 'fa-long-arrow-down',
|
348 |
+
'fa-long-arrow-up' => 'fa-long-arrow-up',
|
349 |
+
'fa-long-arrow-left' => 'fa-long-arrow-left',
|
350 |
+
'fa-long-arrow-right' => 'fa-long-arrow-right',
|
351 |
+
'fa-apple' => 'fa-apple',
|
352 |
+
'fa-windows' => 'fa-windows',
|
353 |
+
'fa-android' => 'fa-android',
|
354 |
+
'fa-linux' => 'fa-linux',
|
355 |
+
'fa-dribbble' => 'fa-dribbble',
|
356 |
+
'fa-skype' => 'fa-skype',
|
357 |
+
'fa-foursquare' => 'fa-foursquare',
|
358 |
+
'fa-trello' => 'fa-trello',
|
359 |
+
'fa-female' => 'fa-female',
|
360 |
+
'fa-male' => 'fa-male',
|
361 |
+
'fa-gratipay' => 'fa-gratipay',
|
362 |
+
'fa-sun-o' => 'fa-sun-o',
|
363 |
+
'fa-moon-o' => 'fa-moon-o',
|
364 |
+
'fa-archive' => 'fa-archive',
|
365 |
+
'fa-bug' => 'fa-bug',
|
366 |
+
'fa-vk' => 'fa-vk',
|
367 |
+
'fa-weibo' => 'fa-weibo',
|
368 |
+
'fa-renren' => 'fa-renren',
|
369 |
+
'fa-pagelines' => 'fa-pagelines',
|
370 |
+
'fa-stack-exchange' => 'fa-stack-exchange',
|
371 |
+
'fa-arrow-circle-o-right' => 'fa-arrow-circle-o-right',
|
372 |
+
'fa-arrow-circle-o-left' => 'fa-arrow-circle-o-left',
|
373 |
+
'fa-caret-square-o-left' => 'fa-caret-square-o-left',
|
374 |
+
'fa-dot-circle-o' => 'fa-dot-circle-o',
|
375 |
+
'fa-wheelchair' => 'fa-wheelchair',
|
376 |
+
'fa-vimeo-square' => 'fa-vimeo-square',
|
377 |
+
'fa-try' => 'fa-try',
|
378 |
+
'fa-plus-square-o' => 'fa-plus-square-o',
|
379 |
+
'fa-space-shuttle' => 'fa-space-shuttle',
|
380 |
+
'fa-slack' => 'fa-slack',
|
381 |
+
'fa-envelope-square' => 'fa-envelope-square',
|
382 |
+
'fa-wordpress' => 'fa-wordpress',
|
383 |
+
'fa-openid' => 'fa-openid',
|
384 |
+
'fa-university' => 'fa-university',
|
385 |
+
'fa-graduation-cap' => 'fa-graduation-cap',
|
386 |
+
'fa-yahoo' => 'fa-yahoo',
|
387 |
+
'fa-google' => 'fa-google',
|
388 |
+
'fa-reddit' => 'fa-reddit',
|
389 |
+
'fa-reddit-square' => 'fa-reddit-square',
|
390 |
+
'fa-stumbleupon-circle' => 'fa-stumbleupon-circle',
|
391 |
+
'fa-stumbleupon' => 'fa-stumbleupon',
|
392 |
+
'fa-delicious' => 'fa-delicious',
|
393 |
+
'fa-digg' => 'fa-digg',
|
394 |
+
'fa-pied-piper-pp' => 'fa-pied-piper-pp',
|
395 |
+
'fa-pied-piper-alt' => 'fa-pied-piper-alt',
|
396 |
+
'fa-drupal' => 'fa-drupal',
|
397 |
+
'fa-joomla' => 'fa-joomla',
|
398 |
+
'fa-language' => 'fa-language',
|
399 |
+
'fa-fax' => 'fa-fax',
|
400 |
+
'fa-building' => 'fa-building',
|
401 |
+
'fa-child' => 'fa-child',
|
402 |
+
'fa-paw' => 'fa-paw',
|
403 |
+
'fa-spoon' => 'fa-spoon',
|
404 |
+
'fa-cube' => 'fa-cube',
|
405 |
+
'fa-cubes' => 'fa-cubes',
|
406 |
+
'fa-behance' => 'fa-behance',
|
407 |
+
'fa-behance-square' => 'fa-behance-square',
|
408 |
+
'fa-steam' => 'fa-steam',
|
409 |
+
'fa-steam-square' => 'fa-steam-square',
|
410 |
+
'fa-recycle' => 'fa-recycle',
|
411 |
+
'fa-car' => 'fa-car',
|
412 |
+
'fa-taxi' => 'fa-taxi',
|
413 |
+
'fa-tree' => 'fa-tree',
|
414 |
+
'fa-spotify' => 'fa-spotify',
|
415 |
+
'fa-deviantart' => 'fa-deviantart',
|
416 |
+
'fa-soundcloud' => 'fa-soundcloud',
|
417 |
+
'fa-database' => 'fa-database',
|
418 |
+
'fa-file-pdf-o' => 'fa-file-pdf-o',
|
419 |
+
'fa-file-word-o' => 'fa-file-word-o',
|
420 |
+
'fa-file-excel-o' => 'fa-file-excel-o',
|
421 |
+
'fa-file-powerpoint-o' => 'fa-file-powerpoint-o',
|
422 |
+
'fa-file-image-o' => 'fa-file-image-o',
|
423 |
+
'fa-file-archive-o' => 'fa-file-archive-o',
|
424 |
+
'fa-file-audio-o' => 'fa-file-audio-o',
|
425 |
+
'fa-file-video-o' => 'fa-file-video-o',
|
426 |
+
'fa-file-code-o' => 'fa-file-code-o',
|
427 |
+
'fa-vine' => 'fa-vine',
|
428 |
+
'fa-codepen' => 'fa-codepen',
|
429 |
+
'fa-jsfiddle' => 'fa-jsfiddle',
|
430 |
+
'fa-life-ring' => 'fa-life-ring',
|
431 |
+
'fa-circle-o-notch' => 'fa-circle-o-notch',
|
432 |
+
'fa-rebel' => 'fa-rebel',
|
433 |
+
'fa-empire' => 'fa-empire',
|
434 |
+
'fa-git-square' => 'fa-git-square',
|
435 |
+
'fa-git' => 'fa-git',
|
436 |
+
'fa-hacker-news' => 'fa-hacker-news',
|
437 |
+
'fa-tencent-weibo' => 'fa-tencent-weibo',
|
438 |
+
'fa-qq' => 'fa-qq',
|
439 |
+
'fa-weixin' => 'fa-weixin',
|
440 |
+
'fa-paper-plane' => 'fa-paper-plane',
|
441 |
+
'fa-paper-plane-o' => 'fa-paper-plane-o',
|
442 |
+
'fa-history' => 'fa-history',
|
443 |
+
'fa-circle-thin' => 'fa-circle-thin',
|
444 |
+
'fa-header' => 'fa-header',
|
445 |
+
'fa-paragraph' => 'fa-paragraph',
|
446 |
+
'fa-sliders' => 'fa-sliders',
|
447 |
+
'fa-share-alt' => 'fa-share-alt',
|
448 |
+
'fa-share-alt-square' => 'fa-share-alt-square',
|
449 |
+
'fa-bomb' => 'fa-bomb',
|
450 |
+
'fa-futbol-o' => 'fa-futbol-o',
|
451 |
+
'fa-tty' => 'fa-tty',
|
452 |
+
'fa-binoculars' => 'fa-binoculars',
|
453 |
+
'fa-plug' => 'fa-plug',
|
454 |
+
'fa-slideshare' => 'fa-slideshare',
|
455 |
+
'fa-twitch' => 'fa-twitch',
|
456 |
+
'fa-yelp' => 'fa-yelp',
|
457 |
+
'fa-newspaper-o' => 'fa-newspaper-o',
|
458 |
+
'fa-wifi' => 'fa-wifi',
|
459 |
+
'fa-calculator' => 'fa-calculator',
|
460 |
+
'fa-paypal' => 'fa-paypal',
|
461 |
+
'fa-google-wallet' => 'fa-google-wallet',
|
462 |
+
'fa-cc-visa' => 'fa-cc-visa',
|
463 |
+
'fa-cc-mastercard' => 'fa-cc-mastercard',
|
464 |
+
'fa-cc-discover' => 'fa-cc-discover',
|
465 |
+
'fa-cc-amex' => 'fa-cc-amex',
|
466 |
+
'fa-cc-paypal' => 'fa-cc-paypal',
|
467 |
+
'fa-cc-stripe' => 'fa-cc-stripe',
|
468 |
+
'fa-bell-slash' => 'fa-bell-slash',
|
469 |
+
'fa-bell-slash-o' => 'fa-bell-slash-o',
|
470 |
+
'fa-trash' => 'fa-trash',
|
471 |
+
'fa-copyright' => 'fa-copyright',
|
472 |
+
'fa-at' => 'fa-at',
|
473 |
+
'fa-eyedropper' => 'fa-eyedropper',
|
474 |
+
'fa-paint-brush' => 'fa-paint-brush',
|
475 |
+
'fa-birthday-cake' => 'fa-birthday-cake',
|
476 |
+
'fa-area-chart' => 'fa-area-chart',
|
477 |
+
'fa-pie-chart' => 'fa-pie-chart',
|
478 |
+
'fa-line-chart' => 'fa-line-chart',
|
479 |
+
'fa-lastfm' => 'fa-lastfm',
|
480 |
+
'fa-lastfm-square' => 'fa-lastfm-square',
|
481 |
+
'fa-toggle-off' => 'fa-toggle-off',
|
482 |
+
'fa-toggle-on' => 'fa-toggle-on',
|
483 |
+
'fa-bicycle' => 'fa-bicycle',
|
484 |
+
'fa-bus' => 'fa-bus',
|
485 |
+
'fa-ioxhost' => 'fa-ioxhost',
|
486 |
+
'fa-angellist' => 'fa-angellist',
|
487 |
+
'fa-cc' => 'fa-cc',
|
488 |
+
'fa-ils' => 'fa-ils',
|
489 |
+
'fa-meanpath' => 'fa-meanpath',
|
490 |
+
'fa-buysellads' => 'fa-buysellads',
|
491 |
+
'fa-connectdevelop' => 'fa-connectdevelop',
|
492 |
+
'fa-dashcube' => 'fa-dashcube',
|
493 |
+
'fa-forumbee' => 'fa-forumbee',
|
494 |
+
'fa-leanpub' => 'fa-leanpub',
|
495 |
+
'fa-sellsy' => 'fa-sellsy',
|
496 |
+
'fa-shirtsinbulk' => 'fa-shirtsinbulk',
|
497 |
+
'fa-simplybuilt' => 'fa-simplybuilt',
|
498 |
+
'fa-skyatlas' => 'fa-skyatlas',
|
499 |
+
'fa-cart-plus' => 'fa-cart-plus',
|
500 |
+
'fa-cart-arrow-down' => 'fa-cart-arrow-down',
|
501 |
+
'fa-diamond' => 'fa-diamond',
|
502 |
+
'fa-ship' => 'fa-ship',
|
503 |
+
'fa-user-secret' => 'fa-user-secret',
|
504 |
+
'fa-motorcycle' => 'fa-motorcycle',
|
505 |
+
'fa-street-view' => 'fa-street-view',
|
506 |
+
'fa-heartbeat' => 'fa-heartbeat',
|
507 |
+
'fa-venus' => 'fa-venus',
|
508 |
+
'fa-mars' => 'fa-mars',
|
509 |
+
'fa-mercury' => 'fa-mercury',
|
510 |
+
'fa-transgender' => 'fa-transgender',
|
511 |
+
'fa-transgender-alt' => 'fa-transgender-alt',
|
512 |
+
'fa-venus-double' => 'fa-venus-double',
|
513 |
+
'fa-mars-double' => 'fa-mars-double',
|
514 |
+
'fa-venus-mars' => 'fa-venus-mars',
|
515 |
+
'fa-mars-stroke' => 'fa-mars-stroke',
|
516 |
+
'fa-mars-stroke-v' => 'fa-mars-stroke-v',
|
517 |
+
'fa-mars-stroke-h' => 'fa-mars-stroke-h',
|
518 |
+
'fa-neuter' => 'fa-neuter',
|
519 |
+
'fa-genderless' => 'fa-genderless',
|
520 |
+
'fa-facebook-official' => 'fa-facebook-official',
|
521 |
+
'fa-pinterest-p' => 'fa-pinterest-p',
|
522 |
+
'fa-whatsapp' => 'fa-whatsapp',
|
523 |
+
'fa-server' => 'fa-server',
|
524 |
+
'fa-user-plus' => 'fa-user-plus',
|
525 |
+
'fa-user-times' => 'fa-user-times',
|
526 |
+
'fa-bed' => 'fa-bed',
|
527 |
+
'fa-viacoin' => 'fa-viacoin',
|
528 |
+
'fa-train' => 'fa-train',
|
529 |
+
'fa-subway' => 'fa-subway',
|
530 |
+
'fa-medium' => 'fa-medium',
|
531 |
+
'fa-y-combinator' => 'fa-y-combinator',
|
532 |
+
'fa-optin-monster' => 'fa-optin-monster',
|
533 |
+
'fa-opencart' => 'fa-opencart',
|
534 |
+
'fa-expeditedssl' => 'fa-expeditedssl',
|
535 |
+
'fa-battery-full' => 'fa-battery-full',
|
536 |
+
'fa-battery-three-quarters' => 'fa-battery-three-quarters',
|
537 |
+
'fa-battery-half' => 'fa-battery-half',
|
538 |
+
'fa-battery-quarter' => 'fa-battery-quarter',
|
539 |
+
'fa-battery-empty' => 'fa-battery-empty',
|
540 |
+
'fa-mouse-pointer' => 'fa-mouse-pointer',
|
541 |
+
'fa-i-cursor' => 'fa-i-cursor',
|
542 |
+
'fa-object-group' => 'fa-object-group',
|
543 |
+
'fa-object-ungroup' => 'fa-object-ungroup',
|
544 |
+
'fa-sticky-note' => 'fa-sticky-note',
|
545 |
+
'fa-sticky-note-o' => 'fa-sticky-note-o',
|
546 |
+
'fa-cc-jcb' => 'fa-cc-jcb',
|
547 |
+
'fa-cc-diners-club' => 'fa-cc-diners-club',
|
548 |
+
'fa-clone' => 'fa-clone',
|
549 |
+
'fa-balance-scale' => 'fa-balance-scale',
|
550 |
+
'fa-hourglass-o' => 'fa-hourglass-o',
|
551 |
+
'fa-hourglass-start' => 'fa-hourglass-start',
|
552 |
+
'fa-hourglass-half' => 'fa-hourglass-half',
|
553 |
+
'fa-hourglass-end' => 'fa-hourglass-end',
|
554 |
+
'fa-hourglass' => 'fa-hourglass',
|
555 |
+
'fa-hand-rock-o' => 'fa-hand-rock-o',
|
556 |
+
'fa-hand-paper-o' => 'fa-hand-paper-o',
|
557 |
+
'fa-hand-scissors-o' => 'fa-hand-scissors-o',
|
558 |
+
'fa-hand-lizard-o' => 'fa-hand-lizard-o',
|
559 |
+
'fa-hand-spock-o' => 'fa-hand-spock-o',
|
560 |
+
'fa-hand-pointer-o' => 'fa-hand-pointer-o',
|
561 |
+
'fa-hand-peace-o' => 'fa-hand-peace-o',
|
562 |
+
'fa-trademark' => 'fa-trademark',
|
563 |
+
'fa-registered' => 'fa-registered',
|
564 |
+
'fa-creative-commons' => 'fa-creative-commons',
|
565 |
+
'fa-gg' => 'fa-gg',
|
566 |
+
'fa-gg-circle' => 'fa-gg-circle',
|
567 |
+
'fa-tripadvisor' => 'fa-tripadvisor',
|
568 |
+
'fa-odnoklassniki' => 'fa-odnoklassniki',
|
569 |
+
'fa-odnoklassniki-square' => 'fa-odnoklassniki-square',
|
570 |
+
'fa-get-pocket' => 'fa-get-pocket',
|
571 |
+
'fa-wikipedia-w' => 'fa-wikipedia-w',
|
572 |
+
'fa-safari' => 'fa-safari',
|
573 |
+
'fa-chrome' => 'fa-chrome',
|
574 |
+
'fa-firefox' => 'fa-firefox',
|
575 |
+
'fa-opera' => 'fa-opera',
|
576 |
+
'fa-internet-explorer' => 'fa-internet-explorer',
|
577 |
+
'fa-television' => 'fa-television',
|
578 |
+
'fa-contao' => 'fa-contao',
|
579 |
+
'fa-500px' => 'fa-500px',
|
580 |
+
'fa-amazon' => 'fa-amazon',
|
581 |
+
'fa-calendar-plus-o' => 'fa-calendar-plus-o',
|
582 |
+
'fa-calendar-minus-o' => 'fa-calendar-minus-o',
|
583 |
+
'fa-calendar-times-o' => 'fa-calendar-times-o',
|
584 |
+
'fa-calendar-check-o' => 'fa-calendar-check-o',
|
585 |
+
'fa-industry' => 'fa-industry',
|
586 |
+
'fa-map-pin' => 'fa-map-pin',
|
587 |
+
'fa-map-signs' => 'fa-map-signs',
|
588 |
+
'fa-map-o' => 'fa-map-o',
|
589 |
+
'fa-map' => 'fa-map',
|
590 |
+
'fa-commenting' => 'fa-commenting',
|
591 |
+
'fa-commenting-o' => 'fa-commenting-o',
|
592 |
+
'fa-houzz' => 'fa-houzz',
|
593 |
+
'fa-vimeo' => 'fa-vimeo',
|
594 |
+
'fa-black-tie' => 'fa-black-tie',
|
595 |
+
'fa-fonticons' => 'fa-fonticons',
|
596 |
+
'fa-reddit-alien' => 'fa-reddit-alien',
|
597 |
+
'fa-edge' => 'fa-edge',
|
598 |
+
'fa-credit-card-alt' => 'fa-credit-card-alt',
|
599 |
+
'fa-codiepie' => 'fa-codiepie',
|
600 |
+
'fa-modx' => 'fa-modx',
|
601 |
+
'fa-fort-awesome' => 'fa-fort-awesome',
|
602 |
+
'fa-usb' => 'fa-usb',
|
603 |
+
'fa-product-hunt' => 'fa-product-hunt',
|
604 |
+
'fa-mixcloud' => 'fa-mixcloud',
|
605 |
+
'fa-scribd' => 'fa-scribd',
|
606 |
+
'fa-pause-circle' => 'fa-pause-circle',
|
607 |
+
'fa-pause-circle-o' => 'fa-pause-circle-o',
|
608 |
+
'fa-stop-circle' => 'fa-stop-circle',
|
609 |
+
'fa-stop-circle-o' => 'fa-stop-circle-o',
|
610 |
+
'fa-shopping-bag' => 'fa-shopping-bag',
|
611 |
+
'fa-shopping-basket' => 'fa-shopping-basket',
|
612 |
+
'fa-hashtag' => 'fa-hashtag',
|
613 |
+
'fa-bluetooth' => 'fa-bluetooth',
|
614 |
+
'fa-bluetooth-b' => 'fa-bluetooth-b',
|
615 |
+
'fa-percent' => 'fa-percent',
|
616 |
+
'fa-gitlab' => 'fa-gitlab',
|
617 |
+
'fa-wpbeginner' => 'fa-wpbeginner',
|
618 |
+
'fa-wpforms' => 'fa-wpforms',
|
619 |
+
'fa-envira' => 'fa-envira',
|
620 |
+
'fa-universal-access' => 'fa-universal-access',
|
621 |
+
'fa-wheelchair-alt' => 'fa-wheelchair-alt',
|
622 |
+
'fa-question-circle-o' => 'fa-question-circle-o',
|
623 |
+
'fa-blind' => 'fa-blind',
|
624 |
+
'fa-audio-description' => 'fa-audio-description',
|
625 |
+
'fa-volume-control-phone' => 'fa-volume-control-phone',
|
626 |
+
'fa-braille' => 'fa-braille',
|
627 |
+
'fa-assistive-listening-systems' => 'fa-assistive-listening-systems',
|
628 |
+
'fa-american-sign-language-interpreting' => 'fa-american-sign-language-interpreting',
|
629 |
+
'fa-deaf' => 'fa-deaf',
|
630 |
+
'fa-glide' => 'fa-glide',
|
631 |
+
'fa-glide-g' => 'fa-glide-g',
|
632 |
+
'fa-sign-language' => 'fa-sign-language',
|
633 |
+
'fa-low-vision' => 'fa-low-vision',
|
634 |
+
'fa-viadeo' => 'fa-viadeo',
|
635 |
+
'fa-viadeo-square' => 'fa-viadeo-square',
|
636 |
+
'fa-snapchat' => 'fa-snapchat',
|
637 |
+
'fa-snapchat-ghost' => 'fa-snapchat-ghost',
|
638 |
+
'fa-snapchat-square' => 'fa-snapchat-square',
|
639 |
+
'fa-pied-piper' => 'fa-pied-piper',
|
640 |
+
'fa-first-order' => 'fa-first-order',
|
641 |
+
'fa-yoast' => 'fa-yoast',
|
642 |
+
'fa-themeisle' => 'fa-themeisle'
|
643 |
+
);
|
644 |
+
return $icons;
|
645 |
+
}
|
inc/custom-controls/controls/icon-picker/inc/genericons-icons.php
ADDED
@@ -0,0 +1,160 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* This is a list of all the Genericons icons.
|
4 |
+
*
|
5 |
+
* @package O2 Customizer Library
|
6 |
+
* @subpackage Icon Picker
|
7 |
+
* @since 0.1
|
8 |
+
*/
|
9 |
+
function startkit_genericons_list() {
|
10 |
+
$icons = array(
|
11 |
+
'genericon-404' => 'genericon-404',
|
12 |
+
'genericon-activity' => 'genericon-activity',
|
13 |
+
'genericon-anchor' => 'genericon-anchor',
|
14 |
+
'genericon-aside' => 'genericon-aside',
|
15 |
+
'genericon-attachment' => 'genericon-attachment',
|
16 |
+
'genericon-audio' => 'genericon-audio',
|
17 |
+
'genericon-bold' => 'genericon-bold',
|
18 |
+
'genericon-book' => 'genericon-book',
|
19 |
+
'genericon-bug' => 'genericon-bug',
|
20 |
+
'genericon-cart' => 'genericon-cart',
|
21 |
+
'genericon-category' => 'genericon-category',
|
22 |
+
'genericon-chat' => 'genericon-chat',
|
23 |
+
'genericon-checkmark' => 'genericon-checkmark',
|
24 |
+
'genericon-close' => 'genericon-close',
|
25 |
+
'genericon-close-alt' => 'genericon-close-alt',
|
26 |
+
'genericon-cloud' => 'genericon-cloud',
|
27 |
+
'genericon-cloud-download' => 'genericon-cloud-download',
|
28 |
+
'genericon-cloud-upload' => 'genericon-cloud-upload',
|
29 |
+
'genericon-code' => 'genericon-code',
|
30 |
+
'genericon-codepen' => 'genericon-codepen',
|
31 |
+
'genericon-cog' => 'genericon-cog',
|
32 |
+
'genericon-collapse' => 'genericon-collapse',
|
33 |
+
'genericon-comment' => 'genericon-comment',
|
34 |
+
'genericon-day' => 'genericon-day',
|
35 |
+
'genericon-digg' => 'genericon-digg',
|
36 |
+
'genericon-document' => 'genericon-document',
|
37 |
+
'genericon-dot' => 'genericon-dot',
|
38 |
+
'genericon-downarrow' => 'genericon-downarrow',
|
39 |
+
'genericon-download' => 'genericon-download',
|
40 |
+
'genericon-draggable' => 'genericon-draggable',
|
41 |
+
'genericon-dribbble' => 'genericon-dribbble',
|
42 |
+
'genericon-dropbox' => 'genericon-dropbox',
|
43 |
+
'genericon-dropdown' => 'genericon-dropdown',
|
44 |
+
'genericon-dropdown-left' => 'genericon-dropdown-left',
|
45 |
+
'genericon-edit' => 'genericon-edit',
|
46 |
+
'genericon-ellipsis' => 'genericon-ellipsis',
|
47 |
+
'genericon-expand' => 'genericon-expand',
|
48 |
+
'genericon-external' => 'genericon-external',
|
49 |
+
'genericon-facebook' => 'genericon-facebook',
|
50 |
+
'genericon-facebook-alt' => 'genericon-facebook-alt',
|
51 |
+
'genericon-fastforward' => 'genericon-fastforward',
|
52 |
+
'genericon-feed' => 'genericon-feed',
|
53 |
+
'genericon-flag' => 'genericon-flag',
|
54 |
+
'genericon-flickr' => 'genericon-flickr',
|
55 |
+
'genericon-foursquare' => 'genericon-foursquare',
|
56 |
+
'genericon-fullscreen' => 'genericon-fullscreen',
|
57 |
+
'genericon-gallery' => 'genericon-gallery',
|
58 |
+
'genericon-github' => 'genericon-github',
|
59 |
+
'genericon-googleplus' => 'genericon-googleplus',
|
60 |
+
'genericon-googleplus-alt' => 'genericon-googleplus-alt',
|
61 |
+
'genericon-handset' => 'genericon-handset',
|
62 |
+
'genericon-heart' => 'genericon-heart',
|
63 |
+
'genericon-help' => 'genericon-help',
|
64 |
+
'genericon-hide' => 'genericon-hide',
|
65 |
+
'genericon-hierarchy' => 'genericon-hierarchy',
|
66 |
+
'genericon-home' => 'genericon-home',
|
67 |
+
'genericon-image' => 'genericon-image',
|
68 |
+
'genericon-info' => 'genericon-info',
|
69 |
+
'genericon-instagram' => 'genericon-instagram',
|
70 |
+
'genericon-italic' => 'genericon-italic',
|
71 |
+
'genericon-key' => 'genericon-key',
|
72 |
+
'genericon-leftarrow' => 'genericon-leftarrow',
|
73 |
+
'genericon-link' => 'genericon-link',
|
74 |
+
'genericon-linkedin' => 'genericon-linkedin',
|
75 |
+
'genericon-linkedin-alt' => 'genericon-linkedin-alt',
|
76 |
+
'genericon-location' => 'genericon-location',
|
77 |
+
'genericon-lock' => 'genericon-lock',
|
78 |
+
'genericon-mail' => 'genericon-mail',
|
79 |
+
'genericon-maximize' => 'genericon-maximize',
|
80 |
+
'genericon-menu' => 'genericon-menu',
|
81 |
+
'genericon-microphone' => 'genericon-microphone',
|
82 |
+
'genericon-minimize' => 'genericon-minimize',
|
83 |
+
'genericon-minus' => 'genericon-minus',
|
84 |
+
'genericon-month' => 'genericon-month',
|
85 |
+
'genericon-move' => 'genericon-move',
|
86 |
+
'genericon-next' => 'genericon-next',
|
87 |
+
'genericon-notice' => 'genericon-notice',
|
88 |
+
'genericon-paintbrush' => 'genericon-paintbrush',
|
89 |
+
'genericon-path' => 'genericon-path',
|
90 |
+
'genericon-pause' => 'genericon-pause',
|
91 |
+
'genericon-phone' => 'genericon-phone',
|
92 |
+
'genericon-picture' => 'genericon-picture',
|
93 |
+
'genericon-pinned' => 'genericon-pinned',
|
94 |
+
'genericon-pinterest' => 'genericon-pinterest',
|
95 |
+
'genericon-pinterest-alt' => 'genericon-pinterest-alt',
|
96 |
+
'genericon-play' => 'genericon-play',
|
97 |
+
'genericon-plugin' => 'genericon-plugin',
|
98 |
+
'genericon-plus' => 'genericon-plus',
|
99 |
+
'genericon-pocket' => 'genericon-pocket',
|
100 |
+
'genericon-polldaddy' => 'genericon-polldaddy',
|
101 |
+
'genericon-portfolio' => 'genericon-portfolio',
|
102 |
+
'genericon-previous' => 'genericon-previous',
|
103 |
+
'genericon-print' => 'genericon-print',
|
104 |
+
'genericon-quote' => 'genericon-quote',
|
105 |
+
'genericon-rating-empty' => 'genericon-rating-empty',
|
106 |
+
'genericon-rating-full' => 'genericon-rating-full',
|
107 |
+
'genericon-rating-half' => 'genericon-rating-half',
|
108 |
+
'genericon-reddit' => 'genericon-reddit',
|
109 |
+
'genericon-refresh' => 'genericon-refresh',
|
110 |
+
'genericon-reply' => 'genericon-reply',
|
111 |
+
'genericon-reply-alt' => 'genericon-reply-alt',
|
112 |
+
'genericon-reply-single' => 'genericon-reply-single',
|
113 |
+
'genericon-rewind' => 'genericon-rewind',
|
114 |
+
'genericon-rightarrow' => 'genericon-rightarrow',
|
115 |
+
'genericon-search' => 'genericon-search',
|
116 |
+
'genericon-send-to-phone' => 'genericon-send-to-phone',
|
117 |
+
'genericon-send-to-tablet' => 'genericon-send-to-tablet',
|
118 |
+
'genericon-share' => 'genericon-share',
|
119 |
+
'genericon-show' => 'genericon-show',
|
120 |
+
'genericon-shuffle' => 'genericon-shuffle',
|
121 |
+
'genericon-sitemap' => 'genericon-sitemap',
|
122 |
+
'genericon-skip-ahead' => 'genericon-skip-ahead',
|
123 |
+
'genericon-skip-back' => 'genericon-skip-back',
|
124 |
+
'genericon-skype' => 'genericon-skype',
|
125 |
+
'genericon-spam' => 'genericon-spam',
|
126 |
+
'genericon-spotify' => 'genericon-spotify',
|
127 |
+
'genericon-standard' => 'genericon-standard',
|
128 |
+
'genericon-star' => 'genericon-star',
|
129 |
+
'genericon-status' => 'genericon-status',
|
130 |
+
'genericon-stop' => 'genericon-stop',
|
131 |
+
'genericon-stumbleupon' => 'genericon-stumbleupon',
|
132 |
+
'genericon-subscribe' => 'genericon-subscribe',
|
133 |
+
'genericon-subscribed' => 'genericon-subscribed',
|
134 |
+
'genericon-summary' => 'genericon-summary',
|
135 |
+
'genericon-tablet' => 'genericon-tablet',
|
136 |
+
'genericon-tag' => 'genericon-tag',
|
137 |
+
'genericon-time' => 'genericon-time',
|
138 |
+
'genericon-top' => 'genericon-top',
|
139 |
+
'genericon-trash' => 'genericon-trash',
|
140 |
+
'genericon-tumblr' => 'genericon-tumblr',
|
141 |
+
'genericon-twitch' => 'genericon-twitch',
|
142 |
+
'genericon-twitter' => 'genericon-twitter',
|
143 |
+
'genericon-unapprove' => 'genericon-unapprove',
|
144 |
+
'genericon-unsubscribe' => 'genericon-unsubscribe',
|
145 |
+
'genericon-unzoom' => 'genericon-unzoom',
|
146 |
+
'genericon-uparrow' => 'genericon-uparrow',
|
147 |
+
'genericon-user' => 'genericon-user',
|
148 |
+
'genericon-video' => 'genericon-video',
|
149 |
+
'genericon-videocamera' => 'genericon-videocamera',
|
150 |
+
'genericon-vimeo' => 'genericon-vimeo',
|
151 |
+
'genericon-warning' => 'genericon-warning',
|
152 |
+
'genericon-website' => 'genericon-website',
|
153 |
+
'genericon-week' => 'genericon-week',
|
154 |
+
'genericon-wordpress' => 'genericon-wordpress',
|
155 |
+
'genericon-xpost' => 'genericon-xpost',
|
156 |
+
'genericon-youtube' => 'genericon-youtube',
|
157 |
+
'genericon-zoom' => 'genericon-zoom'
|
158 |
+
);
|
159 |
+
return $icons;
|
160 |
+
}
|
inc/custom-controls/controls/range-validator/assets/css/range-control.css
ADDED
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.cleverfox-range-slider {
|
2 |
+
width: 100%;
|
3 |
+
}
|
4 |
+
|
5 |
+
.cleverfox-range-slider-range::-moz-range-track,
|
6 |
+
.cleverfox-range-slider-range::-moz-focus-inner,
|
7 |
+
.cleverfox-range-slider-range::-moz-focus-outer {
|
8 |
+
background: #d7dcdf;
|
9 |
+
border: 0;
|
10 |
+
}
|
11 |
+
|
12 |
+
.cleverfox-range-slider-range {
|
13 |
+
-webkit-appearance: none;
|
14 |
+
width: calc(100% - (100px));
|
15 |
+
height: 6px;
|
16 |
+
border-radius: 5px;
|
17 |
+
background: #d7dcdf;
|
18 |
+
outline: none;
|
19 |
+
padding: 0;
|
20 |
+
margin: 0;
|
21 |
+
}
|
22 |
+
|
23 |
+
.cleverfox-range-slider-range::-webkit-slider-thumb {
|
24 |
+
-webkit-appearance: none;
|
25 |
+
appearance: none;
|
26 |
+
width: 15px;
|
27 |
+
height: 15px;
|
28 |
+
border-radius: 50%;
|
29 |
+
background: #0085BA;
|
30 |
+
cursor: pointer;
|
31 |
+
-webkit-transition: background .15s ease-in-out;
|
32 |
+
transition: background .15s ease-in-out;
|
33 |
+
}
|
34 |
+
|
35 |
+
.cleverfox-range-slider-range::-webkit-slider-thumb:hover {
|
36 |
+
background: #0071A8;
|
37 |
+
}
|
38 |
+
|
39 |
+
.cleverfox-range-slider-range:active::-webkit-slider-thumb {
|
40 |
+
background: #0071A8;
|
41 |
+
}
|
42 |
+
|
43 |
+
.cleverfox-range-slider-range::-moz-range-thumb {
|
44 |
+
width: 20px;
|
45 |
+
height: 20px;
|
46 |
+
border: 0;
|
47 |
+
border-radius: 50%;
|
48 |
+
background: #0085BA;
|
49 |
+
cursor: pointer;
|
50 |
+
-webkit-transition: background .15s ease-in-out;
|
51 |
+
transition: background .15s ease-in-out;
|
52 |
+
}
|
53 |
+
|
54 |
+
.cleverfox-range-reset-slider .dashicons{
|
55 |
+
width: 16px;
|
56 |
+
height: 16px;
|
57 |
+
font-size: 16px;
|
58 |
+
line-height: 1;
|
59 |
+
}
|
60 |
+
|
61 |
+
.cleverfox-range-reset-slider {
|
62 |
+
display: inline-block;
|
63 |
+
position: relative;
|
64 |
+
width: 6%;
|
65 |
+
line-height: 1;
|
66 |
+
color: rgba(0,0,0,.2);
|
67 |
+
cursor: pointer;
|
68 |
+
text-align: center;
|
69 |
+
transition: all .3s ease;
|
70 |
+
-webkit-transition: all .3s ease;
|
71 |
+
-moz-transition: all .3s ease;
|
72 |
+
-o-transition: all .3s ease;
|
73 |
+
-ms-transition: all .3s ease;
|
74 |
+
}
|
75 |
+
|
76 |
+
.cleverfox-range-reset-slider:hover {
|
77 |
+
color: #fe5252;
|
78 |
+
}
|
79 |
+
|
80 |
+
.cleverfox-range-slider-range::-moz-range-thumb:hover {
|
81 |
+
background: #0071A8;
|
82 |
+
}
|
83 |
+
|
84 |
+
.cleverfox-range-slider-range:active::-moz-range-thumb {
|
85 |
+
background: #0071A8;
|
86 |
+
}
|
87 |
+
|
88 |
+
input[type="number"].cleverfox-range-slider-value {
|
89 |
+
display: inline-block;
|
90 |
+
position: relative;
|
91 |
+
width: 60px;
|
92 |
+
line-height: 20px;
|
93 |
+
text-align: center;
|
94 |
+
border-radius: 3px;
|
95 |
+
padding: 5px 10px;
|
96 |
+
margin-left: 8px;
|
97 |
+
}
|
inc/custom-controls/controls/range-validator/assets/js/range-control.js
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
wp.customize.controlConstructor['cleverfox-range-slider'] = wp.customize.Control.extend({
|
2 |
+
|
3 |
+
ready: function() {
|
4 |
+
'use strict';
|
5 |
+
|
6 |
+
var control = this,
|
7 |
+
slider = control.container.find( '.cleverfox-range-slider-range' ),
|
8 |
+
output = control.container.find( '.cleverfox-range-slider-value' );
|
9 |
+
|
10 |
+
slider[0].oninput = function() {
|
11 |
+
control.setting.set( this.value );
|
12 |
+
}
|
13 |
+
|
14 |
+
if ( control.params.default !== false ) {
|
15 |
+
var reset = control.container.find( '.cleverfox-range-reset-slider' );
|
16 |
+
|
17 |
+
reset[0].onclick = function() {
|
18 |
+
control.setting.set( control.params.default );
|
19 |
+
}
|
20 |
+
}
|
21 |
+
}
|
22 |
+
|
23 |
+
});
|
inc/custom-controls/controls/range-validator/range-control.php
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
cleverfox Range
|
4 |
+
*/
|
5 |
+
if ( ! class_exists( 'WP_Customize_Control' ) ) {
|
6 |
+
return;
|
7 |
+
}
|
8 |
+
class Cleverfox_Customizer_Range_Slider_Control extends WP_Customize_Control {
|
9 |
+
|
10 |
+
public $type = 'cleverfox-range-slider';
|
11 |
+
|
12 |
+
public function to_json() {
|
13 |
+
if ( ! empty( $this->setting->default ) ) {
|
14 |
+
$this->json['default'] = $this->setting->default;
|
15 |
+
} else {
|
16 |
+
$this->json['default'] = false;
|
17 |
+
}
|
18 |
+
parent::to_json();
|
19 |
+
}
|
20 |
+
|
21 |
+
public function enqueue() {
|
22 |
+
wp_enqueue_script( 'cleverfox-range-slider', OUR_DIRECTORY_URI . 'controls/range-validator/assets/js/range-control.js', array( 'jquery' ), '', true );
|
23 |
+
wp_enqueue_style( 'cleverfox-range-slider', OUR_DIRECTORY_URI . 'controls/range-validator/assets/css/range-control.css' );
|
24 |
+
}
|
25 |
+
|
26 |
+
public function render_content() {
|
27 |
+
?>
|
28 |
+
<label>
|
29 |
+
<?php if ( ! empty( $this->label ) ) : ?>
|
30 |
+
<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
|
31 |
+
<?php endif;
|
32 |
+
if ( ! empty( $this->description ) ) : ?>
|
33 |
+
<span class="description customize-control-description"><?php echo esc_html( $this->description ); ?></span>
|
34 |
+
<?php endif; ?>
|
35 |
+
<div id="<?php echo esc_attr( $this->id ); ?>">
|
36 |
+
<div class="cleverfox-range-slider">
|
37 |
+
<input class="cleverfox-range-slider-range" type="range" value="<?php echo esc_attr( $this->value() ); ?>" <?php $this->input_attrs(); $this->link(); ?> />
|
38 |
+
<input class="cleverfox-range-slider-value" type="number" value="<?php echo esc_attr( $this->value() ); ?>" <?php $this->input_attrs(); $this->link(); ?> />
|
39 |
+
<?php if ( ! empty( $this->setting->default ) ) : ?>
|
40 |
+
<span class="cleverfox-range-reset-slider" title="<?php _e( 'Reset', 'cleverfox' ); ?>"><span class="dashicons dashicons-image-rotate"></span></span>
|
41 |
+
<?php endif;?>
|
42 |
+
</div>
|
43 |
+
</div>
|
44 |
+
</label>
|
45 |
+
<?php }
|
46 |
+
|
47 |
+
}
|
inc/custom-controls/controls/select/assets/js/select-control.js
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
wp.customize.controlConstructor['hantus-select'] = wp.customize.Control.extend({
|
2 |
+
|
3 |
+
ready: function() {
|
4 |
+
'use strict';
|
5 |
+
|
6 |
+
var control = this,
|
7 |
+
element = this.container.find( 'select' );
|
8 |
+
|
9 |
+
jQuery( element ).selectize();
|
10 |
+
|
11 |
+
this.container.on( 'change', 'select', function() {
|
12 |
+
selectValue = jQuery( this ).val();
|
13 |
+
control.setting.set( selectValue );
|
14 |
+
});
|
15 |
+
}
|
16 |
+
|
17 |
+
});
|
inc/custom-controls/controls/select/assets/js/selectize.js
ADDED
@@ -0,0 +1,3667 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* sifter.js
|
3 |
+
* Copyright (c) 2013 Brian Reavis & contributors
|
4 |
+
*
|
5 |
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
|
6 |
+
* file except in compliance with the License. You may obtain a copy of the License at:
|
7 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
8 |
+
*
|
9 |
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
10 |
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
|
11 |
+
* ANY KIND, either express or implied. See the License for the specific language
|
12 |
+
* governing permissions and limitations under the License.
|
13 |
+
*
|
14 |
+
* @author Brian Reavis <brian@thirdroute.com>
|
15 |
+
*/
|
16 |
+
|
17 |
+
(function(root, factory) {
|
18 |
+
if (typeof define === 'function' && define.amd) {
|
19 |
+
define('sifter', factory);
|
20 |
+
} else if (typeof exports === 'object') {
|
21 |
+
module.exports = factory();
|
22 |
+
} else {
|
23 |
+
root.Sifter = factory();
|
24 |
+
}
|
25 |
+
}(this, function() {
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Textually searches arrays and hashes of objects
|
29 |
+
* by property (or multiple properties). Designed
|
30 |
+
* specifically for autocomplete.
|
31 |
+
*
|
32 |
+
* @constructor
|
33 |
+
* @param {array|object} items
|
34 |
+
* @param {object} items
|
35 |
+
*/
|
36 |
+
var Sifter = function(items, settings) {
|
37 |
+
this.items = items;
|
38 |
+
this.settings = settings || {diacritics: true};
|
39 |
+
};
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Splits a search string into an array of individual
|
43 |
+
* regexps to be used to match results.
|
44 |
+
*
|
45 |
+
* @param {string} query
|
46 |
+
* @returns {array}
|
47 |
+
*/
|
48 |
+
Sifter.prototype.tokenize = function(query) {
|
49 |
+
query = trim(String(query || '').toLowerCase());
|
50 |
+
if (!query || !query.length) return [];
|
51 |
+
|
52 |
+
var i, n, regex, letter;
|
53 |
+
var tokens = [];
|
54 |
+
var words = query.split(/ +/);
|
55 |
+
|
56 |
+
for (i = 0, n = words.length; i < n; i++) {
|
57 |
+
regex = escape_regex(words[i]);
|
58 |
+
if (this.settings.diacritics) {
|
59 |
+
for (letter in DIACRITICS) {
|
60 |
+
if (DIACRITICS.hasOwnProperty(letter)) {
|
61 |
+
regex = regex.replace(new RegExp(letter, 'g'), DIACRITICS[letter]);
|
62 |
+
}
|
63 |
+
}
|
64 |
+
}
|
65 |
+
tokens.push({
|
66 |
+
string : words[i],
|
67 |
+
regex : new RegExp(regex, 'i')
|
68 |
+
});
|
69 |
+
}
|
70 |
+
|
71 |
+
return tokens;
|
72 |
+
};
|
73 |
+
|
74 |
+
/**
|
75 |
+
* Iterates over arrays and hashes.
|
76 |
+
*
|
77 |
+
* ```
|
78 |
+
* this.iterator(this.items, function(item, id) {
|
79 |
+
* // invoked for each item
|
80 |
+
* });
|
81 |
+
* ```
|
82 |
+
*
|
83 |
+
* @param {array|object} object
|
84 |
+
*/
|
85 |
+
Sifter.prototype.iterator = function(object, callback) {
|
86 |
+
var iterator;
|
87 |
+
if (is_array(object)) {
|
88 |
+
iterator = Array.prototype.forEach || function(callback) {
|
89 |
+
for (var i = 0, n = this.length; i < n; i++) {
|
90 |
+
callback(this[i], i, this);
|
91 |
+
}
|
92 |
+
};
|
93 |
+
} else {
|
94 |
+
iterator = function(callback) {
|
95 |
+
for (var key in this) {
|
96 |
+
if (this.hasOwnProperty(key)) {
|
97 |
+
callback(this[key], key, this);
|
98 |
+
}
|
99 |
+
}
|
100 |
+
};
|
101 |
+
}
|
102 |
+
|
103 |
+
iterator.apply(object, [callback]);
|
104 |
+
};
|
105 |
+
|
106 |
+
/**
|
107 |
+
* Returns a function to be used to score individual results.
|
108 |
+
*
|
109 |
+
* Good matches will have a higher score than poor matches.
|
110 |
+
* If an item is not a match, 0 will be returned by the function.
|
111 |
+
*
|
112 |
+
* @param {object|string} search
|
113 |
+
* @param {object} options (optional)
|
114 |
+
* @returns {function}
|
115 |
+
*/
|
116 |
+
Sifter.prototype.getScoreFunction = function(search, options) {
|
117 |
+
var self, fields, tokens, token_count;
|
118 |
+
|
119 |
+
self = this;
|
120 |
+
search = self.prepareSearch(search, options);
|
121 |
+
tokens = search.tokens;
|
122 |
+
fields = search.options.fields;
|
123 |
+
token_count = tokens.length;
|
124 |
+
|
125 |
+
/**
|
126 |
+
* Calculates how close of a match the
|
127 |
+
* given value is against a search token.
|
128 |
+
*
|
129 |
+
* @param {mixed} value
|
130 |
+
* @param {object} token
|
131 |
+
* @return {number}
|
132 |
+
*/
|
133 |
+
var scoreValue = function(value, token) {
|
134 |
+
var score, pos;
|
135 |
+
|
136 |
+
if (!value) return 0;
|
137 |
+
value = String(value || '');
|
138 |
+
pos = value.search(token.regex);
|
139 |
+
if (pos === -1) return 0;
|
140 |
+
score = token.string.length / value.length;
|
141 |
+
if (pos === 0) score += 0.5;
|
142 |
+
return score;
|
143 |
+
};
|
144 |
+
|
145 |
+
/**
|
146 |
+
* Calculates the score of an object
|
147 |
+
* against the search query.
|
148 |
+
*
|
149 |
+
* @param {object} token
|
150 |
+
* @param {object} data
|
151 |
+
* @return {number}
|
152 |
+
*/
|
153 |
+
var scoreObject = (function() {
|
154 |
+
var field_count = fields.length;
|
155 |
+
if (!field_count) {
|
156 |
+
return function() { return 0; };
|
157 |
+
}
|
158 |
+
if (field_count === 1) {
|
159 |
+
return function(token, data) {
|
160 |
+
return scoreValue(data[fields[0]], token);
|
161 |
+
};
|
162 |
+
}
|
163 |
+
return function(token, data) {
|
164 |
+
for (var i = 0, sum = 0; i < field_count; i++) {
|
165 |
+
sum += scoreValue(data[fields[i]], token);
|
166 |
+
}
|
167 |
+
return sum / field_count;
|
168 |
+
};
|
169 |
+
})();
|
170 |
+
|
171 |
+
if (!token_count) {
|
172 |
+
return function() { return 0; };
|
173 |
+
}
|
174 |
+
if (token_count === 1) {
|
175 |
+
return function(data) {
|
176 |
+
return scoreObject(tokens[0], data);
|
177 |
+
};
|
178 |
+
}
|
179 |
+
|
180 |
+
if (search.options.conjunction === 'and') {
|
181 |
+
return function(data) {
|
182 |
+
var score;
|
183 |
+
for (var i = 0, sum = 0; i < token_count; i++) {
|
184 |
+
score = scoreObject(tokens[i], data);
|
185 |
+
if (score <= 0) return 0;
|
186 |
+
sum += score;
|
187 |
+
}
|
188 |
+
return sum / token_count;
|
189 |
+
};
|
190 |
+
} else {
|
191 |
+
return function(data) {
|
192 |
+
for (var i = 0, sum = 0; i < token_count; i++) {
|
193 |
+
sum += scoreObject(tokens[i], data);
|
194 |
+
}
|
195 |
+
return sum / token_count;
|
196 |
+
};
|
197 |
+
}
|
198 |
+
};
|
199 |
+
|
200 |
+
/**
|
201 |
+
* Returns a function that can be used to compare two
|
202 |
+
* results, for sorting purposes. If no sorting should
|
203 |
+
* be performed, `null` will be returned.
|
204 |
+
*
|
205 |
+
* @param {string|object} search
|
206 |
+
* @param {object} options
|
207 |
+
* @return function(a,b)
|
208 |
+
*/
|
209 |
+
Sifter.prototype.getSortFunction = function(search, options) {
|
210 |
+
var i, n, self, field, fields, fields_count, multiplier, multipliers, get_field, implicit_score, sort;
|
211 |
+
|
212 |
+
self = this;
|
213 |
+
search = self.prepareSearch(search, options);
|
214 |
+
sort = (!search.query && options.sort_empty) || options.sort;
|
215 |
+
|
216 |
+
/**
|
217 |
+
* Fetches the specified sort field value
|
218 |
+
* from a search result item.
|
219 |
+
*
|
220 |
+
* @param {string} name
|
221 |
+
* @param {object} result
|
222 |
+
* @return {mixed}
|
223 |
+
*/
|
224 |
+
get_field = function(name, result) {
|
225 |
+
if (name === '$score') return result.score;
|
226 |
+
return self.items[result.id][name];
|
227 |
+
};
|
228 |
+
|
229 |
+
// parse options
|
230 |
+
fields = [];
|
231 |
+
if (sort) {
|
232 |
+
for (i = 0, n = sort.length; i < n; i++) {
|
233 |
+
if (search.query || sort[i].field !== '$score') {
|
234 |
+
fields.push(sort[i]);
|
235 |
+
}
|
236 |
+
}
|
237 |
+
}
|
238 |
+
|
239 |
+
// the "$score" field is implied to be the primary
|
240 |
+
// sort field, unless it's manually specified
|
241 |
+
if (search.query) {
|
242 |
+
implicit_score = true;
|
243 |
+
for (i = 0, n = fields.length; i < n; i++) {
|
244 |
+
if (fields[i].field === '$score') {
|
245 |
+
implicit_score = false;
|
246 |
+
break;
|
247 |
+
}
|
248 |
+
}
|
249 |
+
if (implicit_score) {
|
250 |
+
fields.unshift({field: '$score', direction: 'desc'});
|
251 |
+
}
|
252 |
+
} else {
|
253 |
+
for (i = 0, n = fields.length; i < n; i++) {
|
254 |
+
if (fields[i].field === '$score') {
|
255 |
+
fields.splice(i, 1);
|
256 |
+
break;
|
257 |
+
}
|
258 |
+
}
|
259 |
+
}
|
260 |
+
|
261 |
+
multipliers = [];
|
262 |
+
for (i = 0, n = fields.length; i < n; i++) {
|
263 |
+
multipliers.push(fields[i].direction === 'desc' ? -1 : 1);
|
264 |
+
}
|
265 |
+
|
266 |
+
// build function
|
267 |
+
fields_count = fields.length;
|
268 |
+
if (!fields_count) {
|
269 |
+
return null;
|
270 |
+
} else if (fields_count === 1) {
|
271 |
+
field = fields[0].field;
|
272 |
+
multiplier = multipliers[0];
|
273 |
+
return function(a, b) {
|
274 |
+
return multiplier * cmp(
|
275 |
+
get_field(field, a),
|
276 |
+
get_field(field, b)
|
277 |
+
);
|
278 |
+
};
|
279 |
+
} else {
|
280 |
+
return function(a, b) {
|
281 |
+
var i, result, a_value, b_value, field;
|
282 |
+
for (i = 0; i < fields_count; i++) {
|
283 |
+
field = fields[i].field;
|
284 |
+
result = multipliers[i] * cmp(
|
285 |
+
get_field(field, a),
|
286 |
+
get_field(field, b)
|
287 |
+
);
|
288 |
+
if (result) return result;
|
289 |
+
}
|
290 |
+
return 0;
|
291 |
+
};
|
292 |
+
}
|
293 |
+
};
|
294 |
+
|
295 |
+
/**
|
296 |
+
* Parses a search query and returns an object
|
297 |
+
* with tokens and fields ready to be populated
|
298 |
+
* with results.
|
299 |
+
*
|
300 |
+
* @param {string} query
|
301 |
+
* @param {object} options
|
302 |
+
* @returns {object}
|
303 |
+
*/
|
304 |
+
Sifter.prototype.prepareSearch = function(query, options) {
|
305 |
+
if (typeof query === 'object') return query;
|
306 |
+
|
307 |
+
options = extend({}, options);
|
308 |
+
|
309 |
+
var option_fields = options.fields;
|
310 |
+
var option_sort = options.sort;
|
311 |
+
var option_sort_empty = options.sort_empty;
|
312 |
+
|
313 |
+
if (option_fields && !is_array(option_fields)) options.fields = [option_fields];
|
314 |
+
if (option_sort && !is_array(option_sort)) options.sort = [option_sort];
|
315 |
+
if (option_sort_empty && !is_array(option_sort_empty)) options.sort_empty = [option_sort_empty];
|
316 |
+
|
317 |
+
return {
|
318 |
+
options : options,
|
319 |
+
query : String(query || '').toLowerCase(),
|
320 |
+
tokens : this.tokenize(query),
|
321 |
+
total : 0,
|
322 |
+
items : []
|
323 |
+
};
|
324 |
+
};
|
325 |
+
|
326 |
+
/**
|
327 |
+
* Searches through all items and returns a sorted array of matches.
|
328 |
+
*
|
329 |
+
* The `options` parameter can contain:
|
330 |
+
*
|
331 |
+
* - fields {string|array}
|
332 |
+
* - sort {array}
|
333 |
+
* - score {function}
|
334 |
+
* - filter {bool}
|
335 |
+
* - limit {integer}
|
336 |
+
*
|
337 |
+
* Returns an object containing:
|
338 |
+
*
|
339 |
+
* - options {object}
|
340 |
+
* - query {string}
|
341 |
+
* - tokens {array}
|
342 |
+
* - total {int}
|
343 |
+
* - items {array}
|
344 |
+
*
|
345 |
+
* @param {string} query
|
346 |
+
* @param {object} options
|
347 |
+
* @returns {object}
|
348 |
+
*/
|
349 |
+
Sifter.prototype.search = function(query, options) {
|
350 |
+
var self = this, value, score, search, calculateScore;
|
351 |
+
var fn_sort;
|
352 |
+
var fn_score;
|
353 |
+
|
354 |
+
search = this.prepareSearch(query, options);
|
355 |
+
options = search.options;
|
356 |
+
query = search.query;
|
357 |
+
|
358 |
+
// generate result scoring function
|
359 |
+
fn_score = options.score || self.getScoreFunction(search);
|
360 |
+
|
361 |
+
// perform search and sort
|
362 |
+
if (query.length) {
|
363 |
+
self.iterator(self.items, function(item, id) {
|
364 |
+
score = fn_score(item);
|
365 |
+
if (options.filter === false || score > 0) {
|
366 |
+
search.items.push({'score': score, 'id': id});
|
367 |
+
}
|
368 |
+
});
|
369 |
+
} else {
|
370 |
+
self.iterator(self.items, function(item, id) {
|
371 |
+
search.items.push({'score': 1, 'id': id});
|
372 |
+
});
|
373 |
+
}
|
374 |
+
|
375 |
+
fn_sort = self.getSortFunction(search, options);
|
376 |
+
if (fn_sort) search.items.sort(fn_sort);
|
377 |
+
|
378 |
+
// apply limits
|
379 |
+
search.total = search.items.length;
|
380 |
+
if (typeof options.limit === 'number') {
|
381 |
+
search.items = search.items.slice(0, options.limit);
|
382 |
+
}
|
383 |
+
|
384 |
+
return search;
|
385 |
+
};
|
386 |
+
|
387 |
+
// utilities
|
388 |
+
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
389 |
+
|
390 |
+
var cmp = function(a, b) {
|
391 |
+
if (typeof a === 'number' && typeof b === 'number') {
|
392 |
+
return a > b ? 1 : (a < b ? -1 : 0);
|
393 |
+
}
|
394 |
+
a = asciifold(String(a || ''));
|
395 |
+
b = asciifold(String(b || ''));
|
396 |
+
if (a > b) return 1;
|
397 |
+
if (b > a) return -1;
|
398 |
+
return 0;
|
399 |
+
};
|
400 |
+
|
401 |
+
var extend = function(a, b) {
|
402 |
+
var i, n, k, object;
|
403 |
+
for (i = 1, n = arguments.length; i < n; i++) {
|
404 |
+
object = arguments[i];
|
405 |
+
if (!object) continue;
|
406 |
+
for (k in object) {
|
407 |
+
if (object.hasOwnProperty(k)) {
|
408 |
+
a[k] = object[k];
|
409 |
+
}
|
410 |
+
}
|
411 |
+
}
|
412 |
+
return a;
|
413 |
+
};
|
414 |
+
|
415 |
+
var trim = function(str) {
|
416 |
+
return (str + '').replace(/^\s+|\s+$|/g, '');
|
417 |
+
};
|
418 |
+
|
419 |
+
var escape_regex = function(str) {
|
420 |
+
return (str + '').replace(/([.?*+^$[\]\\(){}|-])/g, '\\$1');
|
421 |
+
};
|
422 |
+
|
423 |
+
var is_array = Array.isArray || ($ && $.isArray) || function(object) {
|
424 |
+
return Object.prototype.toString.call(object) === '[object Array]';
|
425 |
+
};
|
426 |
+
|
427 |
+
var DIACRITICS = {
|
428 |
+
'a': '[aÀÁÂÃÄÅàáâãäåĀāąĄ]',
|
429 |
+
'c': '[cÇçćĆčČ]',
|
430 |
+
'd': '[dđĐďĎ]',
|
431 |
+
'e': '[eÈÉÊËèéêëěĚĒēęĘ]',
|
432 |
+
'i': '[iÌÍÎÏìíîïĪī]',
|
433 |
+
'l': '[lłŁ]',
|
434 |
+
'n': '[nÑñňŇńŃ]',
|
435 |
+
'o': '[oÒÓÔÕÕÖØòóôõöøŌō]',
|
436 |
+
'r': '[rřŘ]',
|
437 |
+
's': '[sŠšśŚ]',
|
438 |
+
't': '[tťŤ]',
|
439 |
+
'u': '[uÙÚÛÜùúûüůŮŪū]',
|
440 |
+
'y': '[yŸÿýÝ]',
|
441 |
+
'z': '[zŽžżŻźŹ]'
|
442 |
+
};
|
443 |
+
|
444 |
+
var asciifold = (function() {
|
445 |
+
var i, n, k, chunk;
|
446 |
+
var foreignletters = '';
|
447 |
+
var lookup = {};
|
448 |
+
for (k in DIACRITICS) {
|
449 |
+
if (DIACRITICS.hasOwnProperty(k)) {
|
450 |
+
chunk = DIACRITICS[k].substring(2, DIACRITICS[k].length - 1);
|
451 |
+
foreignletters += chunk;
|
452 |
+
for (i = 0, n = chunk.length; i < n; i++) {
|
453 |
+
lookup[chunk.charAt(i)] = k;
|
454 |
+
}
|
455 |
+
}
|
456 |
+
}
|
457 |
+
var regexp = new RegExp('[' + foreignletters + ']', 'g');
|
458 |
+
return function(str) {
|
459 |
+
return str.replace(regexp, function(foreignletter) {
|
460 |
+
return lookup[foreignletter];
|
461 |
+
}).toLowerCase();
|
462 |
+
};
|
463 |
+
})();
|
464 |
+
|
465 |
+
|
466 |
+
// export
|
467 |
+
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
468 |
+
|
469 |
+
return Sifter;
|
470 |
+
}));
|
471 |
+
|
472 |
+
|
473 |
+
|
474 |
+
/**
|
475 |
+
* microplugin.js
|
476 |
+
* Copyright (c) 2013 Brian Reavis & contributors
|
477 |
+
*
|
478 |
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
|
479 |
+
* file except in compliance with the License. You may obtain a copy of the License at:
|
480 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
481 |
+
*
|
482 |
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
483 |
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
|
484 |
+
* ANY KIND, either express or implied. See the License for the specific language
|
485 |
+
* governing permissions and limitations under the License.
|
486 |
+
*
|
487 |
+
* @author Brian Reavis <brian@thirdroute.com>
|
488 |
+
*/
|
489 |
+
|
490 |
+
(function(root, factory) {
|
491 |
+
if (typeof define === 'function' && define.amd) {
|
492 |
+
define('microplugin', factory);
|
493 |
+
} else if (typeof exports === 'object') {
|
494 |
+
module.exports = factory();
|
495 |
+
} else {
|
496 |
+
root.MicroPlugin = factory();
|
497 |
+
}
|
498 |
+
}(this, function() {
|
499 |
+
var MicroPlugin = {};
|
500 |
+
|
501 |
+
MicroPlugin.mixin = function(Interface) {
|
502 |
+
Interface.plugins = {};
|
503 |
+
|
504 |
+
/**
|
505 |
+
* Initializes the listed plugins (with options).
|
506 |
+
* Acceptable formats:
|
507 |
+
*
|
508 |
+
* List (without options):
|
509 |
+
* ['a', 'b', 'c']
|
510 |
+
*
|
511 |
+
* List (with options):
|
512 |
+
* [{'name': 'a', options: {}}, {'name': 'b', options: {}}]
|
513 |
+
*
|
514 |
+
* Hash (with options):
|
515 |
+
* {'a': { ... }, 'b': { ... }, 'c': { ... }}
|
516 |
+
*
|
517 |
+
* @param {mixed} plugins
|
518 |
+
*/
|
519 |
+
Interface.prototype.initializePlugins = function(plugins) {
|
520 |
+
var i, n, key;
|
521 |
+
var self = this;
|
522 |
+
var queue = [];
|
523 |
+
|
524 |
+
self.plugins = {
|
525 |
+
names : [],
|
526 |
+
settings : {},
|
527 |
+
requested : {},
|
528 |
+
loaded : {}
|
529 |
+
};
|
530 |
+
|
531 |
+
if (utils.isArray(plugins)) {
|
532 |
+
for (i = 0, n = plugins.length; i < n; i++) {
|
533 |
+
if (typeof plugins[i] === 'string') {
|
534 |
+
queue.push(plugins[i]);
|
535 |
+
} else {
|
536 |
+
self.plugins.settings[plugins[i].name] = plugins[i].options;
|
537 |
+
queue.push(plugins[i].name);
|
538 |
+
}
|
539 |
+
}
|
540 |
+
} else if (plugins) {
|
541 |
+
for (key in plugins) {
|
542 |
+
if (plugins.hasOwnProperty(key)) {
|
543 |
+
self.plugins.settings[key] = plugins[key];
|
544 |
+
queue.push(key);
|
545 |
+
}
|
546 |
+
}
|
547 |
+
}
|
548 |
+
|
549 |
+
while (queue.length) {
|
550 |
+
self.require(queue.shift());
|
551 |
+
}
|
552 |
+
};
|
553 |
+
|
554 |
+
Interface.prototype.loadPlugin = function(name) {
|
555 |
+
var self = this;
|
556 |
+
var plugins = self.plugins;
|
557 |
+
var plugin = Interface.plugins[name];
|
558 |
+
|
559 |
+
if (!Interface.plugins.hasOwnProperty(name)) {
|
560 |
+
throw new Error('Unable to find "' + name + '" plugin');
|
561 |
+
}
|
562 |
+
|
563 |
+
plugins.requested[name] = true;
|
564 |
+
plugins.loaded[name] = plugin.fn.apply(self, [self.plugins.settings[name] || {}]);
|
565 |
+
plugins.names.push(name);
|
566 |
+
};
|
567 |
+
|
568 |
+
/**
|
569 |
+
* Initializes a plugin.
|
570 |
+
*
|
571 |
+
* @param {string} name
|
572 |
+
*/
|
573 |
+
Interface.prototype.require = function(name) {
|
574 |
+
var self = this;
|
575 |
+
var plugins = self.plugins;
|
576 |
+
|
577 |
+
if (!self.plugins.loaded.hasOwnProperty(name)) {
|
578 |
+
if (plugins.requested[name]) {
|
579 |
+
throw new Error('Plugin has circular dependency ("' + name + '")');
|
580 |
+
}
|
581 |
+
self.loadPlugin(name);
|
582 |
+
}
|
583 |
+
|
584 |
+
return plugins.loaded[name];
|
585 |
+
};
|
586 |
+
|
587 |
+
/**
|
588 |
+
* Registers a plugin.
|
589 |
+
*
|
590 |
+
* @param {string} name
|
591 |
+
* @param {function} fn
|
592 |
+
*/
|
593 |
+
Interface.define = function(name, fn) {
|
594 |
+
Interface.plugins[name] = {
|
595 |
+
'name' : name,
|
596 |
+
'fn' : fn
|
597 |
+
};
|
598 |
+
};
|
599 |
+
};
|
600 |
+
|
601 |
+
var utils = {
|
602 |
+
isArray: Array.isArray || function(vArg) {
|
603 |
+
return Object.prototype.toString.call(vArg) === '[object Array]';
|
604 |
+
}
|
605 |
+
};
|
606 |
+
|
607 |
+
return MicroPlugin;
|
608 |
+
}));
|
609 |
+
|
610 |
+
/**
|
611 |
+
* selectize.js (v0.12.1)
|
612 |
+
* Copyright (c) 2013–2015 Brian Reavis & contributors
|
613 |
+
*
|
614 |
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
|
615 |
+
* file except in compliance with the License. You may obtain a copy of the License at:
|
616 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
617 |
+
*
|
618 |
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
619 |
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
|
620 |
+
* ANY KIND, either express or implied. See the License for the specific language
|
621 |
+
* governing permissions and limitations under the License.
|
622 |
+
*
|
623 |
+
* @author Brian Reavis <brian@thirdroute.com>
|
624 |
+
*/
|
625 |
+
|
626 |
+
/*jshint curly:false */
|
627 |
+
/*jshint browser:true */
|
628 |
+
|
629 |
+
(function(root, factory) {
|
630 |
+
if (typeof define === 'function' && define.amd) {
|
631 |
+
define('selectize', ['jquery','sifter','microplugin'], factory);
|
632 |
+
} else if (typeof exports === 'object') {
|
633 |
+
module.exports = factory(require('jquery'), require('sifter'), require('microplugin'));
|
634 |
+
} else {
|
635 |
+
root.Selectize = factory(root.jQuery, root.Sifter, root.MicroPlugin);
|
636 |
+
}
|
637 |
+
}(this, function($, Sifter, MicroPlugin) {
|
638 |
+
'use strict';
|
639 |
+
|
640 |
+
var highlight = function($element, pattern) {
|
641 |
+
if (typeof pattern === 'string' && !pattern.length) return;
|
642 |
+
var regex = (typeof pattern === 'string') ? new RegExp(pattern, 'i') : pattern;
|
643 |
+
|
644 |
+
var highlight = function(node) {
|
645 |
+
var skip = 0;
|
646 |
+
if (node.nodeType === 3) {
|
647 |
+
var pos = node.data.search(regex);
|
648 |
+
if (pos >= 0 && node.data.length > 0) {
|
649 |
+
var match = node.data.match(regex);
|
650 |
+
var spannode = document.createElement('span');
|
651 |
+
spannode.className = 'highlight';
|
652 |
+
var middlebit = node.splitText(pos);
|
653 |
+
var endbit = middlebit.splitText(match[0].length);
|
654 |
+
var middleclone = middlebit.cloneNode(true);
|
655 |
+
spannode.appendChild(middleclone);
|
656 |
+
middlebit.parentNode.replaceChild(spannode, middlebit);
|
657 |
+
skip = 1;
|
658 |
+
}
|
659 |
+
} else if (node.nodeType === 1 && node.childNodes && !/(script|style)/i.test(node.tagName)) {
|
660 |
+
for (var i = 0; i < node.childNodes.length; ++i) {
|
661 |
+
i += highlight(node.childNodes[i]);
|
662 |
+
}
|
663 |
+
}
|
664 |
+
return skip;
|
665 |
+
};
|
666 |
+
|
667 |
+
return $element.each(function() {
|
668 |
+
highlight(this);
|
669 |
+
});
|
670 |
+
};
|
671 |
+
|
672 |
+
var MicroEvent = function() {};
|
673 |
+
MicroEvent.prototype = {
|
674 |
+
on: function(event, fct){
|
675 |
+
this._events = this._events || {};
|
676 |
+
this._events[event] = this._events[event] || [];
|
677 |
+
this._events[event].push(fct);
|
678 |
+
},
|
679 |
+
off: function(event, fct){
|
680 |
+
var n = arguments.length;
|
681 |
+
if (n === 0) return delete this._events;
|
682 |
+
if (n === 1) return delete this._events[event];
|
683 |
+
|
684 |
+
this._events = this._events || {};
|
685 |
+
if (event in this._events === false) return;
|
686 |
+
this._events[event].splice(this._events[event].indexOf(fct), 1);
|
687 |
+
},
|
688 |
+
trigger: function(event /* , args... */){
|
689 |
+
this._events = this._events || {};
|
690 |
+
if (event in this._events === false) return;
|
691 |
+
for (var i = 0; i < this._events[event].length; i++){
|
692 |
+
this._events[event][i].apply(this, Array.prototype.slice.call(arguments, 1));
|
693 |
+
}
|
694 |
+
}
|
695 |
+
};
|
696 |
+
|
697 |
+
/**
|
698 |
+
* Mixin will delegate all MicroEvent.js function in the destination object.
|
699 |
+
*
|
700 |
+
* - MicroEvent.mixin(Foobar) will make Foobar able to use MicroEvent
|
701 |
+
*
|
702 |
+
* @param {object} the object which will support MicroEvent
|
703 |
+
*/
|
704 |
+
MicroEvent.mixin = function(destObject){
|
705 |
+
var props = ['on', 'off', 'trigger'];
|
706 |
+
for (var i = 0; i < props.length; i++){
|
707 |
+
destObject.prototype[props[i]] = MicroEvent.prototype[props[i]];
|
708 |
+
}
|
709 |
+
};
|
710 |
+
|
711 |
+
var IS_MAC = /Mac/.test(navigator.userAgent);
|
712 |
+
|
713 |
+
var KEY_A = 65;
|
714 |
+
var KEY_COMMA = 188;
|
715 |
+
var KEY_RETURN = 13;
|
716 |
+
var KEY_ESC = 27;
|
717 |
+
var KEY_LEFT = 37;
|
718 |
+
var KEY_UP = 38;
|
719 |
+
var KEY_P = 80;
|
720 |
+
var KEY_RIGHT = 39;
|
721 |
+
var KEY_DOWN = 40;
|
722 |
+
var KEY_N = 78;
|
723 |
+
var KEY_BACKSPACE = 8;
|
724 |
+
var KEY_DELETE = 46;
|
725 |
+
var KEY_SHIFT = 16;
|
726 |
+
var KEY_CMD = IS_MAC ? 91 : 17;
|
727 |
+
var KEY_CTRL = IS_MAC ? 18 : 17;
|
728 |
+
var KEY_TAB = 9;
|
729 |
+
|
730 |
+
var TAG_SELECT = 1;
|
731 |
+
var TAG_INPUT = 2;
|
732 |
+
|
733 |
+
// for now, android support in general is too spotty to support validity
|
734 |
+
var SUPPORTS_VALIDITY_API = !/android/i.test(window.navigator.userAgent) && !!document.createElement('form').validity;
|
735 |
+
|
736 |
+
var isset = function(object) {
|
737 |
+
return typeof object !== 'undefined';
|
738 |
+
};
|
739 |
+
|
740 |
+
/**
|
741 |
+
* Converts a scalar to its best string representation
|
742 |
+
* for hash keys and HTML attribute values.
|
743 |
+
*
|
744 |
+
* Transformations:
|
745 |
+
* 'str' -> 'str'
|
746 |
+
* null -> ''
|
747 |
+
* undefined -> ''
|
748 |
+
* true -> '1'
|
749 |
+
* false -> '0'
|
750 |
+
* 0 -> '0'
|
751 |
+
* 1 -> '1'
|
752 |
+
*
|
753 |
+
* @param {string} value
|
754 |
+
* @returns {string|null}
|
755 |
+
*/
|
756 |
+
var hash_key = function(value) {
|
757 |
+
if (typeof value === 'undefined' || value === null) return null;
|
758 |
+
if (typeof value === 'boolean') return value ? '1' : '0';
|
759 |
+
return value + '';
|
760 |
+
};
|
761 |
+
|
762 |
+
/**
|
763 |
+
* Escapes a string for use within HTML.
|
764 |
+
*
|
765 |
+
* @param {string} str
|
766 |
+
* @returns {string}
|
767 |
+
*/
|
768 |
+
var escape_html = function(str) {
|
769 |
+
return (str + '')
|
770 |
+
.replace(/&/g, '&')
|
771 |
+
.replace(/</g, '<')
|
772 |
+
.replace(/>/g, '>')
|
773 |
+
.replace(/"/g, '"');
|
774 |
+
};
|
775 |
+
|
776 |
+
/**
|
777 |
+
* Escapes "$" characters in replacement strings.
|
778 |
+
*
|
779 |
+
* @param {string} str
|
780 |
+
* @returns {string}
|
781 |
+
*/
|
782 |
+
var escape_replace = function(str) {
|
783 |
+
return (str + '').replace(/\$/g, '$$$$');
|
784 |
+
};
|
785 |
+
|
786 |
+
var hook = {};
|
787 |
+
|
788 |
+
/**
|
789 |
+
* Wraps `method` on `self` so that `fn`
|
790 |
+
* is invoked before the original method.
|
791 |
+
*
|
792 |
+
* @param {object} self
|
793 |
+
* @param {string} method
|
794 |
+
* @param {function} fn
|
795 |
+
*/
|
796 |
+
hook.before = function(self, method, fn) {
|
797 |
+
var original = self[method];
|
798 |
+
self[method] = function() {
|
799 |
+
fn.apply(self, arguments);
|
800 |
+
return original.apply(self, arguments);
|
801 |
+
};
|
802 |
+
};
|
803 |
+
|
804 |
+
/**
|
805 |
+
* Wraps `method` on `self` so that `fn`
|
806 |
+
* is invoked after the original method.
|
807 |
+
*
|
808 |
+
* @param {object} self
|
809 |
+
* @param {string} method
|
810 |
+
* @param {function} fn
|
811 |
+
*/
|
812 |
+
hook.after = function(self, method, fn) {
|
813 |
+
var original = self[method];
|
814 |
+
self[method] = function() {
|
815 |
+
var result = original.apply(self, arguments);
|
816 |
+
fn.apply(self, arguments);
|
817 |
+
return result;
|
818 |
+
};
|
819 |
+
};
|
820 |
+
|
821 |
+
/**
|
822 |
+
* Wraps `fn` so that it can only be invoked once.
|
823 |
+
*
|
824 |
+
* @param {function} fn
|
825 |
+
* @returns {function}
|
826 |
+
*/
|
827 |
+
var once = function(fn) {
|
828 |
+
var called = false;
|
829 |
+
return function() {
|
830 |
+
if (called) return;
|
831 |
+
called = true;
|
832 |
+
fn.apply(this, arguments);
|
833 |
+
};
|
834 |
+
};
|
835 |
+
|
836 |
+
/**
|
837 |
+
* Wraps `fn` so that it can only be called once
|
838 |
+
* every `delay` milliseconds (invoked on the falling edge).
|
839 |
+
*
|
840 |
+
* @param {function} fn
|
841 |
+
* @param {int} delay
|
842 |
+
* @returns {function}
|
843 |
+
*/
|
844 |
+
var debounce = function(fn, delay) {
|
845 |
+
var timeout;
|
846 |
+
return function() {
|
847 |
+
var self = this;
|
848 |
+
var args = arguments;
|
849 |
+
window.clearTimeout(timeout);
|
850 |
+
timeout = window.setTimeout(function() {
|
851 |
+
fn.apply(self, args);
|
852 |
+
}, delay);
|
853 |
+
};
|
854 |
+
};
|
855 |
+
|
856 |
+
/**
|
857 |
+
* Debounce all fired events types listed in `types`
|
858 |
+
* while executing the provided `fn`.
|
859 |
+
*
|
860 |
+
* @param {object} self
|
861 |
+
* @param {array} types
|
862 |
+
* @param {function} fn
|
863 |
+
*/
|
864 |
+
var debounce_events = function(self, types, fn) {
|
865 |
+
var type;
|
866 |
+
var trigger = self.trigger;
|
867 |
+
var event_args = {};
|
868 |
+
|
869 |
+
// override trigger method
|
870 |
+
self.trigger = function() {
|
871 |
+
var type = arguments[0];
|
872 |
+
if (types.indexOf(type) !== -1) {
|
873 |
+
event_args[type] = arguments;
|
874 |
+
} else {
|
875 |
+
return trigger.apply(self, arguments);
|
876 |
+
}
|
877 |
+
};
|
878 |
+
|
879 |
+
// invoke provided function
|
880 |
+
fn.apply(self, []);
|
881 |
+
self.trigger = trigger;
|
882 |
+
|
883 |
+
// trigger queued events
|
884 |
+
for (type in event_args) {
|
885 |
+
if (event_args.hasOwnProperty(type)) {
|
886 |
+
trigger.apply(self, event_args[type]);
|
887 |
+
}
|
888 |
+
}
|
889 |
+
};
|
890 |
+
|
891 |
+
/**
|
892 |
+
* A workaround for http://bugs.jquery.com/ticket/6696
|
893 |
+
*
|
894 |
+
* @param {object} $parent - Parent element to listen on.
|
895 |
+
* @param {string} event - Event name.
|
896 |
+
* @param {string} selector - Descendant selector to filter by.
|
897 |
+
* @param {function} fn - Event handler.
|
898 |
+
*/
|
899 |
+
var watchChildEvent = function($parent, event, selector, fn) {
|
900 |
+
$parent.on(event, selector, function(e) {
|
901 |
+
var child = e.target;
|
902 |
+
while (child && child.parentNode !== $parent[0]) {
|
903 |
+
child = child.parentNode;
|
904 |
+
}
|
905 |
+
e.currentTarget = child;
|
906 |
+
return fn.apply(this, [e]);
|
907 |
+
});
|
908 |
+
};
|
909 |
+
|
910 |
+
/**
|
911 |
+
* Determines the current selection within a text input control.
|
912 |
+
* Returns an object containing:
|
913 |
+
* - start
|
914 |
+
* - length
|
915 |
+
*
|
916 |
+
* @param {object} input
|
917 |
+
* @returns {object}
|
918 |
+
*/
|
919 |
+
var getSelection = function(input) {
|
920 |
+
var result = {};
|
921 |
+
if ('selectionStart' in input) {
|
922 |
+
result.start = input.selectionStart;
|
923 |
+
result.length = input.selectionEnd - result.start;
|
924 |
+
} else if (document.selection) {
|
925 |
+
input.focus();
|
926 |
+
var sel = document.selection.createRange();
|
927 |
+
var selLen = document.selection.createRange().text.length;
|
928 |
+
sel.moveStart('character', -input.value.length);
|
929 |
+
result.start = sel.text.length - selLen;
|
930 |
+
result.length = selLen;
|
931 |
+
}
|
932 |
+
return result;
|
933 |
+
};
|
934 |
+
|
935 |
+
/**
|
936 |
+
* Copies CSS properties from one element to another.
|
937 |
+
*
|
938 |
+
* @param {object} $from
|
939 |
+
* @param {object} $to
|
940 |
+
* @param {array} properties
|
941 |
+
*/
|
942 |
+
var transferStyles = function($from, $to, properties) {
|
943 |
+
var i, n, styles = {};
|
944 |
+
if (properties) {
|
945 |
+
for (i = 0, n = properties.length; i < n; i++) {
|
946 |
+
styles[properties[i]] = $from.css(properties[i]);
|
947 |
+
}
|
948 |
+
} else {
|
949 |
+
styles = $from.css();
|
950 |
+
}
|
951 |
+
$to.css(styles);
|
952 |
+
};
|
953 |
+
|
954 |
+
/**
|
955 |
+
* Measures the width of a string within a
|
956 |
+
* parent element (in pixels).
|
957 |
+
*
|
958 |
+
* @param {string} str
|
959 |
+
* @param {object} $parent
|
960 |
+
* @returns {int}
|
961 |
+
*/
|
962 |
+
var measureString = function(str, $parent) {
|
963 |
+
if (!str) {
|
964 |
+
return 0;
|
965 |
+
}
|
966 |
+
|
967 |
+
var $test = $('<test>').css({
|
968 |
+
position: 'absolute',
|
969 |
+
top: -99999,
|
970 |
+
left: -99999,
|
971 |
+
width: 'auto',
|
972 |
+
padding: 0,
|
973 |
+
whiteSpace: 'pre'
|
974 |
+
}).text(str).appendTo('body');
|
975 |
+
|
976 |
+
transferStyles($parent, $test, [
|
977 |
+
'letterSpacing',
|
978 |
+
'fontSize',
|
979 |
+
'fontFamily',
|
980 |
+
'fontWeight',
|
981 |
+
'textTransform'
|
982 |
+
]);
|
983 |
+
|
984 |
+
var width = $test.width();
|
985 |
+
$test.remove();
|
986 |
+
|
987 |
+
return width;
|
988 |
+
};
|
989 |
+
|
990 |
+
/**
|
991 |
+
* Sets up an input to grow horizontally as the user
|
992 |
+
* types. If the value is changed manually, you can
|
993 |
+
* trigger the "update" handler to resize:
|
994 |
+
*
|
995 |
+
* $input.trigger('update');
|
996 |
+
*
|
997 |
+
* @param {object} $input
|
998 |
+
*/
|
999 |
+
var autoGrow = function($input) {
|
1000 |
+
var currentWidth = null;
|
1001 |
+
|
1002 |
+
var update = function(e, options) {
|
1003 |
+
var value, keyCode, printable, placeholder, width;
|
1004 |
+
var shift, character, selection;
|
1005 |
+
e = e || window.event || {};
|
1006 |
+
options = options || {};
|
1007 |
+
|
1008 |
+
if (e.metaKey || e.altKey) return;
|
1009 |
+
if (!options.force && $input.data('grow') === false) return;
|
1010 |
+
|
1011 |
+
value = $input.val();
|
1012 |
+
if (e.type && e.type.toLowerCase() === 'keydown') {
|
1013 |
+
keyCode = e.keyCode;
|
1014 |
+
printable = (
|
1015 |
+
(keyCode >= 97 && keyCode <= 122) || // a-z
|
1016 |
+
(keyCode >= 65 && keyCode <= 90) || // A-Z
|
1017 |
+
(keyCode >= 48 && keyCode <= 57) || // 0-9
|
1018 |
+
keyCode === 32 // space
|
1019 |
+
);
|
1020 |
+
|
1021 |
+
if (keyCode === KEY_DELETE || keyCode === KEY_BACKSPACE) {
|
1022 |
+
selection = getSelection($input[0]);
|
1023 |
+
if (selection.length) {
|
1024 |
+
value = value.substring(0, selection.start) + value.substring(selection.start + selection.length);
|
1025 |
+
} else if (keyCode === KEY_BACKSPACE && selection.start) {
|
1026 |
+
value = value.substring(0, selection.start - 1) + value.substring(selection.start + 1);
|
1027 |
+
} else if (keyCode === KEY_DELETE && typeof selection.start !== 'undefined') {
|
1028 |
+
value = value.substring(0, selection.start) + value.substring(selection.start + 1);
|
1029 |
+
}
|
1030 |
+
} else if (printable) {
|
1031 |
+
shift = e.shiftKey;
|
1032 |
+
character = String.fromCharCode(e.keyCode);
|
1033 |
+
if (shift) character = character.toUpperCase();
|
1034 |
+
else character = character.toLowerCase();
|
1035 |
+
value += character;
|
1036 |
+
}
|
1037 |
+
}
|
1038 |
+
|
1039 |
+
placeholder = $input.attr('placeholder');
|
1040 |
+
if (!value && placeholder) {
|
1041 |
+
value = placeholder;
|
1042 |
+
}
|
1043 |
+
|
1044 |
+
width = measureString(value, $input) + 4;
|
1045 |
+
if (width !== currentWidth) {
|
1046 |
+
currentWidth = width;
|
1047 |
+
$input.width(width);
|
1048 |
+
$input.triggerHandler('resize');
|
1049 |
+
}
|
1050 |
+
};
|
1051 |
+
|
1052 |
+
$input.on('keydown keyup update blur', update);
|
1053 |
+
update();
|
1054 |
+
};
|
1055 |
+
|
1056 |
+
var Selectize = function($input, settings) {
|
1057 |
+
var key, i, n, dir, input, self = this;
|
1058 |
+
input = $input[0];
|
1059 |
+
input.selectize = self;
|
1060 |
+
|
1061 |
+
// detect rtl environment
|
1062 |
+
var computedStyle = window.getComputedStyle && window.getComputedStyle(input, null);
|
1063 |
+
dir = computedStyle ? computedStyle.getPropertyValue('direction') : input.currentStyle && input.currentStyle.direction;
|
1064 |
+
dir = dir || $input.parents('[dir]:first').attr('dir') || '';
|
1065 |
+
|
1066 |
+
// setup default state
|
1067 |
+
$.extend(self, {
|
1068 |
+
order : 0,
|
1069 |
+
settings : settings,
|
1070 |
+
$input : $input,
|
1071 |
+
tabIndex : $input.attr('tabindex') || '',
|
1072 |
+
tagType : input.tagName.toLowerCase() === 'select' ? TAG_SELECT : TAG_INPUT,
|
1073 |
+
rtl : /rtl/i.test(dir),
|
1074 |
+
|
1075 |
+
eventNS : '.selectize' + (++Selectize.count),
|
1076 |
+
highlightedValue : null,
|
1077 |
+
isOpen : false,
|
1078 |
+
isDisabled : false,
|
1079 |
+
isRequired : $input.is('[required]'),
|
1080 |
+
isInvalid : false,
|
1081 |
+
isLocked : false,
|
1082 |
+
isFocused : false,
|
1083 |
+
isInputHidden : false,
|
1084 |
+
isSetup : false,
|
1085 |
+
isShiftDown : false,
|
1086 |
+
isCmdDown : false,
|
1087 |
+
isCtrlDown : false,
|
1088 |
+
ignoreFocus : false,
|
1089 |
+
ignoreBlur : false,
|
1090 |
+
ignoreHover : false,
|
1091 |
+
hasOptions : false,
|
1092 |
+
currentResults : null,
|
1093 |
+
lastValue : '',
|
1094 |
+
caretPos : 0,
|
1095 |
+
loading : 0,
|
1096 |
+
loadedSearches : {},
|
1097 |
+
|
1098 |
+
$activeOption : null,
|
1099 |
+
$activeItems : [],
|
1100 |
+
|
1101 |
+
optgroups : {},
|
1102 |
+
options : {},
|
1103 |
+
userOptions : {},
|
1104 |
+
items : [],
|
1105 |
+
renderCache : {},
|
1106 |
+
onSearchChange : settings.loadThrottle === null ? self.onSearchChange : debounce(self.onSearchChange, settings.loadThrottle)
|
1107 |
+
});
|
1108 |
+
|
1109 |
+
// search system
|
1110 |
+
self.sifter = new Sifter(this.options, {diacritics: settings.diacritics});
|
1111 |
+
|
1112 |
+
// build options table
|
1113 |
+
if (self.settings.options) {
|
1114 |
+
for (i = 0, n = self.settings.options.length; i < n; i++) {
|
1115 |
+
self.registerOption(self.settings.options[i]);
|
1116 |
+
}
|
1117 |
+
delete self.settings.options;
|
1118 |
+
}
|
1119 |
+
|
1120 |
+
// build optgroup table
|
1121 |
+
if (self.settings.optgroups) {
|
1122 |
+
for (i = 0, n = self.settings.optgroups.length; i < n; i++) {
|
1123 |
+
self.registerOptionGroup(self.settings.optgroups[i]);
|
1124 |
+
}
|
1125 |
+
delete self.settings.optgroups;
|
1126 |
+
}
|
1127 |
+
|
1128 |
+
// option-dependent defaults
|
1129 |
+
self.settings.mode = self.settings.mode || (self.settings.maxItems === 1 ? 'single' : 'multi');
|
1130 |
+
if (typeof self.settings.hideSelected !== 'boolean') {
|
1131 |
+
self.settings.hideSelected = self.settings.mode === 'multi';
|
1132 |
+
}
|
1133 |
+
|
1134 |
+
self.initializePlugins(self.settings.plugins);
|
1135 |
+
self.setupCallbacks();
|
1136 |
+
self.setupTemplates();
|
1137 |
+
self.setup();
|
1138 |
+
};
|
1139 |
+
|
1140 |
+
// mixins
|
1141 |
+
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
1142 |
+
|
1143 |
+
MicroEvent.mixin(Selectize);
|
1144 |
+
MicroPlugin.mixin(Selectize);
|
1145 |
+
|
1146 |
+
// methods
|
1147 |
+
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
1148 |
+
|
1149 |
+
$.extend(Selectize.prototype, {
|
1150 |
+
|
1151 |
+
/**
|
1152 |
+
* Creates all elements and sets up event bindings.
|
1153 |
+
*/
|
1154 |
+
setup: function() {
|
1155 |
+
var self = this;
|
1156 |
+
var settings = self.settings;
|
1157 |
+
var eventNS = self.eventNS;
|
1158 |
+
var $window = $(window);
|
1159 |
+
var $document = $(document);
|
1160 |
+
var $input = self.$input;
|
1161 |
+
|
1162 |
+
var $wrapper;
|
1163 |
+
var $control;
|
1164 |
+
var $control_input;
|
1165 |
+
var $dropdown;
|
1166 |
+
var $dropdown_content;
|
1167 |
+
var $dropdown_parent;
|
1168 |
+
var inputMode;
|
1169 |
+
var timeout_blur;
|
1170 |
+
var timeout_focus;
|
1171 |
+
var classes;
|
1172 |
+
var classes_plugins;
|
1173 |
+
|
1174 |
+
inputMode = self.settings.mode;
|
1175 |
+
classes = $input.attr('class') || '';
|
1176 |
+
|
1177 |
+
$wrapper = $('<div>').addClass(settings.wrapperClass).addClass(classes).addClass(inputMode);
|
1178 |
+
$control = $('<div>').addClass(settings.inputClass).addClass('items').appendTo($wrapper);
|
1179 |
+
$control_input = $('<input type="text" autocomplete="off" />').appendTo($control).attr('tabindex', $input.is(':disabled') ? '-1' : self.tabIndex);
|
1180 |
+
$dropdown_parent = $(settings.dropdownParent || $wrapper);
|
1181 |
+
$dropdown = $('<div>').addClass(settings.dropdownClass).addClass(inputMode).hide().appendTo($dropdown_parent);
|
1182 |
+
$dropdown_content = $('<div>').addClass(settings.dropdownContentClass).appendTo($dropdown);
|
1183 |
+
|
1184 |
+
if(self.settings.copyClassesToDropdown) {
|
1185 |
+
$dropdown.addClass(classes);
|
1186 |
+
}
|
1187 |
+
|
1188 |
+
$wrapper.css({
|
1189 |
+
width: $input[0].style.width
|
1190 |
+
});
|
1191 |
+
|
1192 |
+
if (self.plugins.names.length) {
|
1193 |
+
classes_plugins = 'plugin-' + self.plugins.names.join(' plugin-');
|
1194 |
+
$wrapper.addClass(classes_plugins);
|
1195 |
+
$dropdown.addClass(classes_plugins);
|
1196 |
+
}
|
1197 |
+
|
1198 |
+
if ((settings.maxItems === null || settings.maxItems > 1) && self.tagType === TAG_SELECT) {
|
1199 |
+
$input.attr('multiple', 'multiple');
|
1200 |
+
}
|
1201 |
+
|
1202 |
+
if (self.settings.placeholder) {
|
1203 |
+
$control_input.attr('placeholder', settings.placeholder);
|
1204 |
+
}
|
1205 |
+
|
1206 |
+
// if splitOn was not passed in, construct it from the delimiter to allow pasting universally
|
1207 |
+
if (!self.settings.splitOn && self.settings.delimiter) {
|
1208 |
+
var delimiterEscaped = self.settings.delimiter.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
|
1209 |
+
self.settings.splitOn = new RegExp('\\s*' + delimiterEscaped + '+\\s*');
|
1210 |
+
}
|
1211 |
+
|
1212 |
+
if ($input.attr('autocorrect')) {
|
1213 |
+
$control_input.attr('autocorrect', $input.attr('autocorrect'));
|
1214 |
+
}
|
1215 |
+
|
1216 |
+
if ($input.attr('autocapitalize')) {
|
1217 |
+
$control_input.attr('autocapitalize', $input.attr('autocapitalize'));
|
1218 |
+
}
|
1219 |
+
|
1220 |
+
self.$wrapper = $wrapper;
|
1221 |
+
self.$control = $control;
|
1222 |
+
self.$control_input = $control_input;
|
1223 |
+
self.$dropdown = $dropdown;
|
1224 |
+
self.$dropdown_content = $dropdown_content;
|
1225 |
+
|
1226 |
+
$dropdown.on('mouseenter', '[data-selectable]', function() { return self.onOptionHover.apply(self, arguments); });
|
1227 |
+
$dropdown.on('mousedown click', '[data-selectable]', function() { return self.onOptionSelect.apply(self, arguments); });
|
1228 |
+
watchChildEvent($control, 'mousedown', '*:not(input)', function() { return self.onItemSelect.apply(self, arguments); });
|
1229 |
+
autoGrow($control_input);
|
1230 |
+
|
1231 |
+
$control.on({
|
1232 |
+
mousedown : function() { return self.onMouseDown.apply(self, arguments); },
|
1233 |
+
click : function() { return self.onClick.apply(self, arguments); }
|
1234 |
+
});
|
1235 |
+
|
1236 |
+
$control_input.on({
|
1237 |
+
mousedown : function(e) { e.stopPropagation(); },
|
1238 |
+
keydown : function() { return self.onKeyDown.apply(self, arguments); },
|
1239 |
+
keyup : function() { return self.onKeyUp.apply(self, arguments); },
|
1240 |
+
keypress : function() { return self.onKeyPress.apply(self, arguments); },
|
1241 |
+
resize : function() { self.positionDropdown.apply(self, []); },
|
1242 |
+
blur : function() { return self.onBlur.apply(self, arguments); },
|
1243 |
+
focus : function() { self.ignoreBlur = false; return self.onFocus.apply(self, arguments); },
|
1244 |
+
paste : function() { return self.onPaste.apply(self, arguments); }
|
1245 |
+
});
|
1246 |
+
|
1247 |
+
$document.on('keydown' + eventNS, function(e) {
|
1248 |
+
self.isCmdDown = e[IS_MAC ? 'metaKey' : 'ctrlKey'];
|
1249 |
+
self.isCtrlDown = e[IS_MAC ? 'altKey' : 'ctrlKey'];
|
1250 |
+
self.isShiftDown = e.shiftKey;
|
1251 |
+
});
|
1252 |
+
|
1253 |
+
$document.on('keyup' + eventNS, function(e) {
|
1254 |
+
if (e.keyCode === KEY_CTRL) self.isCtrlDown = false;
|
1255 |
+
if (e.keyCode === KEY_SHIFT) self.isShiftDown = false;
|
1256 |
+
if (e.keyCode === KEY_CMD) self.isCmdDown = false;
|
1257 |
+
});
|
1258 |
+
|
1259 |
+
$document.on('mousedown' + eventNS, function(e) {
|
1260 |
+
if (self.isFocused) {
|
1261 |
+
// prevent events on the dropdown scrollbar from causing the control to blur
|
1262 |
+
if (e.target === self.$dropdown[0] || e.target.parentNode === self.$dropdown[0]) {
|
1263 |
+
return false;
|
1264 |
+
}
|
1265 |
+
// blur on click outside
|
1266 |
+
if (!self.$control.has(e.target).length && e.target !== self.$control[0]) {
|
1267 |
+
self.blur(e.target);
|
1268 |
+
}
|
1269 |
+
}
|
1270 |
+
});
|
1271 |
+
|
1272 |
+
$window.on(['scroll' + eventNS, 'resize' + eventNS].join(' '), function() {
|
1273 |
+
if (self.isOpen) {
|
1274 |
+
self.positionDropdown.apply(self, arguments);
|
1275 |
+
}
|
1276 |
+
});
|
1277 |
+
$window.on('mousemove' + eventNS, function() {
|
1278 |
+
self.ignoreHover = false;
|
1279 |
+
});
|
1280 |
+
|
1281 |
+
// store original children and tab index so that they can be
|
1282 |
+
// restored when the destroy() method is called.
|
1283 |
+
this.revertSettings = {
|
1284 |
+
$children : $input.children().detach(),
|
1285 |
+
tabindex : $input.attr('tabindex')
|
1286 |
+
};
|
1287 |
+
|
1288 |
+
$input.attr('tabindex', -1).hide().after(self.$wrapper);
|
1289 |
+
|
1290 |
+
if ($.isArray(settings.items)) {
|
1291 |
+
self.setValue(settings.items);
|
1292 |
+
delete settings.items;
|
1293 |
+
}
|
1294 |
+
|
1295 |
+
// feature detect for the validation API
|
1296 |
+
if (SUPPORTS_VALIDITY_API) {
|
1297 |
+
$input.on('invalid' + eventNS, function(e) {
|
1298 |
+
e.preventDefault();
|
1299 |
+
self.isInvalid = true;
|
1300 |
+
self.refreshState();
|
1301 |
+
});
|
1302 |
+
}
|
1303 |
+
|
1304 |
+
self.updateOriginalInput();
|
1305 |
+
self.refreshItems();
|
1306 |
+
self.refreshState();
|
1307 |
+
self.updatePlaceholder();
|
1308 |
+
self.isSetup = true;
|
1309 |
+
|
1310 |
+
if ($input.is(':disabled')) {
|
1311 |
+
self.disable();
|
1312 |
+
}
|
1313 |
+
|
1314 |
+
self.on('change', this.onChange);
|
1315 |
+
|
1316 |
+
$input.data('selectize', self);
|
1317 |
+
$input.addClass('selectized');
|
1318 |
+
self.trigger('initialize');
|
1319 |
+
|
1320 |
+
// preload options
|
1321 |
+
if (settings.preload === true) {
|
1322 |
+
self.onSearchChange('');
|
1323 |
+
}
|
1324 |
+
|
1325 |
+
},
|
1326 |
+
|
1327 |
+
/**
|
1328 |
+
* Sets up default rendering functions.
|
1329 |
+
*/
|
1330 |
+
setupTemplates: function() {
|
1331 |
+
var self = this;
|
1332 |
+
var field_label = self.settings.labelField;
|
1333 |
+
var field_optgroup = self.settings.optgroupLabelField;
|
1334 |
+
|
1335 |
+
var templates = {
|
1336 |
+
'optgroup': function(data) {
|
1337 |
+
return '<div class="optgroup">' + data.html + '</div>';
|
1338 |
+
},
|
1339 |
+
'optgroup_header': function(data, escape) {
|
1340 |
+
return '<div class="optgroup-header">' + escape(data[field_optgroup]) + '</div>';
|
1341 |
+
},
|
1342 |
+
'option': function(data, escape) {
|
1343 |
+
return '<div class="option">' + escape(data[field_label]) + '</div>';
|
1344 |
+
},
|
1345 |
+
'item': function(data, escape) {
|
1346 |
+
return '<div class="item">' + escape(data[field_label]) + '</div>';
|
1347 |
+
},
|
1348 |
+
'option_create': function(data, escape) {
|
1349 |
+
return '<div class="create">Add <strong>' + escape(data.input) + '</strong>…</div>';
|
1350 |
+
}
|
1351 |
+
};
|
1352 |
+
|
1353 |
+
self.settings.render = $.extend({}, templates, self.settings.render);
|
1354 |
+
},
|
1355 |
+
|
1356 |
+
/**
|
1357 |
+
* Maps fired events to callbacks provided
|
1358 |
+
* in the settings used when creating the control.
|
1359 |
+
*/
|
1360 |
+
setupCallbacks: function() {
|
1361 |
+
var key, fn, callbacks = {
|
1362 |
+
'initialize' : 'onInitialize',
|
1363 |
+
'change' : 'onChange',
|
1364 |
+
'item_add' : 'onItemAdd',
|
1365 |
+
'item_remove' : 'onItemRemove',
|
1366 |
+
'clear' : 'onClear',
|
1367 |
+
'option_add' : 'onOptionAdd',
|
1368 |
+
'option_remove' : 'onOptionRemove',
|
1369 |
+
'option_clear' : 'onOptionClear',
|
1370 |
+
'optgroup_add' : 'onOptionGroupAdd',
|
1371 |
+
'optgroup_remove' : 'onOptionGroupRemove',
|
1372 |
+
'optgroup_clear' : 'onOptionGroupClear',
|
1373 |
+
'dropdown_open' : 'onDropdownOpen',
|
1374 |
+
'dropdown_close' : 'onDropdownClose',
|
1375 |
+
'type' : 'onType',
|
1376 |
+
'load' : 'onLoad',
|
1377 |
+
'focus' : 'onFocus',
|
1378 |
+
'blur' : 'onBlur'
|
1379 |
+
};
|
1380 |
+
|
1381 |
+
for (key in callbacks) {
|
1382 |
+
if (callbacks.hasOwnProperty(key)) {
|
1383 |
+
fn = this.settings[callbacks[key]];
|
1384 |
+
if (fn) this.on(key, fn);
|
1385 |
+
}
|
1386 |
+
}
|
1387 |
+
},
|
1388 |
+
|
1389 |
+
/**
|
1390 |
+
* Triggered when the main control element
|
1391 |
+
* has a click event.
|
1392 |
+
*
|
1393 |
+
* @param {object} e
|
1394 |
+
* @return {boolean}
|
1395 |
+
*/
|
1396 |
+
onClick: function(e) {
|
1397 |
+
var self = this;
|
1398 |
+
|
1399 |
+
// necessary for mobile webkit devices (manual focus triggering
|
1400 |
+
// is ignored unless invoked within a click event)
|
1401 |
+
if (!self.isFocused) {
|
1402 |
+
self.focus();
|
1403 |
+
e.preventDefault();
|
1404 |
+
}
|
1405 |
+
},
|
1406 |
+
|
1407 |
+
/**
|
1408 |
+
* Triggered when the main control element
|
1409 |
+
* has a mouse down event.
|
1410 |
+
*
|
1411 |
+
* @param {object} e
|
1412 |
+
* @return {boolean}
|
1413 |
+
*/
|
1414 |
+
onMouseDown: function(e) {
|
1415 |
+
var self = this;
|
1416 |
+
var defaultPrevented = e.isDefaultPrevented();
|
1417 |
+
var $target = $(e.target);
|
1418 |
+
|
1419 |
+
if (self.isFocused) {
|
1420 |
+
// retain focus by preventing native handling. if the
|
1421 |
+
// event target is the input it should not be modified.
|
1422 |
+
// otherwise, text selection within the input won't work.
|
1423 |
+
if (e.target !== self.$control_input[0]) {
|
1424 |
+
if (self.settings.mode === 'single') {
|
1425 |
+
// toggle dropdown
|
1426 |
+
self.isOpen ? self.close() : self.open();
|
1427 |
+
} else if (!defaultPrevented) {
|
1428 |
+
self.setActiveItem(null);
|
1429 |
+
}
|
1430 |
+
return false;
|
1431 |
+
}
|
1432 |
+
} else {
|
1433 |
+
// give control focus
|
1434 |
+
if (!defaultPrevented) {
|
1435 |
+
window.setTimeout(function() {
|
1436 |
+
self.focus();
|
1437 |
+
}, 0);
|
1438 |
+
}
|
1439 |
+
}
|
1440 |
+
},
|
1441 |
+
|
1442 |
+
/**
|
1443 |
+
* Triggered when the value of the control has been changed.
|
1444 |
+
* This should propagate the event to the original DOM
|
1445 |
+
* input / select element.
|
1446 |
+
*/
|
1447 |
+
onChange: function() {
|
1448 |
+
this.$input.trigger('change');
|
1449 |
+
},
|
1450 |
+
|
1451 |
+
/**
|
1452 |
+
* Triggered on <input> paste.
|
1453 |
+
*
|
1454 |
+
* @param {object} e
|
1455 |
+
* @returns {boolean}
|
1456 |
+
*/
|
1457 |
+
onPaste: function(e) {
|
1458 |
+
var self = this;
|
1459 |
+
if (self.isFull() || self.isInputHidden || self.isLocked) {
|
1460 |
+
e.preventDefault();
|
1461 |
+
} else {
|
1462 |
+
// If a regex or string is included, this will split the pasted
|
1463 |
+
// input and create Items for each separate value
|
1464 |
+
if (self.settings.splitOn) {
|
1465 |
+
setTimeout(function() {
|
1466 |
+
var splitInput = $.trim(self.$control_input.val() || '').split(self.settings.splitOn);
|
1467 |
+
for (var i = 0, n = splitInput.length; i < n; i++) {
|
1468 |
+
self.createItem(splitInput[i]);
|
1469 |
+
}
|
1470 |
+
}, 0);
|
1471 |
+
}
|
1472 |
+
}
|
1473 |
+
},
|
1474 |
+
|
1475 |
+
/**
|
1476 |
+
* Triggered on <input> keypress.
|
1477 |
+
*
|
1478 |
+
* @param {object} e
|
1479 |
+
* @returns {boolean}
|
1480 |
+
*/
|
1481 |
+
onKeyPress: function(e) {
|
1482 |
+
if (this.isLocked) return e && e.preventDefault();
|
1483 |
+
var character = String.fromCharCode(e.keyCode || e.which);
|
1484 |
+
if (this.settings.create && this.settings.mode === 'multi' && character === this.settings.delimiter) {
|
1485 |
+
this.createItem();
|
1486 |
+
e.preventDefault();
|
1487 |
+
return false;
|
1488 |
+
}
|
1489 |
+
},
|
1490 |
+
|
1491 |
+
/**
|
1492 |
+
* Triggered on <input> keydown.
|
1493 |
+
*
|
1494 |
+
* @param {object} e
|
1495 |
+
* @returns {boolean}
|
1496 |
+
*/
|
1497 |
+
onKeyDown: function(e) {
|
1498 |
+
var isInput = e.target === this.$control_input[0];
|
1499 |
+
var self = this;
|
1500 |
+
|
1501 |
+
if (self.isLocked) {
|
1502 |
+
if (e.keyCode !== KEY_TAB) {
|
1503 |
+
e.preventDefault();
|
1504 |
+
}
|
1505 |
+
return;
|
1506 |
+
}
|
1507 |
+
|
1508 |
+
switch (e.keyCode) {
|
1509 |
+
case KEY_A:
|
1510 |
+
if (self.isCmdDown) {
|
1511 |
+
self.selectAll();
|
1512 |
+
return;
|
1513 |
+
}
|
1514 |
+
break;
|
1515 |
+
case KEY_ESC:
|
1516 |
+
if (self.isOpen) {
|
1517 |
+
e.preventDefault();
|
1518 |
+
e.stopPropagation();
|
1519 |
+
self.close();
|
1520 |
+
}
|
1521 |
+
return;
|
1522 |
+
case KEY_N:
|
1523 |
+
if (!e.ctrlKey || e.altKey) break;
|
1524 |
+
case KEY_DOWN:
|
1525 |
+
if (!self.isOpen && self.hasOptions) {
|
1526 |
+
self.open();
|
1527 |
+
} else if (self.$activeOption) {
|
1528 |
+
self.ignoreHover = true;
|
1529 |
+
var $next = self.getAdjacentOption(self.$activeOption, 1);
|
1530 |
+
if ($next.length) self.setActiveOption($next, true, true);
|
1531 |
+
}
|
1532 |
+
e.preventDefault();
|
1533 |
+
return;
|
1534 |
+
case KEY_P:
|
1535 |
+
if (!e.ctrlKey || e.altKey) break;
|
1536 |
+
case KEY_UP:
|
1537 |
+
if (self.$activeOption) {
|
1538 |
+
self.ignoreHover = true;
|
1539 |
+
var $prev = self.getAdjacentOption(self.$activeOption, -1);
|
1540 |
+
if ($prev.length) self.setActiveOption($prev, true, true);
|
1541 |
+
}
|
1542 |
+
e.preventDefault();
|
1543 |
+
return;
|
1544 |
+
case KEY_RETURN:
|
1545 |
+
if (self.isOpen && self.$activeOption) {
|
1546 |
+
self.onOptionSelect({currentTarget: self.$activeOption});
|
1547 |
+
e.preventDefault();
|
1548 |
+
}
|
1549 |
+
return;
|
1550 |
+
case KEY_LEFT:
|
1551 |
+
self.advanceSelection(-1, e);
|
1552 |
+
return;
|
1553 |
+
case KEY_RIGHT:
|
1554 |
+
self.advanceSelection(1, e);
|
1555 |
+
return;
|
1556 |
+
case KEY_TAB:
|
1557 |
+
if (self.settings.selectOnTab && self.isOpen && self.$activeOption) {
|
1558 |
+
self.onOptionSelect({currentTarget: self.$activeOption});
|
1559 |
+
|
1560 |
+
// Default behaviour is to jump to the next field, we only want this
|
1561 |
+
// if the current field doesn't accept any more entries
|
1562 |
+
if (!self.isFull()) {
|
1563 |
+
e.preventDefault();
|
1564 |
+
}
|
1565 |
+
}
|
1566 |
+
if (self.settings.create && self.createItem()) {
|
1567 |
+
e.preventDefault();
|
1568 |
+
}
|
1569 |
+
return;
|
1570 |
+
case KEY_BACKSPACE:
|
1571 |
+
case KEY_DELETE:
|
1572 |
+
self.deleteSelection(e);
|
1573 |
+
return;
|
1574 |
+
}
|
1575 |
+
|
1576 |
+
if ((self.isFull() || self.isInputHidden) && !(IS_MAC ? e.metaKey : e.ctrlKey)) {
|
1577 |
+
e.preventDefault();
|
1578 |
+
return;
|
1579 |
+
}
|
1580 |
+
},
|
1581 |
+
|
1582 |
+
/**
|
1583 |
+
* Triggered on <input> keyup.
|
1584 |
+
*
|
1585 |
+
* @param {object} e
|
1586 |
+
* @returns {boolean}
|
1587 |
+
*/
|
1588 |
+
onKeyUp: function(e) {
|
1589 |
+
var self = this;
|
1590 |
+
|
1591 |
+
if (self.isLocked) return e && e.preventDefault();
|
1592 |
+
var value = self.$control_input.val() || '';
|
1593 |
+
if (self.lastValue !== value) {
|
1594 |
+
self.lastValue = value;
|
1595 |
+
self.onSearchChange(value);
|
1596 |
+
self.refreshOptions();
|
1597 |
+
self.trigger('type', value);
|
1598 |
+
}
|
1599 |
+
},
|
1600 |
+
|
1601 |
+
/**
|
1602 |
+
* Invokes the user-provide option provider / loader.
|
1603 |
+
*
|
1604 |
+
* Note: this function is debounced in the Selectize
|
1605 |
+
* constructor (by `settings.loadDelay` milliseconds)
|
1606 |
+
*
|
1607 |
+
* @param {string} value
|
1608 |
+
*/
|
1609 |
+
onSearchChange: function(value) {
|
1610 |
+
var self = this;
|
1611 |
+
var fn = self.settings.load;
|
1612 |
+
if (!fn) return;
|
1613 |
+
if (self.loadedSearches.hasOwnProperty(value)) return;
|
1614 |
+
self.loadedSearches[value] = true;
|
1615 |
+
self.load(function(callback) {
|
1616 |
+
fn.apply(self, [value, callback]);
|
1617 |
+
});
|
1618 |
+
},
|
1619 |
+
|
1620 |
+
/**
|
1621 |
+
* Triggered on <input> focus.
|
1622 |
+
*
|
1623 |
+
* @param {object} e (optional)
|
1624 |
+
* @returns {boolean}
|
1625 |
+
*/
|
1626 |
+
onFocus: function(e) {
|
1627 |
+
var self = this;
|
1628 |
+
var wasFocused = self.isFocused;
|
1629 |
+
|
1630 |
+
if (self.isDisabled) {
|
1631 |
+
self.blur();
|
1632 |
+
e && e.preventDefault();
|
1633 |
+
return false;
|
1634 |
+
}
|
1635 |
+
|
1636 |
+
if (self.ignoreFocus) return;
|
1637 |
+
self.isFocused = true;
|
1638 |
+
if (self.settings.preload === 'focus') self.onSearchChange('');
|
1639 |
+
|
1640 |
+
if (!wasFocused) self.trigger('focus');
|
1641 |
+
|
1642 |
+
if (!self.$activeItems.length) {
|
1643 |
+
self.showInput();
|
1644 |
+
self.setActiveItem(null);
|
1645 |
+
self.refreshOptions(!!self.settings.openOnFocus);
|
1646 |
+
}
|
1647 |
+
|
1648 |
+
self.refreshState();
|
1649 |
+
},
|
1650 |
+
|
1651 |
+
/**
|
1652 |
+
* Triggered on <input> blur.
|
1653 |
+
*
|
1654 |
+
* @param {object} e
|
1655 |
+
* @param {Element} dest
|
1656 |
+
*/
|
1657 |
+
onBlur: function(e, dest) {
|
1658 |
+
var self = this;
|
1659 |
+
if (!self.isFocused) return;
|
1660 |
+
self.isFocused = false;
|
1661 |
+
|
1662 |
+
if (self.ignoreFocus) {
|
1663 |
+
return;
|
1664 |
+
} else if (!self.ignoreBlur && document.activeElement === self.$dropdown_content[0]) {
|
1665 |
+
// necessary to prevent IE closing the dropdown when the scrollbar is clicked
|
1666 |
+
self.ignoreBlur = true;
|
1667 |
+
self.onFocus(e);
|
1668 |
+
return;
|
1669 |
+
}
|
1670 |
+
|
1671 |
+
var deactivate = function() {
|
1672 |
+
self.close();
|
1673 |
+
self.setTextboxValue('');
|
1674 |
+
self.setActiveItem(null);
|
1675 |
+
self.setActiveOption(null);
|
1676 |
+
self.setCaret(self.items.length);
|
1677 |
+
self.refreshState();
|
1678 |
+
|
1679 |
+
// IE11 bug: element still marked as active
|
1680 |
+
(dest || document.body).focus();
|
1681 |
+
|
1682 |
+
self.ignoreFocus = false;
|
1683 |
+
self.trigger('blur');
|
1684 |
+
};
|
1685 |
+
|
1686 |
+
self.ignoreFocus = true;
|
1687 |
+
if (self.settings.create && self.settings.createOnBlur) {
|
1688 |
+
self.createItem(null, false, deactivate);
|
1689 |
+
} else {
|
1690 |
+
deactivate();
|
1691 |
+
}
|
1692 |
+
},
|
1693 |
+
|
1694 |
+
/**
|
1695 |
+
* Triggered when the user rolls over
|
1696 |
+
* an option in the autocomplete dropdown menu.
|
1697 |
+
*
|
1698 |
+
* @param {object} e
|
1699 |
+
* @returns {boolean}
|
1700 |
+
*/
|
1701 |
+
onOptionHover: function(e) {
|
1702 |
+
if (this.ignoreHover) return;
|
1703 |
+
this.setActiveOption(e.currentTarget, false);
|
1704 |
+
},
|
1705 |
+
|
1706 |
+
/**
|
1707 |
+
* Triggered when the user clicks on an option
|
1708 |
+
* in the autocomplete dropdown menu.
|
1709 |
+
*
|
1710 |
+
* @param {object} e
|
1711 |
+
* @returns {boolean}
|
1712 |
+
*/
|
1713 |
+
onOptionSelect: function(e) {
|
1714 |
+
var value, $target, $option, self = this;
|
1715 |
+
|
1716 |
+
if (e.preventDefault) {
|
1717 |
+
e.preventDefault();
|
1718 |
+
e.stopPropagation();
|
1719 |
+
}
|
1720 |
+
|
1721 |
+
$target = $(e.currentTarget);
|
1722 |
+
if ($target.hasClass('create')) {
|
1723 |
+
self.createItem(null, function() {
|
1724 |
+
if (self.settings.closeAfterSelect) {
|
1725 |
+
self.close();
|
1726 |
+
}
|
1727 |
+
});
|
1728 |
+
} else {
|
1729 |
+
value = $target.attr('data-value');
|
1730 |
+
if (typeof value !== 'undefined') {
|
1731 |
+
self.lastQuery = null;
|
1732 |
+
self.setTextboxValue('');
|
1733 |
+
self.addItem(value);
|
1734 |
+
if (self.settings.closeAfterSelect) {
|
1735 |
+
self.close();
|
1736 |
+
} else if (!self.settings.hideSelected && e.type && /mouse/.test(e.type)) {
|
1737 |
+
self.setActiveOption(self.getOption(value));
|
1738 |
+
}
|
1739 |
+
}
|
1740 |
+
}
|
1741 |
+
},
|
1742 |
+
|
1743 |
+
/**
|
1744 |
+
* Triggered when the user clicks on an item
|
1745 |
+
* that has been selected.
|
1746 |
+
*
|
1747 |
+
* @param {object} e
|
1748 |
+
* @returns {boolean}
|
1749 |
+
*/
|
1750 |
+
onItemSelect: function(e) {
|
1751 |
+
var self = this;
|
1752 |
+
|
1753 |
+
if (self.isLocked) return;
|
1754 |
+
if (self.settings.mode === 'multi') {
|
1755 |
+
e.preventDefault();
|
1756 |
+
self.setActiveItem(e.currentTarget, e);
|
1757 |
+
}
|
1758 |
+
},
|
1759 |
+
|
1760 |
+
/**
|
1761 |
+
* Invokes the provided method that provides
|
1762 |
+
* results to a callback---which are then added
|
1763 |
+
* as options to the control.
|
1764 |
+
*
|
1765 |
+
* @param {function} fn
|
1766 |
+
*/
|
1767 |
+
load: function(fn) {
|
1768 |
+
var self = this;
|
1769 |
+
var $wrapper = self.$wrapper.addClass(self.settings.loadingClass);
|
1770 |
+
|
1771 |
+
self.loading++;
|
1772 |
+
fn.apply(self, [function(results) {
|
1773 |
+
self.loading = Math.max(self.loading - 1, 0);
|
1774 |
+
if (results && results.length) {
|
1775 |
+
self.addOption(results);
|
1776 |
+
self.refreshOptions(self.isFocused && !self.isInputHidden);
|
1777 |
+
}
|
1778 |
+
if (!self.loading) {
|
1779 |
+
$wrapper.removeClass(self.settings.loadingClass);
|
1780 |
+
}
|
1781 |
+
self.trigger('load', results);
|
1782 |
+
}]);
|
1783 |
+
},
|
1784 |
+
|
1785 |
+
/**
|
1786 |
+
* Sets the input field of the control to the specified value.
|
1787 |
+
*
|
1788 |
+
* @param {string} value
|
1789 |
+
*/
|
1790 |
+
setTextboxValue: function(value) {
|
1791 |
+
var $input = this.$control_input;
|
1792 |
+
var changed = $input.val() !== value;
|
1793 |
+
if (changed) {
|
1794 |
+
$input.val(value).triggerHandler('update');
|
1795 |
+
this.lastValue = value;
|
1796 |
+
}
|
1797 |
+
},
|
1798 |
+
|
1799 |
+
/**
|
1800 |
+
* Returns the value of the control. If multiple items
|
1801 |
+
* can be selected (e.g. <select multiple>), this returns
|
1802 |
+
* an array. If only one item can be selected, this
|
1803 |
+
* returns a string.
|
1804 |
+
*
|
1805 |
+
* @returns {mixed}
|
1806 |
+
*/
|
1807 |
+
getValue: function() {
|
1808 |
+
if (this.tagType === TAG_SELECT && this.$input.attr('multiple')) {
|
1809 |
+
return this.items;
|
1810 |
+
} else {
|
1811 |
+
return this.items.join(this.settings.delimiter);
|
1812 |
+
}
|
1813 |
+
},
|
1814 |
+
|
1815 |
+
/**
|
1816 |
+
* Resets the selected items to the given value.
|
1817 |
+
*
|
1818 |
+
* @param {mixed} value
|
1819 |
+
*/
|
1820 |
+
setValue: function(value, silent) {
|
1821 |
+
var events = silent ? [] : ['change'];
|
1822 |
+
|
1823 |
+
debounce_events(this, events, function() {
|
1824 |
+
this.clear(silent);
|
1825 |
+
this.addItems(value, silent);
|
1826 |
+
});
|
1827 |
+
},
|
1828 |
+
|
1829 |
+
/**
|
1830 |
+
* Sets the selected item.
|
1831 |
+
*
|
1832 |
+
* @param {object} $item
|
1833 |
+
* @param {object} e (optional)
|
1834 |
+
*/
|
1835 |
+
setActiveItem: function($item, e) {
|
1836 |
+
var self = this;
|
1837 |
+
var eventName;
|
1838 |
+
var i, idx, begin, end, item, swap;
|
1839 |
+
var $last;
|
1840 |
+
|
1841 |
+
if (self.settings.mode === 'single') return;
|
1842 |
+
$item = $($item);
|
1843 |
+
|
1844 |
+
// clear the active selection
|
1845 |
+
if (!$item.length) {
|
1846 |
+
$(self.$activeItems).removeClass('active');
|
1847 |
+
self.$activeItems = [];
|
1848 |
+
if (self.isFocused) {
|
1849 |
+
self.showInput();
|
1850 |
+
}
|
1851 |
+
return;
|
1852 |
+
}
|
1853 |
+
|
1854 |
+
// modify selection
|
1855 |
+
eventName = e && e.type.toLowerCase();
|
1856 |
+
|
1857 |
+
if (eventName === 'mousedown' && self.isShiftDown && self.$activeItems.length) {
|
1858 |
+
$last = self.$control.children('.active:last');
|
1859 |
+
begin = Array.prototype.indexOf.apply(self.$control[0].childNodes, [$last[0]]);
|
1860 |
+
end = Array.prototype.indexOf.apply(self.$control[0].childNodes, [$item[0]]);
|
1861 |
+
if (begin > end) {
|
1862 |
+
swap = begin;
|
1863 |
+
begin = end;
|
1864 |
+
end = swap;
|
1865 |
+
}
|
1866 |
+
for (i = begin; i <= end; i++) {
|
1867 |
+
item = self.$control[0].childNodes[i];
|
1868 |
+
if (self.$activeItems.indexOf(item) === -1) {
|
1869 |
+
$(item).addClass('active');
|
1870 |
+
self.$activeItems.push(item);
|
1871 |
+
}
|
1872 |
+
}
|
1873 |
+
e.preventDefault();
|
1874 |
+
} else if ((eventName === 'mousedown' && self.isCtrlDown) || (eventName === 'keydown' && this.isShiftDown)) {
|
1875 |
+
if ($item.hasClass('active')) {
|
1876 |
+
idx = self.$activeItems.indexOf($item[0]);
|
1877 |
+
self.$activeItems.splice(idx, 1);
|
1878 |
+
$item.removeClass('active');
|
1879 |
+
} else {
|
1880 |
+
self.$activeItems.push($item.addClass('active')[0]);
|
1881 |
+
}
|
1882 |
+
} else {
|
1883 |
+
$(self.$activeItems).removeClass('active');
|
1884 |
+
self.$activeItems = [$item.addClass('active')[0]];
|
1885 |
+
}
|
1886 |
+
|
1887 |
+
// ensure control has focus
|
1888 |
+
self.hideInput();
|
1889 |
+
if (!this.isFocused) {
|
1890 |
+
self.focus();
|
1891 |
+
}
|
1892 |
+
},
|
1893 |
+
|
1894 |
+
/**
|
1895 |
+
* Sets the selected item in the dropdown menu
|
1896 |
+
* of available options.
|
1897 |
+
*
|
1898 |
+
* @param {object} $object
|
1899 |
+
* @param {boolean} scroll
|
1900 |
+
* @param {boolean} animate
|
1901 |
+
*/
|
1902 |
+
setActiveOption: function($option, scroll, animate) {
|
1903 |
+
var height_menu, height_item, y;
|
1904 |
+
var scroll_top, scroll_bottom;
|
1905 |
+
var self = this;
|
1906 |
+
|
1907 |
+
if (self.$activeOption) self.$activeOption.removeClass('active');
|
1908 |
+
self.$activeOption = null;
|
1909 |
+
|
1910 |
+
$option = $($option);
|
1911 |
+
if (!$option.length) return;
|
1912 |
+
|
1913 |
+
self.$activeOption = $option.addClass('active');
|
1914 |
+
|
1915 |
+
if (scroll || !isset(scroll)) {
|
1916 |
+
|
1917 |
+
height_menu = self.$dropdown_content.height();
|
1918 |
+
height_item = self.$activeOption.outerHeight(true);
|
1919 |
+
scroll = self.$dropdown_content.scrollTop() || 0;
|
1920 |
+
y = self.$activeOption.offset().top - self.$dropdown_content.offset().top + scroll;
|
1921 |
+
scroll_top = y;
|
1922 |
+
scroll_bottom = y - height_menu + height_item;
|
1923 |
+
|
1924 |
+
if (y + height_item > height_menu + scroll) {
|
1925 |
+
self.$dropdown_content.stop().animate({scrollTop: scroll_bottom}, animate ? self.settings.scrollDuration : 0);
|
1926 |
+
} else if (y < scroll) {
|
1927 |
+
self.$dropdown_content.stop().animate({scrollTop: scroll_top}, animate ? self.settings.scrollDuration : 0);
|
1928 |
+
}
|
1929 |
+
|
1930 |
+
}
|
1931 |
+
},
|
1932 |
+
|
1933 |
+
/**
|
1934 |
+
* Selects all items (CTRL + A).
|
1935 |
+
*/
|
1936 |
+
selectAll: function() {
|
1937 |
+
var self = this;
|
1938 |
+
if (self.settings.mode === 'single') return;
|
1939 |
+
|
1940 |
+
self.$activeItems = Array.prototype.slice.apply(self.$control.children(':not(input)').addClass('active'));
|
1941 |
+
if (self.$activeItems.length) {
|
1942 |
+
self.hideInput();
|
1943 |
+
self.close();
|
1944 |
+
}
|
1945 |
+
self.focus();
|
1946 |
+
},
|
1947 |
+
|
1948 |
+
/**
|
1949 |
+
* Hides the input element out of view, while
|
1950 |
+
* retaining its focus.
|
1951 |
+
*/
|
1952 |
+
hideInput: function() {
|
1953 |
+
var self = this;
|
1954 |
+
|
1955 |
+
self.setTextboxValue('');
|
1956 |
+
self.$control_input.css({opacity: 0, position: 'absolute', left: self.rtl ? 10000 : -10000});
|
1957 |
+
self.isInputHidden = true;
|
1958 |
+
},
|
1959 |
+
|
1960 |
+
/**
|
1961 |
+
* Restores input visibility.
|
1962 |
+
*/
|
1963 |
+
showInput: function() {
|
1964 |
+
this.$control_input.css({opacity: 1, position: 'relative', left: 0});
|
1965 |
+
this.isInputHidden = false;
|
1966 |
+
},
|
1967 |
+
|
1968 |
+
/**
|
1969 |
+
* Gives the control focus.
|
1970 |
+
*/
|
1971 |
+
focus: function() {
|
1972 |
+
var self = this;
|
1973 |
+
if (self.isDisabled) return;
|
1974 |
+
|
1975 |
+
self.ignoreFocus = true;
|
1976 |
+
self.$control_input[0].focus();
|
1977 |
+
window.setTimeout(function() {
|
1978 |
+
self.ignoreFocus = false;
|
1979 |
+
self.onFocus();
|
1980 |
+
}, 0);
|
1981 |
+
},
|
1982 |
+
|
1983 |
+
/**
|
1984 |
+
* Forces the control out of focus.
|
1985 |
+
*
|
1986 |
+
* @param {Element} dest
|
1987 |
+
*/
|
1988 |
+
blur: function(dest) {
|
1989 |
+
this.$control_input[0].blur();
|
1990 |
+
this.onBlur(null, dest);
|
1991 |
+
},
|
1992 |
+
|
1993 |
+
/**
|
1994 |
+
* Returns a function that scores an object
|
1995 |
+
* to show how good of a match it is to the
|
1996 |
+
* provided query.
|
1997 |
+
*
|
1998 |
+
* @param {string} query
|
1999 |
+
* @param {object} options
|
2000 |
+
* @return {function}
|
2001 |
+
*/
|
2002 |
+
getScoreFunction: function(query) {
|
2003 |
+
return this.sifter.getScoreFunction(query, this.getSearchOptions());
|
2004 |
+
},
|
2005 |
+
|
2006 |
+
/**
|
2007 |
+
* Returns search options for sifter (the system
|
2008 |
+
* for scoring and sorting results).
|
2009 |
+
*
|
2010 |
+
* @see https://github.com/brianreavis/sifter.js
|
2011 |
+
* @return {object}
|
2012 |
+
*/
|
2013 |
+
getSearchOptions: function() {
|
2014 |
+
var settings = this.settings;
|
2015 |
+
var sort = settings.sortField;
|
2016 |
+
if (typeof sort === 'string') {
|
2017 |
+
sort = [{field: sort}];
|
2018 |
+
}
|
2019 |
+
|
2020 |
+
return {
|
2021 |
+
fields : settings.searchField,
|
2022 |
+
conjunction : settings.searchConjunction,
|
2023 |
+
sort : sort
|
2024 |
+
};
|
2025 |
+
},
|
2026 |
+
|
2027 |
+
/**
|
2028 |
+
* Searches through available options and returns
|
2029 |
+
* a sorted array of matches.
|
2030 |
+
*
|
2031 |
+
* Returns an object containing:
|
2032 |
+
*
|
2033 |
+
* - query {string}
|
2034 |
+
* - tokens {array}
|
2035 |
+
* - total {int}
|
2036 |
+
* - items {array}
|
2037 |
+
*
|
2038 |
+
* @param {string} query
|
2039 |
+
* @returns {object}
|
2040 |
+
*/
|
2041 |
+
search: function(query) {
|
2042 |
+
var i, value, score, result, calculateScore;
|
2043 |
+
var self = this;
|
2044 |
+
var settings = self.settings;
|
2045 |
+
var options = this.getSearchOptions();
|
2046 |
+
|
2047 |
+
// validate user-provided result scoring function
|
2048 |
+
if (settings.score) {
|
2049 |
+
calculateScore = self.settings.score.apply(this, [query]);
|
2050 |
+
if (typeof calculateScore !== 'function') {
|
2051 |
+
throw new Error('Selectize "score" setting must be a function that returns a function');
|
2052 |
+
}
|
2053 |
+
}
|
2054 |
+
|
2055 |
+
// perform search
|
2056 |
+
if (query !== self.lastQuery) {
|
2057 |
+
self.lastQuery = query;
|
2058 |
+
result = self.sifter.search(query, $.extend(options, {score: calculateScore}));
|
2059 |
+
self.currentResults = result;
|
2060 |
+
} else {
|
2061 |
+
result = $.extend(true, {}, self.currentResults);
|
2062 |
+
}
|
2063 |
+
|
2064 |
+
// filter out selected items
|
2065 |
+
if (settings.hideSelected) {
|
2066 |
+
for (i = result.items.length - 1; i >= 0; i--) {
|
2067 |
+
if (self.items.indexOf(hash_key(result.items[i].id)) !== -1) {
|
2068 |
+
result.items.splice(i, 1);
|
2069 |
+
}
|
2070 |
+
}
|
2071 |
+
}
|
2072 |
+
|
2073 |
+
return result;
|
2074 |
+
},
|
2075 |
+
|
2076 |
+
/**
|
2077 |
+
* Refreshes the list of available options shown
|
2078 |
+
* in the autocomplete dropdown menu.
|
2079 |
+
*
|
2080 |
+
* @param {boolean} triggerDropdown
|
2081 |
+
*/
|
2082 |
+
refreshOptions: function(triggerDropdown) {
|
2083 |
+
var i, j, k, n, groups, groups_order, option, option_html, optgroup, optgroups, html, html_children, has_create_option;
|
2084 |
+
var $active, $active_before, $create;
|
2085 |
+
|
2086 |
+
if (typeof triggerDropdown === 'undefined') {
|
2087 |
+
triggerDropdown = true;
|
2088 |
+
}
|
2089 |
+
|
2090 |
+
var self = this;
|
2091 |
+
var query = $.trim(self.$control_input.val());
|
2092 |
+
var results = self.search(query);
|
2093 |
+
var $dropdown_content = self.$dropdown_content;
|
2094 |
+
var active_before = self.$activeOption && hash_key(self.$activeOption.attr('data-value'));
|
2095 |
+
|
2096 |
+
// build markup
|
2097 |
+
n = results.items.length;
|
2098 |
+
if (typeof self.settings.maxOptions === 'number') {
|
2099 |
+
n = Math.min(n, self.settings.maxOptions);
|
2100 |
+
}
|
2101 |
+
|
2102 |
+
// render and group available options individually
|
2103 |
+
groups = {};
|
2104 |
+
groups_order = [];
|
2105 |
+
|
2106 |
+
for (i = 0; i < n; i++) {
|
2107 |
+
option = self.options[results.items[i].id];
|
2108 |
+
option_html = self.render('option', option);
|
2109 |
+
optgroup = option[self.settings.optgroupField] || '';
|
2110 |
+
optgroups = $.isArray(optgroup) ? optgroup : [optgroup];
|
2111 |
+
|
2112 |
+
for (j = 0, k = optgroups && optgroups.length; j < k; j++) {
|
2113 |
+
optgroup = optgroups[j];
|
2114 |
+
if (!self.optgroups.hasOwnProperty(optgroup)) {
|
2115 |
+
optgroup = '';
|
2116 |
+
}
|
2117 |
+
if (!groups.hasOwnProperty(optgroup)) {
|
2118 |
+
groups[optgroup] = [];
|
2119 |
+
groups_order.push(optgroup);
|
2120 |
+
}
|
2121 |
+
groups[optgroup].push(option_html);
|
2122 |
+
}
|
2123 |
+
}
|
2124 |
+
|
2125 |
+
// sort optgroups
|
2126 |
+
if (this.settings.lockOptgroupOrder) {
|
2127 |
+
groups_order.sort(function(a, b) {
|
2128 |
+
var a_order = self.optgroups[a].$order || 0;
|
2129 |
+
var b_order = self.optgroups[b].$order || 0;
|
2130 |
+
return a_order - b_order;
|
2131 |
+
});
|
2132 |
+
}
|
2133 |
+
|
2134 |
+
// render optgroup headers & join groups
|
2135 |
+
html = [];
|
2136 |
+
for (i = 0, n = groups_order.length; i < n; i++) {
|
2137 |
+
optgroup = groups_order[i];
|
2138 |
+
if (self.optgroups.hasOwnProperty(optgroup) && groups[optgroup].length) {
|
2139 |
+
// render the optgroup header and options within it,
|
2140 |
+
// then pass it to the wrapper template
|
2141 |
+
html_children = self.render('optgroup_header', self.optgroups[optgroup]) || '';
|
2142 |
+
html_children += groups[optgroup].join('');
|
2143 |
+
html.push(self.render('optgroup', $.extend({}, self.optgroups[optgroup], {
|
2144 |
+
html: html_children
|
2145 |
+
})));
|
2146 |
+
} else {
|
2147 |
+
html.push(groups[optgroup].join(''));
|
2148 |
+
}
|
2149 |
+
}
|
2150 |
+
|
2151 |
+
$dropdown_content.html(html.join(''));
|
2152 |
+
|
2153 |
+
// highlight matching terms inline
|
2154 |
+
if (self.settings.highlight && results.query.length && results.tokens.length) {
|
2155 |
+
for (i = 0, n = results.tokens.length; i < n; i++) {
|
2156 |
+
highlight($dropdown_content, results.tokens[i].regex);
|
2157 |
+
}
|
2158 |
+
}
|
2159 |
+
|
2160 |
+
// add "selected" class to selected options
|
2161 |
+
if (!self.settings.hideSelected) {
|
2162 |
+
for (i = 0, n = self.items.length; i < n; i++) {
|
2163 |
+
self.getOption(self.items[i]).addClass('selected');
|
2164 |
+
}
|
2165 |
+
}
|
2166 |
+
|
2167 |
+
// add create option
|
2168 |
+
has_create_option = self.canCreate(query);
|
2169 |
+
if (has_create_option) {
|
2170 |
+
$dropdown_content.prepend(self.render('option_create', {input: query}));
|
2171 |
+
$create = $($dropdown_content[0].childNodes[0]);
|
2172 |
+
}
|
2173 |
+
|
2174 |
+
// activate
|
2175 |
+
self.hasOptions = results.items.length > 0 || has_create_option;
|
2176 |
+
if (self.hasOptions) {
|
2177 |
+
if (results.items.length > 0) {
|
2178 |
+
$active_before = active_before && self.getOption(active_before);
|
2179 |
+
if ($active_before && $active_before.length) {
|
2180 |
+
$active = $active_before;
|
2181 |
+
} else if (self.settings.mode === 'single' && self.items.length) {
|
2182 |
+
$active = self.getOption(self.items[0]);
|
2183 |
+
}
|
2184 |
+
if (!$active || !$active.length) {
|
2185 |
+
if ($create && !self.settings.addPrecedence) {
|
2186 |
+
$active = self.getAdjacentOption($create, 1);
|
2187 |
+
} else {
|
2188 |
+
$active = $dropdown_content.find('[data-selectable]:first');
|
2189 |
+
}
|
2190 |
+
}
|
2191 |
+
} else {
|
2192 |
+
$active = $create;
|
2193 |
+
}
|
2194 |
+
self.setActiveOption($active);
|
2195 |
+
if (triggerDropdown && !self.isOpen) { self.open(); }
|
2196 |
+
} else {
|
2197 |
+
self.setActiveOption(null);
|
2198 |
+
if (triggerDropdown && self.isOpen) { self.close(); }
|
2199 |
+
}
|
2200 |
+
},
|
2201 |
+
|
2202 |
+
/**
|
2203 |
+
* Adds an available option. If it already exists,
|
2204 |
+
* nothing will happen. Note: this does not refresh
|
2205 |
+
* the options list dropdown (use `refreshOptions`
|
2206 |
+
* for that).
|
2207 |
+
*
|
2208 |
+
* Usage:
|
2209 |
+
*
|
2210 |
+
* this.addOption(data)
|
2211 |
+
*
|
2212 |
+
* @param {object|array} data
|
2213 |
+
*/
|
2214 |
+
addOption: function(data) {
|
2215 |
+
var i, n, value, self = this;
|
2216 |
+
|
2217 |
+
if ($.isArray(data)) {
|
2218 |
+
for (i = 0, n = data.length; i < n; i++) {
|
2219 |
+
self.addOption(data[i]);
|
2220 |
+
}
|
2221 |
+
return;
|
2222 |
+
}
|
2223 |
+
|
2224 |
+
if (value = self.registerOption(data)) {
|
2225 |
+
self.userOptions[value] = true;
|
2226 |
+
self.lastQuery = null;
|
2227 |
+
self.trigger('option_add', value, data);
|
2228 |
+
}
|
2229 |
+
},
|
2230 |
+
|
2231 |
+
/**
|
2232 |
+
* Registers an option to the pool of options.
|
2233 |
+
*
|
2234 |
+
* @param {object} data
|
2235 |
+
* @return {boolean|string}
|
2236 |
+
*/
|
2237 |
+
registerOption: function(data) {
|
2238 |
+
var key = hash_key(data[this.settings.valueField]);
|
2239 |
+
if (!key || this.options.hasOwnProperty(key)) return false;
|
2240 |
+
data.$order = data.$order || ++this.order;
|
2241 |
+
this.options[key] = data;
|
2242 |
+
return key;
|
2243 |
+
},
|
2244 |
+
|
2245 |
+
/**
|
2246 |
+
* Registers an option group to the pool of option groups.
|
2247 |
+
*
|
2248 |
+
* @param {object} data
|
2249 |
+
* @return {boolean|string}
|
2250 |
+
*/
|
2251 |
+
registerOptionGroup: function(data) {
|
2252 |
+
var key = hash_key(data[this.settings.optgroupValueField]);
|
2253 |
+
if (!key) return false;
|
2254 |
+
|
2255 |
+
data.$order = data.$order || ++this.order;
|
2256 |
+
this.optgroups[key] = data;
|
2257 |
+
return key;
|
2258 |
+
},
|
2259 |
+
|
2260 |
+
/**
|
2261 |
+
* Registers a new optgroup for options
|
2262 |
+
* to be bucketed into.
|
2263 |
+
*
|
2264 |
+
* @param {string} id
|
2265 |
+
* @param {object} data
|
2266 |
+
*/
|
2267 |
+
addOptionGroup: function(id, data) {
|
2268 |
+
data[this.settings.optgroupValueField] = id;
|
2269 |
+
if (id = this.registerOptionGroup(data)) {
|
2270 |
+
this.trigger('optgroup_add', id, data);
|
2271 |
+
}
|
2272 |
+
},
|
2273 |
+
|
2274 |
+
/**
|
2275 |
+
* Removes an existing option group.
|
2276 |
+
*
|
2277 |
+
* @param {string} id
|
2278 |
+
*/
|
2279 |
+
removeOptionGroup: function(id) {
|
2280 |
+
if (this.optgroups.hasOwnProperty(id)) {
|
2281 |
+
delete this.optgroups[id];
|
2282 |
+
this.renderCache = {};
|
2283 |
+
this.trigger('optgroup_remove', id);
|
2284 |
+
}
|
2285 |
+
},
|
2286 |
+
|
2287 |
+
/**
|
2288 |
+
* Clears all existing option groups.
|
2289 |
+
*/
|
2290 |
+
clearOptionGroups: function() {
|
2291 |
+
this.optgroups = {};
|
2292 |
+
this.renderCache = {};
|
2293 |
+
this.trigger('optgroup_clear');
|
2294 |
+
},
|
2295 |
+
|
2296 |
+
/**
|
2297 |
+
* Updates an option available for selection. If
|
2298 |
+
* it is visible in the selected items or options
|
2299 |
+
* dropdown, it will be re-rendered automatically.
|
2300 |
+
*
|
2301 |
+
* @param {string} value
|
2302 |
+
* @param {object} data
|
2303 |
+
*/
|
2304 |
+
updateOption: function(value, data) {
|
2305 |
+
var self = this;
|
2306 |
+
var $item, $item_new;
|
2307 |
+
var value_new, index_item, cache_items, cache_options, order_old;
|
2308 |
+
|
2309 |
+
value = hash_key(value);
|
2310 |
+
value_new = hash_key(data[self.settings.valueField]);
|
2311 |
+
|
2312 |
+
// sanity checks
|
2313 |
+
if (value === null) return;
|
2314 |
+
if (!self.options.hasOwnProperty(value)) return;
|
2315 |
+
if (typeof value_new !== 'string') throw new Error('Value must be set in option data');
|
2316 |
+
|
2317 |
+
order_old = self.options[value].$order;
|
2318 |
+
|
2319 |
+
// update references
|
2320 |
+
if (value_new !== value) {
|
2321 |
+
delete self.options[value];
|
2322 |
+
index_item = self.items.indexOf(value);
|
2323 |
+
if (index_item !== -1) {
|
2324 |
+
self.items.splice(index_item, 1, value_new);
|
2325 |
+
}
|
2326 |
+
}
|
2327 |
+
data.$order = data.$order || order_old;
|
2328 |
+
self.options[value_new] = data;
|
2329 |
+
|
2330 |
+
// invalidate render cache
|
2331 |
+
cache_items = self.renderCache['item'];
|
2332 |
+
cache_options = self.renderCache['option'];
|
2333 |
+
|
2334 |
+
if (cache_items) {
|
2335 |
+
delete cache_items[value];
|
2336 |
+
delete cache_items[value_new];
|
2337 |
+
}
|
2338 |
+
if (cache_options) {
|
2339 |
+
delete cache_options[value];
|
2340 |
+
delete cache_options[value_new];
|
2341 |
+
}
|
2342 |
+
|
2343 |
+
// update the item if it's selected
|
2344 |
+
if (self.items.indexOf(value_new) !== -1) {
|
2345 |
+
$item = self.getItem(value);
|
2346 |
+
$item_new = $(self.render('item', data));
|
2347 |
+
if ($item.hasClass('active')) $item_new.addClass('active');
|
2348 |
+
$item.replaceWith($item_new);
|
2349 |
+
}
|
2350 |
+
|
2351 |
+
// invalidate last query because we might have updated the sortField
|
2352 |
+
self.lastQuery = null;
|
2353 |
+
|
2354 |
+
// update dropdown contents
|
2355 |
+
if (self.isOpen) {
|
2356 |
+
self.refreshOptions(false);
|
2357 |
+
}
|
2358 |
+
},
|
2359 |
+
|
2360 |
+
/**
|
2361 |
+
* Removes a single option.
|
2362 |
+
*
|
2363 |
+
* @param {string} value
|
2364 |
+
* @param {boolean} silent
|
2365 |
+
*/
|
2366 |
+
removeOption: function(value, silent) {
|
2367 |
+
var self = this;
|
2368 |
+
value = hash_key(value);
|
2369 |
+
|
2370 |
+
var cache_items = self.renderCache['item'];
|
2371 |
+
var cache_options = self.renderCache['option'];
|
2372 |
+
if (cache_items) delete cache_items[value];
|
2373 |
+
if (cache_options) delete cache_options[value];
|
2374 |
+
|
2375 |
+
delete self.userOptions[value];
|
2376 |
+
delete self.options[value];
|
2377 |
+
self.lastQuery = null;
|
2378 |
+
self.trigger('option_remove', value);
|
2379 |
+
self.removeItem(value, silent);
|
2380 |
+
},
|
2381 |
+
|
2382 |
+
/**
|
2383 |
+
* Clears all options.
|
2384 |
+
*/
|
2385 |
+
clearOptions: function() {
|
2386 |
+
var self = this;
|
2387 |
+
|
2388 |
+
self.loadedSearches = {};
|
2389 |
+
self.userOptions = {};
|
2390 |
+
self.renderCache = {};
|
2391 |
+
self.options = self.sifter.items = {};
|
2392 |
+
self.lastQuery = null;
|
2393 |
+
self.trigger('option_clear');
|
2394 |
+
self.clear();
|
2395 |
+
},
|
2396 |
+
|
2397 |
+
/**
|
2398 |
+
* Returns the jQuery element of the option
|
2399 |
+
* matching the given value.
|
2400 |
+
*
|
2401 |
+
* @param {string} value
|
2402 |
+
* @returns {object}
|
2403 |
+
*/
|
2404 |
+
getOption: function(value) {
|
2405 |
+
return this.getElementWithValue(value, this.$dropdown_content.find('[data-selectable]'));
|
2406 |
+
},
|
2407 |
+
|
2408 |
+
/**
|
2409 |
+
* Returns the jQuery element of the next or
|
2410 |
+
* previous selectable option.
|
2411 |
+
*
|
2412 |
+
* @param {object} $option
|
2413 |
+
* @param {int} direction can be 1 for next or -1 for previous
|
2414 |
+
* @return {object}
|
2415 |
+
*/
|
2416 |
+
getAdjacentOption: function($option, direction) {
|
2417 |
+
var $options = this.$dropdown.find('[data-selectable]');
|
2418 |
+
var index = $options.index($option) + direction;
|
2419 |
+
|
2420 |
+
return index >= 0 && index < $options.length ? $options.eq(index) : $();
|
2421 |
+
},
|
2422 |
+
|
2423 |
+
/**
|
2424 |
+
* Finds the first element with a "data-value" attribute
|
2425 |
+
* that matches the given value.
|
2426 |
+
*
|
2427 |
+
* @param {mixed} value
|
2428 |
+
* @param {object} $els
|
2429 |
+
* @return {object}
|
2430 |
+
*/
|
2431 |
+
getElementWithValue: function(value, $els) {
|
2432 |
+
value = hash_key(value);
|
2433 |
+
|
2434 |
+
if (typeof value !== 'undefined' && value !== null) {
|
2435 |
+
for (var i = 0, n = $els.length; i < n; i++) {
|
2436 |
+
if ($els[i].getAttribute('data-value') === value) {
|
2437 |
+
return $($els[i]);
|
2438 |
+
}
|
2439 |
+
}
|
2440 |
+
}
|
2441 |
+
|
2442 |
+
return $();
|
2443 |
+
},
|
2444 |
+
|
2445 |
+
/**
|
2446 |
+
* Returns the jQuery element of the item
|
2447 |
+
* matching the given value.
|
2448 |
+
*
|
2449 |
+
* @param {string} value
|
2450 |
+
* @returns {object}
|
2451 |
+
*/
|
2452 |
+
getItem: function(value) {
|
2453 |
+
return this.getElementWithValue(value, this.$control.children());
|
2454 |
+
},
|
2455 |
+
|
2456 |
+
/**
|
2457 |
+
* "Selects" multiple items at once. Adds them to the list
|
2458 |
+
* at the current caret position.
|
2459 |
+
*
|
2460 |
+
* @param {string} value
|
2461 |
+
* @param {boolean} silent
|
2462 |
+
*/
|
2463 |
+
addItems: function(values, silent) {
|
2464 |
+
var items = $.isArray(values) ? values : [values];
|
2465 |
+
for (var i = 0, n = items.length; i < n; i++) {
|
2466 |
+
this.isPending = (i < n - 1);
|
2467 |
+
this.addItem(items[i], silent);
|
2468 |
+
}
|
2469 |
+
},
|
2470 |
+
|
2471 |
+
/**
|
2472 |
+
* "Selects" an item. Adds it to the list
|
2473 |
+
* at the current caret position.
|
2474 |
+
*
|
2475 |
+
* @param {string} value
|
2476 |
+
* @param {boolean} silent
|
2477 |
+
*/
|
2478 |
+
addItem: function(value, silent) {
|
2479 |
+
var events = silent ? [] : ['change'];
|
2480 |
+
|
2481 |
+
debounce_events(this, events, function() {
|
2482 |
+
var $item, $option, $options;
|
2483 |
+
var self = this;
|
2484 |
+
var inputMode = self.settings.mode;
|
2485 |
+
var i, active, value_next, wasFull;
|
2486 |
+
value = hash_key(value);
|
2487 |
+
|
2488 |
+
if (self.items.indexOf(value) !== -1) {
|
2489 |
+
if (inputMode === 'single') self.close();
|
2490 |
+
return;
|
2491 |
+
}
|
2492 |
+
|
2493 |
+
if (!self.options.hasOwnProperty(value)) return;
|
2494 |
+
if (inputMode === 'single') self.clear(silent);
|
2495 |
+
if (inputMode === 'multi' && self.isFull()) return;
|
2496 |
+
|
2497 |
+
$item = $(self.render('item', self.options[value]));
|
2498 |
+
wasFull = self.isFull();
|
2499 |
+
self.items.splice(self.caretPos, 0, value);
|
2500 |
+
self.insertAtCaret($item);
|
2501 |
+
if (!self.isPending || (!wasFull && self.isFull())) {
|
2502 |
+
self.refreshState();
|
2503 |
+
}
|
2504 |
+
|
2505 |
+
if (self.isSetup) {
|
2506 |
+
$options = self.$dropdown_content.find('[data-selectable]');
|
2507 |
+
|
2508 |
+
// update menu / remove the option (if this is not one item being added as part of series)
|
2509 |
+
if (!self.isPending) {
|
2510 |
+
$option = self.getOption(value);
|
2511 |
+
value_next = self.getAdjacentOption($option, 1).attr('data-value');
|
2512 |
+
self.refreshOptions(self.isFocused && inputMode !== 'single');
|
2513 |
+
if (value_next) {
|
2514 |
+
self.setActiveOption(self.getOption(value_next));
|
2515 |
+
}
|
2516 |
+
}
|
2517 |
+
|
2518 |
+
// hide the menu if the maximum number of items have been selected or no options are left
|
2519 |
+
if (!$options.length || self.isFull()) {
|
2520 |
+
self.close();
|
2521 |
+
} else {
|
2522 |
+
self.positionDropdown();
|
2523 |
+
}
|
2524 |
+
|
2525 |
+
self.updatePlaceholder();
|
2526 |
+
self.trigger('item_add', value, $item);
|
2527 |
+
self.updateOriginalInput({silent: silent});
|
2528 |
+
}
|
2529 |
+
});
|
2530 |
+
},
|
2531 |
+
|
2532 |
+
/**
|
2533 |
+
* Removes the selected item matching
|
2534 |
+
* the provided value.
|
2535 |
+
*
|
2536 |
+
* @param {string} value
|
2537 |
+
*/
|
2538 |
+
removeItem: function(value, silent) {
|
2539 |
+
var self = this;
|
2540 |
+
var $item, i, idx;
|
2541 |
+
|
2542 |
+
$item = (typeof value === 'object') ? value : self.getItem(value);
|
2543 |
+
value = hash_key($item.attr('data-value'));
|
2544 |
+
i = self.items.indexOf(value);
|
2545 |
+
|
2546 |
+
if (i !== -1) {
|
2547 |
+
$item.remove();
|
2548 |
+
if ($item.hasClass('active')) {
|
2549 |
+
idx = self.$activeItems.indexOf($item[0]);
|
2550 |
+
self.$activeItems.splice(idx, 1);
|
2551 |
+
}
|
2552 |
+
|
2553 |
+
self.items.splice(i, 1);
|
2554 |
+
self.lastQuery = null;
|
2555 |
+
if (!self.settings.persist && self.userOptions.hasOwnProperty(value)) {
|
2556 |
+
self.removeOption(value, silent);
|
2557 |
+
}
|
2558 |
+
|
2559 |
+
if (i < self.caretPos) {
|
2560 |
+
self.setCaret(self.caretPos - 1);
|
2561 |
+
}
|
2562 |
+
|
2563 |
+
self.refreshState();
|
2564 |
+
self.updatePlaceholder();
|
2565 |
+
self.updateOriginalInput({silent: silent});
|
2566 |
+
self.positionDropdown();
|
2567 |
+
self.trigger('item_remove', value, $item);
|
2568 |
+
}
|
2569 |
+
},
|
2570 |
+
|
2571 |
+
/**
|
2572 |
+
* Invokes the `create` method provided in the
|
2573 |
+
* selectize options that should provide the data
|
2574 |
+
* for the new item, given the user input.
|
2575 |
+
*
|
2576 |
+
* Once this completes, it will be added
|
2577 |
+
* to the item list.
|
2578 |
+
*
|
2579 |
+
* @param {string} value
|
2580 |
+
* @param {boolean} [triggerDropdown]
|
2581 |
+
* @param {function} [callback]
|
2582 |
+
* @return {boolean}
|
2583 |
+
*/
|
2584 |
+
createItem: function(input, triggerDropdown) {
|
2585 |
+
var self = this;
|
2586 |
+
var caret = self.caretPos;
|
2587 |
+
input = input || $.trim(self.$control_input.val() || '');
|
2588 |
+
|
2589 |
+
var callback = arguments[arguments.length - 1];
|
2590 |
+
if (typeof callback !== 'function') callback = function() {};
|
2591 |
+
|
2592 |
+
if (typeof triggerDropdown !== 'boolean') {
|
2593 |
+
triggerDropdown = true;
|
2594 |
+
}
|
2595 |
+
|
2596 |
+
if (!self.canCreate(input)) {
|
2597 |
+
callback();
|
2598 |
+
return false;
|
2599 |
+
}
|
2600 |
+
|
2601 |
+
self.lock();
|
2602 |
+
|
2603 |
+
var setup = (typeof self.settings.create === 'function') ? this.settings.create : function(input) {
|
2604 |
+
var data = {};
|
2605 |
+
data[self.settings.labelField] = input;
|
2606 |
+
data[self.settings.valueField] = input;
|
2607 |
+
return data;
|
2608 |
+
};
|
2609 |
+
|
2610 |
+
var create = once(function(data) {
|
2611 |
+
self.unlock();
|
2612 |
+
|
2613 |
+
if (!data || typeof data !== 'object') return callback();
|
2614 |
+
var value = hash_key(data[self.settings.valueField]);
|
2615 |
+
if (typeof value !== 'string') return callback();
|
2616 |
+
|
2617 |
+
self.setTextboxValue('');
|
2618 |
+
self.addOption(data);
|
2619 |
+
self.setCaret(caret);
|
2620 |
+
self.addItem(value);
|
2621 |
+
self.refreshOptions(triggerDropdown && self.settings.mode !== 'single');
|
2622 |
+
callback(data);
|
2623 |
+
});
|
2624 |
+
|
2625 |
+
var output = setup.apply(this, [input, create]);
|
2626 |
+
if (typeof output !== 'undefined') {
|
2627 |
+
create(output);
|
2628 |
+
}
|
2629 |
+
|
2630 |
+
return true;
|
2631 |
+
},
|
2632 |
+
|
2633 |
+
/**
|
2634 |
+
* Re-renders the selected item lists.
|
2635 |
+
*/
|
2636 |
+
refreshItems: function() {
|
2637 |
+
this.lastQuery = null;
|
2638 |
+
|
2639 |
+
if (this.isSetup) {
|
2640 |
+
this.addItem(this.items);
|
2641 |
+
}
|
2642 |
+
|
2643 |
+
this.refreshState();
|
2644 |
+
this.updateOriginalInput();
|
2645 |
+
},
|
2646 |
+
|
2647 |
+
/**
|
2648 |
+
* Updates all state-dependent attributes
|
2649 |
+
* and CSS classes.
|
2650 |
+
*/
|
2651 |
+
refreshState: function() {
|
2652 |
+
var invalid, self = this;
|
2653 |
+
if (self.isRequired) {
|
2654 |
+
if (self.items.length) self.isInvalid = false;
|
2655 |
+
self.$control_input.prop('required', invalid);
|
2656 |
+
}
|
2657 |
+
self.refreshClasses();
|
2658 |
+
},
|
2659 |
+
|
2660 |
+
/**
|
2661 |
+
* Updates all state-dependent CSS classes.
|
2662 |
+
*/
|
2663 |
+
refreshClasses: function() {
|
2664 |
+
var self = this;
|
2665 |
+
var isFull = self.isFull();
|
2666 |
+
var isLocked = self.isLocked;
|
2667 |
+
|
2668 |
+
self.$wrapper
|
2669 |
+
.toggleClass('rtl', self.rtl);
|
2670 |
+
|
2671 |
+
self.$control
|
2672 |
+
.toggleClass('focus', self.isFocused)
|
2673 |
+
.toggleClass('disabled', self.isDisabled)
|
2674 |
+
.toggleClass('required', self.isRequired)
|
2675 |
+
.toggleClass('invalid', self.isInvalid)
|
2676 |
+
.toggleClass('locked', isLocked)
|
2677 |
+
.toggleClass('full', isFull).toggleClass('not-full', !isFull)
|
2678 |
+
.toggleClass('input-active', self.isFocused && !self.isInputHidden)
|
2679 |
+
.toggleClass('dropdown-active', self.isOpen)
|
2680 |
+
.toggleClass('has-options', !$.isEmptyObject(self.options))
|
2681 |
+
.toggleClass('has-items', self.items.length > 0);
|
2682 |
+
|
2683 |
+
self.$control_input.data('grow', !isFull && !isLocked);
|
2684 |
+
},
|
2685 |
+
|
2686 |
+
/**
|
2687 |
+
* Determines whether or not more items can be added
|
2688 |
+
* to the control without exceeding the user-defined maximum.
|
2689 |
+
*
|
2690 |
+
* @returns {boolean}
|
2691 |
+
*/
|
2692 |
+
isFull: function() {
|
2693 |
+
return this.settings.maxItems !== null && this.items.length >= this.settings.maxItems;
|
2694 |
+
},
|
2695 |
+
|
2696 |
+
/**
|
2697 |
+
* Refreshes the original <select> or <input>
|
2698 |
+
* element to reflect the current state.
|
2699 |
+
*/
|
2700 |
+
updateOriginalInput: function(opts) {
|
2701 |
+
var i, n, options, label, self = this;
|
2702 |
+
opts = opts || {};
|
2703 |
+
|
2704 |
+
if (self.tagType === TAG_SELECT) {
|
2705 |
+
options = [];
|
2706 |
+
for (i = 0, n = self.items.length; i < n; i++) {
|
2707 |
+
label = self.options[self.items[i]][self.settings.labelField] || '';
|
2708 |
+
options.push('<option value="' + escape_html(self.items[i]) + '" selected="selected">' + escape_html(label) + '</option>');
|
2709 |
+
}
|
2710 |
+
if (!options.length && !this.$input.attr('multiple')) {
|
2711 |
+
options.push('<option value="" selected="selected"></option>');
|
2712 |
+
}
|
2713 |
+
self.$input.html(options.join(''));
|
2714 |
+
} else {
|
2715 |
+
self.$input.val(self.getValue());
|
2716 |
+
self.$input.attr('value',self.$input.val());
|
2717 |
+
}
|
2718 |
+
|
2719 |
+
if (self.isSetup) {
|
2720 |
+
if (!opts.silent) {
|
2721 |
+
self.trigger('change', self.$input.val());
|
2722 |
+
}
|
2723 |
+
}
|
2724 |
+
},
|
2725 |
+
|
2726 |
+
/**
|
2727 |
+
* Shows/hide the input placeholder depending
|
2728 |
+
* on if there items in the list already.
|
2729 |
+
*/
|
2730 |
+
updatePlaceholder: function() {
|
2731 |
+
if (!this.settings.placeholder) return;
|
2732 |
+
var $input = this.$control_input;
|
2733 |
+
|
2734 |
+
if (this.items.length) {
|
2735 |
+
$input.removeAttr('placeholder');
|
2736 |
+
} else {
|
2737 |
+
$input.attr('placeholder', this.settings.placeholder);
|
2738 |
+
}
|
2739 |
+
$input.triggerHandler('update', {force: true});
|
2740 |
+
},
|
2741 |
+
|
2742 |
+
/**
|
2743 |
+
* Shows the autocomplete dropdown containing
|
2744 |
+
* the available options.
|
2745 |
+
*/
|
2746 |
+
open: function() {
|
2747 |
+
var self = this;
|
2748 |
+
|
2749 |
+
if (self.isLocked || self.isOpen || (self.settings.mode === 'multi' && self.isFull())) return;
|
2750 |
+
self.focus();
|
2751 |
+
self.isOpen = true;
|
2752 |
+
self.refreshState();
|
2753 |
+
self.$dropdown.css({visibility: 'hidden', display: 'block'});
|
2754 |
+
self.positionDropdown();
|
2755 |
+
self.$dropdown.css({visibility: 'visible'});
|
2756 |
+
self.trigger('dropdown_open', self.$dropdown);
|
2757 |
+
},
|
2758 |
+
|
2759 |
+
/**
|
2760 |
+
* Closes the autocomplete dropdown menu.
|
2761 |
+
*/
|
2762 |
+
close: function() {
|
2763 |
+
var self = this;
|
2764 |
+
var trigger = self.isOpen;
|
2765 |
+
|
2766 |
+
if (self.settings.mode === 'single' && self.items.length) {
|
2767 |
+
self.hideInput();
|
2768 |
+
}
|
2769 |
+
|
2770 |
+
self.isOpen = false;
|
2771 |
+
self.$dropdown.hide();
|
2772 |
+
self.setActiveOption(null);
|
2773 |
+
self.refreshState();
|
2774 |
+
|
2775 |
+
if (trigger) self.trigger('dropdown_close', self.$dropdown);
|
2776 |
+
},
|
2777 |
+
|
2778 |
+
/**
|
2779 |
+
* Calculates and applies the appropriate
|
2780 |
+
* position of the dropdown.
|
2781 |
+
*/
|
2782 |
+
positionDropdown: function() {
|
2783 |
+
var $control = this.$control;
|
2784 |
+
var offset = this.settings.dropdownParent === 'body' ? $control.offset() : $control.position();
|
2785 |
+
offset.top += $control.outerHeight(true);
|
2786 |
+
|
2787 |
+
this.$dropdown.css({
|
2788 |
+
width : $control.outerWidth(),
|
2789 |
+
top : offset.top,
|
2790 |
+
left : offset.left
|
2791 |
+
});
|
2792 |
+
},
|
2793 |
+
|
2794 |
+
/**
|
2795 |
+
* Resets / clears all selected items
|
2796 |
+
* from the control.
|
2797 |
+
*
|
2798 |
+
* @param {boolean} silent
|
2799 |
+
*/
|
2800 |
+
clear: function(silent) {
|
2801 |
+
var self = this;
|
2802 |
+
|
2803 |
+
if (!self.items.length) return;
|
2804 |
+
self.$control.children(':not(input)').remove();
|
2805 |
+
self.items = [];
|
2806 |
+
self.lastQuery = null;
|
2807 |
+
self.setCaret(0);
|
2808 |
+
self.setActiveItem(null);
|
2809 |
+
self.updatePlaceholder();
|
2810 |
+
self.updateOriginalInput({silent: silent});
|
2811 |
+
self.refreshState();
|
2812 |
+
self.showInput();
|
2813 |
+
self.trigger('clear');
|
2814 |
+
},
|
2815 |
+
|
2816 |
+
/**
|
2817 |
+
* A helper method for inserting an element
|
2818 |
+
* at the current caret position.
|
2819 |
+
*
|
2820 |
+
* @param {object} $el
|
2821 |
+
*/
|
2822 |
+
insertAtCaret: function($el) {
|
2823 |
+
var caret = Math.min(this.caretPos, this.items.length);
|
2824 |
+
if (caret === 0) {
|
2825 |
+
this.$control.prepend($el);
|
2826 |
+
} else {
|
2827 |
+
$(this.$control[0].childNodes[caret]).before($el);
|
2828 |
+
}
|
2829 |
+
this.setCaret(caret + 1);
|
2830 |
+
},
|
2831 |
+
|
2832 |
+
/**
|
2833 |
+
* Removes the current selected item(s).
|
2834 |
+
*
|
2835 |
+
* @param {object} e (optional)
|
2836 |
+
* @returns {boolean}
|
2837 |
+
*/
|
2838 |
+
deleteSelection: function(e) {
|
2839 |
+
var i, n, direction, selection, values, caret, option_select, $option_select, $tail;
|
2840 |
+
var self = this;
|
2841 |
+
|
2842 |
+
direction = (e && e.keyCode === KEY_BACKSPACE) ? -1 : 1;
|
2843 |
+
selection = getSelection(self.$control_input[0]);
|
2844 |
+
|
2845 |
+
if (self.$activeOption && !self.settings.hideSelected) {
|
2846 |
+
option_select = self.getAdjacentOption(self.$activeOption, -1).attr('data-value');
|
2847 |
+
}
|
2848 |
+
|
2849 |
+
// determine items that will be removed
|
2850 |
+
values = [];
|
2851 |
+
|
2852 |
+
if (self.$activeItems.length) {
|
2853 |
+
$tail = self.$control.children('.active:' + (direction > 0 ? 'last' : 'first'));
|
2854 |
+
caret = self.$control.children(':not(input)').index($tail);
|
2855 |
+
if (direction > 0) { caret++; }
|
2856 |
+
|
2857 |
+
for (i = 0, n = self.$activeItems.length; i < n; i++) {
|
2858 |
+
values.push($(self.$activeItems[i]).attr('data-value'));
|
2859 |
+
}
|
2860 |
+
if (e) {
|
2861 |
+
e.preventDefault();
|
2862 |
+
e.stopPropagation();
|
2863 |
+
}
|
2864 |
+
} else if ((self.isFocused || self.settings.mode === 'single') && self.items.length) {
|
2865 |
+
if (direction < 0 && selection.start === 0 && selection.length === 0) {
|
2866 |
+
values.push(self.items[self.caretPos - 1]);
|
2867 |
+
} else if (direction > 0 && selection.start === self.$control_input.val().length) {
|
2868 |
+
values.push(self.items[self.caretPos]);
|
2869 |
+
}
|
2870 |
+
}
|
2871 |
+
|
2872 |
+
// allow the callback to abort
|
2873 |
+
if (!values.length || (typeof self.settings.onDelete === 'function' && self.settings.onDelete.apply(self, [values]) === false)) {
|
2874 |
+
return false;
|
2875 |
+
}
|
2876 |
+
|
2877 |
+
// perform removal
|
2878 |
+
if (typeof caret !== 'undefined') {
|
2879 |
+
self.setCaret(caret);
|
2880 |
+
}
|
2881 |
+
while (values.length) {
|
2882 |
+
self.removeItem(values.pop());
|
2883 |
+
}
|
2884 |
+
|
2885 |
+
self.showInput();
|
2886 |
+
self.positionDropdown();
|
2887 |
+
self.refreshOptions(true);
|
2888 |
+
|
2889 |
+
// select previous option
|
2890 |
+
if (option_select) {
|
2891 |
+
$option_select = self.getOption(option_select);
|
2892 |
+
if ($option_select.length) {
|
2893 |
+
self.setActiveOption($option_select);
|
2894 |
+
}
|
2895 |
+
}
|
2896 |
+
|
2897 |
+
return true;
|
2898 |
+
},
|
2899 |
+
|
2900 |
+
/**
|
2901 |
+
* Selects the previous / next item (depending
|
2902 |
+
* on the `direction` argument).
|
2903 |
+
*
|
2904 |
+
* > 0 - right
|
2905 |
+
* < 0 - left
|
2906 |
+
*
|
2907 |
+
* @param {int} direction
|
2908 |
+
* @param {object} e (optional)
|
2909 |
+
*/
|
2910 |
+
advanceSelection: function(direction, e) {
|
2911 |
+
var tail, selection, idx, valueLength, cursorAtEdge, $tail;
|
2912 |
+
var self = this;
|
2913 |
+
|
2914 |
+
if (direction === 0) return;
|
2915 |
+
if (self.rtl) direction *= -1;
|
2916 |
+
|
2917 |
+
tail = direction > 0 ? 'last' : 'first';
|
2918 |
+
selection = getSelection(self.$control_input[0]);
|
2919 |
+
|
2920 |
+
if (self.isFocused && !self.isInputHidden) {
|
2921 |
+
valueLength = self.$control_input.val().length;
|
2922 |
+
cursorAtEdge = direction < 0
|
2923 |
+
? selection.start === 0 && selection.length === 0
|
2924 |
+
: selection.start === valueLength;
|
2925 |
+
|
2926 |
+
if (cursorAtEdge && !valueLength) {
|
2927 |
+
self.advanceCaret(direction, e);
|
2928 |
+
}
|
2929 |
+
} else {
|
2930 |
+
$tail = self.$control.children('.active:' + tail);
|
2931 |
+
if ($tail.length) {
|
2932 |
+
idx = self.$control.children(':not(input)').index($tail);
|
2933 |
+
self.setActiveItem(null);
|
2934 |
+
self.setCaret(direction > 0 ? idx + 1 : idx);
|
2935 |
+
}
|
2936 |
+
}
|
2937 |
+
},
|
2938 |
+
|
2939 |
+
/**
|
2940 |
+
* Moves the caret left / right.
|
2941 |
+
*
|
2942 |
+
* @param {int} direction
|
2943 |
+
* @param {object} e (optional)
|
2944 |
+
*/
|
2945 |
+
advanceCaret: function(direction, e) {
|
2946 |
+
var self = this, fn, $adj;
|
2947 |
+
|
2948 |
+
if (direction === 0) return;
|
2949 |
+
|
2950 |
+
fn = direction > 0 ? 'next' : 'prev';
|
2951 |
+
if (self.isShiftDown) {
|
2952 |
+
$adj = self.$control_input[fn]();
|
2953 |
+
if ($adj.length) {
|
2954 |
+
self.hideInput();
|
2955 |
+
self.setActiveItem($adj);
|
2956 |
+
e && e.preventDefault();
|
2957 |
+
}
|
2958 |
+
} else {
|
2959 |
+
self.setCaret(self.caretPos + direction);
|
2960 |
+
}
|
2961 |
+
},
|
2962 |
+
|
2963 |
+
/**
|
2964 |
+
* Moves the caret to the specified index.
|
2965 |
+
*
|
2966 |
+
* @param {int} i
|
2967 |
+
*/
|
2968 |
+
setCaret: function(i) {
|
2969 |
+
var self = this;
|
2970 |
+
|
2971 |
+
if (self.settings.mode === 'single') {
|
2972 |
+
i = self.items.length;
|
2973 |
+
} else {
|
2974 |
+
i = Math.max(0, Math.min(self.items.length, i));
|
2975 |
+
}
|
2976 |
+
|
2977 |
+
if(!self.isPending) {
|
2978 |
+
// the input must be moved by leaving it in place and moving the
|
2979 |
+
// siblings, due to the fact that focus cannot be restored once lost
|
2980 |
+
// on mobile webkit devices
|
2981 |
+
var j, n, fn, $children, $child;
|
2982 |
+
$children = self.$control.children(':not(input)');
|
2983 |
+
for (j = 0, n = $children.length; j < n; j++) {
|
2984 |
+
$child = $($children[j]).detach();
|
2985 |
+
if (j < i) {
|
2986 |
+
self.$control_input.before($child);
|
2987 |
+
} else {
|
2988 |
+
self.$control.append($child);
|
2989 |
+
}
|
2990 |
+
}
|
2991 |
+
}
|
2992 |
+
|
2993 |
+
self.caretPos = i;
|
2994 |
+
},
|
2995 |
+
|
2996 |
+
/**
|
2997 |
+
* Disables user input on the control. Used while
|
2998 |
+
* items are being asynchronously created.
|
2999 |
+
*/
|
3000 |
+
lock: function() {
|
3001 |
+
this.close();
|
3002 |
+
this.isLocked = true;
|
3003 |
+
this.refreshState();
|
3004 |
+
},
|
3005 |
+
|
3006 |
+
/**
|
3007 |
+
* Re-enables user input on the control.
|
3008 |
+
*/
|
3009 |
+
unlock: function() {
|
3010 |
+
this.isLocked = false;
|
3011 |
+
this.refreshState();
|
3012 |
+
},
|
3013 |
+
|
3014 |
+
/**
|
3015 |
+
* Disables user input on the control completely.
|
3016 |
+
* While disabled, it cannot receive focus.
|
3017 |
+
*/
|
3018 |
+
disable: function() {
|
3019 |
+
var self = this;
|
3020 |
+
self.$input.prop('disabled', true);
|
3021 |
+
self.$control_input.prop('disabled', true).prop('tabindex', -1);
|
3022 |
+
self.isDisabled = true;
|
3023 |
+
self.lock();
|
3024 |
+
},
|
3025 |
+
|
3026 |
+
/**
|
3027 |
+
* Enables the control so that it can respond
|
3028 |
+
* to focus and user input.
|
3029 |
+
*/
|
3030 |
+
enable: function() {
|
3031 |
+
var self = this;
|
3032 |
+
self.$input.prop('disabled', false);
|
3033 |
+
self.$control_input.prop('disabled', false).prop('tabindex', self.tabIndex);
|
3034 |
+
self.isDisabled = false;
|
3035 |
+
self.unlock();
|
3036 |
+
},
|
3037 |
+
|
3038 |
+
/**
|
3039 |
+
* Completely destroys the control and
|
3040 |
+
* unbinds all event listeners so that it can
|
3041 |
+
* be garbage collected.
|
3042 |
+
*/
|
3043 |
+
destroy: function() {
|
3044 |
+
var self = this;
|
3045 |
+
var eventNS = self.eventNS;
|
3046 |
+
var revertSettings = self.revertSettings;
|
3047 |
+
|
3048 |
+
self.trigger('destroy');
|
3049 |
+
self.off();
|
3050 |
+
self.$wrapper.remove();
|
3051 |
+
self.$dropdown.remove();
|
3052 |
+
|
3053 |
+
self.$input
|
3054 |
+
.html('')
|
3055 |
+
.append(revertSettings.$children)
|
3056 |
+
.removeAttr('tabindex')
|
3057 |
+
.removeClass('selectized')
|
3058 |
+
.attr({tabindex: revertSettings.tabindex})
|
3059 |
+
.show();
|
3060 |
+
|
3061 |
+
self.$control_input.removeData('grow');
|
3062 |
+
self.$input.removeData('selectize');
|
3063 |
+
|
3064 |
+
$(window).off(eventNS);
|
3065 |
+
$(document).off(eventNS);
|
3066 |
+
$(document.body).off(eventNS);
|
3067 |
+
|
3068 |
+
delete self.$input[0].selectize;
|
3069 |
+
},
|
3070 |
+
|
3071 |
+
/**
|
3072 |
+
* A helper method for rendering "item" and
|
3073 |
+
* "option" templates, given the data.
|
3074 |
+
*
|
3075 |
+
* @param {string} templateName
|
3076 |
+
* @param {object} data
|
3077 |
+
* @returns {string}
|
3078 |
+
*/
|
3079 |
+
render: function(templateName, data) {
|
3080 |
+
var value, id, label;
|
3081 |
+
var html = '';
|
3082 |
+
var cache = false;
|
3083 |
+
var self = this;
|
3084 |
+
var regex_tag = /^[\t \r\n]*<([a-z][a-z0-9\-_]*(?:\:[a-z][a-z0-9\-_]*)?)/i;
|
3085 |
+
|
3086 |
+
if (templateName === 'option' || templateName === 'item') {
|
3087 |
+
value = hash_key(data[self.settings.valueField]);
|
3088 |
+
cache = !!value;
|
3089 |
+
}
|
3090 |
+
|
3091 |
+
// pull markup from cache if it exists
|
3092 |
+
if (cache) {
|
3093 |
+
if (!isset(self.renderCache[templateName])) {
|
3094 |
+
self.renderCache[templateName] = {};
|
3095 |
+
}
|
3096 |
+
if (self.renderCache[templateName].hasOwnProperty(value)) {
|
3097 |
+
return self.renderCache[templateName][value];
|
3098 |
+
}
|
3099 |
+
}
|
3100 |
+
|
3101 |
+
// render markup
|
3102 |
+
html = self.settings.render[templateName].apply(this, [data, escape_html]);
|
3103 |
+
|
3104 |
+
// add mandatory attributes
|
3105 |
+
if (templateName === 'option' || templateName === 'option_create') {
|
3106 |
+
html = html.replace(regex_tag, '<$1 data-selectable');
|
3107 |
+
}
|
3108 |
+
if (templateName === 'optgroup') {
|
3109 |
+
id = data[self.settings.optgroupValueField] || '';
|
3110 |
+
html = html.replace(regex_tag, '<$1 data-group="' + escape_replace(escape_html(id)) + '"');
|
3111 |
+
}
|
3112 |
+
if (templateName === 'option' || templateName === 'item') {
|
3113 |
+
html = html.replace(regex_tag, '<$1 data-value="' + escape_replace(escape_html(value || '')) + '"');
|
3114 |
+
}
|
3115 |
+
|
3116 |
+
// update cache
|
3117 |
+
if (cache) {
|
3118 |
+
self.renderCache[templateName][value] = html;
|
3119 |
+
}
|
3120 |
+
|
3121 |
+
return html;
|
3122 |
+
},
|
3123 |
+
|
3124 |
+
/**
|
3125 |
+
* Clears the render cache for a template. If
|
3126 |
+
* no template is given, clears all render
|
3127 |
+
* caches.
|
3128 |
+
*
|
3129 |
+
* @param {string} templateName
|
3130 |
+
*/
|
3131 |
+
clearCache: function(templateName) {
|
3132 |
+
var self = this;
|
3133 |
+
if (typeof templateName === 'undefined') {
|
3134 |
+
self.renderCache = {};
|
3135 |
+
} else {
|
3136 |
+
delete self.renderCache[templateName];
|
3137 |
+
}
|
3138 |
+
},
|
3139 |
+
|
3140 |
+
/**
|
3141 |
+
* Determines whether or not to display the
|
3142 |
+
* create item prompt, given a user input.
|
3143 |
+
*
|
3144 |
+
* @param {string} input
|
3145 |
+
* @return {boolean}
|
3146 |
+
*/
|
3147 |
+
canCreate: function(input) {
|
3148 |
+
var self = this;
|
3149 |
+
if (!self.settings.create) return false;
|
3150 |
+
var filter = self.settings.createFilter;
|
3151 |
+
return input.length
|
3152 |
+
&& (typeof filter !== 'function' || filter.apply(self, [input]))
|
3153 |
+
&& (typeof filter !== 'string' || new RegExp(filter).test(input))
|
3154 |
+
&& (!(filter instanceof RegExp) || filter.test(input));
|
3155 |
+
}
|
3156 |
+
|
3157 |
+
});
|
3158 |
+
|
3159 |
+
|
3160 |
+
Selectize.count = 0;
|
3161 |
+
Selectize.defaults = {
|
3162 |
+
options: [],
|
3163 |
+
optgroups: [],
|
3164 |
+
|
3165 |
+
plugins: [],
|
3166 |
+
delimiter: ',',
|
3167 |
+
splitOn: null, // regexp or string for splitting up values from a paste command
|
3168 |
+
persist: true,
|
3169 |
+
diacritics: true,
|
3170 |
+
create: false,
|
3171 |
+
createOnBlur: false,
|
3172 |
+
createFilter: null,
|
3173 |
+
highlight: true,
|
3174 |
+
openOnFocus: true,
|
3175 |
+
maxOptions: 1000,
|
3176 |
+
maxItems: null,
|
3177 |
+
hideSelected: null,
|
3178 |
+
addPrecedence: false,
|
3179 |
+
selectOnTab: false,
|
3180 |
+
preload: false,
|
3181 |
+
allowEmptyOption: false,
|
3182 |
+
closeAfterSelect: false,
|
3183 |
+
|
3184 |
+
scrollDuration: 60,
|
3185 |
+
loadThrottle: 300,
|
3186 |
+
loadingClass: 'loading',
|
3187 |
+
|
3188 |
+
dataAttr: 'data-data',
|
3189 |
+
optgroupField: 'optgroup',
|
3190 |
+
valueField: 'value',
|
3191 |
+
labelField: 'text',
|
3192 |
+
optgroupLabelField: 'label',
|
3193 |
+
optgroupValueField: 'value',
|
3194 |
+
lockOptgroupOrder: false,
|
3195 |
+
|
3196 |
+
sortField: '$order',
|
3197 |
+
searchField: ['text'],
|
3198 |
+
searchConjunction: 'and',
|
3199 |
+
|
3200 |
+
mode: null,
|
3201 |
+
wrapperClass: 'selectize-control',
|
3202 |
+
inputClass: 'selectize-input',
|
3203 |
+
dropdownClass: 'selectize-dropdown',
|
3204 |
+
dropdownContentClass: 'selectize-dropdown-content',
|
3205 |
+
|
3206 |
+
dropdownParent: null,
|
3207 |
+
|
3208 |
+
copyClassesToDropdown: true,
|
3209 |
+
|
3210 |
+
/*
|
3211 |
+
load : null, // function(query, callback) { ... }
|
3212 |
+
score : null, // function(search) { ... }
|
3213 |
+
onInitialize : null, // function() { ... }
|
3214 |
+
onChange : null, // function(value) { ... }
|
3215 |
+
onItemAdd : null, // function(value, $item) { ... }
|
3216 |
+
onItemRemove : null, // function(value) { ... }
|
3217 |
+
onClear : null, // function() { ... }
|
3218 |
+
onOptionAdd : null, // function(value, data) { ... }
|
3219 |
+
onOptionRemove : null, // function(value) { ... }
|
3220 |
+
onOptionClear : null, // function() { ... }
|
3221 |
+
onOptionGroupAdd : null, // function(id, data) { ... }
|
3222 |
+
onOptionGroupRemove : null, // function(id) { ... }
|
3223 |
+
onOptionGroupClear : null, // function() { ... }
|
3224 |
+
onDropdownOpen : null, // function($dropdown) { ... }
|
3225 |
+
onDropdownClose : null, // function($dropdown) { ... }
|
3226 |
+
onType : null, // function(str) { ... }
|
3227 |
+
onDelete : null, // function(values) { ... }
|
3228 |
+
*/
|
3229 |
+
|
3230 |
+
render: {
|
3231 |
+
/*
|
3232 |
+
item: null,
|
3233 |
+
optgroup: null,
|
3234 |
+
optgroup_header: null,
|
3235 |
+
option: null,
|
3236 |
+
option_create: null
|
3237 |
+
*/
|
3238 |
+
}
|
3239 |
+
};
|
3240 |
+
|
3241 |
+
|
3242 |
+
$.fn.selectize = function(settings_user) {
|
3243 |
+
var defaults = $.fn.selectize.defaults;
|
3244 |
+
var settings = $.extend({}, defaults, settings_user);
|
3245 |
+
var attr_data = settings.dataAttr;
|
3246 |
+
var field_label = settings.labelField;
|
3247 |
+
var field_value = settings.valueField;
|
3248 |
+
var field_optgroup = settings.optgroupField;
|
3249 |
+
var field_optgroup_label = settings.optgroupLabelField;
|
3250 |
+
var field_optgroup_value = settings.optgroupValueField;
|
3251 |
+
|
3252 |
+
/**
|
3253 |
+
* Initializes selectize from a <input type="text"> element.
|
3254 |
+
*
|
3255 |
+
* @param {object} $input
|
3256 |
+
* @param {object} settings_element
|
3257 |
+
*/
|
3258 |
+
var init_textbox = function($input, settings_element) {
|
3259 |
+
var i, n, values, option;
|
3260 |
+
|
3261 |
+
var data_raw = $input.attr(attr_data);
|
3262 |
+
|
3263 |
+
if (!data_raw) {
|
3264 |
+
var value = $.trim($input.val() || '');
|
3265 |
+
if (!settings.allowEmptyOption && !value.length) return;
|
3266 |
+
values = value.split(settings.delimiter);
|
3267 |
+
for (i = 0, n = values.length; i < n; i++) {
|
3268 |
+
option = {};
|
3269 |
+
option[field_label] = values[i];
|
3270 |
+
option[field_value] = values[i];
|
3271 |
+
settings_element.options.push(option);
|
3272 |
+
}
|
3273 |
+
settings_element.items = values;
|
3274 |
+
} else {
|
3275 |
+
settings_element.options = JSON.parse(data_raw);
|
3276 |
+
for (i = 0, n = settings_element.options.length; i < n; i++) {
|
3277 |
+
settings_element.items.push(settings_element.options[i][field_value]);
|
3278 |
+
}
|
3279 |
+
}
|
3280 |
+
};
|
3281 |
+
|
3282 |
+
/**
|
3283 |
+
* Initializes selectize from a <select> element.
|
3284 |
+
*
|
3285 |
+
* @param {object} $input
|
3286 |
+
* @param {object} settings_element
|
3287 |
+
*/
|
3288 |
+
var init_select = function($input, settings_element) {
|
3289 |
+
var i, n, tagName, $children, order = 0;
|
3290 |
+
var options = settings_element.options;
|
3291 |
+
var optionsMap = {};
|
3292 |
+
|
3293 |
+
var readData = function($el) {
|
3294 |
+
var data = attr_data && $el.attr(attr_data);
|
3295 |
+
if (typeof data === 'string' && data.length) {
|
3296 |
+
return JSON.parse(data);
|
3297 |
+
}
|
3298 |
+
return null;
|
3299 |
+
};
|
3300 |
+
|
3301 |
+
var addOption = function($option, group) {
|
3302 |
+
$option = $($option);
|
3303 |
+
|
3304 |
+
var value = hash_key($option.attr('value'));
|
3305 |
+
if (!value && !settings.allowEmptyOption) return;
|
3306 |
+
|
3307 |
+
// if the option already exists, it's probably been
|
3308 |
+
// duplicated in another optgroup. in this case, push
|
3309 |
+
// the current group to the "optgroup" property on the
|
3310 |
+
// existing option so that it's rendered in both places.
|
3311 |
+
if (optionsMap.hasOwnProperty(value)) {
|
3312 |
+
if (group) {
|
3313 |
+
var arr = optionsMap[value][field_optgroup];
|
3314 |
+
if (!arr) {
|
3315 |
+
optionsMap[value][field_optgroup] = group;
|
3316 |
+
} else if (!$.isArray(arr)) {
|
3317 |
+
optionsMap[value][field_optgroup] = [arr, group];
|
3318 |
+
} else {
|
3319 |
+
arr.push(group);
|
3320 |
+
}
|
3321 |
+
}
|
3322 |
+
return;
|
3323 |
+
}
|
3324 |
+
|
3325 |
+
var option = readData($option) || {};
|
3326 |
+
option[field_label] = option[field_label] || $option.text();
|
3327 |
+
option[field_value] = option[field_value] || value;
|
3328 |
+
option[field_optgroup] = option[field_optgroup] || group;
|
3329 |
+
|
3330 |
+
optionsMap[value] = option;
|
3331 |
+
options.push(option);
|
3332 |
+
|
3333 |
+
if ($option.is(':selected')) {
|
3334 |
+
settings_element.items.push(value);
|
3335 |
+
}
|
3336 |
+
};
|
3337 |
+
|
3338 |
+
var addGroup = function($optgroup) {
|
3339 |
+
var i, n, id, optgroup, $options;
|
3340 |
+
|
3341 |
+
$optgroup = $($optgroup);
|
3342 |
+
id = $optgroup.attr('label');
|
3343 |
+
|
3344 |
+
if (id) {
|
3345 |
+
optgroup = readData($optgroup) || {};
|
3346 |
+
optgroup[field_optgroup_label] = id;
|
3347 |
+
optgroup[field_optgroup_value] = id;
|
3348 |
+
settings_element.optgroups.push(optgroup);
|
3349 |
+
}
|
3350 |
+
|
3351 |
+
$options = $('option', $optgroup);
|
3352 |
+
for (i = 0, n = $options.length; i < n; i++) {
|
3353 |
+
addOption($options[i], id);
|
3354 |
+
}
|
3355 |
+
};
|
3356 |
+
|
3357 |
+
settings_element.maxItems = $input.attr('multiple') ? null : 1;
|
3358 |
+
|
3359 |
+
$children = $input.children();
|
3360 |
+
for (i = 0, n = $children.length; i < n; i++) {
|
3361 |
+
tagName = $children[i].tagName.toLowerCase();
|
3362 |
+
if (tagName === 'optgroup') {
|
3363 |
+
addGroup($children[i]);
|
3364 |
+
} else if (tagName === 'option') {
|
3365 |
+
addOption($children[i]);
|
3366 |
+
}
|
3367 |
+
}
|
3368 |
+
};
|
3369 |
+
|
3370 |
+
return this.each(function() {
|
3371 |
+
if (this.selectize) return;
|
3372 |
+
|
3373 |
+
var instance;
|
3374 |
+
var $input = $(this);
|
3375 |
+
var tag_name = this.tagName.toLowerCase();
|
3376 |
+
var placeholder = $input.attr('placeholder') || $input.attr('data-placeholder');
|
3377 |
+
if (!placeholder && !settings.allowEmptyOption) {
|
3378 |
+
placeholder = $input.children('option[value=""]').text();
|
3379 |
+
}
|
3380 |
+
|
3381 |
+
var settings_element = {
|
3382 |
+
'placeholder' : placeholder,
|
3383 |
+
'options' : [],
|
3384 |
+
'optgroups' : [],
|
3385 |
+
'items' : []
|
3386 |
+
};
|
3387 |
+
|
3388 |
+
if (tag_name === 'select') {
|
3389 |
+
init_select($input, settings_element);
|
3390 |
+
} else {
|
3391 |
+
init_textbox($input, settings_element);
|
3392 |
+
}
|
3393 |
+
|
3394 |
+
instance = new Selectize($input, $.extend(true, {}, defaults, settings_element, settings_user));
|
3395 |
+
});
|
3396 |
+
};
|
3397 |
+
|
3398 |
+
$.fn.selectize.defaults = Selectize.defaults;
|
3399 |
+
$.fn.selectize.support = {
|
3400 |
+
validity: SUPPORTS_VALIDITY_API
|
3401 |
+
};
|
3402 |
+
|
3403 |
+
|
3404 |
+
Selectize.define('drag_drop', function(options) {
|
3405 |
+
if (!$.fn.sortable) throw new Error('The "drag_drop" plugin requires jQuery UI "sortable".');
|
3406 |
+
if (this.settings.mode !== 'multi') return;
|
3407 |
+
var self = this;
|
3408 |
+
|
3409 |
+
self.lock = (function() {
|
3410 |
+
var original = self.lock;
|
3411 |
+
return function() {
|
3412 |
+
var sortable = self.$control.data('sortable');
|
3413 |
+
if (sortable) sortable.disable();
|
3414 |
+
return original.apply(self, arguments);
|
3415 |
+
};
|
3416 |
+
})();
|
3417 |
+
|
3418 |
+
self.unlock = (function() {
|
3419 |
+
var original = self.unlock;
|
3420 |
+
return function() {
|
3421 |
+
var sortable = self.$control.data('sortable');
|
3422 |
+
if (sortable) sortable.enable();
|
3423 |
+
return original.apply(self, arguments);
|
3424 |
+
};
|
3425 |
+
})();
|
3426 |
+
|
3427 |
+
self.setup = (function() {
|
3428 |
+
var original = self.setup;
|
3429 |
+
return function() {
|
3430 |
+
original.apply(this, arguments);
|
3431 |
+
|
3432 |
+
var $control = self.$control.sortable({
|
3433 |
+
items: '[data-value]',
|
3434 |
+
forcePlaceholderSize: true,
|
3435 |
+
disabled: self.isLocked,
|
3436 |
+
start: function(e, ui) {
|
3437 |
+
ui.placeholder.css('width', ui.helper.css('width'));
|
3438 |
+
$control.css({overflow: 'visible'});
|
3439 |
+
},
|
3440 |
+
stop: function() {
|
3441 |
+
$control.css({overflow: 'hidden'});
|
3442 |
+
var active = self.$activeItems ? self.$activeItems.slice() : null;
|
3443 |
+
var values = [];
|
3444 |
+
$control.children('[data-value]').each(function() {
|
3445 |
+
values.push($(this).attr('data-value'));
|
3446 |
+
});
|
3447 |
+
self.setValue(values);
|
3448 |
+
self.setActiveItem(active);
|
3449 |
+
}
|
3450 |
+
});
|
3451 |
+
};
|
3452 |
+
})();
|
3453 |
+
|
3454 |
+
});
|
3455 |
+
|
3456 |
+
Selectize.define('dropdown_header', function(options) {
|
3457 |
+
var self = this;
|
3458 |
+
|
3459 |
+
options = $.extend({
|
3460 |
+
title : 'Untitled',
|
3461 |
+
headerClass : 'selectize-dropdown-header',
|
3462 |
+
titleRowClass : 'selectize-dropdown-header-title',
|
3463 |
+
labelClass : 'selectize-dropdown-header-label',
|
3464 |
+
closeClass : 'selectize-dropdown-header-close',
|
3465 |
+
|
3466 |
+
html: function(data) {
|
3467 |
+
return (
|
3468 |
+
'<div class="' + data.headerClass + '">' +
|
3469 |
+
'<div class="' + data.titleRowClass + '">' +
|
3470 |
+
'<span class="' + data.labelClass + '">' + data.title + '</span>' +
|
3471 |
+
'<a href="javascript:void(0)" class="' + data.closeClass + '">×</a>' +
|
3472 |
+
'</div>' +
|
3473 |
+
'</div>'
|
3474 |
+
);
|
3475 |
+
}
|
3476 |
+
}, options);
|
3477 |
+
|
3478 |
+
self.setup = (function() {
|
3479 |
+
var original = self.setup;
|
3480 |
+
return function() {
|
3481 |
+
original.apply(self, arguments);
|
3482 |
+
self.$dropdown_header = $(options.html(options));
|
3483 |
+
self.$dropdown.prepend(self.$dropdown_header);
|
3484 |
+
};
|
3485 |
+
})();
|
3486 |
+
|
3487 |
+
});
|
3488 |
+
|
3489 |
+
Selectize.define('optgroup_columns', function(options) {
|
3490 |
+
var self = this;
|
3491 |
+
|
3492 |
+
options = $.extend({
|
3493 |
+
equalizeWidth : true,
|
3494 |
+
equalizeHeight : true
|
3495 |
+
}, options);
|
3496 |
+
|
3497 |
+
this.getAdjacentOption = function($option, direction) {
|
3498 |
+
var $options = $option.closest('[data-group]').find('[data-selectable]');
|
3499 |
+
var index = $options.index($option) + direction;
|
3500 |
+
|
3501 |
+
return index >= 0 && index < $options.length ? $options.eq(index) : $();
|
3502 |
+
};
|
3503 |
+
|
3504 |
+
this.onKeyDown = (function() {
|
3505 |
+
var original = self.onKeyDown;
|
3506 |
+
return function(e) {
|
3507 |
+
var index, $option, $options, $optgroup;
|
3508 |
+
|
3509 |
+
if (this.isOpen && (e.keyCode === KEY_LEFT || e.keyCode === KEY_RIGHT)) {
|
3510 |
+
self.ignoreHover = true;
|
3511 |
+
$optgroup = this.$activeOption.closest('[data-group]');
|
3512 |
+
index = $optgroup.find('[data-selectable]').index(this.$activeOption);
|
3513 |
+
|
3514 |
+
if(e.keyCode === KEY_LEFT) {
|
3515 |
+
$optgroup = $optgroup.prev('[data-group]');
|
3516 |
+
} else {
|
3517 |
+
$optgroup = $optgroup.next('[data-group]');
|
3518 |
+
}
|
3519 |
+
|
3520 |
+
$options = $optgroup.find('[data-selectable]');
|
3521 |
+
$option = $options.eq(Math.min($options.length - 1, index));
|
3522 |
+
if ($option.length) {
|
3523 |
+
this.setActiveOption($option);
|
3524 |
+
}
|
3525 |
+
return;
|
3526 |
+
}
|
3527 |
+
|
3528 |
+
return original.apply(this, arguments);
|
3529 |
+
};
|
3530 |
+
})();
|
3531 |
+
|
3532 |
+
var getScrollbarWidth = function() {
|
3533 |
+
var div;
|
3534 |
+
var width = getScrollbarWidth.width;
|
3535 |
+
var doc = document;
|
3536 |
+
|
3537 |
+
if (typeof width === 'undefined') {
|
3538 |
+
div = doc.createElement('div');
|
3539 |
+
div.innerHTML = '<div style="width:50px;height:50px;position:absolute;left:-50px;top:-50px;overflow:auto;"><div style="width:1px;height:100px;"></div></div>';
|
3540 |
+
div = div.firstChild;
|
3541 |
+
doc.body.appendChild(div);
|
3542 |
+
width = getScrollbarWidth.width = div.offsetWidth - div.clientWidth;
|
3543 |
+
doc.body.removeChild(div);
|
3544 |
+
}
|
3545 |
+
return width;
|
3546 |
+
};
|
3547 |
+
|
3548 |
+
var equalizeSizes = function() {
|
3549 |
+
var i, n, height_max, width, width_last, width_parent, $optgroups;
|
3550 |
+
|
3551 |
+
$optgroups = $('[data-group]', self.$dropdown_content);
|
3552 |
+
n = $optgroups.length;
|
3553 |
+
if (!n || !self.$dropdown_content.width()) return;
|
3554 |
+
|
3555 |
+
if (options.equalizeHeight) {
|
3556 |
+
height_max = 0;
|
3557 |
+
for (i = 0; i < n; i++) {
|
3558 |
+
height_max = Math.max(height_max, $optgroups.eq(i).height());
|
3559 |
+
}
|
3560 |
+
$optgroups.css({height: height_max});
|
3561 |
+
}
|
3562 |
+
|
3563 |
+
if (options.equalizeWidth) {
|
3564 |
+
width_parent = self.$dropdown_content.innerWidth() - getScrollbarWidth();
|
3565 |
+
width = Math.round(width_parent / n);
|
3566 |
+
$optgroups.css({width: width});
|
3567 |
+
if (n > 1) {
|
3568 |
+
width_last = width_parent - width * (n - 1);
|
3569 |
+
$optgroups.eq(n - 1).css({width: width_last});
|
3570 |
+
}
|
3571 |
+
}
|
3572 |
+
};
|
3573 |
+
|
3574 |
+
if (options.equalizeHeight || options.equalizeWidth) {
|
3575 |
+
hook.after(this, 'positionDropdown', equalizeSizes);
|
3576 |
+
hook.after(this, 'refreshOptions', equalizeSizes);
|
3577 |
+
}
|
3578 |
+
|
3579 |
+
|
3580 |
+
});
|
3581 |
+
|
3582 |
+
Selectize.define('remove_button', function(options) {
|
3583 |
+
if (this.settings.mode === 'single') return;
|
3584 |
+
|
3585 |
+
options = $.extend({
|
3586 |
+
label : '×',
|
3587 |
+
title : 'Remove',
|
3588 |
+
className : 'remove',
|
3589 |
+
append : true
|
3590 |
+
}, options);
|
3591 |
+
|
3592 |
+
var self = this;
|
3593 |
+
var html = '<a href="javascript:void(0)" class="' + options.className + '" tabindex="-1" title="' + escape_html(options.title) + '">' + options.label + '</a>';
|
3594 |
+
|
3595 |
+
/**
|
3596 |
+
* Appends an element as a child (with raw HTML).
|
3597 |
+
*
|
3598 |
+
* @param {string} html_container
|
3599 |
+
* @param {string} html_element
|
3600 |
+
* @return {string}
|
3601 |
+
*/
|
3602 |
+
var append = function(html_container, html_element) {
|
3603 |
+
var pos = html_container.search(/(<\/[^>]+>\s*)$/);
|
3604 |
+
return html_container.substring(0, pos) + html_element + html_container.substring(pos);
|
3605 |
+
};
|
3606 |
+
|
3607 |
+
this.setup = (function() {
|
3608 |
+
var original = self.setup;
|
3609 |
+
return function() {
|
3610 |
+
// override the item rendering method to add the button to each
|
3611 |
+
if (options.append) {
|
3612 |
+
var render_item = self.settings.render.item;
|
3613 |
+
self.settings.render.item = function(data) {
|
3614 |
+
return append(render_item.apply(this, arguments), html);
|
3615 |
+
};
|
3616 |
+
}
|
3617 |
+
|
3618 |
+
original.apply(this, arguments);
|
3619 |
+
|
3620 |
+
// add event listener
|
3621 |
+
this.$control.on('click', '.' + options.className, function(e) {
|
3622 |
+
e.preventDefault();
|
3623 |
+
if (self.isLocked) return;
|
3624 |
+
|
3625 |
+
var $item = $(e.currentTarget).parent();
|
3626 |
+
self.setActiveItem($item);
|
3627 |
+
if (self.deleteSelection()) {
|
3628 |
+
self.setCaret(self.items.length);
|
3629 |
+
}
|
3630 |
+
});
|
3631 |
+
|
3632 |
+
};
|
3633 |
+
})();
|
3634 |
+
|
3635 |
+
});
|
3636 |
+
|
3637 |
+
Selectize.define('restore_on_backspace', function(options) {
|
3638 |
+
var self = this;
|
3639 |
+
|
3640 |
+
options.text = options.text || function(option) {
|
3641 |
+
return option[this.settings.labelField];
|
3642 |
+
};
|
3643 |
+
|
3644 |
+
this.onKeyDown = (function() {
|
3645 |
+
var original = self.onKeyDown;
|
3646 |
+
return function(e) {
|
3647 |
+
var index, option;
|
3648 |
+
if (e.keyCode === KEY_BACKSPACE && this.$control_input.val() === '' && !this.$activeItems.length) {
|
3649 |
+
index = this.caretPos - 1;
|
3650 |
+
if (index >= 0 && index < this.items.length) {
|
3651 |
+
option = this.options[this.items[index]];
|
3652 |
+
if (this.deleteSelection(e)) {
|
3653 |
+
this.setTextboxValue(options.text.apply(this, [option]));
|
3654 |
+
this.refreshOptions(true);
|
3655 |
+
}
|
3656 |
+
e.preventDefault();
|
3657 |
+
return;
|
3658 |
+
}
|
3659 |
+
}
|
3660 |
+
return original.apply(this, arguments);
|
3661 |
+
};
|
3662 |
+
})();
|
3663 |
+
});
|
3664 |
+
|
3665 |
+
|
3666 |
+
return Selectize;
|
3667 |
+
}));
|
inc/custom-controls/controls/select/assets/js/selectize.min.js
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
/*! selectize.js - v0.12.1 | https://github.com/brianreavis/selectize.js | Apache License (v2) */
|
2 |
+
!function(a,b){"function"==typeof define&&define.amd?define("sifter",b):"object"==typeof exports?module.exports=b():a.Sifter=b()}(this,function(){var a=function(a,b){this.items=a,this.settings=b||{diacritics:!0}};a.prototype.tokenize=function(a){if(a=d(String(a||"").toLowerCase()),!a||!a.length)return[];var b,c,f,h,i=[],j=a.split(/ +/);for(b=0,c=j.length;c>b;b++){if(f=e(j[b]),this.settings.diacritics)for(h in g)g.hasOwnProperty(h)&&(f=f.replace(new RegExp(h,"g"),g[h]));i.push({string:j[b],regex:new RegExp(f,"i")})}return i},a.prototype.iterator=function(a,b){var c;c=f(a)?Array.prototype.forEach||function(a){for(var b=0,c=this.length;c>b;b++)a(this[b],b,this)}:function(a){for(var b in this)this.hasOwnProperty(b)&&a(this[b],b,this)},c.apply(a,[b])},a.prototype.getScoreFunction=function(a,b){var c,d,e,f;c=this,a=c.prepareSearch(a,b),e=a.tokens,d=a.options.fields,f=e.length;var g=function(a,b){var c,d;return a?(a=String(a||""),d=a.search(b.regex),-1===d?0:(c=b.string.length/a.length,0===d&&(c+=.5),c)):0},h=function(){var a=d.length;return a?1===a?function(a,b){return g(b[d[0]],a)}:function(b,c){for(var e=0,f=0;a>e;e++)f+=g(c[d[e]],b);return f/a}:function(){return 0}}();return f?1===f?function(a){return h(e[0],a)}:"and"===a.options.conjunction?function(a){for(var b,c=0,d=0;f>c;c++){if(b=h(e[c],a),0>=b)return 0;d+=b}return d/f}:function(a){for(var b=0,c=0;f>b;b++)c+=h(e[b],a);return c/f}:function(){return 0}},a.prototype.getSortFunction=function(a,c){var d,e,f,g,h,i,j,k,l,m,n;if(f=this,a=f.prepareSearch(a,c),n=!a.query&&c.sort_empty||c.sort,l=function(a,b){return"$score"===a?b.score:f.items[b.id][a]},h=[],n)for(d=0,e=n.length;e>d;d++)(a.query||"$score"!==n[d].field)&&h.push(n[d]);if(a.query){for(m=!0,d=0,e=h.length;e>d;d++)if("$score"===h[d].field){m=!1;break}m&&h.unshift({field:"$score",direction:"desc"})}else for(d=0,e=h.length;e>d;d++)if("$score"===h[d].field){h.splice(d,1);break}for(k=[],d=0,e=h.length;e>d;d++)k.push("desc"===h[d].direction?-1:1);return i=h.length,i?1===i?(g=h[0].field,j=k[0],function(a,c){return j*b(l(g,a),l(g,c))}):function(a,c){var d,e,f;for(d=0;i>d;d++)if(f=h[d].field,e=k[d]*b(l(f,a),l(f,c)))return e;return 0}:null},a.prototype.prepareSearch=function(a,b){if("object"==typeof a)return a;b=c({},b);var d=b.fields,e=b.sort,g=b.sort_empty;return d&&!f(d)&&(b.fields=[d]),e&&!f(e)&&(b.sort=[e]),g&&!f(g)&&(b.sort_empty=[g]),{options:b,query:String(a||"").toLowerCase(),tokens:this.tokenize(a),total:0,items:[]}},a.prototype.search=function(a,b){var c,d,e,f,g=this;return d=this.prepareSearch(a,b),b=d.options,a=d.query,f=b.score||g.getScoreFunction(d),a.length?g.iterator(g.items,function(a,e){c=f(a),(b.filter===!1||c>0)&&d.items.push({score:c,id:e})}):g.iterator(g.items,function(a,b){d.items.push({score:1,id:b})}),e=g.getSortFunction(d,b),e&&d.items.sort(e),d.total=d.items.length,"number"==typeof b.limit&&(d.items=d.items.slice(0,b.limit)),d};var b=function(a,b){return"number"==typeof a&&"number"==typeof b?a>b?1:b>a?-1:0:(a=h(String(a||"")),b=h(String(b||"")),a>b?1:b>a?-1:0)},c=function(a){var b,c,d,e;for(b=1,c=arguments.length;c>b;b++)if(e=arguments[b])for(d in e)e.hasOwnProperty(d)&&(a[d]=e[d]);return a},d=function(a){return(a+"").replace(/^\s+|\s+$|/g,"")},e=function(a){return(a+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")},f=Array.isArray||$&&$.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)},g={a:"[aÀÁÂÃÄÅàáâãäåĀāąĄ]",c:"[cÇçćĆčČ]",d:"[dđĐďĎ]",e:"[eÈÉÊËèéêëěĚĒēęĘ]",i:"[iÌÍÎÏìíîïĪī]",l:"[lłŁ]",n:"[nÑñňŇńŃ]",o:"[oÒÓÔÕÕÖØòóôõöøŌō]",r:"[rřŘ]",s:"[sŠšśŚ]",t:"[tťŤ]",u:"[uÙÚÛÜùúûüůŮŪū]",y:"[yŸÿýÝ]",z:"[zŽžżŻźŹ]"},h=function(){var a,b,c,d,e="",f={};for(c in g)if(g.hasOwnProperty(c))for(d=g[c].substring(2,g[c].length-1),e+=d,a=0,b=d.length;b>a;a++)f[d.charAt(a)]=c;var h=new RegExp("["+e+"]","g");return function(a){return a.replace(h,function(a){return f[a]}).toLowerCase()}}();return a}),function(a,b){"function"==typeof define&&define.amd?define("microplugin",b):"object"==typeof exports?module.exports=b():a.MicroPlugin=b()}(this,function(){var a={};a.mixin=function(a){a.plugins={},a.prototype.initializePlugins=function(a){var c,d,e,f=this,g=[];if(f.plugins={names:[],settings:{},requested:{},loaded:{}},b.isArray(a))for(c=0,d=a.length;d>c;c++)"string"==typeof a[c]?g.push(a[c]):(f.plugins.settings[a[c].name]=a[c].options,g.push(a[c].name));else if(a)for(e in a)a.hasOwnProperty(e)&&(f.plugins.settings[e]=a[e],g.push(e));for(;g.length;)f.require(g.shift())},a.prototype.loadPlugin=function(b){var c=this,d=c.plugins,e=a.plugins[b];if(!a.plugins.hasOwnProperty(b))throw new Error('Unable to find "'+b+'" plugin');d.requested[b]=!0,d.loaded[b]=e.fn.apply(c,[c.plugins.settings[b]||{}]),d.names.push(b)},a.prototype.require=function(a){var b=this,c=b.plugins;if(!b.plugins.loaded.hasOwnProperty(a)){if(c.requested[a])throw new Error('Plugin has circular dependency ("'+a+'")');b.loadPlugin(a)}return c.loaded[a]},a.define=function(b,c){a.plugins[b]={name:b,fn:c}}};var b={isArray:Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)}};return a}),function(a,b){"function"==typeof define&&define.amd?define("selectize",["jquery","sifter","microplugin"],b):"object"==typeof exports?module.exports=b(require("jquery"),require("sifter"),require("microplugin")):a.Selectize=b(a.jQuery,a.Sifter,a.MicroPlugin)}(this,function(a,b,c){"use strict";var d=function(a,b){if("string"!=typeof b||b.length){var c="string"==typeof b?new RegExp(b,"i"):b,d=function(a){var b=0;if(3===a.nodeType){var e=a.data.search(c);if(e>=0&&a.data.length>0){var f=a.data.match(c),g=document.createElement("span");g.className="highlight";var h=a.splitText(e),i=(h.splitText(f[0].length),h.cloneNode(!0));g.appendChild(i),h.parentNode.replaceChild(g,h),b=1}}else if(1===a.nodeType&&a.childNodes&&!/(script|style)/i.test(a.tagName))for(var j=0;j<a.childNodes.length;++j)j+=d(a.childNodes[j]);return b};return a.each(function(){d(this)})}},e=function(){};e.prototype={on:function(a,b){this._events=this._events||{},this._events[a]=this._events[a]||[],this._events[a].push(b)},off:function(a,b){var c=arguments.length;return 0===c?delete this._events:1===c?delete this._events[a]:(this._events=this._events||{},void(a in this._events!=!1&&this._events[a].splice(this._events[a].indexOf(b),1)))},trigger:function(a){if(this._events=this._events||{},a in this._events!=!1)for(var b=0;b<this._events[a].length;b++)this._events[a][b].apply(this,Array.prototype.slice.call(arguments,1))}},e.mixin=function(a){for(var b=["on","off","trigger"],c=0;c<b.length;c++)a.prototype[b[c]]=e.prototype[b[c]]};var f=/Mac/.test(navigator.userAgent),g=65,h=13,i=27,j=37,k=38,l=80,m=39,n=40,o=78,p=8,q=46,r=16,s=f?91:17,t=f?18:17,u=9,v=1,w=2,x=!/android/i.test(window.navigator.userAgent)&&!!document.createElement("form").validity,y=function(a){return"undefined"!=typeof a},z=function(a){return"undefined"==typeof a||null===a?null:"boolean"==typeof a?a?"1":"0":a+""},A=function(a){return(a+"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")},B=function(a){return(a+"").replace(/\$/g,"$$$$")},C={};C.before=function(a,b,c){var d=a[b];a[b]=function(){return c.apply(a,arguments),d.apply(a,arguments)}},C.after=function(a,b,c){var d=a[b];a[b]=function(){var b=d.apply(a,arguments);return c.apply(a,arguments),b}};var D=function(a){var b=!1;return function(){b||(b=!0,a.apply(this,arguments))}},E=function(a,b){var c;return function(){var d=this,e=arguments;window.clearTimeout(c),c=window.setTimeout(function(){a.apply(d,e)},b)}},F=function(a,b,c){var d,e=a.trigger,f={};a.trigger=function(){var c=arguments[0];return-1===b.indexOf(c)?e.apply(a,arguments):void(f[c]=arguments)},c.apply(a,[]),a.trigger=e;for(d in f)f.hasOwnProperty(d)&&e.apply(a,f[d])},G=function(a,b,c,d){a.on(b,c,function(b){for(var c=b.target;c&&c.parentNode!==a[0];)c=c.parentNode;return b.currentTarget=c,d.apply(this,[b])})},H=function(a){var b={};if("selectionStart"in a)b.start=a.selectionStart,b.length=a.selectionEnd-b.start;else if(document.selection){a.focus();var c=document.selection.createRange(),d=document.selection.createRange().text.length;c.moveStart("character",-a.value.length),b.start=c.text.length-d,b.length=d}return b},I=function(a,b,c){var d,e,f={};if(c)for(d=0,e=c.length;e>d;d++)f[c[d]]=a.css(c[d]);else f=a.css();b.css(f)},J=function(b,c){if(!b)return 0;var d=a("<test>").css({position:"absolute",top:-99999,left:-99999,width:"auto",padding:0,whiteSpace:"pre"}).text(b).appendTo("body");I(c,d,["letterSpacing","fontSize","fontFamily","fontWeight","textTransform"]);var e=d.width();return d.remove(),e},K=function(a){var b=null,c=function(c,d){var e,f,g,h,i,j,k,l;c=c||window.event||{},d=d||{},c.metaKey||c.altKey||(d.force||a.data("grow")!==!1)&&(e=a.val(),c.type&&"keydown"===c.type.toLowerCase()&&(f=c.keyCode,g=f>=97&&122>=f||f>=65&&90>=f||f>=48&&57>=f||32===f,f===q||f===p?(l=H(a[0]),l.length?e=e.substring(0,l.start)+e.substring(l.start+l.length):f===p&&l.start?e=e.substring(0,l.start-1)+e.substring(l.start+1):f===q&&"undefined"!=typeof l.start&&(e=e.substring(0,l.start)+e.substring(l.start+1))):g&&(j=c.shiftKey,k=String.fromCharCode(c.keyCode),k=j?k.toUpperCase():k.toLowerCase(),e+=k)),h=a.attr("placeholder"),!e&&h&&(e=h),i=J(e,a)+4,i!==b&&(b=i,a.width(i),a.triggerHandler("resize")))};a.on("keydown keyup update blur",c),c()},L=function(c,d){var e,f,g,h,i=this;h=c[0],h.selectize=i;var j=window.getComputedStyle&&window.getComputedStyle(h,null);if(g=j?j.getPropertyValue("direction"):h.currentStyle&&h.currentStyle.direction,g=g||c.parents("[dir]:first").attr("dir")||"",a.extend(i,{order:0,settings:d,$input:c,tabIndex:c.attr("tabindex")||"",tagType:"select"===h.tagName.toLowerCase()?v:w,rtl:/rtl/i.test(g),eventNS:".selectize"+ ++L.count,highlightedValue:null,isOpen:!1,isDisabled:!1,isRequired:c.is("[required]"),isInvalid:!1,isLocked:!1,isFocused:!1,isInputHidden:!1,isSetup:!1,isShiftDown:!1,isCmdDown:!1,isCtrlDown:!1,ignoreFocus:!1,ignoreBlur:!1,ignoreHover:!1,hasOptions:!1,currentResults:null,lastValue:"",caretPos:0,loading:0,loadedSearches:{},$activeOption:null,$activeItems:[],optgroups:{},options:{},userOptions:{},items:[],renderCache:{},onSearchChange:null===d.loadThrottle?i.onSearchChange:E(i.onSearchChange,d.loadThrottle)}),i.sifter=new b(this.options,{diacritics:d.diacritics}),i.settings.options){for(e=0,f=i.settings.options.length;f>e;e++)i.registerOption(i.settings.options[e]);delete i.settings.options}if(i.settings.optgroups){for(e=0,f=i.settings.optgroups.length;f>e;e++)i.registerOptionGroup(i.settings.optgroups[e]);delete i.settings.optgroups}i.settings.mode=i.settings.mode||(1===i.settings.maxItems?"single":"multi"),"boolean"!=typeof i.settings.hideSelected&&(i.settings.hideSelected="multi"===i.settings.mode),i.initializePlugins(i.settings.plugins),i.setupCallbacks(),i.setupTemplates(),i.setup()};return e.mixin(L),c.mixin(L),a.extend(L.prototype,{setup:function(){var b,c,d,e,g,h,i,j,k,l=this,m=l.settings,n=l.eventNS,o=a(window),p=a(document),q=l.$input;if(i=l.settings.mode,j=q.attr("class")||"",b=a("<div>").addClass(m.wrapperClass).addClass(j).addClass(i),c=a("<div>").addClass(m.inputClass).addClass("items").appendTo(b),d=a('<input type="text" autocomplete="off" />').appendTo(c).attr("tabindex",q.is(":disabled")?"-1":l.tabIndex),h=a(m.dropdownParent||b),e=a("<div>").addClass(m.dropdownClass).addClass(i).hide().appendTo(h),g=a("<div>").addClass(m.dropdownContentClass).appendTo(e),l.settings.copyClassesToDropdown&&e.addClass(j),b.css({width:q[0].style.width}),l.plugins.names.length&&(k="plugin-"+l.plugins.names.join(" plugin-"),b.addClass(k),e.addClass(k)),(null===m.maxItems||m.maxItems>1)&&l.tagType===v&&q.attr("multiple","multiple"),l.settings.placeholder&&d.attr("placeholder",m.placeholder),!l.settings.splitOn&&l.settings.delimiter){var u=l.settings.delimiter.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&");l.settings.splitOn=new RegExp("\\s*"+u+"+\\s*")}q.attr("autocorrect")&&d.attr("autocorrect",q.attr("autocorrect")),q.attr("autocapitalize")&&d.attr("autocapitalize",q.attr("autocapitalize")),l.$wrapper=b,l.$control=c,l.$control_input=d,l.$dropdown=e,l.$dropdown_content=g,e.on("mouseenter","[data-selectable]",function(){return l.onOptionHover.apply(l,arguments)}),e.on("mousedown click","[data-selectable]",function(){return l.onOptionSelect.apply(l,arguments)}),G(c,"mousedown","*:not(input)",function(){return l.onItemSelect.apply(l,arguments)}),K(d),c.on({mousedown:function(){return l.onMouseDown.apply(l,arguments)},click:function(){return l.onClick.apply(l,arguments)}}),d.on({mousedown:function(a){a.stopPropagation()},keydown:function(){return l.onKeyDown.apply(l,arguments)},keyup:function(){return l.onKeyUp.apply(l,arguments)},keypress:function(){return l.onKeyPress.apply(l,arguments)},resize:function(){l.positionDropdown.apply(l,[])},blur:function(){return l.onBlur.apply(l,arguments)},focus:function(){return l.ignoreBlur=!1,l.onFocus.apply(l,arguments)},paste:function(){return l.onPaste.apply(l,arguments)}}),p.on("keydown"+n,function(a){l.isCmdDown=a[f?"metaKey":"ctrlKey"],l.isCtrlDown=a[f?"altKey":"ctrlKey"],l.isShiftDown=a.shiftKey}),p.on("keyup"+n,function(a){a.keyCode===t&&(l.isCtrlDown=!1),a.keyCode===r&&(l.isShiftDown=!1),a.keyCode===s&&(l.isCmdDown=!1)}),p.on("mousedown"+n,function(a){if(l.isFocused){if(a.target===l.$dropdown[0]||a.target.parentNode===l.$dropdown[0])return!1;l.$control.has(a.target).length||a.target===l.$control[0]||l.blur(a.target)}}),o.on(["scroll"+n,"resize"+n].join(" "),function(){l.isOpen&&l.positionDropdown.apply(l,arguments)}),o.on("mousemove"+n,function(){l.ignoreHover=!1}),this.revertSettings={$children:q.children().detach(),tabindex:q.attr("tabindex")},q.attr("tabindex",-1).hide().after(l.$wrapper),a.isArray(m.items)&&(l.setValue(m.items),delete m.items),x&&q.on("invalid"+n,function(a){a.preventDefault(),l.isInvalid=!0,l.refreshState()}),l.updateOriginalInput(),l.refreshItems(),l.refreshState(),l.updatePlaceholder(),l.isSetup=!0,q.is(":disabled")&&l.disable(),l.on("change",this.onChange),q.data("selectize",l),q.addClass("selectized"),l.trigger("initialize"),m.preload===!0&&l.onSearchChange("")},setupTemplates:function(){var b=this,c=b.settings.labelField,d=b.settings.optgroupLabelField,e={optgroup:function(a){return'<div class="optgroup">'+a.html+"</div>"},optgroup_header:function(a,b){return'<div class="optgroup-header">'+b(a[d])+"</div>"},option:function(a,b){return'<div class="option">'+b(a[c])+"</div>"},item:function(a,b){return'<div class="item">'+b(a[c])+"</div>"},option_create:function(a,b){return'<div class="create">Add <strong>'+b(a.input)+"</strong>…</div>"}};b.settings.render=a.extend({},e,b.settings.render)},setupCallbacks:function(){var a,b,c={initialize:"onInitialize",change:"onChange",item_add:"onItemAdd",item_remove:"onItemRemove",clear:"onClear",option_add:"onOptionAdd",option_remove:"onOptionRemove",option_clear:"onOptionClear",optgroup_add:"onOptionGroupAdd",optgroup_remove:"onOptionGroupRemove",optgroup_clear:"onOptionGroupClear",dropdown_open:"onDropdownOpen",dropdown_close:"onDropdownClose",type:"onType",load:"onLoad",focus:"onFocus",blur:"onBlur"};for(a in c)c.hasOwnProperty(a)&&(b=this.settings[c[a]],b&&this.on(a,b))},onClick:function(a){var b=this;b.isFocused||(b.focus(),a.preventDefault())},onMouseDown:function(b){{var c=this,d=b.isDefaultPrevented();a(b.target)}if(c.isFocused){if(b.target!==c.$control_input[0])return"single"===c.settings.mode?c.isOpen?c.close():c.open():d||c.setActiveItem(null),!1}else d||window.setTimeout(function(){c.focus()},0)},onChange:function(){this.$input.trigger("change")},onPaste:function(b){var c=this;c.isFull()||c.isInputHidden||c.isLocked?b.preventDefault():c.settings.splitOn&&setTimeout(function(){for(var b=a.trim(c.$control_input.val()||"").split(c.settings.splitOn),d=0,e=b.length;e>d;d++)c.createItem(b[d])},0)},onKeyPress:function(a){if(this.isLocked)return a&&a.preventDefault();var b=String.fromCharCode(a.keyCode||a.which);return this.settings.create&&"multi"===this.settings.mode&&b===this.settings.delimiter?(this.createItem(),a.preventDefault(),!1):void 0},onKeyDown:function(a){var b=(a.target===this.$control_input[0],this);if(b.isLocked)return void(a.keyCode!==u&&a.preventDefault());switch(a.keyCode){case g:if(b.isCmdDown)return void b.selectAll();break;case i:return void(b.isOpen&&(a.preventDefault(),a.stopPropagation(),b.close()));case o:if(!a.ctrlKey||a.altKey)break;case n:if(!b.isOpen&&b.hasOptions)b.open();else if(b.$activeOption){b.ignoreHover=!0;var c=b.getAdjacentOption(b.$activeOption,1);c.length&&b.setActiveOption(c,!0,!0)}return void a.preventDefault();case l:if(!a.ctrlKey||a.altKey)break;case k:if(b.$activeOption){b.ignoreHover=!0;var d=b.getAdjacentOption(b.$activeOption,-1);d.length&&b.setActiveOption(d,!0,!0)}return void a.preventDefault();case h:return void(b.isOpen&&b.$activeOption&&(b.onOptionSelect({currentTarget:b.$activeOption}),a.preventDefault()));case j:return void b.advanceSelection(-1,a);case m:return void b.advanceSelection(1,a);case u:return b.settings.selectOnTab&&b.isOpen&&b.$activeOption&&(b.onOptionSelect({currentTarget:b.$activeOption}),b.isFull()||a.preventDefault()),void(b.settings.create&&b.createItem()&&a.preventDefault());case p:case q:return void b.deleteSelection(a)}return!b.isFull()&&!b.isInputHidden||(f?a.metaKey:a.ctrlKey)?void 0:void a.preventDefault()},onKeyUp:function(a){var b=this;if(b.isLocked)return a&&a.preventDefault();var c=b.$control_input.val()||"";b.lastValue!==c&&(b.lastValue=c,b.onSearchChange(c),b.refreshOptions(),b.trigger("type",c))},onSearchChange:function(a){var b=this,c=b.settings.load;c&&(b.loadedSearches.hasOwnProperty(a)||(b.loadedSearches[a]=!0,b.load(function(d){c.apply(b,[a,d])})))},onFocus:function(a){var b=this,c=b.isFocused;return b.isDisabled?(b.blur(),a&&a.preventDefault(),!1):void(b.ignoreFocus||(b.isFocused=!0,"focus"===b.settings.preload&&b.onSearchChange(""),c||b.trigger("focus"),b.$activeItems.length||(b.showInput(),b.setActiveItem(null),b.refreshOptions(!!b.settings.openOnFocus)),b.refreshState()))},onBlur:function(a,b){var c=this;if(c.isFocused&&(c.isFocused=!1,!c.ignoreFocus)){if(!c.ignoreBlur&&document.activeElement===c.$dropdown_content[0])return c.ignoreBlur=!0,void c.onFocus(a);var d=function(){c.close(),c.setTextboxValue(""),c.setActiveItem(null),c.setActiveOption(null),c.setCaret(c.items.length),c.refreshState(),(b||document.body).focus(),c.ignoreFocus=!1,c.trigger("blur")};c.ignoreFocus=!0,c.settings.create&&c.settings.createOnBlur?c.createItem(null,!1,d):d()}},onOptionHover:function(a){this.ignoreHover||this.setActiveOption(a.currentTarget,!1)},onOptionSelect:function(b){var c,d,e=this;b.preventDefault&&(b.preventDefault(),b.stopPropagation()),d=a(b.currentTarget),d.hasClass("create")?e.createItem(null,function(){e.settings.closeAfterSelect&&e.close()}):(c=d.attr("data-value"),"undefined"!=typeof c&&(e.lastQuery=null,e.setTextboxValue(""),e.addItem(c),e.settings.closeAfterSelect?e.close():!e.settings.hideSelected&&b.type&&/mouse/.test(b.type)&&e.setActiveOption(e.getOption(c))))},onItemSelect:function(a){var b=this;b.isLocked||"multi"===b.settings.mode&&(a.preventDefault(),b.setActiveItem(a.currentTarget,a))},load:function(a){var b=this,c=b.$wrapper.addClass(b.settings.loadingClass);b.loading++,a.apply(b,[function(a){b.loading=Math.max(b.loading-1,0),a&&a.length&&(b.addOption(a),b.refreshOptions(b.isFocused&&!b.isInputHidden)),b.loading||c.removeClass(b.settings.loadingClass),b.trigger("load",a)}])},setTextboxValue:function(a){var b=this.$control_input,c=b.val()!==a;c&&(b.val(a).triggerHandler("update"),this.lastValue=a)},getValue:function(){return this.tagType===v&&this.$input.attr("multiple")?this.items:this.items.join(this.settings.delimiter)},setValue:function(a,b){var c=b?[]:["change"];F(this,c,function(){this.clear(b),this.addItems(a,b)})},setActiveItem:function(b,c){var d,e,f,g,h,i,j,k,l=this;if("single"!==l.settings.mode){if(b=a(b),!b.length)return a(l.$activeItems).removeClass("active"),l.$activeItems=[],void(l.isFocused&&l.showInput());if(d=c&&c.type.toLowerCase(),"mousedown"===d&&l.isShiftDown&&l.$activeItems.length){for(k=l.$control.children(".active:last"),g=Array.prototype.indexOf.apply(l.$control[0].childNodes,[k[0]]),h=Array.prototype.indexOf.apply(l.$control[0].childNodes,[b[0]]),g>h&&(j=g,g=h,h=j),e=g;h>=e;e++)i=l.$control[0].childNodes[e],-1===l.$activeItems.indexOf(i)&&(a(i).addClass("active"),l.$activeItems.push(i));c.preventDefault()}else"mousedown"===d&&l.isCtrlDown||"keydown"===d&&this.isShiftDown?b.hasClass("active")?(f=l.$activeItems.indexOf(b[0]),l.$activeItems.splice(f,1),b.removeClass("active")):l.$activeItems.push(b.addClass("active")[0]):(a(l.$activeItems).removeClass("active"),l.$activeItems=[b.addClass("active")[0]]);l.hideInput(),this.isFocused||l.focus()}},setActiveOption:function(b,c,d){var e,f,g,h,i,j=this;j.$activeOption&&j.$activeOption.removeClass("active"),j.$activeOption=null,b=a(b),b.length&&(j.$activeOption=b.addClass("active"),(c||!y(c))&&(e=j.$dropdown_content.height(),f=j.$activeOption.outerHeight(!0),c=j.$dropdown_content.scrollTop()||0,g=j.$activeOption.offset().top-j.$dropdown_content.offset().top+c,h=g,i=g-e+f,g+f>e+c?j.$dropdown_content.stop().animate({scrollTop:i},d?j.settings.scrollDuration:0):c>g&&j.$dropdown_content.stop().animate({scrollTop:h},d?j.settings.scrollDuration:0)))},selectAll:function(){var a=this;"single"!==a.settings.mode&&(a.$activeItems=Array.prototype.slice.apply(a.$control.children(":not(input)").addClass("active")),a.$activeItems.length&&(a.hideInput(),a.close()),a.focus())},hideInput:function(){var a=this;a.setTextboxValue(""),a.$control_input.css({opacity:0,position:"absolute",left:a.rtl?1e4:-1e4}),a.isInputHidden=!0},showInput:function(){this.$control_input.css({opacity:1,position:"relative",left:0}),this.isInputHidden=!1},focus:function(){var a=this;a.isDisabled||(a.ignoreFocus=!0,a.$control_input[0].focus(),window.setTimeout(function(){a.ignoreFocus=!1,a.onFocus()},0))},blur:function(a){this.$control_input[0].blur(),this.onBlur(null,a)},getScoreFunction:function(a){return this.sifter.getScoreFunction(a,this.getSearchOptions())},getSearchOptions:function(){var a=this.settings,b=a.sortField;return"string"==typeof b&&(b=[{field:b}]),{fields:a.searchField,conjunction:a.searchConjunction,sort:b}},search:function(b){var c,d,e,f=this,g=f.settings,h=this.getSearchOptions();if(g.score&&(e=f.settings.score.apply(this,[b]),"function"!=typeof e))throw new Error('Selectize "score" setting must be a function that returns a function');if(b!==f.lastQuery?(f.lastQuery=b,d=f.sifter.search(b,a.extend(h,{score:e})),f.currentResults=d):d=a.extend(!0,{},f.currentResults),g.hideSelected)for(c=d.items.length-1;c>=0;c--)-1!==f.items.indexOf(z(d.items[c].id))&&d.items.splice(c,1);return d},refreshOptions:function(b){var c,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s;"undefined"==typeof b&&(b=!0);var t=this,u=a.trim(t.$control_input.val()),v=t.search(u),w=t.$dropdown_content,x=t.$activeOption&&z(t.$activeOption.attr("data-value"));for(g=v.items.length,"number"==typeof t.settings.maxOptions&&(g=Math.min(g,t.settings.maxOptions)),h={},i=[],c=0;g>c;c++)for(j=t.options[v.items[c].id],k=t.render("option",j),l=j[t.settings.optgroupField]||"",m=a.isArray(l)?l:[l],e=0,f=m&&m.length;f>e;e++)l=m[e],t.optgroups.hasOwnProperty(l)||(l=""),h.hasOwnProperty(l)||(h[l]=[],i.push(l)),h[l].push(k);for(this.settings.lockOptgroupOrder&&i.sort(function(a,b){var c=t.optgroups[a].$order||0,d=t.optgroups[b].$order||0;return c-d}),n=[],c=0,g=i.length;g>c;c++)l=i[c],t.optgroups.hasOwnProperty(l)&&h[l].length?(o=t.render("optgroup_header",t.optgroups[l])||"",o+=h[l].join(""),n.push(t.render("optgroup",a.extend({},t.optgroups[l],{html:o})))):n.push(h[l].join(""));if(w.html(n.join("")),t.settings.highlight&&v.query.length&&v.tokens.length)for(c=0,g=v.tokens.length;g>c;c++)d(w,v.tokens[c].regex);if(!t.settings.hideSelected)for(c=0,g=t.items.length;g>c;c++)t.getOption(t.items[c]).addClass("selected");p=t.canCreate(u),p&&(w.prepend(t.render("option_create",{input:u})),s=a(w[0].childNodes[0])),t.hasOptions=v.items.length>0||p,t.hasOptions?(v.items.length>0?(r=x&&t.getOption(x),r&&r.length?q=r:"single"===t.settings.mode&&t.items.length&&(q=t.getOption(t.items[0])),q&&q.length||(q=s&&!t.settings.addPrecedence?t.getAdjacentOption(s,1):w.find("[data-selectable]:first"))):q=s,t.setActiveOption(q),b&&!t.isOpen&&t.open()):(t.setActiveOption(null),b&&t.isOpen&&t.close())},addOption:function(b){var c,d,e,f=this;if(a.isArray(b))for(c=0,d=b.length;d>c;c++)f.addOption(b[c]);else(e=f.registerOption(b))&&(f.userOptions[e]=!0,f.lastQuery=null,f.trigger("option_add",e,b))},registerOption:function(a){var b=z(a[this.settings.valueField]);return!b||this.options.hasOwnProperty(b)?!1:(a.$order=a.$order||++this.order,this.options[b]=a,b)},registerOptionGroup:function(a){var b=z(a[this.settings.optgroupValueField]);return b?(a.$order=a.$order||++this.order,this.optgroups[b]=a,b):!1},addOptionGroup:function(a,b){b[this.settings.optgroupValueField]=a,(a=this.registerOptionGroup(b))&&this.trigger("optgroup_add",a,b)},removeOptionGroup:function(a){this.optgroups.hasOwnProperty(a)&&(delete this.optgroups[a],this.renderCache={},this.trigger("optgroup_remove",a))},clearOptionGroups:function(){this.optgroups={},this.renderCache={},this.trigger("optgroup_clear")},updateOption:function(b,c){var d,e,f,g,h,i,j,k=this;if(b=z(b),f=z(c[k.settings.valueField]),null!==b&&k.options.hasOwnProperty(b)){if("string"!=typeof f)throw new Error("Value must be set in option data");j=k.options[b].$order,f!==b&&(delete k.options[b],g=k.items.indexOf(b),-1!==g&&k.items.splice(g,1,f)),c.$order=c.$order||j,k.options[f]=c,h=k.renderCache.item,i=k.renderCache.option,h&&(delete h[b],delete h[f]),i&&(delete i[b],delete i[f]),-1!==k.items.indexOf(f)&&(d=k.getItem(b),e=a(k.render("item",c)),d.hasClass("active")&&e.addClass("active"),d.replaceWith(e)),k.lastQuery=null,k.isOpen&&k.refreshOptions(!1)}},removeOption:function(a,b){var c=this;a=z(a);var d=c.renderCache.item,e=c.renderCache.option;d&&delete d[a],e&&delete e[a],delete c.userOptions[a],delete c.options[a],c.lastQuery=null,c.trigger("option_remove",a),c.removeItem(a,b)},clearOptions:function(){var a=this;a.loadedSearches={},a.userOptions={},a.renderCache={},a.options=a.sifter.items={},a.lastQuery=null,a.trigger("option_clear"),a.clear()},getOption:function(a){return this.getElementWithValue(a,this.$dropdown_content.find("[data-selectable]"))},getAdjacentOption:function(b,c){var d=this.$dropdown.find("[data-selectable]"),e=d.index(b)+c;return e>=0&&e<d.length?d.eq(e):a()},getElementWithValue:function(b,c){if(b=z(b),"undefined"!=typeof b&&null!==b)for(var d=0,e=c.length;e>d;d++)if(c[d].getAttribute("data-value")===b)return a(c[d]);return a()},getItem:function(a){return this.getElementWithValue(a,this.$control.children())},addItems:function(b,c){for(var d=a.isArray(b)?b:[b],e=0,f=d.length;f>e;e++)this.isPending=f-1>e,this.addItem(d[e],c)},addItem:function(b,c){var d=c?[]:["change"];F(this,d,function(){var d,e,f,g,h,i=this,j=i.settings.mode;return b=z(b),-1!==i.items.indexOf(b)?void("single"===j&&i.close()):void(i.options.hasOwnProperty(b)&&("single"===j&&i.clear(c),"multi"===j&&i.isFull()||(d=a(i.render("item",i.options[b])),h=i.isFull(),i.items.splice(i.caretPos,0,b),i.insertAtCaret(d),(!i.isPending||!h&&i.isFull())&&i.refreshState(),i.isSetup&&(f=i.$dropdown_content.find("[data-selectable]"),i.isPending||(e=i.getOption(b),g=i.getAdjacentOption(e,1).attr("data-value"),i.refreshOptions(i.isFocused&&"single"!==j),g&&i.setActiveOption(i.getOption(g))),!f.length||i.isFull()?i.close():i.positionDropdown(),i.updatePlaceholder(),i.trigger("item_add",b,d),i.updateOriginalInput({silent:c})))))})},removeItem:function(a,b){var c,d,e,f=this;c="object"==typeof a?a:f.getItem(a),a=z(c.attr("data-value")),d=f.items.indexOf(a),-1!==d&&(c.remove(),c.hasClass("active")&&(e=f.$activeItems.indexOf(c[0]),f.$activeItems.splice(e,1)),f.items.splice(d,1),f.lastQuery=null,!f.settings.persist&&f.userOptions.hasOwnProperty(a)&&f.removeOption(a,b),d<f.caretPos&&f.setCaret(f.caretPos-1),f.refreshState(),f.updatePlaceholder(),f.updateOriginalInput({silent:b}),f.positionDropdown(),f.trigger("item_remove",a,c))},createItem:function(b,c){var d=this,e=d.caretPos;b=b||a.trim(d.$control_input.val()||"");var f=arguments[arguments.length-1];if("function"!=typeof f&&(f=function(){}),"boolean"!=typeof c&&(c=!0),!d.canCreate(b))return f(),!1;d.lock();var g="function"==typeof d.settings.create?this.settings.create:function(a){var b={};return b[d.settings.labelField]=a,b[d.settings.valueField]=a,b},h=D(function(a){if(d.unlock(),!a||"object"!=typeof a)return f();var b=z(a[d.settings.valueField]);return"string"!=typeof b?f():(d.setTextboxValue(""),d.addOption(a),d.setCaret(e),d.addItem(b),d.refreshOptions(c&&"single"!==d.settings.mode),void f(a))}),i=g.apply(this,[b,h]);return"undefined"!=typeof i&&h(i),!0},refreshItems:function(){this.lastQuery=null,this.isSetup&&this.addItem(this.items),this.refreshState(),this.updateOriginalInput()},refreshState:function(){var a,b=this;b.isRequired&&(b.items.length&&(b.isInvalid=!1),b.$control_input.prop("required",a)),b.refreshClasses()},refreshClasses:function(){var b=this,c=b.isFull(),d=b.isLocked;b.$wrapper.toggleClass("rtl",b.rtl),b.$control.toggleClass("focus",b.isFocused).toggleClass("disabled",b.isDisabled).toggleClass("required",b.isRequired).toggleClass("invalid",b.isInvalid).toggleClass("locked",d).toggleClass("full",c).toggleClass("not-full",!c).toggleClass("input-active",b.isFocused&&!b.isInputHidden).toggleClass("dropdown-active",b.isOpen).toggleClass("has-options",!a.isEmptyObject(b.options)).toggleClass("has-items",b.items.length>0),b.$control_input.data("grow",!c&&!d)},isFull:function(){return null!==this.settings.maxItems&&this.items.length>=this.settings.maxItems},updateOriginalInput:function(a){var b,c,d,e,f=this;if(a=a||{},f.tagType===v){for(d=[],b=0,c=f.items.length;c>b;b++)e=f.options[f.items[b]][f.settings.labelField]||"",d.push('<option value="'+A(f.items[b])+'" selected="selected">'+A(e)+"</option>");d.length||this.$input.attr("multiple")||d.push('<option value="" selected="selected"></option>'),f.$input.html(d.join(""))}else f.$input.val(f.getValue()),f.$input.attr("value",f.$input.val());f.isSetup&&(a.silent||f.trigger("change",f.$input.val()))},updatePlaceholder:function(){if(this.settings.placeholder){var a=this.$control_input;this.items.length?a.removeAttr("placeholder"):a.attr("placeholder",this.settings.placeholder),a.triggerHandler("update",{force:!0})}},open:function(){var a=this;a.isLocked||a.isOpen||"multi"===a.settings.mode&&a.isFull()||(a.focus(),a.isOpen=!0,a.refreshState(),a.$dropdown.css({visibility:"hidden",display:"block"}),a.positionDropdown(),a.$dropdown.css({visibility:"visible"}),a.trigger("dropdown_open",a.$dropdown))},close:function(){var a=this,b=a.isOpen;"single"===a.settings.mode&&a.items.length&&a.hideInput(),a.isOpen=!1,a.$dropdown.hide(),a.setActiveOption(null),a.refreshState(),b&&a.trigger("dropdown_close",a.$dropdown)},positionDropdown:function(){var a=this.$control,b="body"===this.settings.dropdownParent?a.offset():a.position();b.top+=a.outerHeight(!0),this.$dropdown.css({width:a.outerWidth(),top:b.top,left:b.left})},clear:function(a){var b=this;b.items.length&&(b.$control.children(":not(input)").remove(),b.items=[],b.lastQuery=null,b.setCaret(0),b.setActiveItem(null),b.updatePlaceholder(),b.updateOriginalInput({silent:a}),b.refreshState(),b.showInput(),b.trigger("clear"))},insertAtCaret:function(b){var c=Math.min(this.caretPos,this.items.length);0===c?this.$control.prepend(b):a(this.$control[0].childNodes[c]).before(b),this.setCaret(c+1)},deleteSelection:function(b){var c,d,e,f,g,h,i,j,k,l=this;if(e=b&&b.keyCode===p?-1:1,f=H(l.$control_input[0]),l.$activeOption&&!l.settings.hideSelected&&(i=l.getAdjacentOption(l.$activeOption,-1).attr("data-value")),g=[],l.$activeItems.length){for(k=l.$control.children(".active:"+(e>0?"last":"first")),h=l.$control.children(":not(input)").index(k),e>0&&h++,c=0,d=l.$activeItems.length;d>c;c++)g.push(a(l.$activeItems[c]).attr("data-value"));
|
3 |
+
b&&(b.preventDefault(),b.stopPropagation())}else(l.isFocused||"single"===l.settings.mode)&&l.items.length&&(0>e&&0===f.start&&0===f.length?g.push(l.items[l.caretPos-1]):e>0&&f.start===l.$control_input.val().length&&g.push(l.items[l.caretPos]));if(!g.length||"function"==typeof l.settings.onDelete&&l.settings.onDelete.apply(l,[g])===!1)return!1;for("undefined"!=typeof h&&l.setCaret(h);g.length;)l.removeItem(g.pop());return l.showInput(),l.positionDropdown(),l.refreshOptions(!0),i&&(j=l.getOption(i),j.length&&l.setActiveOption(j)),!0},advanceSelection:function(a,b){var c,d,e,f,g,h,i=this;0!==a&&(i.rtl&&(a*=-1),c=a>0?"last":"first",d=H(i.$control_input[0]),i.isFocused&&!i.isInputHidden?(f=i.$control_input.val().length,g=0>a?0===d.start&&0===d.length:d.start===f,g&&!f&&i.advanceCaret(a,b)):(h=i.$control.children(".active:"+c),h.length&&(e=i.$control.children(":not(input)").index(h),i.setActiveItem(null),i.setCaret(a>0?e+1:e))))},advanceCaret:function(a,b){var c,d,e=this;0!==a&&(c=a>0?"next":"prev",e.isShiftDown?(d=e.$control_input[c](),d.length&&(e.hideInput(),e.setActiveItem(d),b&&b.preventDefault())):e.setCaret(e.caretPos+a))},setCaret:function(b){var c=this;if(b="single"===c.settings.mode?c.items.length:Math.max(0,Math.min(c.items.length,b)),!c.isPending){var d,e,f,g;for(f=c.$control.children(":not(input)"),d=0,e=f.length;e>d;d++)g=a(f[d]).detach(),b>d?c.$control_input.before(g):c.$control.append(g)}c.caretPos=b},lock:function(){this.close(),this.isLocked=!0,this.refreshState()},unlock:function(){this.isLocked=!1,this.refreshState()},disable:function(){var a=this;a.$input.prop("disabled",!0),a.$control_input.prop("disabled",!0).prop("tabindex",-1),a.isDisabled=!0,a.lock()},enable:function(){var a=this;a.$input.prop("disabled",!1),a.$control_input.prop("disabled",!1).prop("tabindex",a.tabIndex),a.isDisabled=!1,a.unlock()},destroy:function(){var b=this,c=b.eventNS,d=b.revertSettings;b.trigger("destroy"),b.off(),b.$wrapper.remove(),b.$dropdown.remove(),b.$input.html("").append(d.$children).removeAttr("tabindex").removeClass("selectized").attr({tabindex:d.tabindex}).show(),b.$control_input.removeData("grow"),b.$input.removeData("selectize"),a(window).off(c),a(document).off(c),a(document.body).off(c),delete b.$input[0].selectize},render:function(a,b){var c,d,e="",f=!1,g=this,h=/^[\t \r\n]*<([a-z][a-z0-9\-_]*(?:\:[a-z][a-z0-9\-_]*)?)/i;return("option"===a||"item"===a)&&(c=z(b[g.settings.valueField]),f=!!c),f&&(y(g.renderCache[a])||(g.renderCache[a]={}),g.renderCache[a].hasOwnProperty(c))?g.renderCache[a][c]:(e=g.settings.render[a].apply(this,[b,A]),("option"===a||"option_create"===a)&&(e=e.replace(h,"<$1 data-selectable")),"optgroup"===a&&(d=b[g.settings.optgroupValueField]||"",e=e.replace(h,'<$1 data-group="'+B(A(d))+'"')),("option"===a||"item"===a)&&(e=e.replace(h,'<$1 data-value="'+B(A(c||""))+'"')),f&&(g.renderCache[a][c]=e),e)},clearCache:function(a){var b=this;"undefined"==typeof a?b.renderCache={}:delete b.renderCache[a]},canCreate:function(a){var b=this;if(!b.settings.create)return!1;var c=b.settings.createFilter;return!(!a.length||"function"==typeof c&&!c.apply(b,[a])||"string"==typeof c&&!new RegExp(c).test(a)||c instanceof RegExp&&!c.test(a))}}),L.count=0,L.defaults={options:[],optgroups:[],plugins:[],delimiter:",",splitOn:null,persist:!0,diacritics:!0,create:!1,createOnBlur:!1,createFilter:null,highlight:!0,openOnFocus:!0,maxOptions:1e3,maxItems:null,hideSelected:null,addPrecedence:!1,selectOnTab:!1,preload:!1,allowEmptyOption:!1,closeAfterSelect:!1,scrollDuration:60,loadThrottle:300,loadingClass:"loading",dataAttr:"data-data",optgroupField:"optgroup",valueField:"value",labelField:"text",optgroupLabelField:"label",optgroupValueField:"value",lockOptgroupOrder:!1,sortField:"$order",searchField:["text"],searchConjunction:"and",mode:null,wrapperClass:"selectize-control",inputClass:"selectize-input",dropdownClass:"selectize-dropdown",dropdownContentClass:"selectize-dropdown-content",dropdownParent:null,copyClassesToDropdown:!0,render:{}},a.fn.selectize=function(b){var c=a.fn.selectize.defaults,d=a.extend({},c,b),e=d.dataAttr,f=d.labelField,g=d.valueField,h=d.optgroupField,i=d.optgroupLabelField,j=d.optgroupValueField,k=function(b,c){var h,i,j,k,l=b.attr(e);if(l)for(c.options=JSON.parse(l),h=0,i=c.options.length;i>h;h++)c.items.push(c.options[h][g]);else{var m=a.trim(b.val()||"");if(!d.allowEmptyOption&&!m.length)return;for(j=m.split(d.delimiter),h=0,i=j.length;i>h;h++)k={},k[f]=j[h],k[g]=j[h],c.options.push(k);c.items=j}},l=function(b,c){var k,l,m,n,o=c.options,p={},q=function(a){var b=e&&a.attr(e);return"string"==typeof b&&b.length?JSON.parse(b):null},r=function(b,e){b=a(b);var i=z(b.attr("value"));if(i||d.allowEmptyOption)if(p.hasOwnProperty(i)){if(e){var j=p[i][h];j?a.isArray(j)?j.push(e):p[i][h]=[j,e]:p[i][h]=e}}else{var k=q(b)||{};k[f]=k[f]||b.text(),k[g]=k[g]||i,k[h]=k[h]||e,p[i]=k,o.push(k),b.is(":selected")&&c.items.push(i)}},s=function(b){var d,e,f,g,h;for(b=a(b),f=b.attr("label"),f&&(g=q(b)||{},g[i]=f,g[j]=f,c.optgroups.push(g)),h=a("option",b),d=0,e=h.length;e>d;d++)r(h[d],f)};for(c.maxItems=b.attr("multiple")?null:1,n=b.children(),k=0,l=n.length;l>k;k++)m=n[k].tagName.toLowerCase(),"optgroup"===m?s(n[k]):"option"===m&&r(n[k])};return this.each(function(){if(!this.selectize){var e,f=a(this),g=this.tagName.toLowerCase(),h=f.attr("placeholder")||f.attr("data-placeholder");h||d.allowEmptyOption||(h=f.children('option[value=""]').text());var i={placeholder:h,options:[],optgroups:[],items:[]};"select"===g?l(f,i):k(f,i),e=new L(f,a.extend(!0,{},c,i,b))}})},a.fn.selectize.defaults=L.defaults,a.fn.selectize.support={validity:x},L.define("drag_drop",function(){if(!a.fn.sortable)throw new Error('The "drag_drop" plugin requires jQuery UI "sortable".');if("multi"===this.settings.mode){var b=this;b.lock=function(){var a=b.lock;return function(){var c=b.$control.data("sortable");return c&&c.disable(),a.apply(b,arguments)}}(),b.unlock=function(){var a=b.unlock;return function(){var c=b.$control.data("sortable");return c&&c.enable(),a.apply(b,arguments)}}(),b.setup=function(){var c=b.setup;return function(){c.apply(this,arguments);var d=b.$control.sortable({items:"[data-value]",forcePlaceholderSize:!0,disabled:b.isLocked,start:function(a,b){b.placeholder.css("width",b.helper.css("width")),d.css({overflow:"visible"})},stop:function(){d.css({overflow:"hidden"});var c=b.$activeItems?b.$activeItems.slice():null,e=[];d.children("[data-value]").each(function(){e.push(a(this).attr("data-value"))}),b.setValue(e),b.setActiveItem(c)}})}}()}}),L.define("dropdown_header",function(b){var c=this;b=a.extend({title:"Untitled",headerClass:"selectize-dropdown-header",titleRowClass:"selectize-dropdown-header-title",labelClass:"selectize-dropdown-header-label",closeClass:"selectize-dropdown-header-close",html:function(a){return'<div class="'+a.headerClass+'"><div class="'+a.titleRowClass+'"><span class="'+a.labelClass+'">'+a.title+'</span><a href="javascript:void(0)" class="'+a.closeClass+'">×</a></div></div>'}},b),c.setup=function(){var d=c.setup;return function(){d.apply(c,arguments),c.$dropdown_header=a(b.html(b)),c.$dropdown.prepend(c.$dropdown_header)}}()}),L.define("optgroup_columns",function(b){var c=this;b=a.extend({equalizeWidth:!0,equalizeHeight:!0},b),this.getAdjacentOption=function(b,c){var d=b.closest("[data-group]").find("[data-selectable]"),e=d.index(b)+c;return e>=0&&e<d.length?d.eq(e):a()},this.onKeyDown=function(){var a=c.onKeyDown;return function(b){var d,e,f,g;return!this.isOpen||b.keyCode!==j&&b.keyCode!==m?a.apply(this,arguments):(c.ignoreHover=!0,g=this.$activeOption.closest("[data-group]"),d=g.find("[data-selectable]").index(this.$activeOption),g=b.keyCode===j?g.prev("[data-group]"):g.next("[data-group]"),f=g.find("[data-selectable]"),e=f.eq(Math.min(f.length-1,d)),void(e.length&&this.setActiveOption(e)))}}();var d=function(){var a,b=d.width,c=document;return"undefined"==typeof b&&(a=c.createElement("div"),a.innerHTML='<div style="width:50px;height:50px;position:absolute;left:-50px;top:-50px;overflow:auto;"><div style="width:1px;height:100px;"></div></div>',a=a.firstChild,c.body.appendChild(a),b=d.width=a.offsetWidth-a.clientWidth,c.body.removeChild(a)),b},e=function(){var e,f,g,h,i,j,k;if(k=a("[data-group]",c.$dropdown_content),f=k.length,f&&c.$dropdown_content.width()){if(b.equalizeHeight){for(g=0,e=0;f>e;e++)g=Math.max(g,k.eq(e).height());k.css({height:g})}b.equalizeWidth&&(j=c.$dropdown_content.innerWidth()-d(),h=Math.round(j/f),k.css({width:h}),f>1&&(i=j-h*(f-1),k.eq(f-1).css({width:i})))}};(b.equalizeHeight||b.equalizeWidth)&&(C.after(this,"positionDropdown",e),C.after(this,"refreshOptions",e))}),L.define("remove_button",function(b){if("single"!==this.settings.mode){b=a.extend({label:"×",title:"Remove",className:"remove",append:!0},b);var c=this,d='<a href="javascript:void(0)" class="'+b.className+'" tabindex="-1" title="'+A(b.title)+'">'+b.label+"</a>",e=function(a,b){var c=a.search(/(<\/[^>]+>\s*)$/);return a.substring(0,c)+b+a.substring(c)};this.setup=function(){var f=c.setup;return function(){if(b.append){var g=c.settings.render.item;c.settings.render.item=function(){return e(g.apply(this,arguments),d)}}f.apply(this,arguments),this.$control.on("click","."+b.className,function(b){if(b.preventDefault(),!c.isLocked){var d=a(b.currentTarget).parent();c.setActiveItem(d),c.deleteSelection()&&c.setCaret(c.items.length)}})}}()}}),L.define("restore_on_backspace",function(a){var b=this;a.text=a.text||function(a){return a[this.settings.labelField]},this.onKeyDown=function(){var c=b.onKeyDown;return function(b){var d,e;return b.keyCode===p&&""===this.$control_input.val()&&!this.$activeItems.length&&(d=this.caretPos-1,d>=0&&d<this.items.length)?(e=this.options[this.items[d]],this.deleteSelection(b)&&(this.setTextboxValue(a.text.apply(this,[e])),this.refreshOptions(!0)),void b.preventDefault()):c.apply(this,arguments)}}()}),L});
|
inc/custom-controls/controls/select/select-control.php
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* cleverfox select control
|
4 |
+
*/
|
5 |
+
if ( ! class_exists( 'WP_Customize_Control' ) ) {
|
6 |
+
return;
|
7 |
+
}
|
8 |
+
class Cleverfox_Customizer_Select_Control extends WP_Customize_Control {
|
9 |
+
|
10 |
+
public $type = 'hantus-select';
|
11 |
+
|
12 |
+
public function enqueue() {
|
13 |
+
wp_enqueue_script( 'selectize-js', OUR_DIRECTORY_URI . 'controls/select/assets/js/selectize.min.js', array( 'jquery' ) );
|
14 |
+
wp_enqueue_script( 'cleverfox-select-control', OUR_DIRECTORY_URI . 'controls/select/assets/js/select-control.js', array( 'jquery', 'selectize-js' ), '', true );
|
15 |
+
wp_enqueue_style( 'selectize-css', OUR_DIRECTORY_URI . 'controls/select/selectize.default.css' );
|
16 |
+
}
|
17 |
+
|
18 |
+
public function render_content() {
|
19 |
+
?>
|
20 |
+
<label>
|
21 |
+
<?php if ( ! empty( $this->label ) ) : ?>
|
22 |
+
<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
|
23 |
+
<?php endif;
|
24 |
+
if ( ! empty( $this->description ) ) : ?>
|
25 |
+
<span class="description customize-control-description"><?php echo esc_html( $this->description ); ?></span>
|
26 |
+
<?php endif; ?>
|
27 |
+
<select <?php $this->link(); ?> class="hantus-select-control">
|
28 |
+
<?php foreach ( $this->choices as $value => $label ) : ?>
|
29 |
+
<option value="<?php echo esc_attr( $value ); ?>" <?php echo selected( $this->value(), $value, false ); ?> ><?php echo esc_html( $label ); ?></option>
|
30 |
+
<?php endforeach; ?>
|
31 |
+
</select>
|
32 |
+
</label>
|
33 |
+
<?php }
|
34 |
+
|
35 |
+
}
|
inc/custom-controls/controls/select/selectize.default.css
ADDED
@@ -0,0 +1,387 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* selectize.default.css (v0.12.1) - Default Theme
|
3 |
+
* Copyright (c) 2013–2015 Brian Reavis & contributors
|
4 |
+
*
|
5 |
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
|
6 |
+
* file except in compliance with the License. You may obtain a copy of the License at:
|
7 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
8 |
+
*
|
9 |
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
10 |
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
|
11 |
+
* ANY KIND, either express or implied. See the License for the specific language
|
12 |
+
* governing permissions and limitations under the License.
|
13 |
+
*
|
14 |
+
* @author Brian Reavis <brian@thirdroute.com>
|
15 |
+
*/
|
16 |
+
.selectize-control.plugin-drag_drop.multi > .selectize-input > div.ui-sortable-placeholder {
|
17 |
+
visibility: visible !important;
|
18 |
+
background: #f2f2f2 !important;
|
19 |
+
background: rgba(0, 0, 0, 0.06) !important;
|
20 |
+
border: 0 none !important;
|
21 |
+
-webkit-box-shadow: inset 0 0 12px 4px #ffffff;
|
22 |
+
box-shadow: inset 0 0 12px 4px #ffffff;
|
23 |
+
}
|
24 |
+
.selectize-control.plugin-drag_drop .ui-sortable-placeholder::after {
|
25 |
+
content: '!';
|
26 |
+
visibility: hidden;
|
27 |
+
}
|
28 |
+
.selectize-control.plugin-drag_drop .ui-sortable-helper {
|
29 |
+
-webkit-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
|
30 |
+
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
|
31 |
+
}
|
32 |
+
.selectize-dropdown-header {
|
33 |
+
position: relative;
|
34 |
+
padding: 5px 8px;
|
35 |
+
border-bottom: 1px solid #d0d0d0;
|
36 |
+
background: #f8f8f8;
|
37 |
+
-webkit-border-radius: 3px 3px 0 0;
|
38 |
+
-moz-border-radius: 3px 3px 0 0;
|
39 |
+
border-radius: 3px 3px 0 0;
|
40 |
+
}
|
41 |
+
.selectize-dropdown-header-close {
|
42 |
+
position: absolute;
|
43 |
+
right: 8px;
|
44 |
+
top: 50%;
|
45 |
+
color: #303030;
|
46 |
+
opacity: 0.4;
|
47 |
+
margin-top: -12px;
|
48 |
+
line-height: 20px;
|
49 |
+
font-size: 20px !important;
|
50 |
+
}
|
51 |
+
.selectize-dropdown-header-close:hover {
|
52 |
+
color: #000000;
|
53 |
+
}
|
54 |
+
.selectize-dropdown.plugin-optgroup_columns .optgroup {
|
55 |
+
border-right: 1px solid #f2f2f2;
|
56 |
+
border-top: 0 none;
|
57 |
+
float: left;
|
58 |
+
-webkit-box-sizing: border-box;
|
59 |
+
-moz-box-sizing: border-box;
|
60 |
+
box-sizing: border-box;
|
61 |
+
}
|
62 |
+
.selectize-dropdown.plugin-optgroup_columns .optgroup:last-child {
|
63 |
+
border-right: 0 none;
|
64 |
+
}
|
65 |
+
.selectize-dropdown.plugin-optgroup_columns .optgroup:before {
|
66 |
+
display: none;
|
67 |
+
}
|
68 |
+
.selectize-dropdown.plugin-optgroup_columns .optgroup-header {
|
69 |
+
border-top: 0 none;
|
70 |
+
}
|
71 |
+
.selectize-control.plugin-remove_button [data-value] {
|
72 |
+
position: relative;
|
73 |
+
padding-right: 24px !important;
|
74 |
+
}
|
75 |
+
.selectize-control.plugin-remove_button [data-value] .remove {
|
76 |
+
z-index: 1;
|
77 |
+
/* fixes ie bug (see #392) */
|
78 |
+
position: absolute;
|
79 |
+
top: 0;
|
80 |
+
right: 0;
|
81 |
+
bottom: 0;
|
82 |
+
width: 17px;
|
83 |
+
text-align: center;
|
84 |
+
font-weight: bold;
|
85 |
+
font-size: 12px;
|
86 |
+
color: inherit;
|
87 |
+
text-decoration: none;
|
88 |
+
vertical-align: middle;
|
89 |
+
display: inline-block;
|
90 |
+
padding: 2px 0 0 0;
|
91 |
+
border-left: 1px solid #0073bb;
|
92 |
+
-webkit-border-radius: 0 2px 2px 0;
|
93 |
+
-moz-border-radius: 0 2px 2px 0;
|
94 |
+
border-radius: 0 2px 2px 0;
|
95 |
+
-webkit-box-sizing: border-box;
|
96 |
+
-moz-box-sizing: border-box;
|
97 |
+
box-sizing: border-box;
|
98 |
+
}
|
99 |
+
.selectize-control.plugin-remove_button [data-value] .remove:hover {
|
100 |
+
background: rgba(0, 0, 0, 0.05);
|
101 |
+
}
|
102 |
+
.selectize-control.plugin-remove_button [data-value].active .remove {
|
103 |
+
border-left-color: #00578d;
|
104 |
+
}
|
105 |
+
.selectize-control.plugin-remove_button .disabled [data-value] .remove:hover {
|
106 |
+
background: none;
|
107 |
+
}
|
108 |
+
.selectize-control.plugin-remove_button .disabled [data-value] .remove {
|
109 |
+
border-left-color: #aaaaaa;
|
110 |
+
}
|
111 |
+
.selectize-control {
|
112 |
+
position: relative;
|
113 |
+
}
|
114 |
+
.selectize-dropdown,
|
115 |
+
.selectize-input,
|
116 |
+
.selectize-input input {
|
117 |
+
color: #303030;
|
118 |
+
font-family: inherit;
|
119 |
+
font-size: 13px;
|
120 |
+
line-height: 18px;
|
121 |
+
-webkit-font-smoothing: inherit;
|
122 |
+
}
|
123 |
+
.selectize-input,
|
124 |
+
.selectize-control.single .selectize-input.input-active {
|
125 |
+
background: #ffffff;
|
126 |
+
cursor: text;
|
127 |
+
display: inline-block;
|
128 |
+
}
|
129 |
+
.selectize-input {
|
130 |
+
border: 1px solid #d0d0d0;
|
131 |
+
padding: 8px 8px;
|
132 |
+
display: inline-block;
|
133 |
+
width: 100%;
|
134 |
+
overflow: hidden;
|
135 |
+
position: relative;
|
136 |
+
z-index: 1;
|
137 |
+
-webkit-box-sizing: border-box;
|
138 |
+
-moz-box-sizing: border-box;
|
139 |
+
box-sizing: border-box;
|
140 |
+
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.1);
|
141 |
+
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.1);
|
142 |
+
-webkit-border-radius: 3px;
|
143 |
+
-moz-border-radius: 3px;
|
144 |
+
border-radius: 3px;
|
145 |
+
}
|
146 |
+
.selectize-control.multi .selectize-input.has-items {
|
147 |
+
padding: 5px 8px 2px;
|
148 |
+
}
|
149 |
+
.selectize-input.full {
|
150 |
+
background-color: #ffffff;
|
151 |
+
}
|
152 |
+
.selectize-input.disabled,
|
153 |
+
.selectize-input.disabled * {
|
154 |
+
cursor: default !important;
|
155 |
+
}
|
156 |
+
.selectize-input.focus {
|
157 |
+
-webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15);
|
158 |
+
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15);
|
159 |
+
}
|
160 |
+
.selectize-input.dropdown-active {
|
161 |
+
-webkit-border-radius: 3px 3px 0 0;
|
162 |
+
-moz-border-radius: 3px 3px 0 0;
|
163 |
+
border-radius: 3px 3px 0 0;
|
164 |
+
}
|
165 |
+
.selectize-input > * {
|
166 |
+
vertical-align: baseline;
|
167 |
+
display: -moz-inline-stack;
|
168 |
+
display: inline-block;
|
169 |
+
zoom: 1;
|
170 |
+
*display: inline;
|
171 |
+
}
|
172 |
+
.selectize-control.multi .selectize-input > div {
|
173 |
+
cursor: pointer;
|
174 |
+
margin: 0 3px 3px 0;
|
175 |
+
padding: 2px 6px;
|
176 |
+
background: #1da7ee;
|
177 |
+
color: #ffffff;
|
178 |
+
border: 1px solid #0073bb;
|
179 |
+
}
|
180 |
+
.selectize-control.multi .selectize-input > div.active {
|
181 |
+
background: #92c836;
|
182 |
+
color: #ffffff;
|
183 |
+
border: 1px solid #00578d;
|
184 |
+
}
|
185 |
+
.selectize-control.multi .selectize-input.disabled > div,
|
186 |
+
.selectize-control.multi .selectize-input.disabled > div.active {
|
187 |
+
color: #ffffff;
|
188 |
+
background: #d2d2d2;
|
189 |
+
border: 1px solid #aaaaaa;
|
190 |
+
}
|
191 |
+
.selectize-input > input {
|
192 |
+
display: inline-block !important;
|
193 |
+
padding: 0 !important;
|
194 |
+
min-height: 0 !important;
|
195 |
+
max-height: none !important;
|
196 |
+
max-width: 100% !important;
|
197 |
+
margin: 0 1px !important;
|
198 |
+
text-indent: 0 !important;
|
199 |
+
border: 0 none !important;
|
200 |
+
background: none !important;
|
201 |
+
line-height: inherit !important;
|
202 |
+
-webkit-user-select: auto !important;
|
203 |
+
-webkit-box-shadow: none !important;
|
204 |
+
box-shadow: none !important;
|
205 |
+
}
|
206 |
+
.selectize-input > input::-ms-clear {
|
207 |
+
display: none;
|
208 |
+
}
|
209 |
+
.selectize-input > input:focus {
|
210 |
+
outline: none !important;
|
211 |
+
}
|
212 |
+
.selectize-input::after {
|
213 |
+
content: ' ';
|
214 |
+
display: block;
|
215 |
+
clear: left;
|
216 |
+
}
|
217 |
+
.selectize-input.dropdown-active::before {
|
218 |
+
content: ' ';
|
219 |
+
display: block;
|
220 |
+
position: absolute;
|
221 |
+
background: #f0f0f0;
|
222 |
+
height: 1px;
|
223 |
+
bottom: 0;
|
224 |
+
left: 0;
|
225 |
+
right: 0;
|
226 |
+
}
|
227 |
+
.selectize-dropdown {
|
228 |
+
position: absolute;
|
229 |
+
z-index: 10;
|
230 |
+
border: 1px solid #d0d0d0;
|
231 |
+
background: #ffffff;
|
232 |
+
margin: -1px 0 0 0;
|
233 |
+
border-top: 0 none;
|
234 |
+
-webkit-box-sizing: border-box;
|
235 |
+
-moz-box-sizing: border-box;
|
236 |
+
box-sizing: border-box;
|
237 |
+
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
238 |
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
239 |
+
-webkit-border-radius: 0 0 3px 3px;
|
240 |
+
-moz-border-radius: 0 0 3px 3px;
|
241 |
+
border-radius: 0 0 3px 3px;
|
242 |
+
}
|
243 |
+
.selectize-dropdown [data-selectable] {
|
244 |
+
cursor: pointer;
|
245 |
+
overflow: hidden;
|
246 |
+
}
|
247 |
+
.selectize-dropdown [data-selectable] .highlight {
|
248 |
+
background: rgba(125, 168, 208, 0.2);
|
249 |
+
-webkit-border-radius: 1px;
|
250 |
+
-moz-border-radius: 1px;
|
251 |
+
border-radius: 1px;
|
252 |
+
}
|
253 |
+
.selectize-dropdown [data-selectable],
|
254 |
+
.selectize-dropdown .optgroup-header {
|
255 |
+
padding: 5px 8px;
|
256 |
+
}
|
257 |
+
.selectize-dropdown .optgroup:first-child .optgroup-header {
|
258 |
+
border-top: 0 none;
|
259 |
+
}
|
260 |
+
.selectize-dropdown .optgroup-header {
|
261 |
+
color: #303030;
|
262 |
+
background: #ffffff;
|
263 |
+
cursor: default;
|
264 |
+
}
|
265 |
+
.selectize-dropdown .active {
|
266 |
+
background-color: #f5fafd;
|
267 |
+
color: #495c68;
|
268 |
+
}
|
269 |
+
.selectize-dropdown .active.create {
|
270 |
+
color: #495c68;
|
271 |
+
}
|
272 |
+
.selectize-dropdown .create {
|
273 |
+
color: rgba(48, 48, 48, 0.5);
|
274 |
+
}
|
275 |
+
.selectize-dropdown-content {
|
276 |
+
overflow-y: auto;
|
277 |
+
overflow-x: hidden;
|
278 |
+
max-height: 200px;
|
279 |
+
}
|
280 |
+
.selectize-control.single .selectize-input,
|
281 |
+
.selectize-control.single .selectize-input input {
|
282 |
+
cursor: pointer;
|
283 |
+
}
|
284 |
+
.selectize-control.single .selectize-input.input-active,
|
285 |
+
.selectize-control.single .selectize-input.input-active input {
|
286 |
+
cursor: text;
|
287 |
+
}
|
288 |
+
.selectize-control.single .selectize-input:after {
|
289 |
+
content: ' ';
|
290 |
+
display: block;
|
291 |
+
position: absolute;
|
292 |
+
top: 50%;
|
293 |
+
right: 15px;
|
294 |
+
margin-top: -3px;
|
295 |
+
width: 0;
|
296 |
+
height: 0;
|
297 |
+
border-style: solid;
|
298 |
+
border-width: 5px 5px 0 5px;
|
299 |
+
border-color: #808080 transparent transparent transparent;
|
300 |
+
}
|
301 |
+
.selectize-control.single .selectize-input.dropdown-active:after {
|
302 |
+
margin-top: -4px;
|
303 |
+
border-width: 0 5px 5px 5px;
|
304 |
+
border-color: transparent transparent #808080 transparent;
|
305 |
+
}
|
306 |
+
.selectize-control.rtl.single .selectize-input:after {
|
307 |
+
left: 15px;
|
308 |
+
right: auto;
|
309 |
+
}
|
310 |
+
.selectize-control.rtl .selectize-input > input {
|
311 |
+
margin: 0 4px 0 -2px !important;
|
312 |
+
}
|
313 |
+
.selectize-control .selectize-input.disabled {
|
314 |
+
opacity: 0.5;
|
315 |
+
background-color: #fafafa;
|
316 |
+
}
|
317 |
+
.selectize-control.multi .selectize-input.has-items {
|
318 |
+
padding-left: 5px;
|
319 |
+
padding-right: 5px;
|
320 |
+
}
|
321 |
+
.selectize-control.multi .selectize-input.disabled [data-value] {
|
322 |
+
color: #999;
|
323 |
+
text-shadow: none;
|
324 |
+
background: none;
|
325 |
+
-webkit-box-shadow: none;
|
326 |
+
box-shadow: none;
|
327 |
+
}
|
328 |
+
.selectize-control.multi .selectize-input.disabled [data-value],
|
329 |
+
.selectize-control.multi .selectize-input.disabled [data-value] .remove {
|
330 |
+
border-color: #e6e6e6;
|
331 |
+
}
|
332 |
+
.selectize-control.multi .selectize-input.disabled [data-value] .remove {
|
333 |
+
background: none;
|
334 |
+
}
|
335 |
+
.selectize-control.multi .selectize-input [data-value] {
|
336 |
+
text-shadow: 0 1px 0 rgba(0, 51, 83, 0.3);
|
337 |
+
-webkit-border-radius: 3px;
|
338 |
+
-moz-border-radius: 3px;
|
339 |
+
border-radius: 3px;
|
340 |
+
background-color: #1b9dec;
|
341 |
+
background-image: -moz-linear-gradient(top, #1da7ee, #178ee9);
|
342 |
+
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#1da7ee), to(#178ee9));
|
343 |
+
background-image: -webkit-linear-gradient(top, #1da7ee, #178ee9);
|
344 |
+
background-image: -o-linear-gradient(top, #1da7ee, #178ee9);
|
345 |
+
background-image: linear-gradient(to bottom, #1da7ee, #178ee9);
|
346 |
+
background-repeat: repeat-x;
|
347 |
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff1da7ee', endColorstr='#ff178ee9', GradientType=0);
|
348 |
+
-webkit-box-shadow: 0 1px 0 rgba(0,0,0,0.2),inset 0 1px rgba(255,255,255,0.03);
|
349 |
+
box-shadow: 0 1px 0 rgba(0,0,0,0.2),inset 0 1px rgba(255,255,255,0.03);
|
350 |
+
}
|
351 |
+
.selectize-control.multi .selectize-input [data-value].active {
|
352 |
+
background-color: #0085d4;
|
353 |
+
background-image: -moz-linear-gradient(top, #008fd8, #0075cf);
|
354 |
+
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#008fd8), to(#0075cf));
|
355 |
+
background-image: -webkit-linear-gradient(top, #008fd8, #0075cf);
|
356 |
+
background-image: -o-linear-gradient(top, #008fd8, #0075cf);
|
357 |
+
background-image: linear-gradient(to bottom, #008fd8, #0075cf);
|
358 |
+
background-repeat: repeat-x;
|
359 |
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff008fd8', endColorstr='#ff0075cf', GradientType=0);
|
360 |
+
}
|
361 |
+
.selectize-control.single .selectize-input {
|
362 |
+
-webkit-box-shadow: 0 1px 0 rgba(0,0,0,0.05), inset 0 1px 0 rgba(255,255,255,0.8);
|
363 |
+
box-shadow: 0 1px 0 rgba(0,0,0,0.05), inset 0 1px 0 rgba(255,255,255,0.8);
|
364 |
+
background-color: #f9f9f9;
|
365 |
+
background-image: -moz-linear-gradient(top, #fefefe, #f2f2f2);
|
366 |
+
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fefefe), to(#f2f2f2));
|
367 |
+
background-image: -webkit-linear-gradient(top, #fefefe, #f2f2f2);
|
368 |
+
background-image: -o-linear-gradient(top, #fefefe, #f2f2f2);
|
369 |
+
background-image: linear-gradient(to bottom, #fefefe, #f2f2f2);
|
370 |
+
background-repeat: repeat-x;
|
371 |
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffefefe', endColorstr='#fff2f2f2', GradientType=0);
|
372 |
+
}
|
373 |
+
.selectize-control.single .selectize-input,
|
374 |
+
.selectize-dropdown.single {
|
375 |
+
border-color: #b8b8b8;
|
376 |
+
}
|
377 |
+
.selectize-dropdown .optgroup-header {
|
378 |
+
padding-top: 7px;
|
379 |
+
font-weight: bold;
|
380 |
+
font-size: 0.85em;
|
381 |
+
}
|
382 |
+
.selectize-dropdown .optgroup {
|
383 |
+
border-top: 1px solid #f0f0f0;
|
384 |
+
}
|
385 |
+
.selectize-dropdown .optgroup:first-child {
|
386 |
+
border-top: 0 none;
|
387 |
+
}
|
inc/custom-controls/layout/LICENSE.txt
ADDED
@@ -0,0 +1,340 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
GNU GENERAL PUBLIC LICENSE
|
2 |
+
Version 2, June 1991
|
3 |
+
|
4 |
+
Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/>
|
5 |
+
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
6 |
+
Everyone is permitted to copy and distribute verbatim copies
|
7 |
+
of this license document, but changing it is not allowed.
|
8 |
+
|
9 |
+
Preamble
|
10 |
+
|
11 |
+
The licenses for most software are designed to take away your
|
12 |
+
freedom to share and change it. By contrast, the GNU General Public
|
13 |
+
License is intended to guarantee your freedom to share and change free
|
14 |
+
software--to make sure the software is free for all its users. This
|
15 |
+
General Public License applies to most of the Free Software
|
16 |
+
Foundation's software and to any other program whose authors commit to
|
17 |
+
using it. (Some other Free Software Foundation software is covered by
|
18 |
+
the GNU Lesser General Public License instead.) You can apply it to
|
19 |
+
your programs, too.
|
20 |
+
|
21 |
+
When we speak of free software, we are referring to freedom, not
|
22 |
+
price. Our General Public Licenses are designed to make sure that you
|
23 |
+
have the freedom to distribute copies of free software (and charge for
|
24 |
+
this service if you wish), that you receive source code or can get it
|
25 |
+
if you want it, that you can change the software or use pieces of it
|
26 |
+
in new free programs; and that you know you can do these things.
|
27 |
+
|
28 |
+
To protect your rights, we need to make restrictions that forbid
|
29 |
+
anyone to deny you these rights or to ask you to surrender the rights.
|
30 |
+
These restrictions translate to certain responsibilities for you if you
|
31 |
+
distribute copies of the software, or if you modify it.
|
32 |
+
|
33 |
+
For example, if you distribute copies of such a program, whether
|
34 |
+
gratis or for a fee, you must give the recipients all the rights that
|
35 |
+
you have. You must make sure that they, too, receive or can get the
|
36 |
+
source code. And you must show them these terms so they know their
|
37 |
+
rights.
|
38 |
+
|
39 |
+
We protect your rights with two steps: (1) copyright the software, and
|
40 |
+
(2) offer you this license which gives you legal permission to copy,
|
41 |
+
distribute and/or modify the software.
|
42 |
+
|
43 |
+
Also, for each author's protection and ours, we want to make certain
|
44 |
+
that everyone understands that there is no warranty for this free
|
45 |
+
software. If the software is modified by someone else and passed on, we
|
46 |
+
want its recipients to know that what they have is not the original, so
|
47 |
+
that any problems introduced by others will not reflect on the original
|
48 |
+
authors' reputations.
|
49 |
+
|
50 |
+
Finally, any free program is threatened constantly by software
|
51 |
+
patents. We wish to avoid the danger that redistributors of a free
|
52 |
+
program will individually obtain patent licenses, in effect making the
|
53 |
+
program proprietary. To prevent this, we have made it clear that any
|
54 |
+
patent must be licensed for everyone's free use or not licensed at all.
|
55 |
+
|
56 |
+
The precise terms and conditions for copying, distribution and
|
57 |
+
modification follow.
|
58 |
+
|
59 |
+
GNU GENERAL PUBLIC LICENSE
|
60 |
+
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
61 |
+
|
62 |
+
0. This License applies to any program or other work which contains
|
63 |
+
a notice placed by the copyright holder saying it may be distributed
|
64 |
+
under the terms of this General Public License. The "Program", below,
|
65 |
+
refers to any such program or work, and a "work based on the Program"
|
66 |
+
means either the Program or any derivative work under copyright law:
|
67 |
+
that is to say, a work containing the Program or a portion of it,
|
68 |
+
either verbatim or with modifications and/or translated into another
|
69 |
+
language. (Hereinafter, translation is included without limitation in
|
70 |
+
the term "modification".) Each licensee is addressed as "you".
|
71 |
+
|
72 |
+
Activities other than copying, distribution and modification are not
|
73 |
+
covered by this License; they are outside its scope. The act of
|
74 |
+
running the Program is not restricted, and the output from the Program
|
75 |
+
is covered only if its contents constitute a work based on the
|
76 |
+
Program (independent of having been made by running the Program).
|
77 |
+
Whether that is true depends on what the Program does.
|
78 |
+
|
79 |
+
1. You may copy and distribute verbatim copies of the Program's
|
80 |
+
source code as you receive it, in any medium, provided that you
|
81 |
+
conspicuously and appropriately publish on each copy an appropriate
|
82 |
+
copyright notice and disclaimer of warranty; keep intact all the
|
83 |
+
notices that refer to this License and to the absence of any warranty;
|
84 |
+
and give any other recipients of the Program a copy of this License
|
85 |
+
along with the Program.
|
86 |
+
|
87 |
+
You may charge a fee for the physical act of transferring a copy, and
|
88 |
+
you may at your option offer warranty protection in exchange for a fee.
|
89 |
+
|
90 |
+
2. You may modify your copy or copies of the Program or any portion
|
91 |
+
of it, thus forming a work based on the Program, and copy and
|
92 |
+
distribute such modifications or work under the terms of Section 1
|
93 |
+
above, provided that you also meet all of these conditions:
|
94 |
+
|
95 |
+
a) You must cause the modified files to carry prominent notices
|
96 |
+
stating that you changed the files and the date of any change.
|
97 |
+
|
98 |
+
b) You must cause any work that you distribute or publish, that in
|
99 |
+
whole or in part contains or is derived from the Program or any
|
100 |
+
part thereof, to be licensed as a whole at no charge to all third
|
101 |
+
parties under the terms of this License.
|
102 |
+
|
103 |
+
c) If the modified program normally reads commands interactively
|
104 |
+
when run, you must cause it, when started running for such
|
105 |
+
interactive use in the most ordinary way, to print or display an
|
106 |
+
announcement including an appropriate copyright notice and a
|
107 |
+
notice that there is no warranty (or else, saying that you provide
|
108 |
+
a warranty) and that users may redistribute the program under
|
109 |
+
these conditions, and telling the user how to view a copy of this
|
110 |
+
License. (Exception: if the Program itself is interactive but
|
111 |
+
does not normally print such an announcement, your work based on
|
112 |
+
the Program is not required to print an announcement.)
|
113 |
+
|
114 |
+
These requirements apply to the modified work as a whole. If
|
115 |
+
identifiable sections of that work are not derived from the Program,
|
116 |
+
and can be reasonably considered independent and separate works in
|
117 |
+
themselves, then this License, and its terms, do not apply to those
|
118 |
+
sections when you distribute them as separate works. But when you
|
119 |
+
distribute the same sections as part of a whole which is a work based
|
120 |
+
on the Program, the distribution of the whole must be on the terms of
|
121 |
+
this License, whose permissions for other licensees extend to the
|
122 |
+
entire whole, and thus to each and every part regardless of who wrote it.
|
123 |
+
|
124 |
+
Thus, it is not the intent of this section to claim rights or contest
|
125 |
+
your rights to work written entirely by you; rather, the intent is to
|
126 |
+
exercise the right to control the distribution of derivative or
|
127 |
+
collective works based on the Program.
|
128 |
+
|
129 |
+
In addition, mere aggregation of another work not based on the Program
|
130 |
+
with the Program (or with a work based on the Program) on a volume of
|
131 |
+
a storage or distribution medium does not bring the other work under
|
132 |
+
the scope of this License.
|
133 |
+
|
134 |
+
3. You may copy and distribute the Program (or a work based on it,
|
135 |
+
under Section 2) in object code or executable form under the terms of
|
136 |
+
Sections 1 and 2 above provided that you also do one of the following:
|
137 |
+
|
138 |
+
a) Accompany it with the complete corresponding machine-readable
|
139 |
+
source code, which must be distributed under the terms of Sections
|
140 |
+
1 and 2 above on a medium customarily used for software interchange; or,
|
141 |
+
|
142 |
+
b) Accompany it with a written offer, valid for at least three
|
143 |
+
years, to give any third party, for a charge no more than your
|
144 |
+
cost of physically performing source distribution, a complete
|
145 |
+
machine-readable copy of the corresponding source code, to be
|
146 |
+
distributed under the terms of Sections 1 and 2 above on a medium
|
147 |
+
customarily used for software interchange; or,
|
148 |
+
|
149 |
+
c) Accompany it with the information you received as to the offer
|
150 |
+
to distribute corresponding source code. (This alternative is
|
151 |
+
allowed only for noncommercial distribution and only if you
|
152 |
+
received the program in object code or executable form with such
|
153 |
+
an offer, in accord with Subsection b above.)
|
154 |
+
|
155 |
+
The source code for a work means the preferred form of the work for
|
156 |
+
making modifications to it. For an executable work, complete source
|
157 |
+
code means all the source code for all modules it contains, plus any
|
158 |
+
associated interface definition files, plus the scripts used to
|
159 |
+
control compilation and installation of the executable. However, as a
|
160 |
+
special exception, the source code distributed need not include
|
161 |
+
anything that is normally distributed (in either source or binary
|
162 |
+
form) with the major components (compiler, kernel, and so on) of the
|
163 |
+
operating system on which the executable runs, unless that component
|
164 |
+
itself accompanies the executable.
|
165 |
+
|
166 |
+
If distribution of executable or object code is made by offering
|
167 |
+
access to copy from a designated place, then offering equivalent
|
168 |
+
access to copy the source code from the same place counts as
|
169 |
+
distribution of the source code, even though third parties are not
|
170 |
+
compelled to copy the source along with the object code.
|
171 |
+
|
172 |
+
4. You may not copy, modify, sublicense, or distribute the Program
|
173 |
+
except as expressly provided under this License. Any attempt
|
174 |
+
otherwise to copy, modify, sublicense or distribute the Program is
|
175 |
+
void, and will automatically terminate your rights under this License.
|
176 |
+
However, parties who have received copies, or rights, from you under
|
177 |
+
this License will not have their licenses terminated so long as such
|
178 |
+
parties remain in full compliance.
|
179 |
+
|
180 |
+
5. You are not required to accept this License, since you have not
|
181 |
+
signed it. However, nothing else grants you permission to modify or
|
182 |
+
distribute the Program or its derivative works. These actions are
|
183 |
+
prohibited by law if you do not accept this License. Therefore, by
|
184 |
+
modifying or distributing the Program (or any work based on the
|
185 |
+
Program), you indicate your acceptance of this License to do so, and
|
186 |
+
all its terms and conditions for copying, distributing or modifying
|
187 |
+
the Program or works based on it.
|
188 |
+
|
189 |
+
6. Each time you redistribute the Program (or any work based on the
|
190 |
+
Program), the recipient automatically receives a license from the
|
191 |
+
original licensor to copy, distribute or modify the Program subject to
|
192 |
+
these terms and conditions. You may not impose any further
|
193 |
+
restrictions on the recipients' exercise of the rights granted herein.
|
194 |
+
You are not responsible for enforcing compliance by third parties to
|
195 |
+
this License.
|
196 |
+
|
197 |
+
7. If, as a consequence of a court judgment or allegation of patent
|
198 |
+
infringement or for any other reason (not limited to patent issues),
|
199 |
+
conditions are imposed on you (whether by court order, agreement or
|
200 |
+
otherwise) that contradict the conditions of this License, they do not
|
201 |
+
excuse you from the conditions of this License. If you cannot
|
202 |
+
distribute so as to satisfy simultaneously your obligations under this
|
203 |
+
License and any other pertinent obligations, then as a consequence you
|
204 |
+
may not distribute the Program at all. For example, if a patent
|
205 |
+
license would not permit royalty-free redistribution of the Program by
|
206 |
+
all those who receive copies directly or indirectly through you, then
|
207 |
+
the only way you could satisfy both it and this License would be to
|
208 |
+
refrain entirely from distribution of the Program.
|
209 |
+
|
210 |
+
If any portion of this section is held invalid or unenforceable under
|
211 |
+
any particular circumstance, the balance of the section is intended to
|
212 |
+
apply and the section as a whole is intended to apply in other
|
213 |
+
circumstances.
|
214 |
+
|
215 |
+
It is not the purpose of this section to induce you to infringe any
|
216 |
+
patents or other property right claims or to contest validity of any
|
217 |
+
such claims; this section has the sole purpose of protecting the
|
218 |
+
integrity of the free software distribution system, which is
|
219 |
+
implemented by public license practices. Many people have made
|
220 |
+
generous contributions to the wide range of software distributed
|
221 |
+
through that system in reliance on consistent application of that
|
222 |
+
system; it is up to the author/donor to decide if he or she is willing
|
223 |
+
to distribute software through any other system and a licensee cannot
|
224 |
+
impose that choice.
|
225 |
+
|
226 |
+
This section is intended to make thoroughly clear what is believed to
|
227 |
+
be a consequence of the rest of this License.
|
228 |
+
|
229 |
+
8. If the distribution and/or use of the Program is restricted in
|
230 |
+
certain countries either by patents or by copyrighted interfaces, the
|
231 |
+
original copyright holder who places the Program under this License
|
232 |
+
may add an explicit geographical distribution limitation excluding
|
233 |
+
those countries, so that distribution is permitted only in or among
|
234 |
+
countries not thus excluded. In such case, this License incorporates
|
235 |
+
the limitation as if written in the body of this License.
|
236 |
+
|
237 |
+
9. The Free Software Foundation may publish revised and/or new versions
|
238 |
+
of the General Public License from time to time. Such new versions will
|
239 |
+
be similar in spirit to the present version, but may differ in detail to
|
240 |
+
address new problems or concerns.
|
241 |
+
|
242 |
+
Each version is given a distinguishing version number. If the Program
|
243 |
+
specifies a version number of this License which applies to it and "any
|
244 |
+
later version", you have the option of following the terms and conditions
|
245 |
+
either of that version or of any later version published by the Free
|
246 |
+
Software Foundation. If the Program does not specify a version number of
|
247 |
+
this License, you may choose any version ever published by the Free Software
|
248 |
+
Foundation.
|
249 |
+
|
250 |
+
10. If you wish to incorporate parts of the Program into other free
|
251 |
+
programs whose distribution conditions are different, write to the author
|
252 |
+
to ask for permission. For software which is copyrighted by the Free
|
253 |
+
Software Foundation, write to the Free Software Foundation; we sometimes
|
254 |
+
make exceptions for this. Our decision will be guided by the two goals
|
255 |
+
of preserving the free status of all derivatives of our free software and
|
256 |
+
of promoting the sharing and reuse of software generally.
|
257 |
+
|
258 |
+
NO WARRANTY
|
259 |
+
|
260 |
+
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
261 |
+
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
262 |
+
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
263 |
+
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
264 |
+
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
265 |
+
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
266 |
+
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
267 |
+
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
268 |
+
REPAIR OR CORRECTION.
|
269 |
+
|
270 |
+
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
271 |
+
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
272 |
+
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
273 |
+
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
274 |
+
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
275 |
+
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
276 |
+
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
277 |
+
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
278 |
+
POSSIBILITY OF SUCH DAMAGES.
|
279 |
+
|
280 |
+
END OF TERMS AND CONDITIONS
|
281 |
+
|
282 |
+
How to Apply These Terms to Your New Programs
|
283 |
+
|
284 |
+
If you develop a new program, and you want it to be of the greatest
|
285 |
+
possible use to the public, the best way to achieve this is to make it
|
286 |
+
free software which everyone can redistribute and change under these terms.
|
287 |
+
|
288 |
+
To do so, attach the following notices to the program. It is safest
|
289 |
+
to attach them to the start of each source file to most effectively
|
290 |
+
convey the exclusion of warranty; and each file should have at least
|
291 |
+
the "copyright" line and a pointer to where the full notice is found.
|
292 |
+
|
293 |
+
{description}
|
294 |
+
Copyright (C) {year} {fullname}
|
295 |
+
|
296 |
+
This program is free software; you can redistribute it and/or modify
|
297 |
+
it under the terms of the GNU General Public License as published by
|
298 |
+
the Free Software Foundation; either version 2 of the License, or
|
299 |
+
(at your option) any later version.
|
300 |
+
|
301 |
+
This program is distributed in the hope that it will be useful,
|
302 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
303 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
304 |
+
GNU General Public License for more details.
|
305 |
+
|
306 |
+
You should have received a copy of the GNU General Public License along
|
307 |
+
with this program; if not, write to the Free Software Foundation, Inc.,
|
308 |
+
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
309 |
+
|
310 |
+
Also add information on how to contact you by electronic and paper mail.
|
311 |
+
|
312 |
+
If the program is interactive, make it output a short notice like this
|
313 |
+
when it starts in an interactive mode:
|
314 |
+
|
315 |
+
Gnomovision version 69, Copyright (C) year name of author
|
316 |
+
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
317 |
+
This is free software, and you are welcome to redistribute it
|
318 |
+
under certain conditions; type `show c' for details.
|
319 |
+
|
320 |
+
The hypothetical commands `show w' and `show c' should show the appropriate
|
321 |
+
parts of the General Public License. Of course, the commands you use may
|
322 |
+
be called something other than `show w' and `show c'; they could even be
|
323 |
+
mouse-clicks or menu items--whatever suits your program.
|
324 |
+
|
325 |
+
You should also get your employer (if you work as a programmer) or your
|
326 |
+
school, if any, to sign a "copyright disclaimer" for the program, if
|
327 |
+
necessary. Here is a sample; alter the names:
|
328 |
+
|
329 |
+
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
330 |
+
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
331 |
+
|
332 |
+
{signature of Ty Coon}, 1 April 1989
|
333 |
+
Ty Coon, President of Vice
|
334 |
+
|
335 |
+
This General Public License does not permit incorporating your program into
|
336 |
+
proprietary programs. If your program is a subroutine library, you may
|
337 |
+
consider it more useful to permit linking proprietary applications with the
|
338 |
+
library. If this is what you want to do, use the GNU Lesser General
|
339 |
+
Public License instead of this License.
|
340 |
+
|
inc/custom-controls/layout/assets/customizer-control.css
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
ul.fx-share-multicheck-sortable-list .fx-share-multicheck-sortable-handle{
|
2 |
+
float: right;
|
3 |
+
cursor: move;
|
4 |
+
}
|
5 |
+
ul.fx-share-multicheck-sortable-list li{
|
6 |
+
padding: 7px;
|
7 |
+
border: 1px solid #e5e5e5;
|
8 |
+
background: #fafafa;
|
9 |
+
}
|
10 |
+
.fx-share-hideme{
|
11 |
+
display: none !important;
|
12 |
+
}
|
inc/custom-controls/layout/assets/customizer-control.js
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery( document ).ready( function($) {
|
2 |
+
|
3 |
+
/* === Sortable Multi-CheckBoxes === */
|
4 |
+
|
5 |
+
/* Make it sortable. */
|
6 |
+
$( 'ul.fx-share-multicheck-sortable-list' ).sortable({
|
7 |
+
handle: '.fx-share-multicheck-sortable-handle',
|
8 |
+
axis: 'y',
|
9 |
+
update: function( e, ui ){
|
10 |
+
$('input.fx-share-multicheck-sortable-item').trigger( 'change' );
|
11 |
+
}
|
12 |
+
});
|
13 |
+
|
14 |
+
/* On changing the value. */
|
15 |
+
$( "input.fx-share-multicheck-sortable-item" ).on( 'change', function() {
|
16 |
+
|
17 |
+
/* Get the value, and convert to string. */
|
18 |
+
this_checkboxes_values = $( this ).parents( 'ul.fx-share-multicheck-sortable-list' ).find( 'input.fx-share-multicheck-sortable-item' ).map( function() {
|
19 |
+
var active = '0';
|
20 |
+
if( $(this).prop("checked") ){
|
21 |
+
var active = '1';
|
22 |
+
}
|
23 |
+
return this.name + ':' + active;
|
24 |
+
}).get().join( ',' );
|
25 |
+
|
26 |
+
/* Add the value to hidden input. */
|
27 |
+
$( this ).parents( 'ul.fx-share-multicheck-sortable-list' ).find( 'input.fx-share-multicheck-sortable' ).val( this_checkboxes_values ).trigger( 'change' );
|
28 |
+
|
29 |
+
});
|
30 |
+
|
31 |
+
/* === Multi-CheckBoxes === */
|
32 |
+
|
33 |
+
/* On changing the value. */
|
34 |
+
$( "input.fx-share-multicheck-item" ).on( 'change', function() {
|
35 |
+
|
36 |
+
/* Get the value (only the "checked" item), and convert to comma separated string. */
|
37 |
+
this_checkboxes_values = $( this ).parents( 'ul.fx-share-multicheck-list' ).find( 'input.fx-share-multicheck-item:checked' ).map( function() {
|
38 |
+
return this.name;
|
39 |
+
}).get().join( ',' );
|
40 |
+
|
41 |
+
/* Add the value to hidden input. */
|
42 |
+
$( this ).parents( 'ul.fx-share-multicheck-list' ).find( 'input.fx-share-multicheck' ).val( this_checkboxes_values ).trigger( 'change' );
|
43 |
+
|
44 |
+
});
|
45 |
+
});
|
inc/custom-controls/layout/assets/fx-share-icons/fonts/fx-share.eot
ADDED
Binary file
|
inc/custom-controls/layout/assets/fx-share-icons/fonts/fx-share.svg
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" standalone="no"?>
|
2 |
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
3 |
+
<svg xmlns="http://www.w3.org/2000/svg">
|
4 |
+
<metadata>Generated by Fontastic.me</metadata>
|
5 |
+
<defs>
|
6 |
+
<font id="fx-share" horiz-adv-x="512">
|
7 |
+
<font-face font-family="fx-share" units-per-em="512" ascent="480" descent="-32"/>
|
8 |
+
<missing-glyph horiz-adv-x="512" />
|
9 |
+
|
10 |
+
<glyph unicode="f" d="M292 353l74 0-9-81-65 0 0-235-97 0 0 235-49 0 0 81 49 0 0 49c0 35 8 61 24 79 17 18 44 26 81 26l65 0 0-81-40 0c-8 0-14 0-18-2-5-1-8-3-10-6-2-4-3-7-4-10 0-3-1-8-1-14z"/>
|
11 |
+
<glyph unicode="t" d="M481 395c-13-18-28-34-46-47 0-3 0-7 0-12 0-25-3-50-11-74-7-25-18-49-33-71-14-23-32-43-52-61-21-17-45-31-74-41-29-11-60-16-92-16-52 0-99 14-142 42 7-1 14-2 22-2 43 0 81 14 115 40-20 0-38 6-54 18-16 12-27 27-33 46 7-1 13-2 18-2 8 0 16 1 24 4-21 4-39 15-53 31-14 17-21 37-21 59l0 1c13-7 27-11 42-11-13 8-23 19-30 32-8 14-11 29-11 44 0 17 4 33 12 47 23-28 51-51 84-68 33-17 69-27 107-29-2 8-3 15-3 22 0 25 9 47 27 65 18 18 40 27 66 27 26 0 49-10 67-29 21 4 40 11 59 22-7-22-21-39-41-51 18 2 35 7 53 14z"/>
|
12 |
+
<glyph unicode="g" d="M269 93c0 4-1 8-2 12-1 4-1 7-2 10-1 3-3 7-5 10-3 4-5 6-6 9-2 2-5 5-8 8-3 4-6 6-8 8-2 1-5 4-9 7-4 3-7 5-9 6-1 2-5 4-9 7-5 3-8 5-9 6-3 0-8 1-14 1-11 0-21-1-31-2-9-2-20-4-30-8-11-3-20-7-28-13-8-5-15-12-20-21-5-9-8-19-8-31 0-13 4-24 10-34 7-11 16-19 27-24 11-6 22-11 34-13 12-3 24-5 37-5 11 0 22 1 32 4 10 2 19 6 28 11 9 5 16 12 22 21 5 9 8 19 8 31z m-35 247c0 11-1 23-4 36-4 13-8 25-14 37-6 12-14 22-24 30-10 8-21 12-34 12-18 0-31-7-41-20-10-13-15-29-15-47 0-9 1-18 4-28 2-10 5-20 10-30 4-10 10-19 16-27 6-8 13-14 22-19 9-5 18-7 28-7 18 0 32 5 40 17 8 11 12 27 12 46z m-37 135l125 0-39-22-38 0c13-9 24-21 31-36 7-16 11-32 11-48 0-15-2-27-6-38-5-11-10-20-16-26-7-7-13-13-19-19-7-5-12-11-16-17-5-6-7-13-7-20 0-5 2-9 5-14 3-5 7-9 12-14 5-4 11-9 17-14 6-4 12-10 18-15 6-6 12-13 17-19 5-7 9-15 12-25 3-9 5-19 5-30 0-30-13-57-40-81-29-25-69-37-120-37-11 0-23 1-34 3-12 2-23 5-35 9-12 5-22 10-31 17-9 7-16 15-22 25-6 11-9 22-9 35 0 12 4 25 11 39 6 12 15 22 27 31 12 9 26 16 42 21 15 4 30 8 44 10 14 2 28 3 43 4-12 16-18 30-18 42 0 3 0 5 0 7 1 2 1 4 2 6 0 1 1 3 2 6 1 2 1 4 2 6-8-1-14-2-20-2-29 0-53 10-73 28-20 19-31 43-31 71 0 26 9 50 28 71 18 21 40 35 66 41 18 4 36 5 54 5z m297-73l0-36-73 0 0-73-37 0 0 73-73 0 0 36 73 0 0 73 37 0 0-73z"/>
|
13 |
+
</font></defs></svg>
|
inc/custom-controls/layout/assets/fx-share-icons/fonts/fx-share.ttf
ADDED
Binary file
|
inc/custom-controls/layout/assets/fx-share-icons/fonts/fx-share.woff
ADDED
Binary file
|
inc/custom-controls/layout/assets/fx-share-icons/fx-share-icons.css
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@charset "UTF-8";
|
2 |
+
|
3 |
+
@font-face {
|
4 |
+
font-family: "fx-share";
|
5 |
+
src:url("fonts/fx-share.eot");
|
6 |
+
src:url("fonts/fx-share.eot?#iefix") format("embedded-opentype"),
|
7 |
+
url("fonts/fx-share.woff") format("woff"),
|
8 |
+
url("fonts/fx-share.ttf") format("truetype"),
|
9 |
+
url("fonts/fx-share.svg#fx-share") format("svg");
|
10 |
+
font-weight: normal;
|
11 |
+
font-style: normal;
|
12 |
+
|
13 |
+
}
|
14 |
+
|
15 |
+
[data-icon]:before {
|
16 |
+
font-family: "fx-share" !important;
|
17 |
+
content: attr(data-icon);
|
18 |
+
font-style: normal !important;
|
19 |
+
font-weight: normal !important;
|
20 |
+
font-variant: normal !important;
|
21 |
+
text-transform: none !important;
|
22 |
+
speak: none;
|
23 |
+
line-height: 1;
|
24 |
+
-webkit-font-smoothing: antialiased;
|
25 |
+
-moz-osx-font-smoothing: grayscale;
|
26 |
+
}
|
27 |
+
|
28 |
+
[class^="icon-"]:before,
|
29 |
+
[class*=" icon-"]:before {
|
30 |
+
font-family: "fx-share" !important;
|
31 |
+
font-style: normal !important;
|
32 |
+
font-weight: normal !important;
|
33 |
+
font-variant: normal !important;
|
34 |
+
text-transform: none !important;
|
35 |
+
speak: none;
|
36 |
+
line-height: 1;
|
37 |
+
-webkit-font-smoothing: antialiased;
|
38 |
+
-moz-osx-font-smoothing: grayscale;
|
39 |
+
}
|
40 |
+
|
41 |
+
.icon-facebook:before {
|
42 |
+
content: "f";
|
43 |
+
}
|
44 |
+
.icon-twitter:before {
|
45 |
+
content: "t";
|
46 |
+
}
|
47 |
+
.icon-google-plus:before {
|
48 |
+
content: "g";
|
49 |
+
}
|
inc/custom-controls/layout/assets/fx-share.css
ADDED
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.fx-share{
|
2 |
+
clear: both;
|
3 |
+
}
|
4 |
+
.fx-share:before,
|
5 |
+
.fx-share:after{
|
6 |
+
content:".";display:block;height:0;clear:both;visibility:hidden;
|
7 |
+
}
|
8 |
+
.fx-share ul{
|
9 |
+
padding: 0 !important;
|
10 |
+
margin: 0 0 .7em 0 !important;
|
11 |
+
list-style: none !important;
|
12 |
+
}
|
13 |
+
.fx-share ul li{
|
14 |
+
display: inline-block;
|
15 |
+
}
|
16 |
+
|
17 |
+
|
18 |
+
/* Buttons */
|
19 |
+
.fx-share-button{
|
20 |
+
text-decoration: none !important;
|
21 |
+
display: inline-block;
|
22 |
+
margin: 0 5px 5px 0;
|
23 |
+
font-size: 12px;
|
24 |
+
font-family: "Open Sans", sans-serif;
|
25 |
+
font-weight: normal;
|
26 |
+
border-radius: 3px;
|
27 |
+
color: #777 !important;
|
28 |
+
background: #f8f8f8;
|
29 |
+
border: 1px solid #cccccc;
|
30 |
+
box-shadow: 0 1px 0 rgba(0,0,0,.08);
|
31 |
+
text-shadow: none;
|
32 |
+
line-height: 23px;
|
33 |
+
padding: 1px 8px 0px 5px;
|
34 |
+
}
|
35 |
+
.fx-share-button:hover,
|
36 |
+
.fx-share-button:focus,
|
37 |
+
.fx-share-button:active{
|
38 |
+
color: #555;
|
39 |
+
background: #fafafa;
|
40 |
+
border: 1px solid #999999;
|
41 |
+
}
|
42 |
+
.fx-share-button:active{
|
43 |
+
box-shadow: inset 0 1px 0 rgba(0,0,0,.16);
|
44 |
+
}
|
45 |
+
.fx-share-button:before{
|
46 |
+
content: "";
|
47 |
+
font-family: "fx-share";
|
48 |
+
vertical-align: top;
|
49 |
+
margin-right: 3px;
|
50 |
+
-webkit-font-smoothing: antialiased;
|
51 |
+
}
|
52 |
+
.fx-share-button-facebook:before{
|
53 |
+
content: "f";
|
54 |
+
}
|
55 |
+
.fx-share-button-twitter:before{
|
56 |
+
content: "t";
|
57 |
+
}
|
58 |
+
.fx-share-button-google_plus:before{
|
59 |
+
content: "g";
|
60 |
+
}
|
inc/custom-controls/layout/fx-share.php
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Plugin Name: f(x) Share
|
4 |
+
* Plugin URI: http://genbu.me/plugins/fx-share/
|
5 |
+
* Description: Simple sharing plugin. Easily add Facebook, Twitter, and Google+ share button to your content.
|
6 |
+
* Version: 1.0.0
|
7 |
+
* Author: David Chandra Purnama
|
8 |
+
* Author URI: http://shellcreeper.com/
|
9 |
+
*
|
10 |
+
* This program is free software; you can redistribute it and/or modify it under the terms of the GNU
|
11 |
+
* General Public License version 2, as published by the Free Software Foundation. You may NOT assume
|
12 |
+
* that you can use any other version of the GPL.
|
13 |
+
*
|
14 |
+
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
|
15 |
+
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
16 |
+
*
|
17 |
+
* @author David Chandra Purnama <david@genbu.me>
|
18 |
+
* @copyright Copyright (c) 2015, Genbu Media
|
19 |
+
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
20 |
+
**/
|
21 |
+
|
22 |
+
/* Plugin Version. */
|
23 |
+
define( 'FX_SHARE_VERSION', '1.0.0' );
|
24 |
+
|
25 |
+
/* Path to plugin directory. */
|
26 |
+
define( 'FX_SHARE_PATH', trailingslashit( plugin_dir_path( __FILE__ ) ) );
|
27 |
+
|
28 |
+
/* Plugin URL. */
|
29 |
+
define( 'FX_SHARE_URL', trailingslashit( plugin_dir_url( __FILE__ ) ) );
|
30 |
+
|
31 |
+
/* Load it on init */
|
32 |
+
add_action( 'plugins_loaded', 'fx_share_load' );
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Do Stuff.
|
36 |
+
* @since 0.1.0
|
37 |
+
*/
|
38 |
+
function fx_share_load(){
|
39 |
+
|
40 |
+
/* Load Functions */
|
41 |
+
require_once( FX_SHARE_PATH . 'includes/functions.php' );
|
42 |
+
|
43 |
+
/* Load Customizer Settings */
|
44 |
+
require_once( FX_SHARE_PATH . 'includes/customizer.php' );
|
45 |
+
|
46 |
+
/* Load Sanitize Functions */
|
47 |
+
require_once( FX_SHARE_PATH . 'includes/sanitize.php' );
|
48 |
+
|
49 |
+
/* Load Setup Functions */
|
50 |
+
require_once( FX_SHARE_PATH . 'includes/setup.php' );
|
51 |
+
|
52 |
+
}
|
inc/custom-controls/layout/includes/customizer-controls.php
ADDED
@@ -0,0 +1,173 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Sortable multi check boxes custom control.
|
4 |
+
* @since 0.1.0
|
5 |
+
* @author David Chandra Purnama <david@genbu.me>
|
6 |
+
* @copyright Copyright (c) 2015, Genbu Media
|
7 |
+
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
8 |
+
*/
|
9 |
+
class specia_layout_Customize_Control_Sortable_Checkboxes extends WP_Customize_Control {
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Control Type
|
13 |
+
*/
|
14 |
+
public $type = 'fx-share-multicheck-sortable';
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Enqueue Scripts
|
18 |
+
*/
|
19 |
+
public function enqueue() {
|
20 |
+
wp_enqueue_style( 'fx-share-customize' );
|
21 |
+
wp_enqueue_script( 'fx-share-customize' );
|
22 |
+
}
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Render Settings
|
26 |
+
*/
|
27 |
+
public function render_content() {
|
28 |
+
|
29 |
+
/* if no choices, bail. */
|
30 |
+
if ( empty( $this->choices ) ){
|
31 |
+
return;
|
32 |
+
} ?>
|
33 |
+
|
34 |
+
<?php if ( !empty( $this->label ) ){ ?>
|
35 |
+
<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
|
36 |
+
<?php } // add label if needed. ?>
|
37 |
+
|
38 |
+
<?php if ( !empty( $this->description ) ){ ?>
|
39 |
+
<span class="description customize-control-description"><?php echo $this->description; ?></span>
|
40 |
+
<?php } // add desc if needed. ?>
|
41 |
+
|
42 |
+
<?php
|
43 |
+
/* Data */
|
44 |
+
$values = explode( ',', $this->value() );
|
45 |
+
$choices = $this->choices;
|
46 |
+
|
47 |
+
/* If values exist, use it. */
|
48 |
+
$options = array();
|
49 |
+
if( $values ){
|
50 |
+
|
51 |
+
/* get individual item */
|
52 |
+
foreach( $values as $value ){
|
53 |
+
|
54 |
+
/* separate item with option */
|
55 |
+
$value = explode( ':', $value );
|
56 |
+
|
57 |
+
/* build the array. remove options not listed on choices. */
|
58 |
+
if ( array_key_exists( $value[0], $choices ) ){
|
59 |
+
$options[$value[0]] = $value[1] ? '1' : '0';
|
60 |
+
}
|
61 |
+
}
|
62 |
+
}
|
63 |
+
/* if there's new options (not saved yet), add it in the end. */
|
64 |
+
foreach( $choices as $key => $val ){
|
65 |
+
|
66 |
+
/* if not exist, add it in the end. */
|
67 |
+
if ( ! array_key_exists( $key, $options ) ){
|
68 |
+
$options[$key] = '0'; // use zero to deactivate as default for new items.
|
69 |
+
}
|
70 |
+
}
|
71 |
+
?>
|
72 |
+
|
73 |
+
<ul class="fx-share-multicheck-sortable-list">
|
74 |
+
|
75 |
+
<?php foreach ( $options as $key => $value ){ ?>
|
76 |
+
|
77 |
+
<li>
|
78 |
+
<label>
|
79 |
+
<input name="<?php echo esc_attr( $key ); ?>" class="fx-share-multicheck-sortable-item" type="checkbox" value="<?php echo esc_attr( $value ); ?>" <?php checked( $value ); ?> />
|
80 |
+
<?php echo esc_html( $choices[$key] ); ?>
|
81 |
+
</label>
|
82 |
+
<i class="dashicons dashicons-menu fx-share-multicheck-sortable-handle"></i>
|
83 |
+
</li>
|
84 |
+
|
85 |
+
<?php } // end choices. ?>
|
86 |
+
|
87 |
+
<li class="fx-share-hideme">
|
88 |
+
<input type="hidden" class="fx-share-multicheck-sortable" <?php $this->link(); ?> value="<?php echo esc_attr( $this->value() ); ?>" />
|
89 |
+
</li>
|
90 |
+
|
91 |
+
</ul><!-- .fx-share-multicheck-sortable-list -->
|
92 |
+
|
93 |
+
|
94 |
+
<?php
|
95 |
+
}
|
96 |
+
}
|
97 |
+
|
98 |
+
/**
|
99 |
+
* Multi check boxes custom control.
|
100 |
+
* @since 0.1.0
|
101 |
+
* @author David Chandra Purnama <david@genbu.me>
|
102 |
+
* @copyright Copyright (c) 2015, Genbu Media
|
103 |
+
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
104 |
+
*/
|
105 |
+
class specia_layout_Customize_Control_Checkboxes extends WP_Customize_Control {
|
106 |
+
|
107 |
+
/**
|
108 |
+
* Control Type
|
109 |
+
*/
|
110 |
+
public $type = 'fx-share-multicheck';
|
111 |
+
|
112 |
+
/**
|
113 |
+
* Enqueue Scripts
|
114 |
+
*/
|
115 |
+
public function enqueue() {
|
116 |
+
wp_enqueue_style( 'fx-share-customize' );
|
117 |
+
wp_enqueue_script( 'fx-share-customize' );
|
118 |
+
}
|
119 |
+
|
120 |
+
/**
|
121 |
+
* Render Settings
|
122 |
+
*/
|
123 |
+
public function render_content() {
|
124 |
+
|
125 |
+
/* if no choices, bail. */
|
126 |
+
if ( empty( $this->choices ) ){
|
127 |
+
return;
|
128 |
+
} ?>
|
129 |
+
|
130 |
+
<?php if ( !empty( $this->label ) ){ ?>
|
131 |
+
<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
|
132 |
+
<?php } // add label if needed. ?>
|
133 |
+
|
134 |
+
<?php if ( !empty( $this->description ) ){ ?>
|
135 |
+
<span class="description customize-control-description"><?php echo $this->description; ?></span>
|
136 |
+
<?php } // add desc if needed. ?>
|
137 |
+
|
138 |
+
<?php
|
139 |
+
/* Data */
|
140 |
+
$values = explode( ',', $this->value() );
|
141 |
+
$choices = $this->choices;
|
142 |
+
|
143 |
+
/* If values exist, use it. */
|
144 |
+
$options = array();
|
145 |
+
|
146 |
+
/* get individual post type */
|
147 |
+
foreach( $choices as $key => $label ){
|
148 |
+
$options[$key] = in_array( $key, $values ) ? '1' : '0';
|
149 |
+
}
|
150 |
+
?>
|
151 |
+
|
152 |
+
<ul class="fx-share-multicheck-list">
|
153 |
+
|
154 |
+
<?php foreach ( $choices as $key => $label ){ ?>
|
155 |
+
|
156 |
+
<li>
|
157 |
+
<label>
|
158 |
+
<input name="<?php echo esc_attr( $key ); ?>" class="fx-share-multicheck-item" type="checkbox" value="<?php echo esc_attr( $options[$key] ); ?>" <?php checked( $options[$key] ); ?> />
|
159 |
+
<?php echo esc_html( $label ); ?>
|
160 |
+
</label>
|
161 |
+
</li>
|
162 |
+
|
163 |
+
<?php } // end choices. ?>
|
164 |
+
|
165 |
+
<li class="fx-share-hideme">
|
166 |
+
<input type="hidden" class="fx-share-multicheck" <?php $this->link(); ?> value="<?php echo esc_attr( $this->value() ); ?>" />
|
167 |
+
</li>
|
168 |
+
|
169 |
+
</ul><!-- .fx-share-multicheck-list -->
|
170 |
+
|
171 |
+
<?php
|
172 |
+
}
|
173 |
+
}
|
inc/custom-controls/layout/includes/customizer.php
ADDED
@@ -0,0 +1,163 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* f(x) Share Customizer
|
4 |
+
**/
|
5 |
+
add_action( 'customize_register', 'specia_layout_customizer_register' );
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Customize Register
|
9 |
+
* @since 0.1.0
|
10 |
+
*/
|
11 |
+
function specia_layout_customizer_register( $wp_customize ){
|
12 |
+
|
13 |
+
/* Load custom controls */
|
14 |
+
require_once( specia_layout_PATH . 'includes/customizer-controls.php' );
|
15 |
+
|
16 |
+
/* Add Section */
|
17 |
+
$wp_customize->add_section(
|
18 |
+
'fx_share',
|
19 |
+
array(
|
20 |
+
'title' => esc_html__( 'Sharing', 'hantus-pro' ),
|
21 |
+
)
|
22 |
+
);
|
23 |
+
|
24 |
+
/* === SERVICES === */
|
25 |
+
|
26 |
+
/* Add Settings */
|
27 |
+
$wp_customize->add_setting(
|
28 |
+
'fx_share[services]', /* option name */
|
29 |
+
array(
|
30 |
+
'default' => specia_layout_services_default(), // facebook:1,twitter:1,google_plus:1
|
31 |
+
'sanitize_callback' => 'specia_layout_sanitize_services',
|
32 |
+
'transport' => 'refresh',
|
33 |
+
'type' => 'option',
|
34 |
+
'capability' => 'manage_options',
|
35 |
+
)
|
36 |
+
);
|
37 |
+
|
38 |
+
/* Add Control for the settings. */
|
39 |
+
$choices = array();
|
40 |
+
$services = specia_layout_services();
|
41 |
+
foreach( $services as $key => $val ){
|
42 |
+
$choices[$key] = $val['label'];
|
43 |
+
}
|
44 |
+
$wp_customize->add_control(
|
45 |
+
new specia_layout_Customize_Control_Sortable_Checkboxes(
|
46 |
+
$wp_customize,
|
47 |
+
'specia_layout_services', /* control id */
|
48 |
+
array(
|
49 |
+
'section' => 'fx_share',
|
50 |
+
'settings' => 'fx_share[services]',
|
51 |
+
'label' => __( 'Sharing Services', 'hantus-pro' ),
|
52 |
+
'description' => __( 'Enable and reorder sharing buttons.', 'hantus-pro' ),
|
53 |
+
'choices' => $choices,
|
54 |
+
)
|
55 |
+
)
|
56 |
+
);
|
57 |
+
|
58 |
+
/* === POST TYPES === */
|
59 |
+
|
60 |
+
/* Add Settings */
|
61 |
+
$wp_customize->add_setting(
|
62 |
+
'fx_share[post_types]', /* option name */
|
63 |
+
array(
|
64 |
+
'default' => 'post', // only on "post" post type
|
65 |
+
'sanitize_callback' => 'specia_layout_sanitize_post_types',
|
66 |
+
'transport' => 'refresh',
|
67 |
+
'type' => 'option',
|
68 |
+
'capability' => 'manage_options',
|
69 |
+
)
|
70 |
+
);
|
71 |
+
|
72 |
+
/* Add Control for the settings. */
|
73 |
+
$wp_customize->add_control(
|
74 |
+
new specia_layout_Customize_Control_Checkboxes(
|
75 |
+
$wp_customize,
|
76 |
+
'specia_layout_post_types', /* control id */
|
77 |
+
array(
|
78 |
+
'section' => 'fx_share',
|
79 |
+
'settings' => 'fx_share[post_types]',
|
80 |
+
'label' => __( 'Post Types', 'hantus-pro' ),
|
81 |
+
'description' => __( 'Show sharing buttons on:', 'hantus-pro' ),
|
82 |
+
'choices' => specia_layout_post_types(),
|
83 |
+
)
|
84 |
+
)
|
85 |
+
);
|
86 |
+
|
87 |
+
/* === OTHER OPTIONS === */
|
88 |
+
/* TODO: Share count */
|
89 |
+
|
90 |
+
/* Add Settings */
|
91 |
+
$wp_customize->add_setting(
|
92 |
+
'fx_share[options]', /* option name */
|
93 |
+
array(
|
94 |
+
'default' => '',
|
95 |
+
'sanitize_callback' => 'specia_layout_sanitize_options',
|
96 |
+
'transport' => 'refresh',
|
97 |
+
'type' => 'option',
|
98 |
+
'capability' => 'manage_options',
|
99 |
+
)
|
100 |
+
);
|
101 |
+
|
102 |
+
/* Add Control for the settings. */
|
103 |
+
$wp_customize->add_control(
|
104 |
+
new specia_layout_Customize_Control_Checkboxes(
|
105 |
+
$wp_customize,
|
106 |
+
'specia_layout_options', /* control id */
|
107 |
+
array(
|
108 |
+
'section' => 'fx_share',
|
109 |
+
'settings' => 'fx_share[options]',
|
110 |
+
'label' => __( 'Other Options', 'hantus-pro' ),
|
111 |
+
'description' => '',
|
112 |
+
'choices' => array(
|
113 |
+
'index' => __( 'Show on archives & search pages.', 'hantus-pro' ),
|
114 |
+
),
|
115 |
+
)
|
116 |
+
)
|
117 |
+
);
|
118 |
+
|
119 |
+
/* === Twitter Account === */
|
120 |
+
|
121 |
+
/* Add Settings */
|
122 |
+
$wp_customize->add_setting(
|
123 |
+
'fx_share[twitter_username]', /* option name */
|
124 |
+
array(
|
125 |
+
'default' => '',
|
126 |
+
'sanitize_callback' => 'specia_layout_sanitize_twitter_username',
|
127 |
+
'transport' => 'refresh',
|
128 |
+
'type' => 'option',
|
129 |
+
'capability' => 'manage_options',
|
130 |
+
)
|
131 |
+
);
|
132 |
+
|
133 |
+
/* Add Control for the settings. */
|
134 |
+
$wp_customize->add_control(
|
135 |
+
'specia_layout_twitter_username',
|
136 |
+
array(
|
137 |
+
'type' => 'text',
|
138 |
+
'section' => 'fx_share',
|
139 |
+
'settings' => 'fx_share[twitter_username]',
|
140 |
+
'label' => __( 'Twitter Username', 'hantus-pro' ),
|
141 |
+
'description' => __( "Website Twitter account.", 'hantus-pro' ),
|
142 |
+
)
|
143 |
+
);
|
144 |
+
|
145 |
+
} // end customize register
|
146 |
+
|
147 |
+
|
148 |
+
/* Register Customizer Scripts */
|
149 |
+
add_action( 'customize_controls_enqueue_scripts', 'specia_layout_customize_register_scripts', 0 );
|
150 |
+
|
151 |
+
|
152 |
+
/**
|
153 |
+
* Register Scripts
|
154 |
+
* so we can easily load this scripts multiple times when needed (?)
|
155 |
+
*/
|
156 |
+
function specia_layout_customize_register_scripts(){
|
157 |
+
|
158 |
+
/* CSS */
|
159 |
+
wp_register_style( 'fx-share-customize', specia_layout_URL . 'assets/customizer-control.css' );
|
160 |
+
|
161 |
+
/* JS */
|
162 |
+
wp_register_script( 'fx-share-customize', specia_layout_URL . 'assets/customizer-control.js', array( 'jquery', 'jquery-ui-sortable', 'customize-controls' ) );
|
163 |
+
}
|
inc/custom-controls/layout/includes/functions.php
ADDED
@@ -0,0 +1,219 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Functions
|
4 |
+
**/
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Get Shareable Post Types
|
8 |
+
* @return array
|
9 |
+
*/
|
10 |
+
function specia_layout_post_types(){
|
11 |
+
|
12 |
+
/* Post Types */
|
13 |
+
$post_types = array();
|
14 |
+
|
15 |
+
/* Get All Public Post Types */
|
16 |
+
$supported_post_types = apply_filters( 'specia_layout_post_types', get_post_types( array( 'public' => true ) ) ) ;
|
17 |
+
|
18 |
+
/* Get label */
|
19 |
+
foreach( $supported_post_types as $post_type ){
|
20 |
+
$post_type_obj = get_post_type_object( $post_type );
|
21 |
+
$post_types[$post_type] = $post_type_obj->labels->name;
|
22 |
+
}
|
23 |
+
|
24 |
+
return $post_types;
|
25 |
+
}
|
26 |
+
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Services
|
30 |
+
* list of available sharing services
|
31 |
+
*/
|
32 |
+
function specia_layout_services(){
|
33 |
+
|
34 |
+
$services = array();
|
35 |
+
|
36 |
+
/* facebook */
|
37 |
+
$services['facebook'] = array(
|
38 |
+
'id' => 'facebook',
|
39 |
+
'label' => __( 'Facebook', 'hantus-pro' ),
|
40 |
+
'callback' => 'specia_layout_facebook',
|
41 |
+
);
|
42 |
+
|
43 |
+
/* twitter */
|
44 |
+
$services['twitter'] = array(
|
45 |
+
'id' => 'twitter',
|
46 |
+
'label' => __( 'Twitter', 'hantus-pro' ),
|
47 |
+
'callback' => 'specia_layout_twitter',
|
48 |
+
);
|
49 |
+
|
50 |
+
/* google+ */
|
51 |
+
$services['google_plus'] = array(
|
52 |
+
'id' => 'google_plus',
|
53 |
+
'label' => __( 'Google+', 'hantus-pro' ),
|
54 |
+
'callback' => 'specia_layout_google_plus',
|
55 |
+
);
|
56 |
+
|
57 |
+
return apply_filters( 'specia_layout_services', $services );
|
58 |
+
}
|
59 |
+
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Utility: Default Services to use in customizer default value
|
63 |
+
* @return string
|
64 |
+
*/
|
65 |
+
function specia_layout_services_default(){
|
66 |
+
$default = array();
|
67 |
+
$services = specia_layout_services();
|
68 |
+
foreach( $services as $service ){
|
69 |
+
$default[] = $service['id'] . ':1'; /* activate all as default. */
|
70 |
+
}
|
71 |
+
return apply_filters( 'specia_layout_services_default', implode( ',', $default ) );
|
72 |
+
}
|
73 |
+
|
74 |
+
|
75 |
+
/**
|
76 |
+
* Share Template Tags
|
77 |
+
* the final function with the conditional.
|
78 |
+
*/
|
79 |
+
function fx_share(){
|
80 |
+
|
81 |
+
/* Get the options */
|
82 |
+
$option = get_option( 'fx_share' );
|
83 |
+
|
84 |
+
/* Check Services */
|
85 |
+
$services = specia_layout_services_default();
|
86 |
+
if( isset( $option['services'] ) ){
|
87 |
+
$services = $option['services'];
|
88 |
+
}
|
89 |
+
if( ! $services ) return;
|
90 |
+
|
91 |
+
/* Check Post Status */
|
92 |
+
$current_post_status = get_post_status( get_the_ID() );
|
93 |
+
if ( 'private' === $current_post_status ) return;
|
94 |
+
|
95 |
+
/* Check Post Types */
|
96 |
+
$current_post_type = get_post_type();
|
97 |
+
$post_types = 'post';
|
98 |
+
if( isset( $option['post_types'] ) ){
|
99 |
+
$post_types = $option['post_types'];
|
100 |
+
}
|
101 |
+
$post_types = explode( ',', $post_types );
|
102 |
+
if( ! $post_types || ! in_array( $current_post_type, $post_types ) ) return;
|
103 |
+
|
104 |
+
/* render button */
|
105 |
+
return apply_filters( 'fx_share', specia_layout_get_buttons( $services ) );
|
106 |
+
}
|
107 |
+
|
108 |
+
|
109 |
+
/**
|
110 |
+
* Echo Share buttons HTML based on Options
|
111 |
+
* @param $options string formatted active services
|
112 |
+
*/
|
113 |
+
function specia_layout_buttons( $options ){
|
114 |
+
echo specia_layout_get_buttons( $options );
|
115 |
+
}
|
116 |
+
|
117 |
+
|
118 |
+
/**
|
119 |
+
* Return Share buttons HTML based on Options
|
120 |
+
* @param $options string formatted active services
|
121 |
+
*/
|
122 |
+
function specia_layout_get_buttons( $options ){
|
123 |
+
|
124 |
+
/* bail if empty. */
|
125 |
+
if( ! $options ) return;
|
126 |
+
|
127 |
+
/* available services */
|
128 |
+
$services = specia_layout_services();
|
129 |
+
|
130 |
+
/* var. */
|
131 |
+
$buttons = array();
|
132 |
+
|
133 |
+
/* make array */
|
134 |
+
$options = explode( ',', $options );
|
135 |
+
|
136 |
+
/* loop load */
|
137 |
+
foreach( $options as $option ){
|
138 |
+
$option = explode( ':', $option );
|
139 |
+
if( isset( $option[0] ) && isset( $option[1] ) && array_key_exists( $option[0], $services ) && '1' == $option[1] ){
|
140 |
+
$buttons[] = $option[0];
|
141 |
+
}
|
142 |
+
}
|
143 |
+
|
144 |
+
/* bail if not found. */
|
145 |
+
if( ! $buttons ) return;
|
146 |
+
ob_start();
|
147 |
+
?>
|
148 |
+
<div class="fx-share">
|
149 |
+
<ul>
|
150 |
+
<?php foreach( $buttons as $button ){
|
151 |
+
$fn_callback = $services[$button]['callback'];
|
152 |
+
?>
|
153 |
+
<?php if ( function_exists( $fn_callback ) ){ ?>
|
154 |
+
<li class="fx-share-<?php echo sanitize_html_class( $button );?>">
|
155 |
+
<?php call_user_func( $fn_callback ); ?>
|
156 |
+
</li>
|
157 |
+
<?php } // check callback ?>
|
158 |
+
<?php } // end foreach ?>
|
159 |
+
</ul>
|
160 |
+
</div><!-- .fx-share -->
|
161 |
+
<?php
|
162 |
+
return ob_get_clean();
|
163 |
+
}
|
164 |
+
|
165 |
+
|
166 |
+
/**
|
167 |
+
* Facebook Share HTML
|
168 |
+
*/
|
169 |
+
function specia_layout_facebook(){
|
170 |
+
$base_url = 'https://www.facebook.com/sharer.php';
|
171 |
+
$args = array(
|
172 |
+
'u' => esc_url( get_permalink() ),
|
173 |
+
't' => urlencode( the_title_attribute( 'echo=0' ) ),
|
174 |
+
);
|
175 |
+
$url = add_query_arg( $args, $base_url );
|
176 |
+
?>
|
177 |
+
<a class="fx-share-button fx-share-button-facebook" href="<?php echo esc_url( $url ); ?>" target="_blank" rel="nofollow external"><span class="fx-share-text"><?php _e( 'Facebook', 'hantus-pro' ); ?></span></a>
|
178 |
+
<?php
|
179 |
+
}
|
180 |
+
|
181 |
+
|
182 |
+
/**
|
183 |
+
* Twitter Share HTML
|
184 |
+
*/
|
185 |
+
function specia_layout_twitter(){
|
186 |
+
$base_url = 'https://twitter.com/intent/tweet';
|
187 |
+
$args = array(
|
188 |
+
'url' => esc_url( get_permalink() ),
|
189 |
+
'text' => urlencode( the_title_attribute( 'echo=0' ) ),
|
190 |
+
);
|
191 |
+
|
192 |
+
$options = get_option( 'fx_share' );
|
193 |
+
if( isset( $options['twitter_username'] ) ){
|
194 |
+
$username = specia_layout_sanitize_twitter_username( $options['twitter_username'] );
|
195 |
+
if( !empty( $username ) ){
|
196 |
+
$args['via'] = urlencode( $options['twitter_username'] );
|
197 |
+
}
|
198 |
+
}
|
199 |
+
|
200 |
+
$url = add_query_arg( $args, $base_url );
|
201 |
+
?>
|
202 |
+
<a class="fx-share-button fx-share-button-twitter" href="<?php echo esc_url( $url ); ?>" target="_blank" rel="nofollow external"><span class="fx-share-text"><?php _e( 'Twitter', 'hantus-pro' ); ?></span></a>
|
203 |
+
<?php
|
204 |
+
}
|
205 |
+
|
206 |
+
|
207 |
+
/**
|
208 |
+
* Google+ Share HTML
|
209 |
+
*/
|
210 |
+
function specia_layout_google_plus(){
|
211 |
+
$base_url = 'https://plus.google.com/share';
|
212 |
+
$args = array(
|
213 |
+
'url' => esc_url( get_permalink() ),
|
214 |
+
);
|
215 |
+
$url = add_query_arg( $args, $base_url );
|
216 |
+
?>
|
217 |
+
<a class="fx-share-button fx-share-button-google_plus" href="<?php echo esc_url( $url ); ?>" target="_blank" rel="nofollow external"><span class="fx-share-text"><?php _e( 'Google+', 'hantus-pro' ); ?></span></a>
|
218 |
+
<?php
|
219 |
+
}
|
inc/custom-controls/layout/includes/sanitize.php
ADDED
@@ -0,0 +1,116 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Sanitize Functions
|
4 |
+
**/
|
5 |
+
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Sanitize Sharing Services
|
9 |
+
* @since 0.1.0
|
10 |
+
*/
|
11 |
+
function specia_layout_sanitize_services( $input ){
|
12 |
+
|
13 |
+
/* Var */
|
14 |
+
$output = array();
|
15 |
+
|
16 |
+
/* Get valid services */
|
17 |
+
$valid_services = specia_layout_services();
|
18 |
+
|
19 |
+
/* Make array */
|
20 |
+
$services = explode( ',', $input );
|
21 |
+
|
22 |
+
/* Bail. */
|
23 |
+
if( ! $services ){
|
24 |
+
return null;
|
25 |
+
}
|
26 |
+
|
27 |
+
/* Loop and verify */
|
28 |
+
foreach( $services as $service ){
|
29 |
+
|
30 |
+
/* Separate service and status */
|
31 |
+
$service = explode( ':', $service );
|
32 |
+
|
33 |
+
if( isset( $service[0] ) && isset( $service[1] ) ){
|
34 |
+
if( array_key_exists( $service[0], $valid_services ) ){
|
35 |
+
$status = $service[1] ? '1' : '0';
|
36 |
+
$output[] = trim( $service[0] . ':' . $status );
|
37 |
+
}
|
38 |
+
}
|
39 |
+
|
40 |
+
}
|
41 |
+
|
42 |
+
return trim( esc_attr( implode( ',', $output ) ) );
|
43 |
+
}
|
44 |
+
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Sanitize Post Types
|
48 |
+
* @since 0.1.0
|
49 |
+
*/
|
50 |
+
function specia_layout_sanitize_post_types( $input ){
|
51 |
+
|
52 |
+
/* Var */
|
53 |
+
$output = array();
|
54 |
+
|
55 |
+
/* Make input as array */
|
56 |
+
$post_types = explode( ',', $input );
|
57 |
+
|
58 |
+
/* Bail. */
|
59 |
+
if( ! $post_types ){
|
60 |
+
return null;
|
61 |
+
}
|
62 |
+
|
63 |
+
/* Get valid post types */
|
64 |
+
$valid_post_types = specia_layout_post_types();
|
65 |
+
|
66 |
+
/* Loop and verify */
|
67 |
+
foreach( $post_types as $post_type ){
|
68 |
+
if( array_key_exists( $post_type, $valid_post_types ) ){
|
69 |
+
$output[] = $post_type;
|
70 |
+
}
|
71 |
+
}
|
72 |
+
|
73 |
+
/* return it back as string. */
|
74 |
+
return trim( esc_attr( implode( ',', $output ) ) );
|
75 |
+
}
|
76 |
+
|
77 |
+
/**
|
78 |
+
* Sanitize Post Types
|
79 |
+
* @since 0.1.0
|
80 |
+
*/
|
81 |
+
function specia_layout_sanitize_options( $input ){
|
82 |
+
|
83 |
+
/* Var */
|
84 |
+
$output = array();
|
85 |
+
|
86 |
+
/* Make input as array */
|
87 |
+
$options = explode( ',', $input );
|
88 |
+
|
89 |
+
/* Bail. */
|
90 |
+
if( ! $options ){
|
91 |
+
return null;
|
92 |
+
}
|
93 |
+
|
94 |
+
/* Get valid post types */
|
95 |
+
$valid_options = array( 'index' );
|
96 |
+
|
97 |
+
/* Loop and verify */
|
98 |
+
foreach( $options as $option ){
|
99 |
+
if( in_array( $option, $valid_options ) ){
|
100 |
+
$output[] = $option;
|
101 |
+
}
|
102 |
+
}
|
103 |
+
|
104 |
+
/* return it back as string. */
|
105 |
+
return trim( esc_attr( implode( ',', $output ) ) );
|
106 |
+
}
|
107 |
+
|
108 |
+
/**
|
109 |
+
* Sanitize Twitter Username
|
110 |
+
* Strip out anything other than a letter, number, or underscore.
|
111 |
+
* This will prevent the inadvertent inclusion of an extra @, as well as normalizing the handle.
|
112 |
+
* @since 0.1.0
|
113 |
+
*/
|
114 |
+
function specia_layout_sanitize_twitter_username( $input ){
|
115 |
+
return trim( preg_replace( '/[^\da-z_]+/i', '', $input ) );
|
116 |
+
}
|
inc/custom-controls/layout/includes/setup.php
ADDED
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Setup
|
4 |
+
**/
|
5 |
+
|
6 |
+
/* === Load front end styles === */
|
7 |
+
add_action( 'wp_enqueue_scripts', 'specia_layout_scripts' );
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Enqueue Scripts
|
11 |
+
*/
|
12 |
+
function specia_layout_scripts(){
|
13 |
+
wp_enqueue_style( 'fx-share-icon', specia_layout_URL . 'assets/fx-share-icons/fx-share-icons.css' );
|
14 |
+
wp_enqueue_style( 'hantus-pro', specia_layout_URL . 'assets/fx-share.css', array( 'fx-share-icon' ) );
|
15 |
+
}
|
16 |
+
|
17 |
+
/* === Add share buttons in excerpt and content === */
|
18 |
+
if( apply_filters( 'specia_layout_display', true ) ){
|
19 |
+
add_filter( 'the_excerpt', 'specia_layout_filter_excerpt', 99 );
|
20 |
+
add_filter( 'the_content', 'specia_layout_filter_content', 99 );
|
21 |
+
}
|
22 |
+
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Add sharing button by filtering content on singular pages.
|
26 |
+
*/
|
27 |
+
function specia_layout_filter_excerpt( $excerpt ){
|
28 |
+
|
29 |
+
/* Check settings. */
|
30 |
+
$data = get_option( 'fx_share' );
|
31 |
+
$options = array();
|
32 |
+
if( isset( $data['options'] ) || ! empty( $data['options'] ) ){
|
33 |
+
$options = explode( ',', $data['options'] );
|
34 |
+
};
|
35 |
+
|
36 |
+
/* filter excerpt. */
|
37 |
+
$current_post_type = get_post_type();
|
38 |
+
if( !is_singular() && in_array( 'index', $options ) && is_main_query() && 'attachment' != $current_post_type ){
|
39 |
+
$excerpt .= fx_share();
|
40 |
+
}
|
41 |
+
return $excerpt;
|
42 |
+
}
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Add sharing button by filtering content on singular pages.
|
46 |
+
*/
|
47 |
+
function specia_layout_filter_content( $content ){
|
48 |
+
|
49 |
+
/* Check settings. */
|
50 |
+
$data = get_option( 'fx_share' );
|
51 |
+
$options = array();
|
52 |
+
if( isset( $data['options'] ) || ! empty( $data['options'] ) ){
|
53 |
+
$options = explode( ',', $data['options'] );
|
54 |
+
};
|
55 |
+
$display = in_array( 'index', $options ) ? true : is_singular();
|
56 |
+
|
57 |
+
/* Filter content. */
|
58 |
+
if( $display && is_main_query() ){
|
59 |
+
$content .= fx_share();
|
60 |
+
}
|
61 |
+
return $content;
|
62 |
+
}
|
inc/custom-controls/layout/readme.txt
ADDED
@@ -0,0 +1,113 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
=== f(x) Share ===
|
2 |
+
Contributors: turtlepod
|
3 |
+
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=TT23LVNKA3AU2
|
4 |
+
Tags: comments, spam
|
5 |
+
Requires at least: 4.3
|
6 |
+
Tested up to: 4.6
|
7 |
+
Stable tag: 1.0.0
|
8 |
+
License: GPLv2 or later
|
9 |
+
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
+
|
11 |
+
Simple sharing plugin. Easily add Facebook, Twitter, and Google+ share button to your content.
|
12 |
+
|
13 |
+
== Description ==
|
14 |
+
|
15 |
+
f(x) Share is a very simple sharing plugin. You can easily add Facebook, Twitter, and Google+ share button to your content.
|
16 |
+
|
17 |
+
After installation of this plugin, you can configure where to display and reorder your sharing buttons via the "Customizer" page under the "Appearance" menu where you can see the changes live before you save them.
|
18 |
+
|
19 |
+
**Features:**
|
20 |
+
|
21 |
+
1. Easily disable/enable sharing item and reorder it.
|
22 |
+
1. Hide/display in post/page or any post type (custom post types are supported).
|
23 |
+
1. Hide/display in archive page and single page.
|
24 |
+
1. Customizer: See it live before saving the settings.
|
25 |
+
1. Extendable and fully documented (read the Dev Notes).
|
26 |
+
1. The GPL v2.0 or later license. :) Use it to make something cool.
|
27 |
+
1. Support available at [Genbu Media](https://genbu.me/contact-us/).
|
28 |
+
|
29 |
+
|
30 |
+
== Installation ==
|
31 |
+
|
32 |
+
1. Navigate to "Plugins > Add New" Page from your Admin.
|
33 |
+
2. To install directly from WordPress.org repository, search the plugin name in the search box and click "Install Now" button to install the plugin.
|
34 |
+
3. To install from plugin .zip file, click "Upload Plugin" button in "Plugins > Add New" Screen. Browse the plugin .zip file, and click "Install Now" button.
|
35 |
+
4. Activate the plugin.
|
36 |
+
5. Navigate to "Appearance > Customize" page in your admin panel to manage the plugin settings.
|
37 |
+
|
38 |
+
== Frequently Asked Questions ==
|
39 |
+
|
40 |
+
= Where is the settings ? =
|
41 |
+
|
42 |
+
The settings in in the customizer page (Appearance > Customize) in the "Sharing" section.
|
43 |
+
|
44 |
+
= How to disable the CSS? =
|
45 |
+
|
46 |
+
This plugin have no option to disable CSS. If you want to disable the CSS you need to dequeue the stylesheet. Read the "Dev Notes" section for more info.
|
47 |
+
|
48 |
+
= How to manually place the share button in template ? =
|
49 |
+
|
50 |
+
You can use the `fx_share();` function. Please read the "Dev Notes".
|
51 |
+
|
52 |
+
== Screenshots ==
|
53 |
+
|
54 |
+
1. Customizer setting.
|
55 |
+
|
56 |
+
== Changelog ==
|
57 |
+
|
58 |
+
= 1.0.0 - 7 Jan 2015 =
|
59 |
+
* Add readme. Change description.
|
60 |
+
|
61 |
+
= 0.1.0 =
|
62 |
+
* First relase.
|
63 |
+
|
64 |
+
== Upgrade Notice ==
|
65 |
+
|
66 |
+
= 1.0.0 =
|
67 |
+
Maintenance relase.
|
68 |
+
|
69 |
+
== Dev Notes ==
|
70 |
+
|
71 |
+
Notes for developer:
|
72 |
+
|
73 |
+
= Github =
|
74 |
+
|
75 |
+
Development of this plugin is hosted at [GitHub](https://github.com/turtlepod/fx-share). Pull request and bug reports are welcome.
|
76 |
+
|
77 |
+
= Options =
|
78 |
+
|
79 |
+
This plugin save the options in single option name: `fx_share`. To read more about the data structure you can read this tutorial:
|
80 |
+
|
81 |
+
[How to Create Sortable Checkboxes Option in Customizer](https://shellcreeper.com/how-to-create-sortable-checkboxes-option-in-customizer/)
|
82 |
+
|
83 |
+
= Scripts =
|
84 |
+
|
85 |
+
This plugin load two CSS in site front-end.
|
86 |
+
|
87 |
+
* `fx-share-icon` is the icon font.
|
88 |
+
* `fx-share` is the stylesheet.
|
89 |
+
|
90 |
+
Both are loaded using `fx_share_scripts` function hooked to `wp_enqueue_scripts` at default priority (10). To remove the default CSS, you can use this code in theme `functions.php`:
|
91 |
+
|
92 |
+
`remove_action( 'wp_enqueue_scripts', 'fx_share_scripts' );
|
93 |
+
`
|
94 |
+
|
95 |
+
= Hooks =
|
96 |
+
|
97 |
+
List of hooks available in this plugin:
|
98 |
+
|
99 |
+
**filter:** `fx_share_post_types` (array)
|
100 |
+
|
101 |
+
List of post types in the checkbox option. You can remove or add post types in the list. As default it will list all public post types.
|
102 |
+
|
103 |
+
**filter:** `fx_share_services` (array)
|
104 |
+
|
105 |
+
List of supported sharing provider. As default it support facebook, google plus, and twitter. It's a multi dimentional array, with array key as the service ID, each item has `id`, `label`, and `callback` node.
|
106 |
+
|
107 |
+
**filter:** `fx_share` (string)
|
108 |
+
|
109 |
+
The HTML output of the share buttons.
|
110 |
+
|
111 |
+
**filter:** `fx_share_display` (bool, default: true)
|
112 |
+
|
113 |
+
Control the default excerpt and content filter. Set it to **false** to disable excerpt and content filter. Useful if you need to manually place the share button in template using `<?php echo fx_share(); ?>` function.
|
inc/hantus/default-pages/home-page.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
//post status and options
|
3 |
+
$post = array(
|
4 |
+
'comment_status' => 'closed',
|
5 |
+
'ping_status' => 'closed' ,
|
6 |
+
'post_author' => 1,
|
7 |
+
'post_date' => date('Y-m-d H:i:s'),
|
8 |
+
'post_name' => 'Home',
|
9 |
+
'post_status' => 'publish' ,
|
10 |
+
'post_title' => 'Home',
|
11 |
+
'post_type' => 'page',
|
12 |
+
);
|
13 |
+
//insert page and save the id
|
14 |
+
$newvalue = wp_insert_post( $post, false );
|
15 |
+
if ( $newvalue && ! is_wp_error( $newvalue ) ){
|
16 |
+
update_post_meta( $newvalue, '_wp_page_template', 'templates/template-homepage.php' );
|
17 |
+
|
18 |
+
// Use a static front page
|
19 |
+
$page = get_page_by_title('Home');
|
20 |
+
update_option( 'show_on_front', 'page' );
|
21 |
+
update_option( 'page_on_front', $page->ID );
|
22 |
+
|
23 |
+
}
|
24 |
+
?>
|
inc/hantus/default-pages/upload-media.php
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$file = CLEVERFOX_PLUGIN_URL .'inc/hantus/images/logo.png';
|
3 |
+
$ImagePath = CLEVERFOX_PLUGIN_URL .'inc/hantus/images';
|
4 |
+
|
5 |
+
$images = array(
|
6 |
+
$ImagePath. '/logo.png',
|
7 |
+
);
|
8 |
+
$parent_post_id = null;
|
9 |
+
foreach($images as $name) {
|
10 |
+
$filename = basename($name);
|
11 |
+
$upload_file = wp_upload_bits($filename, null, file_get_contents($name));
|
12 |
+
if (!$upload_file['error']) {
|
13 |
+
$wp_filetype = wp_check_filetype($filename, null );
|
14 |
+
$attachment = array(
|
15 |
+
'post_mime_type' => $wp_filetype['type'],
|
16 |
+
'post_parent' => $parent_post_id,
|
17 |
+
'post_title' => preg_replace('/\.[^.]+$/', '', $filename),
|
18 |
+
'post_excerpt' => 'hantus caption',
|
19 |
+
'post_status' => 'inherit'
|
20 |
+
);
|
21 |
+
$ImageId[] = $attachment_id = wp_insert_attachment( $attachment, $upload_file['file'], $parent_post_id );
|
22 |
+
|
23 |
+
if (!is_wp_error($attachment_id)) {
|
24 |
+
require_once(ABSPATH . "wp-admin" . '/includes/image.php');
|
25 |
+
$attachment_data = wp_generate_attachment_metadata( $attachment_id, $upload_file['file'] );
|
26 |
+
wp_update_attachment_metadata( $attachment_id, $attachment_data );
|
27 |
+
}
|
28 |
+
}
|
29 |
+
|
30 |
+
}
|
31 |
+
|
32 |
+
update_option( 'hantus_media_id', $ImageId );
|
33 |
+
|
34 |
+
?>
|
inc/hantus/default-widgets/default-widget.php
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$activate = array(
|
3 |
+
// 'sidebar-primary' => array(
|
4 |
+
// 'search-1',
|
5 |
+
// 'recent-posts-1',
|
6 |
+
// 'archives-1',
|
7 |
+
// ),
|
8 |
+
'footer-widget-area' => array(
|
9 |
+
'footer-widget-area',
|
10 |
+
'recent-posts-1',
|
11 |
+
'archives-1',
|
12 |
+
),
|
13 |
+
'footer-widget-area' => array(
|
14 |
+
'text-1',
|
15 |
+
),
|
16 |
+
);
|
17 |
+
/* the default titles will appear */
|
18 |
+
update_option('widget_text', array(
|
19 |
+
1 => array('title' => '',
|
20 |
+
'text'=>'<div class="footer-logo"><img src="'.CLEVERFOX_PLUGIN_URL.'inc/hantus/images/logo.png" alt=""></div>
|
21 |
+
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been.</p>
|
22 |
+
<ul class="widget-info">
|
23 |
+
<li><i class="fa fa-map-marker"></i>198 Collins St, Melbourne, NY</li>
|
24 |
+
<li><i class="fa fa-phone"></i>12) 345 678 910</li>
|
25 |
+
<li><i class="fa fa-envelope"></i>email@companyname.com</li>
|
26 |
+
</ul>
|
27 |
+
'),
|
28 |
+
2 => array('title' => 'Recent Posts'),
|
29 |
+
3 => array('title' => 'Categories'),
|
30 |
+
));
|
31 |
+
|
32 |
+
update_option('sidebars_widgets', $activate);
|
33 |
+
$MediaId = get_option('hantus_media_id');
|
34 |
+
set_theme_mod( 'custom_logo', $MediaId[0] );
|
35 |
+
?>
|
inc/hantus/features/navigation.php
ADDED
@@ -0,0 +1,207 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Customizer tabs for header social media & address
|
3 |
+
function hantus_social_customize_register( $wp_customize ) {
|
4 |
+
if ( class_exists( 'Cleverfox_Customize_Control_Tabs' ) ) {
|
5 |
+
$wp_customize->add_setting(
|
6 |
+
'hantus_social_tabs', array(
|
7 |
+
'sanitize_callback' => 'sanitize_text_field',
|
8 |
+
)
|
9 |
+
);
|
10 |
+
$wp_customize->add_control(
|
11 |
+
new Cleverfox_Customize_Control_Tabs(
|
12 |
+
$wp_customize, 'hantus_social_tabs', array(
|
13 |
+
'section' => 'header_setting',
|
14 |
+
'tabs' => array(
|
15 |
+
'general' => array(
|
16 |
+
'nicename' => esc_html__( 'Setting', 'hantus' ),
|
17 |
+
'icon' => 'cogs',
|
18 |
+
'controls' => array(
|
19 |
+
'hide_show_social_icon',
|
20 |
+
),
|
21 |
+
),
|
22 |
+
'first' => array(
|
23 |
+
'nicename' => esc_html__( 'Timing', 'hantus' ),
|
24 |
+
'icon' => 'table',
|
25 |
+
'controls' => array(
|
26 |
+
'hantus_time_icon',
|
27 |
+
'hantus_timing'
|
28 |
+
),
|
29 |
+
),
|
30 |
+
'second' => array(
|
31 |
+
'nicename' => esc_html__( 'Social Icons', 'hantus' ),
|
32 |
+
'icon' => 'table',
|
33 |
+
'controls' => array(
|
34 |
+
'social_icons',
|
35 |
+
),
|
36 |
+
),
|
37 |
+
),
|
38 |
+
)
|
39 |
+
)
|
40 |
+
);
|
41 |
+
}
|
42 |
+
}
|
43 |
+
add_action( 'customize_register', 'hantus_social_customize_register' );
|
44 |
+
|
45 |
+
// Customizer tabs for header social media & address
|
46 |
+
function hantus_contact_customize_register( $wp_customize ) {
|
47 |
+
if ( class_exists( 'Cleverfox_Customize_Control_Tabs' ) ) {
|
48 |
+
|
49 |
+
|
50 |
+
$wp_customize->add_setting(
|
51 |
+
'hantus_contacts_tabs', array(
|
52 |
+
'sanitize_callback' => 'sanitize_text_field',
|
53 |
+
)
|
54 |
+
);
|
55 |
+
|
56 |
+
$wp_customize->add_control(
|
57 |
+
new Cleverfox_Customize_Control_Tabs(
|
58 |
+
$wp_customize, 'hantus_contacts_tabs', array(
|
59 |
+
'section' => 'header_contact',
|
60 |
+
'tabs' => array(
|
61 |
+
'general' => array(
|
62 |
+
'nicename' => esc_html__( 'Setting', 'hantus' ),
|
63 |
+
'icon' => 'cogs',
|
64 |
+
'controls' => array(
|
65 |
+
'hide_show_contact_infot',
|
66 |
+
),
|
67 |
+
),
|
68 |
+
'first' => array(
|
69 |
+
'nicename' => esc_html__( 'Email', 'hantus' ),
|
70 |
+
'icon' => 'table',
|
71 |
+
'controls' => array(
|
72 |
+
'header_email_icon',
|
73 |
+
'header_email',
|
74 |
+
),
|
75 |
+
),
|
76 |
+
'second' => array(
|
77 |
+
'nicename' => esc_html__( 'Phone', 'hantus' ),
|
78 |
+
'icon' => 'table',
|
79 |
+
'controls' => array(
|
80 |
+
'header_phone_icon',
|
81 |
+
'header_phone_number',
|
82 |
+
),
|
83 |
+
),
|
84 |
+
|
85 |
+
),
|
86 |
+
)
|
87 |
+
)
|
88 |
+
);
|
89 |
+
}
|
90 |
+
}
|
91 |
+
add_action( 'customize_register', 'hantus_contact_customize_register' );
|
92 |
+
|
93 |
+
// Customizer tabs for header Search & cart
|
94 |
+
function hantus_search_customize_register( $wp_customize ) {
|
95 |
+
if ( class_exists( 'Cleverfox_Customize_Control_Tabs' ) ) {
|
96 |
+
$wp_customize->add_setting(
|
97 |
+
'hantus_search_tabs', array(
|
98 |
+
'sanitize_callback' => 'sanitize_text_field',
|
99 |
+
)
|
100 |
+
);
|
101 |
+
$wp_customize->add_control(
|
102 |
+
new Cleverfox_Customize_Control_Tabs(
|
103 |
+
$wp_customize, 'hantus_search_tabs', array(
|
104 |
+
'section' => 'header_contact_cart',
|
105 |
+
'tabs' => array(
|
106 |
+
'general' => array(
|
107 |
+
'nicename' => esc_html__( 'Setting', 'hantus' ),
|
108 |
+
'icon' => 'cogs',
|
109 |
+
'controls' => array(
|
110 |
+
'search_header_setting',
|
111 |
+
),
|
112 |
+
),
|
113 |
+
'first' => array(
|
114 |
+
'nicename' => esc_html__( 'Search', 'hantus' ),
|
115 |
+
'icon' => 'table',
|
116 |
+
'controls' => array(
|
117 |
+
'header_search',
|
118 |
+
),
|
119 |
+
),
|
120 |
+
),
|
121 |
+
)
|
122 |
+
)
|
123 |
+
);
|
124 |
+
}
|
125 |
+
}
|
126 |
+
add_action( 'customize_register', 'hantus_search_customize_register' );
|
127 |
+
|
128 |
+
// Customizer tabs for copyright_content
|
129 |
+
|
130 |
+
function hantus_copyright_content_customize_register( $wp_customize ) {
|
131 |
+
if ( class_exists( 'Cleverfox_Customize_Control_Tabs' ) ) {
|
132 |
+
|
133 |
+
// Pricing Tables Tabs
|
134 |
+
$wp_customize->add_setting(
|
135 |
+
'hantus_copyrights_tabs', array(
|
136 |
+
'sanitize_callback' => 'sanitize_text_field',
|
137 |
+
)
|
138 |
+
);
|
139 |
+
|
140 |
+
$wp_customize->add_control(
|
141 |
+
new Cleverfox_Customize_Control_Tabs(
|
142 |
+
$wp_customize, 'hantus_copyrights_tabs', array(
|
143 |
+
'section' => 'footer_copyright',
|
144 |
+
'tabs' => array(
|
145 |
+
'general' => array(
|
146 |
+
'nicename' => esc_html__( 'Settings', 'hantus' ),
|
147 |
+
'icon' => 'cogs',
|
148 |
+
'controls' => array(
|
149 |
+
'hide_show_copyright',
|
150 |
+
),
|
151 |
+
),
|
152 |
+
'first' => array(
|
153 |
+
'nicename' => esc_html__( 'Content', 'hantus' ),
|
154 |
+
'icon' => 'table',
|
155 |
+
'controls' => array(
|
156 |
+
'copyright_content',
|
157 |
+
'footer_background_setting',
|
158 |
+
),
|
159 |
+
),
|
160 |
+
),
|
161 |
+
)
|
162 |
+
)
|
163 |
+
);
|
164 |
+
}
|
165 |
+
}
|
166 |
+
add_action( 'customize_register', 'hantus_copyright_content_customize_register' );
|
167 |
+
|
168 |
+
|
169 |
+
// Customizer tabs for Payment
|
170 |
+
function hantus_payment_content_customize_register( $wp_customize ) {
|
171 |
+
if ( class_exists( 'Cleverfox_Customize_Control_Tabs' ) ) {
|
172 |
+
|
173 |
+
// Pricing Tables Tabs
|
174 |
+
$wp_customize->add_setting(
|
175 |
+
'hantus_payment_tabs', array(
|
176 |
+
'sanitize_callback' => 'sanitize_text_field',
|
177 |
+
)
|
178 |
+
);
|
179 |
+
|
180 |
+
$wp_customize->add_control(
|
181 |
+
new Cleverfox_Customize_Control_Tabs(
|
182 |
+
$wp_customize, 'hantus_payment_tabs', array(
|
183 |
+
'section' => 'footer_icon',
|
184 |
+
'tabs' => array(
|
185 |
+
'general' => array(
|
186 |
+
'nicename' => esc_html__( 'Settings', 'hantus' ),
|
187 |
+
'icon' => 'cogs',
|
188 |
+
'controls' => array(
|
189 |
+
'hide_show_payment',
|
190 |
+
),
|
191 |
+
),
|
192 |
+
'first' => array(
|
193 |
+
'nicename' => esc_html__( 'Content', 'hantus' ),
|
194 |
+
'icon' => 'table',
|
195 |
+
'controls' => array(
|
196 |
+
'footer_Payment_icon',
|
197 |
+
),
|
198 |
+
),
|
199 |
+
),
|
200 |
+
)
|
201 |
+
)
|
202 |
+
);
|
203 |
+
}
|
204 |
+
}
|
205 |
+
|
206 |
+
add_action( 'customize_register', 'hantus_payment_content_customize_register' );
|
207 |
+
?>
|
inc/hantus/features/section-info.php
ADDED
@@ -0,0 +1,410 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
function hantus_info_setting( $wp_customize ) {
|
3 |
+
|
4 |
+
$selective_refresh = isset( $wp_customize->selective_refresh ) ? 'postMessage' : 'refresh';
|
5 |
+
/*=========================================
|
6 |
+
Slider Section Panel
|
7 |
+
=========================================*/
|
8 |
+
$wp_customize->add_section(
|
9 |
+
'info_setting', array(
|
10 |
+
'title' => esc_html__( 'Info Section', 'hantus' ),
|
11 |
+
'panel' => 'hantus_frontpage_sections',
|
12 |
+
'priority' => apply_filters( 'hantus_section_priority', 12, 'hantus_info' ),
|
13 |
+
)
|
14 |
+
);
|
15 |
+
// info Hide/ Show Setting //
|
16 |
+
if ( class_exists( 'Hantus_Customizer_Toggle_Control' ) ) {
|
17 |
+
$wp_customize->add_setting(
|
18 |
+
'hide_show_info' ,
|
19 |
+
array(
|
20 |
+
'default' => esc_html__( '1', 'hantus' ),
|
21 |
+
'capability' => 'edit_theme_options',
|
22 |
+
'sanitize_callback' => 'sanitize_text_field',
|
23 |
+
'transport' => $selective_refresh,
|
24 |
+
)
|
25 |
+
);
|
26 |
+
|
27 |
+
$wp_customize->add_control( new Hantus_Customizer_Toggle_Control( $wp_customize,
|
28 |
+
'hide_show_info',
|
29 |
+
array(
|
30 |
+
'label' => esc_html__( 'Hide / Show Section', 'hantus' ),
|
31 |
+
'section' => 'info_setting',
|
32 |
+
'settings' => 'hide_show_info',
|
33 |
+
'type' => 'ios', // light, ios, flat
|
34 |
+
)
|
35 |
+
));
|
36 |
+
}
|
37 |
+
/*=========================================
|
38 |
+
Info contents Section first
|
39 |
+
=========================================*/
|
40 |
+
|
41 |
+
// Image //
|
42 |
+
$wp_customize->add_setting(
|
43 |
+
'info_first_img_setting' ,
|
44 |
+
array(
|
45 |
+
'default' => CLEVERFOX_PLUGIN_URL . 'inc/hantus/images/icons/icon01.png',
|
46 |
+
'capability' => 'edit_theme_options',
|
47 |
+
'sanitize_callback' => 'hantus_sanitize_url',
|
48 |
+
)
|
49 |
+
);
|
50 |
+
|
51 |
+
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize , 'info_first_img_setting' ,
|
52 |
+
array(
|
53 |
+
'label' => __( 'Image', 'hantus' ),
|
54 |
+
'section' => 'info_setting',
|
55 |
+
'settings' => 'info_first_img_setting',
|
56 |
+
)
|
57 |
+
));
|
58 |
+
|
59 |
+
// info title //
|
60 |
+
$wp_customize->add_setting(
|
61 |
+
'info_title',
|
62 |
+
array(
|
63 |
+
'default' => __('Opening Time','hantus'),
|
64 |
+
'capability' => 'edit_theme_options',
|
65 |
+
'sanitize_callback' => 'sanitize_text_field',
|
66 |
+
'transport' => $selective_refresh,
|
67 |
+
)
|
68 |
+
);
|
69 |
+
|
70 |
+
$wp_customize->add_control(
|
71 |
+
'info_title',
|
72 |
+
array(
|
73 |
+
'label' => __('Title','hantus'),
|
74 |
+
'section' => 'info_setting',
|
75 |
+
'settings'=> 'info_title',
|
76 |
+
'type' => 'text',
|
77 |
+
'description' => __('', 'hantus' ),
|
78 |
+
)
|
79 |
+
);
|
80 |
+
|
81 |
+
// info Description //
|
82 |
+
$wp_customize->add_setting(
|
83 |
+
'info_description',
|
84 |
+
array(
|
85 |
+
'default' => __('Mon - Sat: 10h00 - 18h00','hantus'),
|
86 |
+
'capability' => 'edit_theme_options',
|
87 |
+
'sanitize_callback' => 'sanitize_text_field',
|
88 |
+
'transport' => $selective_refresh,
|
89 |
+
)
|
90 |
+
);
|
91 |
+
|
92 |
+
$wp_customize->add_control(
|
93 |
+
'info_description',
|
94 |
+
array(
|
95 |
+
'label' => __('Description','hantus'),
|
96 |
+
'section' => 'info_setting',
|
97 |
+
'settings'=> 'info_description',
|
98 |
+
'type' => 'text',
|
99 |
+
'description' => __('', 'hantus' ),
|
100 |
+
)
|
101 |
+
);
|
102 |
+
|
103 |
+
/*=========================================
|
104 |
+
Info contents Section second
|
105 |
+
=========================================*/
|
106 |
+
|
107 |
+
// Image //
|
108 |
+
$wp_customize->add_setting(
|
109 |
+
'info_second_img_setting' ,
|
110 |
+
array(
|
111 |
+
'default' => CLEVERFOX_PLUGIN_URL . 'inc/hantus/images/icons/icon02.png',
|
112 |
+
'capability' => 'edit_theme_options',
|
113 |
+
'sanitize_callback' => 'hantus_sanitize_url',
|
114 |
+
)
|
115 |
+
);
|
116 |
+
|
117 |
+
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize , 'info_second_img_setting' ,
|
118 |
+
array(
|
119 |
+
'label' => __( 'Image', 'hantus' ),
|
120 |
+
'section' => 'info_setting',
|
121 |
+
'settings' => 'info_second_img_setting',
|
122 |
+
)
|
123 |
+
));
|
124 |
+
// info title //
|
125 |
+
$wp_customize->add_setting(
|
126 |
+
'info_title2',
|
127 |
+
array(
|
128 |
+
'default' => __('Address','hantus'),
|
129 |
+
'capability' => 'edit_theme_options',
|
130 |
+
'sanitize_callback' => 'sanitize_text_field',
|
131 |
+
'transport' => $selective_refresh,
|
132 |
+
)
|
133 |
+
);
|
134 |
+
|
135 |
+
$wp_customize->add_control(
|
136 |
+
'info_title2',
|
137 |
+
array(
|
138 |
+
'label' => __('Title','hantus'),
|
139 |
+
'section' => 'info_setting',
|
140 |
+
'settings'=> 'info_title2',
|
141 |
+
'type' => 'text',
|
142 |
+
'description' => __('', 'hantus' ),
|
143 |
+
)
|
144 |
+
);
|
145 |
+
|
146 |
+
// info Description //
|
147 |
+
$wp_customize->add_setting(
|
148 |
+
'info_description2',
|
149 |
+
array(
|
150 |
+
'default' => __('40 Baria Sreet, NY USA','hantus'),
|
151 |
+
'capability' => 'edit_theme_options',
|
152 |
+
'sanitize_callback' => 'sanitize_text_field',
|
153 |
+
'transport' => $selective_refresh,
|
154 |
+
)
|
155 |
+
);
|
156 |
+
|
157 |
+
$wp_customize->add_control(
|
158 |
+
'info_description2',
|
159 |
+
array(
|
160 |
+
'label' => __('Description','hantus'),
|
161 |
+
'section' => 'info_setting',
|
162 |
+
'settings'=> 'info_description2',
|
163 |
+
'type' => 'text',
|
164 |
+
'description' => __('', 'hantus' ),
|
165 |
+
)
|
166 |
+
);
|
167 |
+
|
168 |
+
/*=========================================
|
169 |
+
Info contents Section third
|
170 |
+
=========================================*/
|
171 |
+
|
172 |
+
// Image //
|
173 |
+
$wp_customize->add_setting(
|
174 |
+
'info_third_img_setting' ,
|
175 |
+
array(
|
176 |
+
'default' => CLEVERFOX_PLUGIN_URL . 'inc/hantus/images/icons/icon03.png',
|
177 |
+
'capability' => 'edit_theme_options',
|
178 |
+
'sanitize_callback' => 'hantus_sanitize_url',
|
179 |
+
)
|
180 |
+
);
|
181 |
+
|
182 |
+
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize , 'info_third_img_setting' ,
|
183 |
+
array(
|
184 |
+
'label' => __( 'Image', 'hantus' ),
|
185 |
+
'section' => 'info_setting',
|
186 |
+
'settings' => 'info_third_img_setting',
|
187 |
+
)
|
188 |
+
));
|
189 |
+
// info title //
|
190 |
+
$wp_customize->add_setting(
|
191 |
+
'info_title3',
|
192 |
+
array(
|
193 |
+
'default' => __('Telephone','hantus'),
|
194 |
+
'capability' => 'edit_theme_options',
|
195 |
+
'sanitize_callback' => 'sanitize_text_field',
|
196 |
+
'transport' => $selective_refresh,
|
197 |
+
)
|
198 |
+
);
|
199 |
+
|
200 |
+
$wp_customize->add_control(
|
201 |
+
'info_title3',
|
202 |
+
array(
|
203 |
+
'label' => __('Title','hantus'),
|
204 |
+
'section' => 'info_setting',
|
205 |
+
'settings'=> 'info_title3',
|
206 |
+
'type' => 'text',
|
207 |
+
'description' => __('', 'hantus' ),
|
208 |
+
)
|
209 |
+
);
|
210 |
+
|
211 |
+
// info Description //
|
212 |
+
$wp_customize->add_setting(
|
213 |
+
'info_description3',
|
214 |
+
array(
|
215 |
+
'default' => __('+12 345 678 9101','hantus'),
|
216 |
+
'capability' => 'edit_theme_options',
|
217 |
+
'sanitize_callback' => 'sanitize_text_field',
|
218 |
+
'transport' => $selective_refresh,
|
219 |
+
)
|
220 |
+
);
|
221 |
+
|
222 |
+
$wp_customize->add_control(
|
223 |
+
'info_description3',
|
224 |
+
array(
|
225 |
+
'label' => __('Description','hantus'),
|
226 |
+
'section' => 'info_setting',
|
227 |
+
'settings'=> 'info_description3',
|
228 |
+
'type' => 'text',
|
229 |
+
'description' => __('', 'hantus' ),
|
230 |
+
)
|
231 |
+
);
|
232 |
+
|
233 |
+
}
|
234 |
+
add_action( 'customize_register', 'hantus_info_setting' );
|
235 |
+
?>
|
236 |
+
<?php
|
237 |
+
// Customizer tabs
|
238 |
+
|
239 |
+
function hantus_info_customize_register( $wp_customize ) {
|
240 |
+
if ( class_exists( 'Cleverfox_Customize_Control_Tabs' ) ) {
|
241 |
+
|
242 |
+
// Pricing Tables Tabs
|
243 |
+
$wp_customize->add_setting(
|
244 |
+
'hantus_info_tabs', array(
|
245 |
+
'sanitize_callback' => 'sanitize_text_field',
|
246 |
+
)
|
247 |
+
);
|
248 |
+
|
249 |
+
$wp_customize->add_control(
|
250 |
+
new Cleverfox_Customize_Control_Tabs(
|
251 |
+
$wp_customize, 'hantus_info_tabs', array(
|
252 |
+
'section' => 'info_setting',
|
253 |
+
'tabs' => array(
|
254 |
+
'general' => array(
|
255 |
+
'nicename' => esc_html__( 'Setting', 'hantus' ),
|
256 |
+
'icon' => 'cogs',
|
257 |
+
'controls' => array(
|
258 |
+
'hide_show_info',
|
259 |
+
),
|
260 |
+
),
|
261 |
+
'first' => array(
|
262 |
+
'nicename' => esc_html__( 'First', 'hantus' ),
|
263 |
+
'icon' => 'info',
|
264 |
+
'controls' => array(
|
265 |
+
'info_first_img_setting',
|
266 |
+
'info_title',
|
267 |
+
'info_description',
|
268 |
+
),
|
269 |
+
),
|
270 |
+
'second' => array(
|
271 |
+
'nicename' => esc_html__( 'Second', 'hantus' ),
|
272 |
+
'icon' => 'info',
|
273 |
+
'controls' => array(
|
274 |
+
'info_second_img_setting',
|
275 |
+
'info_title2',
|
276 |
+
'info_description2',
|
277 |
+
),
|
278 |
+
),
|
279 |
+
'third' => array(
|
280 |
+
'nicename' => esc_html__( 'Third', 'hantus' ),
|
281 |
+
'icon' => 'info',
|
282 |
+
'controls' => array(
|
283 |
+
'info_third_img_setting',
|
284 |
+
'info_title3',
|
285 |
+
'info_description3',
|
286 |
+
),
|
287 |
+
),
|
288 |
+
),
|
289 |
+
)
|
290 |
+
)
|
291 |
+
);
|
292 |
+
}
|
293 |
+
}
|
294 |
+
|
295 |
+
add_action( 'customize_register', 'hantus_info_customize_register' );
|
296 |
+
/**
|
297 |
+
* Add selective refresh for Front page section section controls.
|
298 |
+
*/
|
299 |
+
function hantus_home_info_section_partials( $wp_customize ){
|
300 |
+
|
301 |
+
// hide_show_info
|
302 |
+
$wp_customize->selective_refresh->add_partial(
|
303 |
+
'hide_show_info', array(
|
304 |
+
'selector' => '#contact',
|
305 |
+
'container_inclusive' => true,
|
306 |
+
'render_callback' => 'info_setting',
|
307 |
+
'fallback_refresh' => true,
|
308 |
+
)
|
309 |
+
);
|
310 |
+
|
311 |
+
//info section first
|
312 |
+
$wp_customize->selective_refresh->add_partial( 'info_title', array(
|
313 |
+
'selector' => '#contact .info-first h4',
|
314 |
+
'settings' => 'info_title',
|
315 |
+
'render_callback' => 'info_section_title_render_callback',
|
316 |
+
|
317 |
+
) );
|
318 |
+
|
319 |
+
$wp_customize->selective_refresh->add_partial( 'info_first_img_setting', array(
|
320 |
+
'selector' => '#contact .info-first img',
|
321 |
+
'settings' => 'info_first_img_setting',
|
322 |
+
'render_callback' => 'home_service_section_img_render_callback',
|
323 |
+
|
324 |
+
) );
|
325 |
+
|
326 |
+
$wp_customize->selective_refresh->add_partial( 'info_description', array(
|
327 |
+
'selector' => '#contact .info-first p',
|
328 |
+
'settings' => 'info_description',
|
329 |
+
'render_callback' => 'home_service_section_description_render_callback',
|
330 |
+
|
331 |
+
) );
|
332 |
+
// info second
|
333 |
+
$wp_customize->selective_refresh->add_partial( 'info_title2', array(
|
334 |
+
'selector' => '#contact .info-second h4',
|
335 |
+
'settings' => 'info_title2',
|
336 |
+
'render_callback' => 'info_second_title_render_callback',
|
337 |
+
|
338 |
+
) );
|
339 |
+
|
340 |
+
$wp_customize->selective_refresh->add_partial( 'info_second_img_setting', array(
|
341 |
+
'selector' => '#contact .info-second img',
|
342 |
+
'settings' => 'info_second_img_setting',
|
343 |
+
'render_callback' => 'info_second_img_render_callback',
|
344 |
+
|
345 |
+
) );
|
346 |
+
|
347 |
+
$wp_customize->selective_refresh->add_partial( 'info_description2', array(
|
348 |
+
'selector' => '#contact .info-second p',
|
349 |
+
'settings' => 'info_description2',
|
350 |
+
'render_callback' => 'info_second_description_render_callback',
|
351 |
+
|
352 |
+
) );
|
353 |
+
// info third
|
354 |
+
$wp_customize->selective_refresh->add_partial( 'info_title3', array(
|
355 |
+
'selector' => '#contact .info-third h4',
|
356 |
+
'settings' => 'info_title3',
|
357 |
+
'render_callback' => 'info_third_title_render_callback',
|
358 |
+
|
359 |
+
) );
|
360 |
+
|
361 |
+
$wp_customize->selective_refresh->add_partial( 'info_third_img_setting', array(
|
362 |
+
'selector' => '#contact .info-third img',
|
363 |
+
'settings' => 'info_third_img_setting',
|
364 |
+
'render_callback' => 'info_third_img_render_callback',
|
365 |
+
|
366 |
+
) );
|
367 |
+
|
368 |
+
$wp_customize->selective_refresh->add_partial( 'info_description3', array(
|
369 |
+
'selector' => '#contact .info-third p',
|
370 |
+
'settings' => 'info_description3',
|
371 |
+
'render_callback' => 'info_third_description_render_callback',
|
372 |
+
|
373 |
+
) );
|
374 |
+
|
375 |
+
}
|
376 |
+
|
377 |
+
add_action( 'customize_register', 'hantus_home_info_section_partials' );
|
378 |
+
// info first
|
379 |
+
function info_section_title_render_callback() {
|
380 |
+
return get_theme_mod( 'info_title' );
|
381 |
+
}
|
382 |
+
function home_service_section_img_render_callback() {
|
383 |
+
return get_theme_mod( 'info_first_img_setting' );
|
384 |
+
}
|
385 |
+
|
386 |
+
function home_service_section_description_render_callback() {
|
387 |
+
return get_theme_mod( 'info_description' );
|
388 |
+
}
|
389 |
+
// info second
|
390 |
+
function info_second_title_render_callback() {
|
391 |
+
return get_theme_mod( 'info_title2' );
|
392 |
+
}
|
393 |
+
function info_second_img_render_callback() {
|
394 |
+
return get_theme_mod( 'info_second_img_setting' );
|
395 |
+
}
|
396 |
+
|
397 |
+
function info_second_description_render_callback() {
|
398 |
+
return get_theme_mod( 'info_description2' );
|
399 |
+
}
|
400 |
+
// info third
|
401 |
+
function info_third_title_render_callback() {
|
402 |
+
return get_theme_mod( 'info_title3' );
|
403 |
+
}
|
404 |
+
function info_third_img_render_callback() {
|
405 |
+
return get_theme_mod( 'info_third_img_setting' );
|
406 |
+
}
|
407 |
+
|
408 |
+
function info_third_description_render_callback() {
|
409 |
+
return get_theme_mod( 'info_description3' );
|
410 |
+
}
|
inc/hantus/features/section-service.php
ADDED
@@ -0,0 +1,247 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
function hantus_service_setting( $wp_customize ) {
|
3 |
+
$selective_refresh = isset( $wp_customize->selective_refresh ) ? 'postMessage' : 'refresh';
|
4 |
+
/*=========================================
|
5 |
+
Service Settings Section
|
6 |
+
=========================================*/
|
7 |
+
$wp_customize->add_section(
|
8 |
+
'service_setting', array(
|
9 |
+
'title' => esc_html__( 'Service Section', 'hantus' ),
|
10 |
+
'priority' => apply_filters( 'hantus_section_priority', 25, 'hantus_service' ),
|
11 |
+
'panel' => 'hantus_frontpage_sections',
|
12 |
+
)
|
13 |
+
);
|
14 |
+
// service Hide/ Show Setting //
|
15 |
+
if ( class_exists( 'Hantus_Customizer_Toggle_Control' ) ) {
|
16 |
+
$wp_customize->add_setting(
|
17 |
+
'hide_show_service' ,
|
18 |
+
array(
|
19 |
+
'default' => esc_html__( '1', 'hantus' ),
|
20 |
+
'sanitize_callback' => 'sanitize_text_field',
|
21 |
+
'capability' => 'edit_theme_options',
|
22 |
+
'transport' => $selective_refresh,
|
23 |
+
)
|
24 |
+
);
|
25 |
+
|
26 |
+
$wp_customize->add_control( new Hantus_Customizer_Toggle_Control( $wp_customize,
|
27 |
+
'hide_show_service',
|
28 |
+
array(
|
29 |
+
'label' => esc_html__( 'Hide / Show Section', 'hantus' ),
|
30 |
+
'section' => 'service_setting',
|
31 |
+
'settings' => 'hide_show_service',
|
32 |
+
'type' => 'ios', // light, ios, flat
|
33 |
+
)
|
34 |
+
));
|
35 |
+
}
|
36 |
+
// Service Header Section //
|
37 |
+
|
38 |
+
|
39 |
+
// Service Title //
|
40 |
+
$wp_customize->add_setting(
|
41 |
+
'service_title',
|
42 |
+
array(
|
43 |
+
'default' => __('Our Services','hantus'),
|
44 |
+
'capability' => 'edit_theme_options',
|
45 |
+
'sanitize_callback' => 'hantus_sanitize_html',
|
46 |
+
'transport' => $selective_refresh,
|
47 |
+
)
|
48 |
+
);
|
49 |
+
|
50 |
+
$wp_customize->add_control(
|
51 |
+
'service_title',
|
52 |
+
array(
|
53 |
+
'label' => __('Title','hantus'),
|
54 |
+
'section' => 'service_setting',
|
55 |
+
'settings' => 'service_title',
|
56 |
+
'type' => 'text',
|
57 |
+
)
|
58 |
+
);
|
59 |
+
|
60 |
+
// Service Description //
|
61 |
+
$wp_customize->add_setting(
|
62 |
+
'service_description',
|
63 |
+
array(
|
64 |
+
'default' => __('These are the services we provide, these makes us stand apart.','hantus'),
|
65 |
+
'capability' => 'edit_theme_options',
|
66 |
+
'sanitize_callback' => 'hantus_sanitize_text',
|
67 |
+
'transport' => $selective_refresh,
|
68 |
+
)
|
69 |
+
);
|
70 |
+
|
71 |
+
$wp_customize->add_control(
|
72 |
+
'service_description',
|
73 |
+
array(
|
74 |
+
'label' => __('Description','hantus'),
|
75 |
+
'section' => 'service_setting',
|
76 |
+
'settings' => 'service_description',
|
77 |
+
'type' => 'textarea',
|
78 |
+
)
|
79 |
+
);
|
80 |
+
|
81 |
+
// Service content Section //
|
82 |
+
|
83 |
+
|
84 |
+
/**
|
85 |
+
* Customizer Repeater for add service
|
86 |
+
*/
|
87 |
+
|
88 |
+
$wp_customize->add_setting( 'service_contents',
|
89 |
+
array(
|
90 |
+
'sanitize_callback' => 'hantus_repeater_sanitize',
|
91 |
+
'transport' => $selective_refresh,
|
92 |
+
'default' => json_encode(
|
93 |
+
array(
|
94 |
+
array(
|
95 |
+
'image_url' => CLEVERFOX_PLUGIN_URL . 'inc/hantus/images/service/service01.png',
|
96 |
+
'title' => esc_html__( 'Oil Massage', 'hantus' ),
|
97 |
+
'text' => esc_html__( 'Lorem Ipsum is simply dummy text of the printing and typesetting.', 'hantus' ),
|
98 |
+
'id' => 'customizer_repeater_service_001',
|
99 |
+
|
100 |
+
),
|
101 |
+
array(
|
102 |
+
'image_url' => CLEVERFOX_PLUGIN_URL . 'inc/hantus/images/service/service02.png',
|
103 |
+
'title' => esc_html__( 'Skin Care', 'hantus' ),
|
104 |
+
'text' => esc_html__( 'Lorem Ipsum is simply dummy text of the printing and typesetting.', 'hantus' ),
|
105 |
+
'id' => 'customizer_repeater_service_002',
|
106 |
+
|
107 |
+
),
|
108 |
+
array(
|
109 |
+
'image_url' => CLEVERFOX_PLUGIN_URL . 'inc/hantus/images/service/service03.png',
|
110 |
+
'title' => esc_html__( 'Natural Relaxation', 'hantus' ),
|
111 |
+
'text' => esc_html__( 'Lorem Ipsum is simply dummy text of the printing and typesetting.', 'hantus' ),
|
112 |
+
'id' => 'customizer_repeater_service_003',
|
113 |
+
|
114 |
+
),
|
115 |
+
array(
|
116 |
+
'image_url' => CLEVERFOX_PLUGIN_URL . 'inc/hantus/images/service/service04.png',
|
117 |
+
'title' => esc_html__( 'Nails Design', 'hantus' ),
|
118 |
+
'text' => esc_html__( 'Lorem Ipsum is simply dummy text of the printing and typesetting.', 'hantus' ),
|
119 |
+
'id' => 'customizer_repeater_service_004',
|
120 |
+
|
121 |
+
),
|
122 |
+
)
|
123 |
+
)
|
124 |
+
)
|
125 |
+
);
|
126 |
+
|
127 |
+
$wp_customize->add_control(
|
128 |
+
new hantus_Repeater( $wp_customize,
|
129 |
+
'service_contents',
|
130 |
+
array(
|
131 |
+
'label' => esc_html__('Service','hantus'),
|
132 |
+
'section' => 'service_setting',
|
133 |
+
'add_field_label' => esc_html__( 'Add New', 'hantus' ),
|
134 |
+
'item_name' => esc_html__( 'Service', 'hantus' ),
|
135 |
+
'priority' => 1,
|
136 |
+
'customizer_repeater_image_control' => true,
|
137 |
+
'customizer_repeater_title_control' => true,
|
138 |
+
'customizer_repeater_text_control' => true,
|
139 |
+
)
|
140 |
+
)
|
141 |
+
);
|
142 |
+
}
|
143 |
+
|
144 |
+
add_action( 'customize_register', 'hantus_service_setting' );
|
145 |
+
?>
|
146 |
+
<?php
|
147 |
+
// Customizer tabs
|
148 |
+
|
149 |
+
function hantus_servicess_customize_register( $wp_customize ) {
|
150 |
+
if ( class_exists( 'Cleverfox_Customize_Control_Tabs' ) ) {
|
151 |
+
|
152 |
+
// Pricing Tables Tabs
|
153 |
+
$wp_customize->add_setting(
|
154 |
+
'hantus_servicess_tabs', array(
|
155 |
+
'sanitize_callback' => 'sanitize_text_field',
|
156 |
+
)
|
157 |
+
);
|
158 |
+
|
159 |
+
$wp_customize->add_control(
|
160 |
+
new Cleverfox_Customize_Control_Tabs(
|
161 |
+
$wp_customize, 'hantus_servicess_tabs', array(
|
162 |
+
'section' => 'service_setting',
|
163 |
+
'tabs' => array(
|
164 |
+
'general' => array(
|
165 |
+
'nicename' => esc_html__( 'Setting', 'hantus' ),
|
166 |
+
'icon' => 'cogs',
|
167 |
+
'controls' => array(
|
168 |
+
'hide_show_service',
|
169 |
+
),
|
170 |
+
),
|
171 |
+
'first' => array(
|
172 |
+
'nicename' => esc_html__( 'Header', 'hantus' ),
|
173 |
+
'icon' => 'header',
|
174 |
+
'controls' => array(
|
175 |
+
'service_title',
|
176 |
+
'service_description',
|
177 |
+
),
|
178 |
+
),
|
179 |
+
'second' => array(
|
180 |
+
'nicename' => esc_html__( 'Content', 'hantus' ),
|
181 |
+
'icon' => 'info',
|
182 |
+
'controls' => array(
|
183 |
+
'service_contents',
|
184 |
+
),
|
185 |
+
),
|
186 |
+
|
187 |
+
),
|
188 |
+
)
|
189 |
+
)
|
190 |
+
);
|
191 |
+
}
|
192 |
+
}
|
193 |
+
add_action( 'customize_register', 'hantus_servicess_customize_register' );
|
194 |
+
// service selective refresh
|
195 |
+
function hantus_home_service_section_partials( $wp_customize ){
|
196 |
+
// hide_show_service
|
197 |
+
$wp_customize->selective_refresh->add_partial(
|
198 |
+
'hide_show_service', array(
|
199 |
+
'selector' => '#services',
|
200 |
+
'container_inclusive' => true,
|
201 |
+
'render_callback' => 'service_setting',
|
202 |
+
'fallback_refresh' => true,
|
203 |
+
)
|
204 |
+
);
|
205 |
+
|
206 |
+
// service title
|
207 |
+
$wp_customize->selective_refresh->add_partial( 'service_title', array(
|
208 |
+
'selector' => '#services .service-section h2',
|
209 |
+
'settings' => 'service_title',
|
210 |
+
'render_callback' => 'home_section_service_title_render_callback',
|
211 |
+
|
212 |
+
) );
|
213 |
+
// service description
|
214 |
+
$wp_customize->selective_refresh->add_partial( 'service_description', array(
|
215 |
+
'selector' => '#services .service-section p',
|
216 |
+
'settings' => 'service_description',
|
217 |
+
'render_callback' => 'home_section_service_desc_render_callback',
|
218 |
+
|
219 |
+
) );
|
220 |
+
// service content
|
221 |
+
$wp_customize->selective_refresh->add_partial( 'service_contents', array(
|
222 |
+
'selector' => '.servicesss',
|
223 |
+
'settings' => 'service_contents',
|
224 |
+
'render_callback' => 'home_section_service_contents_render_callback',
|
225 |
+
|
226 |
+
) );
|
227 |
+
|
228 |
+
}
|
229 |
+
|
230 |
+
add_action( 'customize_register', 'hantus_home_service_section_partials' );
|
231 |
+
|
232 |
+
// service title
|
233 |
+
function home_section_service_title_render_callback() {
|
234 |
+
return get_theme_mod( 'service_title' );
|
235 |
+
}
|
236 |
+
|
237 |
+
|
238 |
+
// service description
|
239 |
+
function home_section_service_desc_render_callback() {
|
240 |
+
return get_theme_mod( 'service_description' );
|
241 |
+
}
|
242 |
+
|
243 |
+
// service content
|
244 |
+
function home_section_service_contents_render_callback() {
|
245 |
+
$service_contents = get_theme_mod( 'service_contents' );
|
246 |
+
service_contents( $service_contents, true );
|
247 |
+
}
|
inc/hantus/features/section-slider.php
ADDED
@@ -0,0 +1,237 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! function_exists( 'hantus_slider_setting' ) ) :
|
3 |
+
function hantus_slider_setting( $wp_customize ) {
|
4 |
+
$selective_refresh = isset( $wp_customize->selective_refresh ) ? 'postMessage' : 'refresh';
|
5 |
+
/*=========================================
|
6 |
+
Slider Section Panel
|
7 |
+
=========================================*/
|
8 |
+
$wp_customize->add_section(
|
9 |
+
'slider_setting', array(
|
10 |
+
'title' => esc_html__( 'Slider Section', 'hantus' ),
|
11 |
+
'panel' => 'hantus_frontpage_sections',
|
12 |
+
'priority' => apply_filters( 'hantus_section_priority', 1, 'slider_setting' ),
|
13 |
+
)
|
14 |
+
);
|
15 |
+
// Slider Hide/ Show Setting //
|
16 |
+
if ( class_exists( 'Hantus_Customizer_Toggle_Control' ) ) {
|
17 |
+
$wp_customize->add_setting(
|
18 |
+
'hide_show_slider' ,
|
19 |
+
array(
|
20 |
+
'default' => '1',
|
21 |
+
'capability' => 'edit_theme_options',
|
22 |
+
)
|
23 |
+
);
|
24 |
+
|
25 |
+
$wp_customize->add_control( new Hantus_Customizer_Toggle_Control( $wp_customize,
|
26 |
+
'hide_show_slider',
|
27 |
+
array(
|
28 |
+
'label' => esc_html__( 'Hide / Show Section', 'hantus' ),
|
29 |
+
'section' => 'slider_setting',
|
30 |
+
'settings' => 'hide_show_slider',
|
31 |
+
'type' => 'ios', // light, ios, flat
|
32 |
+
)
|
33 |
+
));
|
34 |
+
}
|
35 |
+
// Background Image //
|
36 |
+
$wp_customize->add_setting(
|
37 |
+
'slide_image' ,
|
38 |
+
array(
|
39 |
+
'default' => CLEVERFOX_PLUGIN_URL .'inc/hantus/images/slider/slider.jpg',
|
40 |
+
'capability' => 'edit_theme_options',
|
41 |
+
'sanitize_callback' => 'hantus_sanitize_url',
|
42 |
+
|
43 |
+
)
|
44 |
+
);
|
45 |
+
|
46 |
+
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize , 'slide_image' ,
|
47 |
+
array(
|
48 |
+
'label' => __( 'Background Image', 'hantus' ),
|
49 |
+
'section' => 'slider_setting',
|
50 |
+
'settings' => 'slide_image',
|
51 |
+
)
|
52 |
+
));
|
53 |
+
//slide title//
|
54 |
+
|
55 |
+
$wp_customize->add_setting(
|
56 |
+
'slide_title',
|
57 |
+
array(
|
58 |
+
'default' => __('Welcome To Hantus Spa','hantus'),
|
59 |
+
'capability' => 'edit_theme_options',
|
60 |
+
'sanitize_callback' => 'hantus_sanitize_html',
|
61 |
+
'transport' => $selective_refresh,
|
62 |
+
)
|
63 |
+
);
|
64 |
+
|
65 |
+
$wp_customize->add_control(
|
66 |
+
'slide_title',
|
67 |
+
array(
|
68 |
+
'label' => __('Title','hantus'),
|
69 |
+
'section' => 'slider_setting',
|
70 |
+
'settings' => 'slide_title',
|
71 |
+
'type' => 'text',
|
72 |
+
)
|
73 |
+
);
|
74 |
+
|
75 |
+
//slide subtitle//
|
76 |
+
|
77 |
+
$wp_customize->add_setting(
|
78 |
+
'slide_subtitle',
|
79 |
+
array(
|
80 |
+
'default' => __('Beauty & Spa Wellness','hantus'),
|
81 |
+
'capability' => 'edit_theme_options',
|
82 |
+
'sanitize_callback' => 'hantus_sanitize_html',
|
83 |
+
'transport' => $selective_refresh,
|
84 |
+
)
|
85 |
+
);
|
86 |
+
|
87 |
+
$wp_customize->add_control(
|
88 |
+
'slide_subtitle',
|
89 |
+
array(
|
90 |
+
'label' => __('Subtitle','hantus'),
|
91 |
+
'section' => 'slider_setting',
|
92 |
+
'settings' => 'slide_subtitle',
|
93 |
+
'type' => 'text',
|
94 |
+
)
|
95 |
+
);
|
96 |
+
|
97 |
+
//slide description//
|
98 |
+
$wp_customize->add_setting(
|
99 |
+
'slide_description',
|
100 |
+
array(
|
101 |
+
'default' => __('The Spa at Sun Valley is a serene oasis amid all the exciting activities our iconic valley has delivered for decades.'),
|
102 |
+
'capability' => 'edit_theme_options',
|
103 |
+
'sanitize_callback' => 'hantus_sanitize_html',
|
104 |
+
'transport' => $selective_refresh,
|
105 |
+
)
|
106 |
+
);
|
107 |
+
|
108 |
+
$wp_customize->add_control(
|
109 |
+
'slide_description',
|
110 |
+
array(
|
111 |
+
'label' => __('Description','hantus'),
|
112 |
+
'section' => 'slider_setting',
|
113 |
+
'settings' => 'slide_description',
|
114 |
+
'type' => 'textarea',
|
115 |
+
)
|
116 |
+
);
|
117 |
+
// button text
|
118 |
+
$wp_customize->add_setting(
|
119 |
+
'slide_btn_text',
|
120 |
+
array(
|
121 |
+
'default' => __('Make an Appoinment','hantus'),
|
122 |
+
'capability' => 'edit_theme_options',
|
123 |
+
'sanitize_callback' => 'hantus_sanitize_html',
|
124 |
+
'transport' => $selective_refresh,
|
125 |
+
)
|
126 |
+
);
|
127 |
+
|
128 |
+
$wp_customize->add_control(
|
129 |
+
'slide_btn_text',
|
130 |
+
array(
|
131 |
+
'label' => __('button text','hantus'),
|
132 |
+
'section' => 'slider_setting',
|
133 |
+
'settings' => 'slide_btn_text',
|
134 |
+
'type' => 'text',
|
135 |
+
)
|
136 |
+
);
|
137 |
+
|
138 |
+
// Slider button link
|
139 |
+
$wp_customize->add_setting(
|
140 |
+
'slide_btn_link',
|
141 |
+
array(
|
142 |
+
'default' => __('#','hantus'),
|
143 |
+
'capability' => 'edit_theme_options',
|
144 |
+
'sanitize_callback' => 'hantus_sanitize_url',
|
145 |
+
'transport' => $selective_refresh,
|
146 |
+
)
|
147 |
+
);
|
148 |
+
|
149 |
+
$wp_customize->add_control(
|
150 |
+
'slide_btn_link',
|
151 |
+
array(
|
152 |
+
'label' => __('Link','hantus'),
|
153 |
+
'section' => 'slider_setting',
|
154 |
+
'settings' => 'slide_btn_link',
|
155 |
+
'type' => 'text',
|
156 |
+
)
|
157 |
+
);
|
158 |
+
//slider opacity
|
159 |
+
|
160 |
+
// Slider Text Caption //
|
161 |
+
$wp_customize->add_setting(
|
162 |
+
'slider_opacity' ,
|
163 |
+
array(
|
164 |
+
'default' => '0',
|
165 |
+
'capability' => 'edit_theme_options',
|
166 |
+
)
|
167 |
+
);
|
168 |
+
$wp_customize->add_control(
|
169 |
+
new Cleverfox_Customizer_Range_Slider_Control( $wp_customize, 'slider_opacity',
|
170 |
+
array(
|
171 |
+
'section' => 'slider_setting',
|
172 |
+
'settings' => 'slider_opacity',
|
173 |
+
'label' => __( 'Background Opacity','hantus' ),
|
174 |
+
'input_attrs' => array(
|
175 |
+
'min' => 0,
|
176 |
+
'max' => 0.9,
|
177 |
+
'step' => 0.1,
|
178 |
+
//'suffix' => 'px', //optional suffix
|
179 |
+
),
|
180 |
+
) )
|
181 |
+
);
|
182 |
+
}
|
183 |
+
add_action( 'customize_register', 'hantus_slider_setting' );
|
184 |
+
endif;
|
185 |
+
// slider selective refresh
|
186 |
+
function hantus_home_slider_section_partials( $wp_customize ){
|
187 |
+
|
188 |
+
|
189 |
+
// slider title
|
190 |
+
$wp_customize->selective_refresh->add_partial( 'slide_title', array(
|
191 |
+
'selector' => '#slider .header-single-slider h3',
|
192 |
+
'settings' => 'slide_title',
|
193 |
+
'render_callback' => 'home_section_slider_tit_render_callback',
|
194 |
+
|
195 |
+
) );
|
196 |
+
// slider subtitle
|
197 |
+
$wp_customize->selective_refresh->add_partial( 'slide_subtitle', array(
|
198 |
+
'selector' => '#slider .header-single-slider h1',
|
199 |
+
'settings' => 'slide_subtitle',
|
200 |
+
'render_callback' => 'home_section_slide_subtitle_render_callback',
|
201 |
+
|
202 |
+
) );
|
203 |
+
// slider title
|
204 |
+
$wp_customize->selective_refresh->add_partial( 'slide_description', array(
|
205 |
+
'selector' => '#slider .header-single-slider p',
|
206 |
+
'settings' => 'slide_description',
|
207 |
+
'render_callback' => 'home_section_slider_desc_render_callback',
|
208 |
+
|
209 |
+
) );
|
210 |
+
// slider button
|
211 |
+
$wp_customize->selective_refresh->add_partial( 'slide_btn_text', array(
|
212 |
+
'selector' => '#slider .header-single-slider a',
|
213 |
+
'settings' => 'slide_btn_text',
|
214 |
+
'render_callback' => 'home_section_slider_button_render_callback',
|
215 |
+
|
216 |
+
) );
|
217 |
+
|
218 |
+
}
|
219 |
+
add_action( 'customize_register', 'hantus_home_slider_section_partials' );
|
220 |
+
|
221 |
+
// slider title
|
222 |
+
function home_section_slider_tit_render_callback() {
|
223 |
+
return get_theme_mod( 'slide_title' );
|
224 |
+
}
|
225 |
+
// slider subtitle
|
226 |
+
function home_section_slide_subtitle_render_callback() {
|
227 |
+
return get_theme_mod( 'slide_subtitle' );
|
228 |
+
}
|
229 |
+
//slide desc
|
230 |
+
function home_section_slider_desc_render_callback() {
|
231 |
+
return get_theme_mod( 'slide_description' );
|
232 |
+
}
|
233 |
+
//slide desc
|
234 |
+
function home_section_slider_button_render_callback() {
|
235 |
+
return get_theme_mod( 'slide_btn_text' );
|
236 |
+
}
|
237 |
+
?>
|
inc/hantus/features/section-testimonial.php
ADDED
@@ -0,0 +1,187 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
function hantus_testimonial_setting( $wp_customize ) {
|
3 |
+
$selective_refresh = isset( $wp_customize->selective_refresh ) ? 'postMessage' : 'refresh';
|
4 |
+
/*=========================================
|
5 |
+
Testimonial Section Panel
|
6 |
+
=========================================*/
|
7 |
+
$wp_customize->add_section(
|
8 |
+
'testimonial_setting', array(
|
9 |
+
'title' => esc_html__( 'Testimonial Section', 'hantus' ),
|
10 |
+
'panel' => 'hantus_frontpage_sections',
|
11 |
+
'priority' => apply_filters( 'hantus_section_priority', 37, 'hantus_Testimonial' ),
|
12 |
+
)
|
13 |
+
);
|
14 |
+
/*=========================================
|
15 |
+
Testimonial Settings Section
|
16 |
+
=========================================*/
|
17 |
+
if ( class_exists( 'Hantus_Customizer_Toggle_Control' ) ) {
|
18 |
+
$wp_customize->add_setting(
|
19 |
+
'hide_show_testimonial' ,
|
20 |
+
array(
|
21 |
+
'default' => esc_html__( '1', 'hantus' ),
|
22 |
+
'capability' => 'edit_theme_options',
|
23 |
+
'sanitize_callback' => 'sanitize_text_field',
|
24 |
+
'transport' => $selective_refresh,
|
25 |
+
)
|
26 |
+
);
|
27 |
+
|
28 |
+
$wp_customize->add_control( new Hantus_Customizer_Toggle_Control( $wp_customize,
|
29 |
+
'hide_show_testimonial',
|
30 |
+
array(
|
31 |
+
'label' => esc_html__( 'Hide / Show Section', 'hantus' ),
|
32 |
+
'section' => 'testimonial_setting',
|
33 |
+
'settings' => 'hide_show_testimonial',
|
34 |
+
'type' => 'ios', // light, ios, flat
|
35 |
+
)
|
36 |
+
));
|
37 |
+
}
|
38 |
+
/*=========================================
|
39 |
+
Testimonial Header Section
|
40 |
+
=========================================*/
|
41 |
+
// Testimonial Content Section //
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Customizer Repeater for add Testimonial
|
45 |
+
*/
|
46 |
+
$wp_customize->add_setting( 'testimonial_contents',
|
47 |
+
array(
|
48 |
+
'sanitize_callback' => 'hantus_repeater_sanitize',
|
49 |
+
'default' => json_encode(
|
50 |
+
array(
|
51 |
+
array(
|
52 |
+
'title' => esc_html__( 'Eric Matision', 'hantus' ),
|
53 |
+
'designation' => esc_html__( 'Forest Hills. NY', 'hantus' ),
|
54 |
+
'text' => esc_html__( 'I am very impressed by the efficiency of your service and your excellent returns policy. It is so pleasant to deal with such a customer focussed website.', 'hantus' ),
|
55 |
+
'image_url' => CLEVERFOX_PLUGIN_URL . 'inc/hantus/images/testimonial/testimonial01.png',
|
56 |
+
'id' => 'customizer_repeater_testimonial_001',
|
57 |
+
),
|
58 |
+
array(
|
59 |
+
'title' => esc_html__( 'Jennifer Lopez', 'hantus' ),
|
60 |
+
'designation' => esc_html__( 'Forest Hills. NY', 'hantus' ),
|
61 |
+
'text' => esc_html__( 'I am very impressed by the efficiency of your service and your excellent returns policy. It is so pleasant to deal with such a customer focussed website.', 'hantus' ),
|
62 |
+
'image_url' => CLEVERFOX_PLUGIN_URL . 'inc/hantus/images/testimonial/testimonial01.png',
|
63 |
+
'id' => 'customizer_repeater_testimonial_002',
|
64 |
+
),
|
65 |
+
array(
|
66 |
+
'title' => esc_html__( 'Betty Ross', 'hantus' ),
|
67 |
+
'designation' => esc_html__( 'Developer', 'hantus' ),
|
68 |
+
'text' => esc_html__( 'I am very impressed by the efficiency of your service and your excellent returns policy. It is so pleasant to deal with such a customer focussed website.', 'hantus' ),
|
69 |
+
'image_url' => CLEVERFOX_PLUGIN_URL . 'inc/hantus/images/testimonial/testimonial01.png',
|
70 |
+
'id' => 'customizer_repeater_testimonial_003',
|
71 |
+
),
|
72 |
+
)
|
73 |
+
)
|
74 |
+
)
|
75 |
+
);
|
76 |
+
|
77 |
+
$wp_customize->add_control(
|
78 |
+
new hantus_Repeater( $wp_customize,
|
79 |
+
'testimonial_contents',
|
80 |
+
array(
|
81 |
+
'label' => esc_html__('Testimonial','hantus'),
|
82 |
+
'section' => 'testimonial_setting',
|
83 |
+
'add_field_label' => esc_html__( 'Add New', 'hantus' ),
|
84 |
+
'item_name' => esc_html__( 'Testimonial', 'hantus' ),
|
85 |
+
'priority' => 1,
|
86 |
+
'customizer_repeater_image_control' => true,
|
87 |
+
'customizer_repeater_title_control' => true,
|
88 |
+
'customizer_repeater_designation_control' => true,
|
89 |
+
'customizer_repeater_text_control' => true,
|
90 |
+
)
|
91 |
+
)
|
92 |
+
);
|
93 |
+
// testimonial Background Section //
|
94 |
+
// Background Image //
|
95 |
+
$wp_customize->add_setting(
|
96 |
+
'testimonial_background_setting' ,
|
97 |
+
array(
|
98 |
+
'default' => CLEVERFOX_PLUGIN_URL .'inc/hantus/images/testimonial/testimonial-bg.jpg',
|
99 |
+
'capability' => 'edit_theme_options',
|
100 |
+
'sanitize_callback' => 'hantus_sanitize_url',
|
101 |
+
)
|
102 |
+
);
|
103 |
+
|
104 |
+
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize , 'testimonial_background_setting' ,
|
105 |
+
array(
|
106 |
+
'label' => __( 'Background Image', 'hantus' ),
|
107 |
+
'section' => 'testimonial_setting',
|
108 |
+
'settings' => 'testimonial_background_setting',
|
109 |
+
)
|
110 |
+
));
|
111 |
+
}
|
112 |
+
add_action( 'customize_register', 'hantus_testimonial_setting' );
|
113 |
+
?>
|
114 |
+
<?php
|
115 |
+
// Customizer tabs
|
116 |
+
|
117 |
+
function hantus_testimonial_customize_register( $wp_customize ) {
|
118 |
+
if ( class_exists( 'Cleverfox_Customize_Control_Tabs' ) ) {
|
119 |
+
|
120 |
+
// Pricing Tables Tabs
|
121 |
+
$wp_customize->add_setting(
|
122 |
+
'hantus_testimonial_tabs', array(
|
123 |
+
'sanitize_callback' => 'sanitize_text_field',
|
124 |
+
)
|
125 |
+
);
|
126 |
+
|
127 |
+
$wp_customize->add_control(
|
128 |
+
new Cleverfox_Customize_Control_Tabs(
|
129 |
+
$wp_customize, 'hantus_testimonial_tabs', array(
|
130 |
+
'section' => 'testimonial_setting',
|
131 |
+
'tabs' => array(
|
132 |
+
'general' => array(
|
133 |
+
'nicename' => esc_html__( 'Setting', 'hantus' ),
|
134 |
+
'icon' => 'cogs',
|
135 |
+
'controls' => array(
|
136 |
+
'hide_show_testimonial',
|
137 |
+
),
|
138 |
+
),
|
139 |
+
'first' => array(
|
140 |
+
'nicename' => esc_html__( 'Content', 'hantus' ),
|
141 |
+
'icon' => 'info',
|
142 |
+
'controls' => array(
|
143 |
+
'testimonial_contents',
|
144 |
+
),
|
145 |
+
),
|
146 |
+
'second' => array(
|
147 |
+
'nicename' => esc_html__( 'Background', 'hantus' ),
|
148 |
+
'icon' => 'info',
|
149 |
+
'controls' => array(
|
150 |
+
'testimonial_background_setting',
|
151 |
+
),
|
152 |
+
),
|
153 |
+
),
|
154 |
+
)
|
155 |
+
)
|
156 |
+
);
|
157 |
+
}
|
158 |
+
}
|
159 |
+
|
160 |
+
add_action( 'customize_register', 'hantus_testimonial_customize_register' );
|
161 |
+
|
162 |
+
// Testimonial selective refresh
|
163 |
+
function hantus_home_testimonial_section_partials( $wp_customize ){
|
164 |
+
// hide_show_testimonial
|
165 |
+
$wp_customize->selective_refresh->add_partial(
|
166 |
+
'hide_show_testimonial', array(
|
167 |
+
'selector' => '#testimonial',
|
168 |
+
'container_inclusive' => true,
|
169 |
+
'render_callback' => 'testimonial_setting',
|
170 |
+
'fallback_refresh' => true,
|
171 |
+
)
|
172 |
+
);
|
173 |
+
$wp_customize->selective_refresh->add_partial( 'testimonial_contents', array(
|
174 |
+
'selector' => '#testimonial .tst_contents',
|
175 |
+
'settings' => 'testimonial_contents',
|
176 |
+
'render_callback' => 'home_section_testimonial_contents_render_callback',
|
177 |
+
|
178 |
+
) );
|
179 |
+
|
180 |
+
}
|
181 |
+
|
182 |
+
add_action( 'customize_register', 'hantus_home_testimonial_section_partials' );
|
183 |
+
|
184 |
+
// contents
|
185 |
+
function home_section_testimonial_contents_render_callback() {
|
186 |
+
return get_theme_mod( 'testimonial_contents' );
|
187 |
+
}
|
inc/hantus/features/section-typography.php
ADDED
@@ -0,0 +1,966 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php function hantus_typography_customizer( $wp_customize ) {
|
2 |
+
$wp_customize->add_panel( 'hantus_typography_setting', array(
|
3 |
+
'priority' => 134,
|
4 |
+
'capability' => 'edit_theme_options',
|
5 |
+
'title' => __('Typography','hantus-pro'),
|
6 |
+
) );
|
7 |
+
|
8 |
+
// Typography Hide/ Show Setting //
|
9 |
+
|
10 |
+
$wp_customize->add_section(
|
11 |
+
'typography_setting' ,
|
12 |
+
array(
|
13 |
+
'title' => __('Settings','hantus-pro'),
|
14 |
+
'panel' => 'hantus_typography_setting',
|
15 |
+
'priority' => 1,
|
16 |
+
) );
|
17 |
+
if ( class_exists( 'Hantus_Customizer_Toggle_Control' ) ) {
|
18 |
+
$wp_customize->add_setting(
|
19 |
+
'hide_show_typography' ,
|
20 |
+
array(
|
21 |
+
'default' => 0,
|
22 |
+
'sanitize_callback' => 'sanitize_text_field',
|
23 |
+
'capability' => 'edit_theme_options',
|
24 |
+
)
|
25 |
+
);
|
26 |
+
|
27 |
+
$wp_customize->add_control( new Hantus_Customizer_Toggle_Control( $wp_customize,
|
28 |
+
'hide_show_typography',
|
29 |
+
array(
|
30 |
+
'label' => esc_html__( 'Enable Typography', 'hantus-pro' ),
|
31 |
+
'section' => 'typography_setting',
|
32 |
+
'settings' => 'hide_show_typography',
|
33 |
+
'type' => 'ios', // light, ios, flat
|
34 |
+
)
|
35 |
+
));
|
36 |
+
}
|
37 |
+
$font_size = array();
|
38 |
+
for($i=9; $i<=100; $i++)
|
39 |
+
{
|
40 |
+
$font_size[$i] = $i;
|
41 |
+
}
|
42 |
+
|
43 |
+
$font_family = array('Dosis'=>'Dosis','Raleway'=>'Raleway','Arial, sans-serif'=>'Arial','Georgia, serif'=>'Georgia','Times New Roman, serif'=>'Times New Roman','Tahoma, Geneva, Verdana, sans-serif'=>'Tahoma','Palatino, Palatino Linotype, serif'=>'Palatino','Helvetica Neue, Helvetica, sans-serif'=>'Helvetica*','Calibri, Candara, Segoe, Optima, sans-serif'=>'Calibri*','Myriad Pro, Myriad, sans-serif'=>'Myriad Pro*','Lucida Grande, Lucida Sans Unicode, Lucida Sans, sans-serif'=>'Lucida','Arial Black, sans-serif'=>'Arial Black','Gill Sans, Gill Sans MT, Calibri, sans-serif'=>'Gill Sans*','Geneva, Tahoma, Verdana, sans-serif'=>'Geneva*','Impact, Charcoal, sans-serif'=>'Impact','Courier, Courier New, monospace'=>'Courier','Abel'=>'Abel','Abril Fatface'=>'Abril Fatface','Aclonica'=>'Aclonica','Actor'=>'Actor','Adamina'=>'Adamina','Aldrich'=>'Aldrich','Alice'=>'Alice','Alike'=>'Alike','Alike Angular'=>'Alike Angular','Allan'=>'Allan','Allerta'=>'Allerta','Allerta Stencil'=>'Allerta Stencil','Amaranth'=>'Amaranth','Amatic SC'=>'Amatic SC','Andada'=>'Andada','Andika'=>'Andika','Annie Use Your Telescope'=>'Annie Use Your Telescope','Anonymous Pro'=>'Anonymous Pro','Antic'=>'Antic','Anton'=>'Anton','Architects Daughter'=>'Architects Daughter','Arimo'=>'Arimo','Artifika'=>'Artifika','Arvo'=>'Arvo','Asset'=>'Asset','Astloch'=>'Astloch','Atomic Age'=>'Atomic Age','Aubrey'=>'Aubrey','Bangers'=>'Bangers','Bentham'=>'Bentham','Bevan'=>'Bevan','Bigshot One'=>'Bigshot One','Black Ops One'=>'Black Ops One','Bowlby One'=>'Bowlby One','Bowlby One SC'=>'Bowlby One SC','Brawler'=>'Brawler','Butcherman Caps'=>'Butcherman Caps','Cabin'=>'Cabin','Cabin Sketch'=>'Cabin Sketch','Cabin Sketch'=>'Cabin Sketch','Calligraffitti'=>'Calligraffitti','Candal'=>'Candal','Cantarell'=>'Cantarell','Cardo'=>'Cardo','Carme'=>'Carme','Carter One'=>'Carter One','Caudex'=>'Caudex','Cedarville Cursive'=>'Cedarville Cursive','Changa One'=>'Changa One','Cherry Cream Soda'=>'Cherry Cream Soda','Chewy'=>'Chewy','Chivo'=>'Chivo','Coda'=>'Coda','Comfortaa'=>'Comfortaa','Coming Soon'=>'Coming Soon','Contrail One'=>'Contrail One','Copse'=>'Copse','Corben'=>'Corben','Corben'=>'Corben','Cousine'=>'Cousine','Coustard'=>'Coustard','Covered By Your Grace'=>'Covered By Your Grace','Crafty Girls'=>'Crafty Girls','Creepster Caps'=>'Creepster Caps','Crimson Text'=>'Crimson Text','Crushed'=>'Crushed','Cuprum'=>'Cuprum','Damion'=>'Damion','Dancing Script'=>'Dancing Script','Dawning of a New Day'=>'Dawning of a New Day','Days One'=>'Days One','Delius'=>'Delius','Delius Swash Caps'=>'Delius Swash Caps','Delius Unicase'=>'Delius Unicase','Didact Gothic'=>'Didact Gothic','Dorsa'=>'Dorsa','Droid Sans'=>'Droid Sans','Droid Sans Mono'=>'Droid Sans Mono','Droid Serif'=>'Droid Serif','EB Garamond'=>'EB Garamond','Eater Caps'=>'Eater Caps','Expletus Sans'=>'Expletus Sans','Fanwood Text'=>'Fanwood Text','Federant'=>'Federant','Federo'=>'Federo','Roboto' => 'Roboto','Fontdiner Swanky'=>'Fontdiner Swanky','Forum'=>'Forum','Francois One'=>'Francois One','Gentium Book Basic'=>'Gentium Book Basic','Geo'=>'Geo','Geostar'=>'Geostar','Geostar Fill'=>'Geostar Fill','Give You Glory'=>'Give You Glory','Gloria Hallelujah'=>'Gloria Hallelujah','Goblin One'=>'Goblin One','Gochi Hand'=>'Gochi Hand','Goudy Bookletter 1911'=>'Goudy Bookletter 1911','Gravitas One'=>'Gravitas One','Gruppo'=>'Gruppo','Hammersmith One'=>'Hammersmith One','Holtwood One SC'=>'Holtwood One SC','Homemade Apple'=>'Homemade Apple','IM Fell DW Pica'=>'IM Fell DW Pica','IM Fell English'=>'IM Fell English','IM Fell English SC'=>'IM Fell English SC','Inconsolata'=>'Inconsolata','Indie Flower'=>'Indie Flower','Irish Grover'=>'Irish Grover','Irish Growler'=>'Irish Growler','Istok Web'=>'Istok Web','Jockey One'=>'Jockey One','Josefin Sans'=>'Josefin Sans','Josefin Slab'=>'Josefin Slab','Judson'=>'Judson','Julee'=>'Julee','Jura'=>'Jura','Just Another Hand'=>'Just Another Hand','Just Me Again Down Here'=>'Just Me Again Down Here','Kameron'=>'Kameron','Kelly Slab'=>'Kelly Slab','Kenia'=>'Kenia','Kranky'=>'Kranky','Kreon'=>'Kreon','Kristi'=>'Kristi','La Belle Aurore'=>'La Belle Aurore','Lato'=>'Lato','League Script'=>'League Script','Leckerli One'=>'Leckerli One','Lekton'=>'Lekton','Limelight'=>'Limelight','Linden Hill'=>'Linden Hill','Lobster'=>'Lobster','Lobster Two'=>'Lobster Two','Lora'=>'Lora','Love Ya Like A Sister'=>'Love Ya Like A Sister','Loved by the King'=>'Loved by the King','Luckiest Guy'=>'LuckiestGuy','Maiden Orange'=>'Maiden Orange');
|
44 |
+
|
45 |
+
|
46 |
+
$font_transform = array('lowercase'=>'Lowercase','uppercase'=>'Uppercase','capitalize'=>'capitalize');
|
47 |
+
$font_weight = array('normal'=>'normal', 'italic'=>'Italic','oblique'=>'oblique');
|
48 |
+
// General typography section
|
49 |
+
$wp_customize->add_section(
|
50 |
+
'Body_typography' ,
|
51 |
+
array(
|
52 |
+
'title' => __('Body','hantus-pro'),
|
53 |
+
'panel' => 'hantus_typography_setting',
|
54 |
+
'priority' => 2,
|
55 |
+
) );
|
56 |
+
|
57 |
+
//Secondary font weight
|
58 |
+
|
59 |
+
$wp_customize->add_setting(
|
60 |
+
'body_typography_font_weight',
|
61 |
+
array(
|
62 |
+
'default' => __('normal','hantus-pro'),
|
63 |
+
'capability' => 'edit_theme_options',
|
64 |
+
'sanitize_callback' => 'sanitize_text_field',
|
65 |
+
)
|
66 |
+
);
|
67 |
+
$wp_customize->add_control(new Cleverfox_Customizer_Select_Control($wp_customize,
|
68 |
+
'body_typography_font_weight', array(
|
69 |
+
'label' => __('Secondary Font Weight','hantus-pro'),
|
70 |
+
'section' => 'Body_typography',
|
71 |
+
'setting' => 'body_typography_font_weight',
|
72 |
+
'choices'=>$font_weight,
|
73 |
+
'description'=>__('','hantus-pro'),
|
74 |
+
))
|
75 |
+
);
|
76 |
+
// Body font size//
|
77 |
+
$wp_customize->add_setting(
|
78 |
+
'body_font_size' ,
|
79 |
+
array(
|
80 |
+
'default' => __( '14','hantus-pro' ),
|
81 |
+
'capability' => 'edit_theme_options',
|
82 |
+
'sanitize_callback' => 'sanitize_text_field',
|
83 |
+
|
84 |
+
)
|
85 |
+
);
|
86 |
+
|
87 |
+
$wp_customize->add_control(
|
88 |
+
new Cleverfox_Customizer_Range_Slider_Control( $wp_customize, 'body_font_size',
|
89 |
+
array(
|
90 |
+
'section' => 'Body_typography',
|
91 |
+
'settings' => 'body_font_size',
|
92 |
+
'label' => __( 'Font Size','hantus-pro' ),
|
93 |
+
'input_attrs' => array(
|
94 |
+
'min' => 10,
|
95 |
+
'max' => 20,
|
96 |
+
'step' => 1,
|
97 |
+
//'suffix' => 'px', //optional suffix
|
98 |
+
),
|
99 |
+
) )
|
100 |
+
);
|
101 |
+
|
102 |
+
// paragraph typography
|
103 |
+
|
104 |
+
$wp_customize->add_section(
|
105 |
+
'paragraph_typography' ,
|
106 |
+
array(
|
107 |
+
'title' => __('Paragraph','hantus-pro'),
|
108 |
+
'panel' => 'hantus_typography_setting',
|
109 |
+
'priority' => 2,
|
110 |
+
) );
|
111 |
+
//paragraph font weight
|
112 |
+
|
113 |
+
$wp_customize->add_setting(
|
114 |
+
'para_font_weight',
|
115 |
+
array(
|
116 |
+
'default' => 'normal',
|
117 |
+
'capability' => 'edit_theme_options',
|
118 |
+
'sanitize_callback' => 'sanitize_text_field',
|
119 |
+
)
|
120 |
+
);
|
121 |
+
$wp_customize->add_control(new Cleverfox_Customizer_Select_Control($wp_customize,
|
122 |
+
'para_font_weight', array(
|
123 |
+
'label' => __('Font Style','hantus-pro'),
|
124 |
+
'section' => 'paragraph_typography',
|
125 |
+
'setting' => 'para_font_weight',
|
126 |
+
'choices'=>$font_weight,
|
127 |
+
'description'=>__('','hantus-pro'),
|
128 |
+
))
|
129 |
+
);
|
130 |
+
|
131 |
+
// paragraph font size//
|
132 |
+
$wp_customize->add_setting(
|
133 |
+
'paragraph_font_size' ,
|
134 |
+
array(
|
135 |
+
'default' => __( '16','hantus-pro' ),
|
136 |
+
'capability' => 'edit_theme_options',
|
137 |
+
'sanitize_callback' => 'sanitize_text_field',
|
138 |
+
)
|
139 |
+
);
|
140 |
+
|
141 |
+
$wp_customize->add_control(
|
142 |
+
new Cleverfox_Customizer_Range_Slider_Control( $wp_customize, 'paragraph_font_size',
|
143 |
+
array(
|
144 |
+
'section' => 'paragraph_typography',
|
145 |
+
'settings' => 'paragraph_font_size',
|
146 |
+
'label' => __( 'Font Size(px)','hantus-pro' ),
|
147 |
+
'input_attrs' => array(
|
148 |
+
'min' => 1,
|
149 |
+
'max' => 30,
|
150 |
+
'step' => 1,
|
151 |
+
//'suffix' => 'px', //optional suffix
|
152 |
+
),
|
153 |
+
) )
|
154 |
+
);
|
155 |
+
|
156 |
+
// paragraph line height//
|
157 |
+
$wp_customize->add_setting(
|
158 |
+
'paragraph_line_height' ,
|
159 |
+
array(
|
160 |
+
'default' => __( '21','hantus-pro' ),
|
161 |
+
'capability' => 'edit_theme_options',
|
162 |
+
'sanitize_callback' => 'sanitize_text_field',
|
163 |
+
)
|
164 |
+
);
|
165 |
+
|
166 |
+
$wp_customize->add_control(
|
167 |
+
new Cleverfox_Customizer_Range_Slider_Control( $wp_customize, 'paragraph_line_height',
|
168 |
+
array(
|
169 |
+
'section' => 'paragraph_typography',
|
170 |
+
'settings' => 'paragraph_line_height',
|
171 |
+
'label' => __( 'Line Height(px)','hantus-pro' ),
|
172 |
+
'input_attrs' => array(
|
173 |
+
'min' => 1,
|
174 |
+
'max' => 60,
|
175 |
+
'step' => 1,
|
176 |
+
//'suffix' => 'px', //optional suffix
|
177 |
+
),
|
178 |
+
) )
|
179 |
+
);
|
180 |
+
|
181 |
+
|
182 |
+
//H1 typography
|
183 |
+
$wp_customize->add_section(
|
184 |
+
'H1_typography' ,
|
185 |
+
array(
|
186 |
+
'title' => __('H1','hantus-pro'),
|
187 |
+
'panel' => 'hantus_typography_setting',
|
188 |
+
'priority' => 3,
|
189 |
+
)
|
190 |
+
);
|
191 |
+
|
192 |
+
//H1 font weight
|
193 |
+
|
194 |
+
$wp_customize->add_setting(
|
195 |
+
'h1_font_weight',
|
196 |
+
array(
|
197 |
+
'default' => 'normal',
|
198 |
+
'capability' => 'edit_theme_options',
|
199 |
+
'sanitize_callback' => 'sanitize_text_field',
|
200 |
+
)
|
201 |
+
);
|
202 |
+
$wp_customize->add_control(new Cleverfox_Customizer_Select_Control($wp_customize,
|
203 |
+
'h1_font_weight', array(
|
204 |
+
'label' => __('Font Style','hantus-pro'),
|
205 |
+
'section' => 'H1_typography',
|
206 |
+
'setting' => 'h1_font_weight',
|
207 |
+
'choices'=>$font_weight,
|
208 |
+
'description'=>__('','hantus-pro'),
|
209 |
+
))
|
210 |
+
);
|
211 |
+
|
212 |
+
// H1 font size//
|
213 |
+
$wp_customize->add_setting(
|
214 |
+
'h1_font_size' ,
|
215 |
+
array(
|
216 |
+
'default' => __( '48','hantus-pro' ),
|
217 |
+
'capability' => 'edit_theme_options',
|
218 |
+
'sanitize_callback' => 'sanitize_text_field',
|
219 |
+
)
|
220 |
+
);
|
221 |
+
|
222 |
+
$wp_customize->add_control(
|
223 |
+
new Cleverfox_Customizer_Range_Slider_Control( $wp_customize, 'h1_font_size',
|
224 |
+
array(
|
225 |
+
'section' => 'H1_typography',
|
226 |
+
'settings' => 'h1_font_size',
|
227 |
+
'label' => __( 'Font Size(px)','hantus-pro' ),
|
228 |
+
'input_attrs' => array(
|
229 |
+
'min' => 1,
|
230 |
+
'max' => 50,
|
231 |
+
'step' => 1,
|
232 |
+
//'suffix' => 'px', //optional suffix
|
233 |
+
),
|
234 |
+
) )
|
235 |
+
);
|
236 |
+
|
237 |
+
// paragraph line height//
|
238 |
+
$wp_customize->add_setting(
|
239 |
+
'h1_line_height' ,
|
240 |
+
array(
|
241 |
+
'default' => __( '1','hantus-pro' ),
|
242 |
+
'capability' => 'edit_theme_options',
|
243 |
+
'sanitize_callback' => 'sanitize_text_field',
|
244 |
+
)
|
245 |
+
);
|
246 |
+
|
247 |
+
$wp_customize->add_control(
|
248 |
+
new Cleverfox_Customizer_Range_Slider_Control( $wp_customize, 'h1_line_height',
|
249 |
+
array(
|
250 |
+
'section' => 'H1_typography',
|
251 |
+
'settings' => 'h1_line_height',
|
252 |
+
'label' => __( 'Line Height(px)','hantus-pro' ),
|
253 |
+
'input_attrs' => array(
|
254 |
+
'min' => 1,
|
255 |
+
'max' => 70,
|
256 |
+
'step' => 1,
|
257 |
+
//'suffix' => 'px', //optional suffix
|
258 |
+
),
|
259 |
+
) )
|
260 |
+
);
|
261 |
+
//H1 text transform
|
262 |
+
|
263 |
+
$wp_customize->add_setting(
|
264 |
+
'h1_text_transform' ,
|
265 |
+
array(
|
266 |
+
'default' => 'lowercase',
|
267 |
+
'capability' => 'edit_theme_options',
|
268 |
+
'sanitize_callback' => 'sanitize_text_field',
|
269 |
+
)
|
270 |
+
);
|
271 |
+
|
272 |
+
$wp_customize->add_control(new Cleverfox_Customizer_Select_Control($wp_customize,
|
273 |
+
'h1_text_transform' ,
|
274 |
+
array(
|
275 |
+
'label' => __( 'Text Transform', 'hantus-pro' ),
|
276 |
+
'section' => 'H1_typography',
|
277 |
+
'settings' => 'h1_text_transform',
|
278 |
+
'choices' => $font_transform,
|
279 |
+
))
|
280 |
+
);
|
281 |
+
|
282 |
+
|
283 |
+
|
284 |
+
//H2 typography
|
285 |
+
$wp_customize->add_section(
|
286 |
+
'H2_typography' ,
|
287 |
+
array(
|
288 |
+
'title' => __('H2','hantus-pro'),
|
289 |
+
'panel' => 'hantus_typography_setting',
|
290 |
+
'priority' => 3,
|
291 |
+
)
|
292 |
+
);
|
293 |
+
|
294 |
+
//H2 font weight
|
295 |
+
|
296 |
+
$wp_customize->add_setting(
|
297 |
+
'h2_font_weight',
|
298 |
+
array(
|
299 |
+
'default' => 'normal',
|
300 |
+
'capability' => 'edit_theme_options',
|
301 |
+
'sanitize_callback' => 'sanitize_text_field',
|
302 |
+
)
|
303 |
+
);
|
304 |
+
$wp_customize->add_control(new Cleverfox_Customizer_Select_Control($wp_customize,
|
305 |
+
'h2_font_weight', array(
|
306 |
+
'label' => __('Font Style','hantus-pro'),
|
307 |
+
'section' => 'H2_typography',
|
308 |
+
'setting' => 'h2_font_weight',
|
309 |
+
'choices'=>$font_weight,
|
310 |
+
'description'=>__('','hantus-pro'),
|
311 |
+
))
|
312 |
+
);
|
313 |
+
|
314 |
+
// H2 font size//
|
315 |
+
$wp_customize->add_setting(
|
316 |
+
'h2_font_size' ,
|
317 |
+
array(
|
318 |
+
'default' => __( '36','hantus-pro' ),
|
319 |
+
'capability' => 'edit_theme_options',
|
320 |
+
'sanitize_callback' => 'sanitize_text_field',
|
321 |
+
)
|
322 |
+
);
|
323 |
+
|
324 |
+
$wp_customize->add_control(
|
325 |
+
new Cleverfox_Customizer_Range_Slider_Control( $wp_customize, 'h2_font_size',
|
326 |
+
array(
|
327 |
+
'section' => 'H2_typography',
|
328 |
+
'settings' => 'h2_font_size',
|
329 |
+
'label' => __( 'Font Size(px)','hantus-pro' ),
|
330 |
+
'input_attrs' => array(
|
331 |
+
'min' => 1,
|
332 |
+
'max' => 40,
|
333 |
+
'step' => 1,
|
334 |
+
//'suffix' => 'px', //optional suffix
|
335 |
+
),
|
336 |
+
) )
|
337 |
+
);
|
338 |
+
|
339 |
+
// paragraph line height//
|
340 |
+
$wp_customize->add_setting(
|
341 |
+
'h2_line_height' ,
|
342 |
+
array(
|
343 |
+
'default' => '46',
|
344 |
+
'capability' => 'edit_theme_options',
|
345 |
+
'sanitize_callback' => 'sanitize_text_field',
|
346 |
+
)
|
347 |
+
);
|
348 |
+
|
349 |
+
$wp_customize->add_control(
|
350 |
+
new Cleverfox_Customizer_Range_Slider_Control( $wp_customize, 'h2_line_height',
|
351 |
+
array(
|
352 |
+
'section' => 'H2_typography',
|
353 |
+
'settings' => 'h2_line_height',
|
354 |
+
'label' => __( 'Line Height(px)','hantus-pro' ),
|
355 |
+
'input_attrs' => array(
|
356 |
+
'min' => 1,
|
357 |
+
'max' => 70,
|
358 |
+
'step' => 1,
|
359 |
+
//'suffix' => 'px', //optional suffix
|
360 |
+
),
|
361 |
+
) )
|
362 |
+
);
|
363 |
+
//H1 text transform
|
364 |
+
|
365 |
+
$wp_customize->add_setting(
|
366 |
+
'h2_text_transform' ,
|
367 |
+
array(
|
368 |
+
'default' => __( 'lowercase', 'hantus-pro' ),
|
369 |
+
'capability' => 'edit_theme_options',
|
370 |
+
'sanitize_callback' => 'sanitize_text_field',
|
371 |
+
)
|
372 |
+
);
|
373 |
+
|
374 |
+
$wp_customize->add_control(new Cleverfox_Customizer_Select_Control($wp_customize,
|
375 |
+
'h2_text_transform' ,
|
376 |
+
array(
|
377 |
+
'label' => __( 'Text Transform', 'hantus-pro' ),
|
378 |
+
'section' => 'H2_typography',
|
379 |
+
'settings' => 'h2_text_transform',
|
380 |
+
'choices' => $font_transform,
|
381 |
+
) )
|
382 |
+
);
|
383 |
+
|
384 |
+
|
385 |
+
//H3 typography
|
386 |
+
$wp_customize->add_section(
|
387 |
+
'H3_typography' ,
|
388 |
+
array(
|
389 |
+
'title' => __('H3','hantus-pro'),
|
390 |
+
'panel' => 'hantus_typography_setting',
|
391 |
+
'priority' => 3,
|
392 |
+
)
|
393 |
+
);
|
394 |
+
|
395 |
+
//H3 font weight
|
396 |
+
|
397 |
+
$wp_customize->add_setting(
|
398 |
+
'h3_font_weight',
|
399 |
+
array(
|
400 |
+
'default' => 'normal',
|
401 |
+
'capability' => 'edit_theme_options',
|
402 |
+
'sanitize_callback' => 'sanitize_text_field',
|
403 |
+
)
|
404 |
+
);
|
405 |
+
$wp_customize->add_control(new Cleverfox_Customizer_Select_Control($wp_customize,
|
406 |
+
'h3_font_weight', array(
|
407 |
+
'label' => __('Font Style','hantus-pro'),
|
408 |
+
'section' => 'H3_typography',
|
409 |
+
'setting' => 'h3_font_weight',
|
410 |
+
'choices'=>$font_weight,
|
411 |
+
'description'=>__('','hantus-pro'),
|
412 |
+
))
|
413 |
+
);
|
414 |
+
|
415 |
+
// H3 font size//
|
416 |
+
$wp_customize->add_setting(
|
417 |
+
'h3_font_size' ,
|
418 |
+
array(
|
419 |
+
'default' => __( '30','hantus-pro' ),
|
420 |
+
'capability' => 'edit_theme_options',
|
421 |
+
'sanitize_callback' => 'sanitize_text_field',
|
422 |
+
)
|
423 |
+
);
|
424 |
+
|
425 |
+
$wp_customize->add_control(
|
426 |
+
new Cleverfox_Customizer_Range_Slider_Control( $wp_customize, 'h3_font_size',
|
427 |
+
array(
|
428 |
+
'section' => 'H3_typography',
|
429 |
+
'settings' => 'h3_font_size',
|
430 |
+
'label' => __( 'Font Size(px)','hantus-pro' ),
|
431 |
+
'input_attrs' => array(
|
432 |
+
'min' => 1,
|
433 |
+
'max' => 40,
|
434 |
+
'step' => 1,
|
435 |
+
//'suffix' => 'px', //optional suffix
|
436 |
+
),
|
437 |
+
) )
|
438 |
+
);
|
439 |
+
|
440 |
+
//h3 line height//
|
441 |
+
$wp_customize->add_setting(
|
442 |
+
'h3_line_height' ,
|
443 |
+
array(
|
444 |
+
'default' => '34',
|
445 |
+
'capability' => 'edit_theme_options',
|
446 |
+
'sanitize_callback' => 'sanitize_text_field',
|
447 |
+
)
|
448 |
+
);
|
449 |
+
|
450 |
+
$wp_customize->add_control(
|
451 |
+
new Cleverfox_Customizer_Range_Slider_Control( $wp_customize, 'h3_line_height',
|
452 |
+
array(
|
453 |
+
'section' => 'H3_typography',
|
454 |
+
'settings' => 'h3_line_height',
|
455 |
+
'label' => __( 'Line Height(px)','hantus-pro' ),
|
456 |
+
'input_attrs' => array(
|
457 |
+
'min' => 1,
|
458 |
+
'max' => 50,
|
459 |
+
'step' => 1,
|
460 |
+
//'suffix' => 'px', //optional suffix
|
461 |
+
),
|
462 |
+
) )
|
463 |
+
);
|
464 |
+
//H3 text transform
|
465 |
+
|
466 |
+
$wp_customize->add_setting(
|
467 |
+
'h3_text_transform' ,
|
468 |
+
array(
|
469 |
+
'default' => __( 'lowercase','hantus-pro' ),
|
470 |
+
'capability' => 'edit_theme_options',
|
471 |
+
'sanitize_callback' => 'sanitize_text_field',
|
472 |
+
)
|
473 |
+
);
|
474 |
+
|
475 |
+
$wp_customize->add_control(new Cleverfox_Customizer_Select_Control($wp_customize,
|
476 |
+
'h3_text_transform' ,
|
477 |
+
array(
|
478 |
+
'label' => __( 'Text Transform', 'hantus-pro' ),
|
479 |
+
'section' => 'H3_typography',
|
480 |
+
'settings' => 'h3_text_transform',
|
481 |
+
'choices' => $font_transform,
|
482 |
+
) )
|
483 |
+
);
|
484 |
+
|
485 |
+
//H4 typography
|
486 |
+
$wp_customize->add_section(
|
487 |
+
'H4_typography' ,
|
488 |
+
array(
|
489 |
+
'title' => __('H4','hantus-pro'),
|
490 |
+
'panel' => 'hantus_typography_setting',
|
491 |
+
'priority' => 3,
|
492 |
+
)
|
493 |
+
);
|
494 |
+
|
495 |
+
//H4 font weight
|
496 |
+
|
497 |
+
$wp_customize->add_setting(
|
498 |
+
'h4_font_weight',
|
499 |
+
array(
|
500 |
+
'default' => 'normal',
|
501 |
+
'capability' => 'edit_theme_options',
|
502 |
+
'sanitize_callback' => 'sanitize_text_field',
|
503 |
+
)
|
504 |
+
);
|
505 |
+
$wp_customize->add_control(new Cleverfox_Customizer_Select_Control($wp_customize,
|
506 |
+
'h4_font_weight', array(
|
507 |
+
'label' => __('Font Style','hantus-pro'),
|
508 |
+
'section' => 'H4_typography',
|
509 |
+
'setting' => 'h4_font_weight',
|
510 |
+
'choices'=>$font_weight,
|
511 |
+
'description'=>__('','hantus-pro'),
|
512 |
+
))
|
513 |
+
);
|
514 |
+
|
515 |
+
// H4 font size//
|
516 |
+
$wp_customize->add_setting(
|
517 |
+
'h4_font_size' ,
|
518 |
+
array(
|
519 |
+
'default' => __( '20','hantus-pro' ),
|
520 |
+
'capability' => 'edit_theme_options',
|
521 |
+
'sanitize_callback' => 'sanitize_text_field',
|
522 |
+
)
|
523 |
+
);
|
524 |
+
|
525 |
+
$wp_customize->add_control(
|
526 |
+
new Cleverfox_Customizer_Range_Slider_Control( $wp_customize, 'h4_font_size',
|
527 |
+
array(
|
528 |
+
'section' => 'H4_typography',
|
529 |
+
'settings' => 'h4_font_size',
|
530 |
+
'label' => __( 'Font Size(px)','hantus-pro' ),
|
531 |
+
'input_attrs' => array(
|
532 |
+
'min' => 1,
|
533 |
+
'max' => 30,
|
534 |
+
'step' => 1,
|
535 |
+
//'suffix' => 'px', //optional suffix
|
536 |
+
),
|
537 |
+
) )
|
538 |
+
);
|
539 |
+
|
540 |
+
//h3 line height//
|
541 |
+
$wp_customize->add_setting(
|
542 |
+
'h4_line_height' ,
|
543 |
+
array(
|
544 |
+
'default' => '28',
|
545 |
+
'capability' => 'edit_theme_options',
|
546 |
+
'sanitize_callback' => 'sanitize_text_field',
|
547 |
+
)
|
548 |
+
);
|
549 |
+
|
550 |
+
$wp_customize->add_control(
|
551 |
+
new Cleverfox_Customizer_Range_Slider_Control( $wp_customize, 'h4_line_height',
|
552 |
+
array(
|
553 |
+
'section' => 'H4_typography',
|
554 |
+
'settings' => 'h4_line_height',
|
555 |
+
'label' => __( 'Line Height(px)','hantus-pro' ),
|
556 |
+
'input_attrs' => array(
|
557 |
+
'min' => 1,
|
558 |
+
'max' => 70,
|
559 |
+
'step' => 1,
|
560 |
+
//'suffix' => 'px', //optional suffix
|
561 |
+
),
|
562 |
+
) )
|
563 |
+
);
|
564 |
+
//H4 text transform
|
565 |
+
|
566 |
+
$wp_customize->add_setting(
|
567 |
+
'h4_text_transform' ,
|
568 |
+
array(
|
569 |
+
'default' => 'lowercase',
|
570 |
+
'capability' => 'edit_theme_options',
|
571 |
+
'sanitize_callback' => 'sanitize_text_field',
|
572 |
+
)
|
573 |
+
);
|
574 |
+
|
575 |
+
$wp_customize->add_control(new Cleverfox_Customizer_Select_Control($wp_customize,
|
576 |
+
'h4_text_transform' ,
|
577 |
+
array(
|
578 |
+
'label' => __( 'Text Transform', 'hantus-pro' ),
|
579 |
+
'section' => 'H4_typography',
|
580 |
+
'settings' => 'h4_text_transform',
|
581 |
+
'choices' => $font_transform,
|
582 |
+
) )
|
583 |
+
);
|
584 |
+
|
585 |
+
|
586 |
+
//H5 typography
|
587 |
+
$wp_customize->add_section(
|
588 |
+
'H5_typography' ,
|
589 |
+
array(
|
590 |
+
'title' => __('H5','hantus-pro'),
|
591 |
+
'panel' => 'hantus_typography_setting',
|
592 |
+
'priority' => 3,
|
593 |
+
)
|
594 |
+
);
|
595 |
+
|
596 |
+
//H5 font weight
|
597 |
+
|
598 |
+
$wp_customize->add_setting(
|
599 |
+
'h5_font_weight',
|
600 |
+
array(
|
601 |
+
'default' => 'normal',
|
602 |
+
'capability' => 'edit_theme_options',
|
603 |
+
'sanitize_callback' => 'sanitize_text_field',
|
604 |
+
)
|
605 |
+
);
|
606 |
+
$wp_customize->add_control(new Cleverfox_Customizer_Select_Control($wp_customize,
|
607 |
+
'h5_font_weight', array(
|
608 |
+
'label' => __('Font Style','hantus-pro'),
|
609 |
+
'section' => 'H5_typography',
|
610 |
+
'setting' => 'h5_font_weight',
|
611 |
+
'choices'=>$font_weight,
|
612 |
+
'description'=>__('','hantus-pro'),
|
613 |
+
))
|
614 |
+
);
|
615 |
+
|
616 |
+
// H5 font size//
|
617 |
+
$wp_customize->add_setting(
|
618 |
+
'h5_font_size' ,
|
619 |
+
array(
|
620 |
+
'default' => '16',
|
621 |
+
'capability' => 'edit_theme_options',
|
622 |
+
'sanitize_callback' => 'sanitize_text_field',
|
623 |
+
)
|
624 |
+
);
|
625 |
+
|
626 |
+
$wp_customize->add_control(
|
627 |
+
new Cleverfox_Customizer_Range_Slider_Control( $wp_customize, 'h5_font_size',
|
628 |
+
array(
|
629 |
+
'section' => 'H5_typography',
|
630 |
+
'settings' => 'h5_font_size',
|
631 |
+
'label' => __( 'Font Size(px)','hantus-pro' ),
|
632 |
+
'input_attrs' => array(
|
633 |
+
'min' => 1,
|
634 |
+
'max' => 30,
|
635 |
+
'step' => 1,
|
636 |
+
//'suffix' => 'px', //optional suffix
|
637 |
+
),
|
638 |
+
) )
|
639 |
+
);
|
640 |
+
|
641 |
+
//h5 line height//
|
642 |
+
$wp_customize->add_setting(
|
643 |
+
'h5_line_height' ,
|
644 |
+
array(
|
645 |
+
'default' => '15',
|
646 |
+
'capability' => 'edit_theme_options',
|
647 |
+
'sanitize_callback' => 'sanitize_text_field',
|
648 |
+
)
|
649 |
+
);
|
650 |
+
|
651 |
+
$wp_customize->add_control(
|
652 |
+
new Cleverfox_Customizer_Range_Slider_Control( $wp_customize, 'h5_line_height',
|
653 |
+
array(
|
654 |
+
'section' => 'H5_typography',
|
655 |
+
'settings' => 'h5_line_height',
|
656 |
+
'label' => __( 'Line Height(px)','hantus-pro' ),
|
657 |
+
'input_attrs' => array(
|
658 |
+
'min' => 1,
|
659 |
+
'max' => 70,
|
660 |
+
'step' => 1,
|
661 |
+
//'suffix' => 'px', //optional suffix
|
662 |
+
),
|
663 |
+
) )
|
664 |
+
);
|
665 |
+
//H5 text transform
|
666 |
+
|
667 |
+
$wp_customize->add_setting(
|
668 |
+
'h5_text_transform' ,
|
669 |
+
array(
|
670 |
+
'default' => 'lowercase',
|
671 |
+
'capability' => 'edit_theme_options',
|
672 |
+
'sanitize_callback' => 'sanitize_text_field',
|
673 |
+
)
|
674 |
+
);
|
675 |
+
|
676 |
+
$wp_customize->add_control(new Cleverfox_Customizer_Select_Control($wp_customize,
|
677 |
+
'h5_text_transform' ,
|
678 |
+
array(
|
679 |
+
'label' => __( 'Text Transform', 'hantus-pro' ),
|
680 |
+
'section' => 'H5_typography',
|
681 |
+
'settings' => 'h5_text_transform',
|
682 |
+
'choices' => $font_transform,
|
683 |
+
) )
|
684 |
+
);
|
685 |
+
|
686 |
+
|
687 |
+
//H6 typography
|
688 |
+
$wp_customize->add_section(
|
689 |
+
'H6_typography' ,
|
690 |
+
array(
|
691 |
+
'title' => __('H6','hantus-pro'),
|
692 |
+
'panel' => 'hantus_typography_setting',
|
693 |
+
'priority' => 3,
|
694 |
+
)
|
695 |
+
);
|
696 |
+
|
697 |
+
//H5 font weight
|
698 |
+
|
699 |
+
$wp_customize->add_setting(
|
700 |
+
'h6_font_weight',
|
701 |
+
array(
|
702 |
+
'default' => 'normal',
|
703 |
+
'capability' => 'edit_theme_options',
|
704 |
+
'sanitize_callback' => 'sanitize_text_field',
|
705 |
+
)
|
706 |
+
);
|
707 |
+
$wp_customize->add_control(new Cleverfox_Customizer_Select_Control($wp_customize,
|
708 |
+
'h6_font_weight', array(
|
709 |
+
'label' => __('Font Style','hantus-pro'),
|
710 |
+
'section' => 'H6_typography',
|
711 |
+
'setting' => 'h6_font_weight',
|
712 |
+
'choices'=>$font_weight,
|
713 |
+
'description'=>__('','hantus-pro'),
|
714 |
+
))
|
715 |
+
);
|
716 |
+
|
717 |
+
// H6 font size//
|
718 |
+
$wp_customize->add_setting(
|
719 |
+
'h6_font_size' ,
|
720 |
+
array(
|
721 |
+
'default' => '16',
|
722 |
+
'capability' => 'edit_theme_options',
|
723 |
+
'sanitize_callback' => 'sanitize_text_field',
|
724 |
+
)
|
725 |
+
);
|
726 |
+
|
727 |
+
$wp_customize->add_control(
|
728 |
+
new Cleverfox_Customizer_Range_Slider_Control( $wp_customize, 'h6_font_size',
|
729 |
+
array(
|
730 |
+
'section' => 'H6_typography',
|
731 |
+
'settings' => 'h6_font_size',
|
732 |
+
'label' => __( 'Font Size(px)','hantus-pro' ),
|
733 |
+
'input_attrs' => array(
|
734 |
+
'min' => 1,
|
735 |
+
'max' => 30,
|
736 |
+
'step' => 1,
|
737 |
+
//'suffix' => 'px', //optional suffix
|
738 |
+
),
|
739 |
+
) )
|
740 |
+
);
|
741 |
+
|
742 |
+
//h6 line height//
|
743 |
+
$wp_customize->add_setting(
|
744 |
+
'h6_line_height' ,
|
745 |
+
array(
|
746 |
+
'default' => '24',
|
747 |
+
'capability' => 'edit_theme_options',
|
748 |
+
'sanitize_callback' => 'sanitize_text_field',
|
749 |
+
)
|
750 |
+
);
|
751 |
+
|
752 |
+
$wp_customize->add_control(
|
753 |
+
new Cleverfox_Customizer_Range_Slider_Control( $wp_customize, 'h6_line_height',
|
754 |
+
array(
|
755 |
+
'section' => 'H6_typography',
|
756 |
+
'settings' => 'h6_line_height',
|
757 |
+
'label' => __( 'Line Height(px)','hantus-pro' ),
|
758 |
+
'input_attrs' => array(
|
759 |
+
'min' => 1,
|
760 |
+
'max' => 70,
|
761 |
+
'step' => 1,
|
762 |
+
//'suffix' => 'px', //optional suffix
|
763 |
+
),
|
764 |
+
) )
|
765 |
+
);
|
766 |
+
//H5 text transform
|
767 |
+
|
768 |
+
$wp_customize->add_setting(
|
769 |
+
'h6_text_transform' ,
|
770 |
+
array(
|
771 |
+
'default' => 'lowercase',
|
772 |
+
'capability' => 'edit_theme_options',
|
773 |
+
'sanitize_callback' => 'sanitize_text_field',
|
774 |
+
)
|
775 |
+
);
|
776 |
+
|
777 |
+
$wp_customize->add_control(new Cleverfox_Customizer_Select_Control($wp_customize,
|
778 |
+
'h6_text_transform' ,
|
779 |
+
array(
|
780 |
+
'label' => __( 'Text Transform', 'hantus-pro' ),
|
781 |
+
'section' => 'H6_typography',
|
782 |
+
'settings' => 'h6_text_transform',
|
783 |
+
'choices' => $font_transform,
|
784 |
+
) )
|
785 |
+
);
|
786 |
+
|
787 |
+
|
788 |
+
// menu typography section
|
789 |
+
$wp_customize->add_section(
|
790 |
+
'menu_typography' ,
|
791 |
+
array(
|
792 |
+
'title' => __('Menus','hantus-pro'),
|
793 |
+
'panel' => 'hantus_typography_setting',
|
794 |
+
'priority' => 2,
|
795 |
+
) );
|
796 |
+
|
797 |
+
|
798 |
+
//menu font weight
|
799 |
+
$wp_customize->add_setting(
|
800 |
+
'menu_font_weight',
|
801 |
+
array(
|
802 |
+
'default' => 'normal',
|
803 |
+
'capability' => 'edit_theme_options',
|
804 |
+
'sanitize_callback' => 'sanitize_text_field',
|
805 |
+
)
|
806 |
+
);
|
807 |
+
$wp_customize->add_control(new Cleverfox_Customizer_Select_Control($wp_customize,
|
808 |
+
'menu_font_weight',
|
809 |
+
array(
|
810 |
+
'label' => __('Font Style','hantus-pro'),
|
811 |
+
'section' => 'menu_typography',
|
812 |
+
'setting' => 'menu_font_weight',
|
813 |
+
'choices'=>$font_weight,
|
814 |
+
'description'=>__('','hantus-pro'),
|
815 |
+
))
|
816 |
+
);
|
817 |
+
|
818 |
+
// menu font size//
|
819 |
+
$wp_customize->add_setting(
|
820 |
+
'menu_font_size' ,
|
821 |
+
array(
|
822 |
+
'default' => '15',
|
823 |
+
'capability' => 'edit_theme_options',
|
824 |
+
'sanitize_callback' => 'sanitize_text_field',
|
825 |
+
)
|
826 |
+
);
|
827 |
+
|
828 |
+
$wp_customize->add_control(
|
829 |
+
new Cleverfox_Customizer_Range_Slider_Control( $wp_customize, 'menu_font_size',
|
830 |
+
array(
|
831 |
+
'section' => 'menu_typography',
|
832 |
+
'settings' => 'menu_font_size',
|
833 |
+
'label' => __( 'Font Size(px)','hantus-pro' ),
|
834 |
+
'input_attrs' => array(
|
835 |
+
'min' => 1,
|
836 |
+
'max' => 20,
|
837 |
+
'step' => 1,
|
838 |
+
//'suffix' => 'px', //optional suffix
|
839 |
+
),
|
840 |
+
) )
|
841 |
+
);
|
842 |
+
|
843 |
+
//menu text transform
|
844 |
+
|
845 |
+
$wp_customize->add_setting(
|
846 |
+
'menu_text_transform' ,
|
847 |
+
array(
|
848 |
+
'default' => 'capitalize',
|
849 |
+
'capability' => 'edit_theme_options',
|
850 |
+
'sanitize_callback' => 'sanitize_text_field',
|
851 |
+
)
|
852 |
+
);
|
853 |
+
|
854 |
+
$wp_customize->add_control(new Cleverfox_Customizer_Select_Control($wp_customize,
|
855 |
+
'menu_text_transform' ,
|
856 |
+
array(
|
857 |
+
'label' => __( 'Text Transform', 'hantus-pro' ),
|
858 |
+
'section' => 'menu_typography',
|
859 |
+
'settings' => 'menu_text_transform',
|
860 |
+
'choices' => $font_transform,
|
861 |
+
) )
|
862 |
+
);
|
863 |
+
|
864 |
+
// Sections typography section
|
865 |
+
$wp_customize->add_section(
|
866 |
+
'section_typography' ,
|
867 |
+
array(
|
868 |
+
'title' => __('Sections','hantus-pro'),
|
869 |
+
'panel' => 'hantus_typography_setting',
|
870 |
+
'priority' => 2,
|
871 |
+
) );
|
872 |
+
|
873 |
+
//section font weight
|
874 |
+
|
875 |
+
$wp_customize->add_setting(
|
876 |
+
'section_tit_font_weight',
|
877 |
+
array(
|
878 |
+
'default' => 'normal',
|
879 |
+
'capability' => 'edit_theme_options',
|
880 |
+
'sanitize_callback' => 'sanitize_text_field',
|
881 |
+
)
|
882 |
+
);
|
883 |
+
$wp_customize->add_control(new Cleverfox_Customizer_Select_Control($wp_customize,
|
884 |
+
'section_tit_font_weight',
|
885 |
+
array(
|
886 |
+
'label' => __(' Title Font Style','hantus-pro'),
|
887 |
+
'section' => 'section_typography',
|
888 |
+
'setting' => 'section_tit_font_weight',
|
889 |
+
'choices'=>$font_weight,
|
890 |
+
'description'=>__('','hantus-pro'),
|
891 |
+
))
|
892 |
+
);
|
893 |
+
|
894 |
+
// section title font size//
|
895 |
+
$wp_customize->add_setting(
|
896 |
+
'section_tit_font_size' ,
|
897 |
+
array(
|
898 |
+
'default' => '36',
|
899 |
+
'capability' => 'edit_theme_options',
|
900 |
+
'sanitize_callback' => 'sanitize_text_field',
|
901 |
+
)
|
902 |
+
);
|
903 |
+
|
904 |
+
$wp_customize->add_control(
|
905 |
+
new Cleverfox_Customizer_Range_Slider_Control( $wp_customize, 'section_tit_font_size',
|
906 |
+
array(
|
907 |
+
'section' => 'section_typography',
|
908 |
+
'settings' => 'section_tit_font_size',
|
909 |
+
'label' => __( 'Title Font Size(px)','hantus-pro' ),
|
910 |
+
'input_attrs' => array(
|
911 |
+
'min' => 1,
|
912 |
+
'max' => 50,
|
913 |
+
'step' => 1,
|
914 |
+
//'suffix' => 'px', //optional suffix
|
915 |
+
),
|
916 |
+
) )
|
917 |
+
);
|
918 |
+
|
919 |
+
//section font weight
|
920 |
+
|
921 |
+
$wp_customize->add_setting(
|
922 |
+
'section_des_font_weight',
|
923 |
+
array(
|
924 |
+
'default' => 'normal',
|
925 |
+
'capability' => 'edit_theme_options',
|
926 |
+
'sanitize_callback' => 'sanitize_text_field',
|
927 |
+
)
|
928 |
+
);
|
929 |
+
$wp_customize->add_control(new Cleverfox_Customizer_Select_Control($wp_customize,
|
930 |
+
'section_des_font_weight',
|
931 |
+
array(
|
932 |
+
'label' => __('Description Font Style','hantus-pro'),
|
933 |
+
'section' => 'section_typography',
|
934 |
+
'setting' => 'section_des_font_weight',
|
935 |
+
'choices'=>$font_weight,
|
936 |
+
'description'=>__('','hantus-pro'),
|
937 |
+
))
|
938 |
+
);
|
939 |
+
|
940 |
+
// section title font size//
|
941 |
+
$wp_customize->add_setting(
|
942 |
+
'section_desc_font_size' ,
|
943 |
+
array(
|
944 |
+
'default' => '16',
|
945 |
+
'capability' => 'edit_theme_options',
|
946 |
+
'sanitize_callback' => 'sanitize_text_field',
|
947 |
+
)
|
948 |
+
);
|
949 |
+
|
950 |
+
$wp_customize->add_control(
|
951 |
+
new Cleverfox_Customizer_Range_Slider_Control( $wp_customize, 'section_desc_font_size',
|
952 |
+
array(
|
953 |
+
'section' => 'section_typography',
|
954 |
+
'settings' => 'section_desc_font_size',
|
955 |
+
'label' => __( 'Description Font Size(px)','hantus-pro' ),
|
956 |
+
'input_attrs' => array(
|
957 |
+
'min' => 1,
|
958 |
+
'max' => 30,
|
959 |
+
'step' => 1,
|
960 |
+
//'suffix' => 'px', //optional suffix
|
961 |
+
),
|
962 |
+
) )
|
963 |
+
);
|
964 |
+
}
|
965 |
+
add_action( 'customize_register', 'hantus_typography_customizer' );
|
966 |
+
?>
|
inc/hantus/images/footerlogo.png
ADDED
Binary file
|
inc/hantus/images/icons/icon01.png
ADDED
Binary file
|
inc/hantus/images/icons/icon02.png
ADDED
Binary file
|
inc/hantus/images/icons/icon03.png
ADDED
Binary file
|
inc/hantus/images/logo.png
ADDED
Binary file
|
inc/hantus/images/service/service01.png
ADDED
Binary file
|
inc/hantus/images/service/service02.png
ADDED
Binary file
|
inc/hantus/images/service/service03.png
ADDED
Binary file
|
inc/hantus/images/service/service04.png
ADDED
Binary file
|
inc/hantus/images/slider/slider.jpg
ADDED
Binary file
|
inc/hantus/images/testimonial/testimonial-bg.jpg
ADDED
Binary file
|
inc/hantus/images/testimonial/testimonial01.png
ADDED
Binary file
|
inc/hantus/images/testimonial/testimonial02.png
ADDED
Binary file
|
inc/hantus/images/testimonial/testimonial03.png
ADDED
Binary file
|
inc/hantus/sections/section-info.php
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! function_exists( 'hantus_lite_info' ) ) :
|
3 |
+
function hantus_lite_info() {
|
4 |
+
$hide_show_info = get_theme_mod('hide_show_info','1');
|
5 |
+
$info_first_img_setting = get_theme_mod('info_first_img_setting',CLEVERFOX_PLUGIN_URL . 'inc/hantus/images/icons/icon01.png');
|
6 |
+
$info_title = get_theme_mod('info_title','Opening Time');
|
7 |
+
$info_description = get_theme_mod('info_description','Mon - Sat: 10h00 - 18h00');
|
8 |
+
$info_second_img_setting= get_theme_mod('info_second_img_setting',CLEVERFOX_PLUGIN_URL . 'inc/hantus/images/icons/icon02.png');
|
9 |
+
$info_title2 = get_theme_mod('info_title2','Address');
|
10 |
+
$info_description2 = get_theme_mod('info_description2','40 Baria Sreet, NY USAm');
|
11 |
+
$info_third_img_setting = get_theme_mod('info_third_img_setting',CLEVERFOX_PLUGIN_URL . 'inc/hantus/images/icons/icon03.png');
|
12 |
+
$info_title3 = get_theme_mod('info_title3','Telephone');
|
13 |
+
$info_description3 = get_theme_mod('info_description3','+12 345 678 9101');
|
14 |
+
?>
|
15 |
+
<?php if($hide_show_info == '1') { ?>
|
16 |
+
<section id="contact">
|
17 |
+
<div class="container contact-wrapper text-center text-xl-left">
|
18 |
+
<div class="row">
|
19 |
+
<div class="col-xl-4 col-md-6 col-sm-6 single-contact info-first">
|
20 |
+
<?php if ( ! empty( $info_first_img_setting ) ) { ?>
|
21 |
+
<img src="<?php echo esc_url( $info_first_img_setting ); ?>" <?php if ( ! empty( $title ) ) : ?> alt="<?php echo esc_attr( $title ); ?>" title="<?php echo esc_attr( $title ); ?>" <?php endif; ?> />
|
22 |
+
<?php } ?>
|
23 |
+
<h4><?php echo esc_attr( $info_title ); ?></h4>
|
24 |
+
<p><?php echo esc_attr( $info_description ); ?></p>
|
25 |
+
</div>
|
26 |
+
<div class="col-xl-4 col-md-6 col-sm-6 single-contact info-second">
|
27 |
+
<?php if ( ! empty( $info_second_img_setting ) ) { ?>
|
28 |
+
<img src="<?php echo esc_url( $info_second_img_setting ); ?>" <?php if ( ! empty( $title ) ) : ?> alt="<?php echo esc_attr( $title ); ?>" title="<?php echo esc_attr( $title ); ?>" <?php endif; ?> />
|
29 |
+
<?php } ?>
|
30 |
+
<h4><?php echo esc_attr( $info_title2 ); ?></h4>
|
31 |
+
<p><?php echo esc_attr( $info_description2 ); ?></p>
|
32 |
+
</div>
|
33 |
+
<div class="col-xl-4 offset-xl-0 col-md-6 col-sm-6 offset-sm-3 single-contact info-third">
|
34 |
+
<?php if ( ! empty( $info_third_img_setting ) ) { ?>
|
35 |
+
<img src="<?php echo esc_url( $info_third_img_setting ); ?>" <?php if ( ! empty( $title ) ) : ?> alt="<?php echo esc_attr( $title ); ?>" title="<?php echo esc_attr( $title ); ?>" <?php endif; ?> />
|
36 |
+
<?php } ?>
|
37 |
+
<h4><?php echo esc_attr( $info_title3 ); ?></h4>
|
38 |
+
<p><?php echo esc_attr( $info_description3 ); ?></p>
|
39 |
+
</div>
|
40 |
+
</div>
|
41 |
+
</div>
|
42 |
+
</section>
|
43 |
+
<?php
|
44 |
+
}
|
45 |
+
}
|
46 |
+
endif;
|
47 |
+
if ( function_exists( 'hantus_lite_info' ) ) {
|
48 |
+
$section_priority = apply_filters( 'hantus_section_priority', 12, 'hantus_lite_info' );
|
49 |
+
add_action( 'hantus_sections', 'hantus_lite_info', absint( $section_priority ) );
|
50 |
+
}
|
51 |
+
?>
|
inc/hantus/sections/section-service.php
ADDED
@@ -0,0 +1,114 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! function_exists( 'hantus_lite_service' ) ) :
|
3 |
+
function hantus_lite_service() {
|
4 |
+
function hantus_get_service_default() {
|
5 |
+
return apply_filters(
|
6 |
+
'hantus_get_service_default', json_encode(
|
7 |
+
array(
|
8 |
+
array(
|
9 |
+
'image_url' => CLEVERFOX_PLUGIN_URL . 'inc/hantus/images/service/service01.png',
|
10 |
+
'title' => esc_html__( 'Oil Massage', 'hantus' ),
|
11 |
+
'text' => esc_html__( 'Lorem Ipsum is simply dummy text of the printing and typesetting.', 'hantus' ),
|
12 |
+
'id' => 'customizer_repeater_service_001',
|
13 |
+
|
14 |
+
),
|
15 |
+
array(
|
16 |
+
'image_url' => CLEVERFOX_PLUGIN_URL . 'inc/hantus/images/service/service02.png',
|
17 |
+
'title' => esc_html__( 'Skin Care', 'hantus' ),
|
18 |
+
'text' => esc_html__( 'Lorem Ipsum is simply dummy text of the printing and typesetting.', 'hantus' ),
|
19 |
+
'id' => 'customizer_repeater_service_002',
|
20 |
+
|
21 |
+
),
|
22 |
+
array(
|
23 |
+
'image_url' => CLEVERFOX_PLUGIN_URL . 'inc/hantus/images/service/service03.png',
|
24 |
+
'title' => esc_html__( 'Natural Relaxation', 'hantus' ),
|
25 |
+
'text' => esc_html__( 'Lorem Ipsum is simply dummy text of the printing and typesetting.', 'hantus' ),
|
26 |
+
'id' => 'customizer_repeater_service_003',
|
27 |
+
|
28 |
+
),
|
29 |
+
array(
|
30 |
+
'image_url' => CLEVERFOX_PLUGIN_URL . 'inc/hantus/images/service/service04.png',
|
31 |
+
'title' => esc_html__( 'Nails Design', 'hantus' ),
|
32 |
+
'text' => esc_html__( 'Lorem Ipsum is simply dummy text of the printing and typesetting.', 'hantus' ),
|
33 |
+
'id' => 'customizer_repeater_service_004',
|
34 |
+
|
35 |
+
),
|
36 |
+
)
|
37 |
+
)
|
38 |
+
);
|
39 |
+
}
|
40 |
+
$default_content = null;
|
41 |
+
if ( current_user_can( 'edit_theme_options' ) ) {
|
42 |
+
$default_content = hantus_get_service_default();
|
43 |
+
}
|
44 |
+
?>
|
45 |
+
<?php
|
46 |
+
$hide_show_service= get_theme_mod('hide_show_service','1');
|
47 |
+
$service_title= get_theme_mod('service_title','Our Services');
|
48 |
+
$service_description= get_theme_mod('service_description','These are the services we provide, these makes us stand apart.');
|
49 |
+
$service_contents= get_theme_mod('service_contents',$default_content);
|
50 |
+
$service_display_num= get_theme_mod('service_display_num');
|
51 |
+
$hide_show_service_excerpt= get_theme_mod('hide_show_service_excerpt');
|
52 |
+
$service_sec_column= get_theme_mod('service_sec_column','3');
|
53 |
+
|
54 |
+
?>
|
55 |
+
<?php if($hide_show_service == '1') {?>
|
56 |
+
<section id="services" class="section-padding">
|
57 |
+
<div class="container">
|
58 |
+
<div class="row">
|
59 |
+
<div class="col-lg-6 offset-lg-3 col-12 text-center">
|
60 |
+
<div class="section-title service-section">
|
61 |
+
<h2><?php echo $service_title; ?></h2>
|
62 |
+
<hr style="background: url('<?php echo get_template_directory_uri(); ?>/images/section-icon.png') no-repeat center / cover;">
|
63 |
+
<p><?php echo $service_description; ?></p>
|
64 |
+
</div>
|
65 |
+
</div>
|
66 |
+
</div>
|
67 |
+
<div class="row servicesss">
|
68 |
+
<?php
|
69 |
+
if ( ! empty( $service_contents ) ) {
|
70 |
+
$allowed_html = array(
|
71 |
+
'br' => array(),
|
72 |
+
'em' => array(),
|
73 |
+
'strong' => array(),
|
74 |
+
'b' => array(),
|
75 |
+
'i' => array(),
|
76 |
+
);
|
77 |
+
$service_contents = json_decode( $service_contents );
|
78 |
+
foreach ( $service_contents as $service_item ) {
|
79 |
+
$title = ! empty( $service_item->title ) ? apply_filters( 'hantus_translate_single_string', $service_item->title, 'service section' ) : '';
|
80 |
+
$text = ! empty( $service_item->text ) ? apply_filters( 'hantus_translate_single_string', $service_item->text, 'service section' ) : '';
|
81 |
+
$image = ! empty( $service_item->image_url ) ? apply_filters( 'hantus_translate_single_string', $service_item->image_url, 'service section' ) : '';
|
82 |
+
?>
|
83 |
+
<div class="col-lg-<?php echo $service_sec_column; ?> col-md-6 col-sm-6 mb-5 mb-lg-0 serv-cont">
|
84 |
+
<div class="service-box text-center">
|
85 |
+
<figure>
|
86 |
+
<?php if ( ! empty( $image ) ) : ?>
|
87 |
+
<img class="services_cols_mn_icon" src="<?php echo esc_url( $image ); ?>" <?php if ( ! empty( $title ) ) : ?> alt="<?php echo esc_attr( $title ); ?>" title="<?php echo esc_attr( $title ); ?>" <?php endif; ?> />
|
88 |
+
<?php endif; ?>
|
89 |
+
<figcaption>
|
90 |
+
<div class="inner-text">
|
91 |
+
</div>
|
92 |
+
</figcaption>
|
93 |
+
</figure>
|
94 |
+
<?php if ( ! empty( $title ) ) : ?>
|
95 |
+
<h4><?php echo esc_html( $title ); ?></h4>
|
96 |
+
<?php endif; ?>
|
97 |
+
<?php if ( ! empty( $text ) ) : ?>
|
98 |
+
<p><?php echo esc_html( $text ); ?></p>
|
99 |
+
<?php endif; ?>
|
100 |
+
</div>
|
101 |
+
</div>
|
102 |
+
<?php }}?>
|
103 |
+
</div>
|
104 |
+
</div>
|
105 |
+
</section>
|
106 |
+
<?php
|
107 |
+
}
|
108 |
+
}
|
109 |
+
endif;
|
110 |
+
if ( function_exists( 'hantus_lite_service' ) ) {
|
111 |
+
$section_priority = apply_filters( 'hantus_section_priority', 25, 'hantus_lite_service' );
|
112 |
+
add_action( 'hantus_sections', 'hantus_lite_service', absint( $section_priority ) );
|
113 |
+
}
|
114 |
+
?>
|
inc/hantus/sections/section-slider.php
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Slider section for the homepage.
|
4 |
+
*/
|
5 |
+
if ( ! function_exists( 'hantus_lite_slider' ) ) :
|
6 |
+
|
7 |
+
function hantus_lite_slider() {
|
8 |
+
|
9 |
+
$slide_image = get_theme_mod('slide_image',CLEVERFOX_PLUGIN_URL .'inc/hantus/images/slider/slider.jpg');
|
10 |
+
$slide_title = get_theme_mod('slide_title','Welcome To Hantus Spa');
|
11 |
+
$slide_subtitle = get_theme_mod('slide_subtitle','Beauty & Spa Wellness');
|
12 |
+
$slide_description = get_theme_mod('slide_description','The Spa at Sun Valley is a serene oasis amid all the exciting activities our iconic valley has delivered for decades.');
|
13 |
+
$slide_btn_text = get_theme_mod('slide_btn_text','Make an Appoinment');
|
14 |
+
$slide_btn_link = get_theme_mod('slide_btn_link','#');
|
15 |
+
$slider_opacity = get_theme_mod('slider_opacity');
|
16 |
+
$hide_show_slider = get_theme_mod('hide_show_slider','1');
|
17 |
+
|
18 |
+
if($hide_show_slider == '1') {
|
19 |
+
?>
|
20 |
+
<header id="slider">
|
21 |
+
<div class="row">
|
22 |
+
<div class="col-md-12">
|
23 |
+
<div class="header-slider">
|
24 |
+
<div class="header-single-slider">
|
25 |
+
<figure>
|
26 |
+
<img src="<?php echo esc_url( $slide_image ); ?>" alt="">
|
27 |
+
<figcaption>
|
28 |
+
<div class="content" style="background: rgba(35, 48, 73,<?php echo $slider_opacity; ?>);">
|
29 |
+
<div class="container inner-content text-left">
|
30 |
+
<h3><?php echo esc_html( $slide_title ); ?></h3>
|
31 |
+
<h1><?php echo esc_html( $slide_subtitle ); ?></h1>
|
32 |
+
<p><?php echo esc_html( $slide_description ); ?></p>
|
33 |
+
<a href="<?php echo esc_url( $slide_btn_link ); ?>" class="boxed-btn"><?php echo esc_html( $slide_btn_text ); ?></a>
|
34 |
+
</div>
|
35 |
+
</div>
|
36 |
+
</figcaption>
|
37 |
+
</figure>
|
38 |
+
</div>
|
39 |
+
</div>
|
40 |
+
</div>
|
41 |
+
</div>
|
42 |
+
</header>
|
43 |
+
<?php
|
44 |
+
}
|
45 |
+
}
|
46 |
+
|
47 |
+
endif;
|
48 |
+
|
49 |
+
if ( function_exists( 'hantus_lite_slider' ) ) {
|
50 |
+
$section_priority = apply_filters( 'hantus_section_priority', 11, 'hantus_lite_slider' );
|
51 |
+
add_action( 'hantus_sections', 'hantus_lite_slider', absint( $section_priority ) );
|
52 |
+
|
53 |
+
}
|
inc/hantus/sections/section-testimonial.php
ADDED
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! function_exists( 'hantus_lite_testimonial' ) ) :
|
3 |
+
function hantus_lite_testimonial() {
|
4 |
+
function hantus_get_testimonial_default() {
|
5 |
+
return apply_filters(
|
6 |
+
'hantus_get_testimonial_default', json_encode(
|
7 |
+
array(
|
8 |
+
array(
|
9 |
+
'title' => esc_html__( 'Eric Matision', 'hantus-pro' ),
|
10 |
+
'designation' => esc_html__( 'Forest Hills. NY', 'hantus-pro' ),
|
11 |
+
'text' => esc_html__( 'I am very impressed by the efficiency of your service and your excellent returns policy. It is so pleasant to deal with such a customer focussed website.', 'hantus-pro' ),
|
12 |
+
'image_url' => CLEVERFOX_PLUGIN_URL . 'inc/hantus/images/testimonial/testimonial01.png',
|
13 |
+
'id' => 'customizer_repeater_testimonial_001',
|
14 |
+
),
|
15 |
+
array(
|
16 |
+
'title' => esc_html__( 'Jennifer Lopez', 'hantus-pro' ),
|
17 |
+
'designation' => esc_html__( 'Forest Hills. NY', 'hantus-pro' ),
|
18 |
+
'text' => esc_html__( 'I am very impressed by the efficiency of your service and your excellent returns policy. It is so pleasant to deal with such a customer focussed website.', 'hantus-pro' ),
|
19 |
+
'image_url' => CLEVERFOX_PLUGIN_URL . 'inc/hantus/images/testimonial/testimonial01.png',
|
20 |
+
'id' => 'customizer_repeater_testimonial_002',
|
21 |
+
),
|
22 |
+
array(
|
23 |
+
'title' => esc_html__( 'Betty Ross', 'hantus-pro' ),
|
24 |
+
'designation' => esc_html__( 'Developer', 'hantus-pro' ),
|
25 |
+
'text' => esc_html__( 'I am very impressed by the efficiency of your service and your excellent returns policy. It is so pleasant to deal with such a customer focussed website.', 'hantus-pro' ),
|
26 |
+
'image_url' => CLEVERFOX_PLUGIN_URL . 'inc/hantus/images/testimonial/testimonial01.png',
|
27 |
+
'id' => 'customizer_repeater_testimonial_003',
|
28 |
+
),
|
29 |
+
)
|
30 |
+
)
|
31 |
+
);
|
32 |
+
}
|
33 |
+
$default_content = null;
|
34 |
+
if ( current_user_can( 'edit_theme_options' ) ) {
|
35 |
+
$default_content = hantus_get_testimonial_default();
|
36 |
+
}
|
37 |
+
?>
|
38 |
+
<?php
|
39 |
+
$hide_show_testimonial= get_theme_mod('hide_show_testimonial','1');
|
40 |
+
$testimonial_contents= get_theme_mod('testimonial_contents',$default_content);
|
41 |
+
$testimonial_background_setting= get_theme_mod('testimonial_background_setting',CLEVERFOX_PLUGIN_URL .'inc/hantus/images/testimonial/testimonial-bg.jpg');
|
42 |
+
?>
|
43 |
+
<?php if ( ! empty( $testimonial_background_setting ) ) { ?>
|
44 |
+
<section id="testimonial" class="section-padding" style="background: url('<?php echo esc_url($testimonial_background_setting); ?>') no-repeat center scroll/ 100% 100% ">
|
45 |
+
<?php }else{ ?>
|
46 |
+
<section id="testimonial" class="section-padding" style="background:#f7f7f7;">
|
47 |
+
<?php } ?>
|
48 |
+
<div class="container">
|
49 |
+
<div class="row">
|
50 |
+
<div class="col-md-12">
|
51 |
+
<div class="testimonial-carousel text-center" data-slider-id="1">
|
52 |
+
<?php
|
53 |
+
if ( ! empty( $testimonial_contents ) ) {
|
54 |
+
$allowed_html = array(
|
55 |
+
'br' => array(),
|
56 |
+
'em' => array(),
|
57 |
+
'strong' => array(),
|
58 |
+
'b' => array(),
|
59 |
+
'i' => array(),
|
60 |
+
);
|
61 |
+
$testimonial_contents = json_decode( $testimonial_contents );
|
62 |
+
foreach ( $testimonial_contents as $testimonial_item ) {
|
63 |
+
|
64 |
+
$title = ! empty( $testimonial_item->title ) ? apply_filters( 'hantus_translate_single_string', $testimonial_item->title, 'testimonial section' ) : '';
|
65 |
+
$designation = ! empty( $testimonial_item->designation ) ? apply_filters( 'hantus_translate_single_string', $testimonial_item->designation, 'testimonial section' ) : '';
|
66 |
+
$text = ! empty( $testimonial_item->text ) ? apply_filters( 'hantus_translate_single_string', $testimonial_item->text, 'testimonial section' ) : '';
|
67 |
+
$image = ! empty( $testimonial_item->image_url ) ? apply_filters( 'hantus_translate_single_string', $testimonial_item->image_url, 'testimonial section' ) : '';
|
68 |
+
?>
|
69 |
+
<div class="single-testimonial" data-dot="<img src='<?php echo esc_url( $image ); ?>'/>">
|
70 |
+
<?php if ( ! empty( $text ) ) : ?>
|
71 |
+
<p>“<?php echo esc_attr( $text ); ?>”</p>
|
72 |
+
<?php endif; ?>
|
73 |
+
<?php if ( ! empty( $title ) ) : ?>
|
74 |
+
<h5><?php echo esc_attr( $title ); ?></h5>
|
75 |
+
<?php endif; ?>
|
76 |
+
<?php if ( ! empty( $designation ) ) : ?>
|
77 |
+
<p class="title"><?php echo esc_attr( $designation ); ?></p>
|
78 |
+
<?php endif; ?>
|
79 |
+
</div>
|
80 |
+
<?php
|
81 |
+
}
|
82 |
+
}
|
83 |
+
?>
|
84 |
+
</div>
|
85 |
+
</div>
|
86 |
+
</div>
|
87 |
+
</div>
|
88 |
+
</section>
|
89 |
+
</section>
|
90 |
+
<?php
|
91 |
+
}
|
92 |
+
endif;
|
93 |
+
if ( function_exists( 'hantus_lite_testimonial' ) ) {
|
94 |
+
$section_priority = apply_filters( 'hantus_section_priority', 37, 'hantus_lite_testimonial' );
|
95 |
+
add_action( 'hantus_sections', 'hantus_lite_testimonial', absint( $section_priority ) );
|
96 |
+
}
|
97 |
+
?>
|
inc/hantus/typography_style.php
ADDED
@@ -0,0 +1,615 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
function hantus_own_theme_typography() {
|
3 |
+
$hide_show_typography= get_theme_mod('hide_show_typography','off');
|
4 |
+
if( $hide_show_typography == '1' ):
|
5 |
+
|
6 |
+
$body_typography_font_weight = get_theme_mod('body_typography_font_weight','normal');
|
7 |
+
$body_font_size = get_theme_mod('body_font_size','14');
|
8 |
+
|
9 |
+
$para_font_weight = get_theme_mod('para_font_weight','normal');
|
10 |
+
$paragraph_font_size = get_theme_mod('paragraph_font_size','16');
|
11 |
+
$paragraph_line_height = get_theme_mod('paragraph_line_height','21');
|
12 |
+
|
13 |
+
$h1_font_weight = get_theme_mod('h1_font_weight','normal');
|
14 |
+
$h1_font_size = get_theme_mod('h1_font_size','48');
|
15 |
+
$h1_line_height = get_theme_mod('h1_line_height','1');
|
16 |
+
$h1_text_transform = get_theme_mod('h1_text_transform','lowercase');
|
17 |
+
|
18 |
+
$h2_font_weight = get_theme_mod('h2_font_weight','normal');
|
19 |
+
$h2_font_size = get_theme_mod('h2_font_size','36');
|
20 |
+
$h2_line_height = get_theme_mod('h2_line_height','46');
|
21 |
+
$h2_text_transform = get_theme_mod('h2_text_transform','lowercase');
|
22 |
+
|
23 |
+
$h3_font_weight = get_theme_mod('h3_font_weight','normal');
|
24 |
+
$h3_font_size = get_theme_mod('h3_font_size','30');
|
25 |
+
$h3_line_height = get_theme_mod('h3_line_height','34');
|
26 |
+
$h3_text_transform = get_theme_mod('h3_text_transform','lowercase');
|
27 |
+
|
28 |
+
$h4_font_weight = get_theme_mod('h4_font_weight','normal');
|
29 |
+
$h4_font_size = get_theme_mod('h4_font_size','20');
|
30 |
+
$h4_line_height = get_theme_mod('h4_line_height','28');
|
31 |
+
$h4_text_transform = get_theme_mod('h4_text_transform','lowercase');
|
32 |
+
|
33 |
+
$h5_font_weight = get_theme_mod('h5_font_weight','normal');
|
34 |
+
$h5_font_size = get_theme_mod('h5_font_size','16');
|
35 |
+
$h5_line_height = get_theme_mod('h5_line_height','15');
|
36 |
+
$h5_text_transform = get_theme_mod('h5_text_transform','lowercase');
|
37 |
+
|
38 |
+
$h6_font_weight = get_theme_mod('h6_font_weight','normal');
|
39 |
+
$h6_font_size = get_theme_mod('h6_font_size','16');
|
40 |
+
$h6_line_height = get_theme_mod('h6_line_height','24');
|
41 |
+
$h6_text_transform = get_theme_mod('h6_text_transform','lowercase');
|
42 |
+
|
43 |
+
$menu_font_weight = get_theme_mod('menu_font_weight','normal');
|
44 |
+
$menu_font_size = get_theme_mod('menu_font_size','15');
|
45 |
+
$menu_text_transform = get_theme_mod('menu_text_transform','capitalize');
|
46 |
+
|
47 |
+
$section_tit_font_weight = get_theme_mod('section_tit_font_weight','normal');
|
48 |
+
$section_tit_font_size = get_theme_mod('section_tit_font_size','40');
|
49 |
+
|
50 |
+
$section_des_font_weight = get_theme_mod('section_des_font_weight','normal');
|
51 |
+
$section_desc_font_size = get_theme_mod('section_desc_font_size','16');
|
52 |
+
?>
|
53 |
+
<style type="text/css">
|
54 |
+
body {
|
55 |
+
font-weight: 400;
|
56 |
+
font-size: <?php echo $body_font_size; ?>px!important;
|
57 |
+
font-style: <?php echo $body_typography_font_weight; ?>!important;
|
58 |
+
line-height: 22px;
|
59 |
+
}
|
60 |
+
|
61 |
+
h1,
|
62 |
+
h2,
|
63 |
+
h3,
|
64 |
+
h4,
|
65 |
+
h5,
|
66 |
+
h6 {
|
67 |
+
font-family: 'Rubik', sans-serif;
|
68 |
+
font-weight: 500;
|
69 |
+
}
|
70 |
+
|
71 |
+
h4 {
|
72 |
+
font-size: <?php echo $h4_font_size; ?>px;
|
73 |
+
line-height: <?php echo $h4_line_height; ?>px;
|
74 |
+
text-transform:<?php echo $h4_text_transform; ?>;
|
75 |
+
font-style: <?php echo $h4_font_weight; ?>;
|
76 |
+
font-weight: 400;
|
77 |
+
}
|
78 |
+
|
79 |
+
.section-title h2 {
|
80 |
+
font-style: <?php echo $section_tit_font_weight; ?>!important;
|
81 |
+
font-size:<?php echo $section_tit_font_size; ?>px!important;
|
82 |
+
}
|
83 |
+
|
84 |
+
.section-title p {
|
85 |
+
font-style: <?php echo $section_des_font_weight; ?>!important;
|
86 |
+
font-size:<?php echo $section_desc_font_size; ?>px!important;
|
87 |
+
}
|
88 |
+
|
89 |
+
.boxed-btn {
|
90 |
+
font-weight: 500;
|
91 |
+
text-transform: capitalize;
|
92 |
+
font-size: <?php echo $paragraph_font_size; ?>px;
|
93 |
+
line-height: <?php echo $paragraph_line_height; ?>px;
|
94 |
+
font-style: <?php echo $para_font_weight; ?>;
|
95 |
+
}
|
96 |
+
|
97 |
+
.input__label {
|
98 |
+
font-weight: bold;
|
99 |
+
font-size: 70.25%;
|
100 |
+
}
|
101 |
+
|
102 |
+
.input__label--hantus {
|
103 |
+
text-align: left;
|
104 |
+
font-size: <?php echo $paragraph_font_size; ?>px!important;
|
105 |
+
font-weight: 400;
|
106 |
+
}
|
107 |
+
|
108 |
+
.preloader h1 {
|
109 |
+
text-transform: uppercase;
|
110 |
+
line-height: <?php echo $h1_line_height; ?>px;
|
111 |
+
font-size: <?php echo $h1_font_size; ?>px!important;
|
112 |
+
font-style: <?php echo $h1_font_weight; ?>!important;
|
113 |
+
}
|
114 |
+
|
115 |
+
.header-social li a {
|
116 |
+
font-size: <?php echo $paragraph_font_size; ?>px!important;
|
117 |
+
line-height: <?php echo $paragraph_line_height; ?>px!important;
|
118 |
+
font-style: <?php echo $para_font_weight; ?>!important;
|
119 |
+
}
|
120 |
+
|
121 |
+
.main-menu li a {
|
122 |
+
font-weight: 500;
|
123 |
+
font-size: <?php echo $menu_font_size; ?>px!important;
|
124 |
+
font-style: <?php echo $menu_font_weight; ?>!important;
|
125 |
+
text-transform: <?php echo $menu_text_transform; ?>!important;
|
126 |
+
}
|
127 |
+
|
128 |
+
.cart-icon-wrapper {
|
129 |
+
font-size: <?php echo $paragraph_font_size; ?>px!important;
|
130 |
+
}
|
131 |
+
|
132 |
+
.cart-count {
|
133 |
+
line-height: 20px;
|
134 |
+
font-size: 12px;
|
135 |
+
}
|
136 |
+
|
137 |
+
.sidenav .sidenav-header h3 {
|
138 |
+
font-size: <?php echo $h3_font_size; ?>px!important;
|
139 |
+
}
|
140 |
+
|
141 |
+
.sidenav .cart-item-description h4,
|
142 |
+
.cart-remove,
|
143 |
+
.sidenav .cart-item-description p {
|
144 |
+
font-size: <?php echo $paragraph_font_size; ?>px!important;
|
145 |
+
}
|
146 |
+
|
147 |
+
.sidenav .cart-item-description {
|
148 |
+
font-size: <?php echo $paragraph_font_size; ?>px!important;
|
149 |
+
}
|
150 |
+
|
151 |
+
.sidenav.active .cart-item {
|
152 |
+
font-size: 0;
|
153 |
+
}
|
154 |
+
|
155 |
+
.sb-search-input {
|
156 |
+
font-size: 20px;
|
157 |
+
}
|
158 |
+
|
159 |
+
.sb-icon-search,
|
160 |
+
.sb-search-submit {
|
161 |
+
line-height: 60px;
|
162 |
+
}
|
163 |
+
|
164 |
+
.header-slider h3 {
|
165 |
+
font-family: 'Dancing Script', cursive;
|
166 |
+
font-weight: 700;
|
167 |
+
font-size: <?php echo $h3_font_size; ?>px;
|
168 |
+
line-height: <?php echo $h3_line_height; ?>px;
|
169 |
+
text-transform: <?php echo $h3_text_transform; ?>;
|
170 |
+
font-style: <?php echo $h3_font_weight; ?>;
|
171 |
+
}
|
172 |
+
|
173 |
+
.header-slider h1 {
|
174 |
+
line-height: <?php echo $h1_line_height; ?>px;
|
175 |
+
font-size: <?php echo $h1_font_size; ?>px;
|
176 |
+
text-transform: <?php echo $h1_text_transform; ?>;
|
177 |
+
font-style: <?php echo $h1_font_weight; ?>;
|
178 |
+
}
|
179 |
+
|
180 |
+
.header-slider .owl-next,
|
181 |
+
.header-slider .owl-prev {
|
182 |
+
line-height: 50px;
|
183 |
+
font-size: 24px;
|
184 |
+
}
|
185 |
+
|
186 |
+
.single-contact h4 {
|
187 |
+
font-size: 20px;
|
188 |
+
}
|
189 |
+
|
190 |
+
.contact-wrapper i {
|
191 |
+
font-size: 40px;
|
192 |
+
}
|
193 |
+
|
194 |
+
.contact-wrapper .single-contact:hover h4 {
|
195 |
+
font-size: <?php echo $h4_font_size; ?>px!important;
|
196 |
+
font-weight: 400;
|
197 |
+
}
|
198 |
+
|
199 |
+
.contact-wrapper .single-contact:hover p {
|
200 |
+
font-size: 20px;
|
201 |
+
font-weight: 500;
|
202 |
+
}
|
203 |
+
|
204 |
+
.service-box p.price {
|
205 |
+
font-family: 'Dancing Script', cursive;
|
206 |
+
font-size: <?php echo $paragraph_font_size; ?>px!important;
|
207 |
+
font-weight: 700;
|
208 |
+
}
|
209 |
+
|
210 |
+
.tab-content ul li h4 .price {
|
211 |
+
font-size: <?php echo $h4_font_size; ?>px!important;
|
212 |
+
font-weight: 700;
|
213 |
+
font-family: 'Dancing Script', cursive;
|
214 |
+
}
|
215 |
+
|
216 |
+
.feature-icon {
|
217 |
+
line-height: 85px;
|
218 |
+
}
|
219 |
+
|
220 |
+
.feature-icon i {
|
221 |
+
font-size: 40px;
|
222 |
+
line-height: 85px;
|
223 |
+
}
|
224 |
+
|
225 |
+
.feature-box h4 {
|
226 |
+
font-weight: 400;
|
227 |
+
}
|
228 |
+
|
229 |
+
.feature-box h4 {
|
230 |
+
font-weight: 400;
|
231 |
+
}
|
232 |
+
|
233 |
+
.pricing-box h3 {
|
234 |
+
font-size: <?php echo $h3_font_size; ?>px!important;
|
235 |
+
}
|
236 |
+
|
237 |
+
.pricing-box .price {
|
238 |
+
font-size: <?php echo $paragraph_font_size; ?>px!important;
|
239 |
+
font-weight: 400;
|
240 |
+
}
|
241 |
+
|
242 |
+
.pricing-box .price sup {
|
243 |
+
font-size: 36px;
|
244 |
+
font-weight: 500;
|
245 |
+
}
|
246 |
+
|
247 |
+
.pricing-box .price span {
|
248 |
+
font-size: 48px;
|
249 |
+
font-weight: 500;
|
250 |
+
}
|
251 |
+
|
252 |
+
.pricing-content li {
|
253 |
+
line-height: 2;
|
254 |
+
font-size: <?php echo $paragraph_font_size; ?>px!important;
|
255 |
+
}
|
256 |
+
|
257 |
+
.recomended-text {
|
258 |
+
font-weight: 500;
|
259 |
+
}
|
260 |
+
|
261 |
+
#counter .single-box i {
|
262 |
+
font-size: 45px;
|
263 |
+
}
|
264 |
+
|
265 |
+
#counter .single-box h3 {
|
266 |
+
font-size: 40px;
|
267 |
+
font-weight: 700;
|
268 |
+
font-family: 'Dancing Script', cursive;
|
269 |
+
}
|
270 |
+
|
271 |
+
#counter .single-box p {
|
272 |
+
font-size: <?php echo $paragraph_font_size; ?>px!important;
|
273 |
+
}
|
274 |
+
|
275 |
+
.single-product h5 {
|
276 |
+
font-size: 18px;
|
277 |
+
font-weight: 400;
|
278 |
+
}
|
279 |
+
|
280 |
+
.single-product .price {
|
281 |
+
font-family: 'Dancing Script', cursive;
|
282 |
+
font-weight: 700;
|
283 |
+
font-size: <?php echo $paragraph_font_size; ?>px!important;
|
284 |
+
}
|
285 |
+
|
286 |
+
.single-product .overlay li a {
|
287 |
+
line-height: 50px;
|
288 |
+
font-size: 20px;
|
289 |
+
}
|
290 |
+
|
291 |
+
.product-carousel .owl-next,
|
292 |
+
.product-carousel .owl-prev {
|
293 |
+
line-height: 50px;
|
294 |
+
font-size: 24px;
|
295 |
+
}
|
296 |
+
|
297 |
+
.single-testimonial p {
|
298 |
+
font-size: <?php echo $paragraph_font_size; ?>px!important;
|
299 |
+
line-height: <?php echo $paragraph_line_height; ?>px!important;
|
300 |
+
}
|
301 |
+
|
302 |
+
.single-testimonial h5 {
|
303 |
+
font-size: 18px;
|
304 |
+
font-weight: 500;
|
305 |
+
}
|
306 |
+
|
307 |
+
.single-testimonial p.title {
|
308 |
+
font-size: <?php echo $paragraph_font_size; ?>px!important;
|
309 |
+
}
|
310 |
+
|
311 |
+
.testimonial-carousel .owl-next,
|
312 |
+
.testimonial-carousel .owl-prev {
|
313 |
+
font-size: 36px;
|
314 |
+
}
|
315 |
+
|
316 |
+
.opening-hours h3 {
|
317 |
+
font-size: 36px;
|
318 |
+
font-weight: 500;
|
319 |
+
}
|
320 |
+
|
321 |
+
.opening-hours p {
|
322 |
+
font-size: <?php echo $paragraph_font_size; ?>px!important;
|
323 |
+
}
|
324 |
+
|
325 |
+
.opening-hours li {
|
326 |
+
font-size: 18px;
|
327 |
+
}
|
328 |
+
|
329 |
+
.single-beauticians .social li a {
|
330 |
+
line-height: 35px;
|
331 |
+
font-size: 18px;
|
332 |
+
}
|
333 |
+
|
334 |
+
.single-beauticians h5 {
|
335 |
+
font-size: 18px;
|
336 |
+
font-weight: 500;
|
337 |
+
line-height: 28px;
|
338 |
+
}
|
339 |
+
|
340 |
+
#subscribe i {
|
341 |
+
font-size: 60px;
|
342 |
+
}
|
343 |
+
|
344 |
+
#subscribe h3 {
|
345 |
+
font-size: 20px;
|
346 |
+
font-weight: 500;
|
347 |
+
line-height: 28px;
|
348 |
+
}
|
349 |
+
|
350 |
+
#subscribe p {
|
351 |
+
font-size: <?php echo $paragraph_font_size; ?>px;
|
352 |
+
line-height: <?php echo $paragraph_line_height; ?>px;
|
353 |
+
font-style: <?php echo $para_font_weight; ?>;
|
354 |
+
}
|
355 |
+
|
356 |
+
#subscribe-form button {
|
357 |
+
line-height: 24px;
|
358 |
+
font-weight: 500;
|
359 |
+
text-transform: uppercase;
|
360 |
+
}
|
361 |
+
|
362 |
+
.payment-method li a {
|
363 |
+
font-size: 18px;
|
364 |
+
line-height: 30px;
|
365 |
+
}
|
366 |
+
.scrollup {
|
367 |
+
line-height: 50px;
|
368 |
+
}
|
369 |
+
|
370 |
+
#breadcrumb-area h2 {
|
371 |
+
font-size: 42px;
|
372 |
+
font-weight: 500;
|
373 |
+
}
|
374 |
+
|
375 |
+
#breadcrumb-area ul li,
|
376 |
+
#breadcrumb-area ul li a {
|
377 |
+
font-size: 18px;
|
378 |
+
}
|
379 |
+
|
380 |
+
#welcome .section-title h3 {
|
381 |
+
font-size: 30px;
|
382 |
+
font-family: 'Dancing Script', cursive;
|
383 |
+
font-weight: 700;
|
384 |
+
}
|
385 |
+
|
386 |
+
.welcome-box h4 {
|
387 |
+
font-size: 20px;
|
388 |
+
}
|
389 |
+
|
390 |
+
#wcu h2 {
|
391 |
+
font-size: 40px;
|
392 |
+
font-weight: 500;
|
393 |
+
}
|
394 |
+
|
395 |
+
#wcu p b {
|
396 |
+
font-size: <?php echo $paragraph_font_size; ?>px!important;
|
397 |
+
font-weight: 500;
|
398 |
+
}
|
399 |
+
|
400 |
+
.gallery-tab-sorting li a {
|
401 |
+
font-size: 18px;
|
402 |
+
}
|
403 |
+
|
404 |
+
.gallery-page .gallery-item figcaption ul li a {
|
405 |
+
font-size: 20px;
|
406 |
+
line-height: 50px;
|
407 |
+
}
|
408 |
+
|
409 |
+
.gallery-page .gallery-item figcaption h4 {
|
410 |
+
font-size: 24px;
|
411 |
+
font-weight: 500;
|
412 |
+
}
|
413 |
+
|
414 |
+
#contact h2 {
|
415 |
+
font-size: 40px;
|
416 |
+
}
|
417 |
+
|
418 |
+
.contact-form label {
|
419 |
+
font-size: 18px;
|
420 |
+
}
|
421 |
+
|
422 |
+
.info-box i {
|
423 |
+
font-size: 30px;
|
424 |
+
}
|
425 |
+
|
426 |
+
.info-box h4 {
|
427 |
+
font-weight: 500;
|
428 |
+
font-size: <?php echo $h4_font_size; ?>px;
|
429 |
+
line-height: <?php echo $h4_line_height; ?>px;
|
430 |
+
text-transform:<?php echo $h4_text_transform; ?>;
|
431 |
+
font-style: <?php echo $h4_font_weight; ?>;
|
432 |
+
}
|
433 |
+
|
434 |
+
.info-box p {
|
435 |
+
line-height: <?php echo $paragraph_line_height; ?>px!important;
|
436 |
+
}
|
437 |
+
|
438 |
+
.portfolio-tab-sorting li a {
|
439 |
+
font-size: 16px;
|
440 |
+
}
|
441 |
+
|
442 |
+
.portfolio-page .portfolio-item figcaption h4 {
|
443 |
+
font-size: <?php echo $h4_font_size; ?>px!important;
|
444 |
+
font-weight: 500;
|
445 |
+
}
|
446 |
+
|
447 |
+
.portfolio-page .portfolio-item figcaption h6 {
|
448 |
+
font-size: <?php echo $h6_font_size; ?>px!important;
|
449 |
+
font-weight: 400;
|
450 |
+
}
|
451 |
+
|
452 |
+
.portfolio-page .portfolio-item figcaption a {
|
453 |
+
font-size: <?php echo $h4_font_size; ?>px!important;
|
454 |
+
font-weight: 400;
|
455 |
+
}
|
456 |
+
|
457 |
+
li.page-item .page-link {
|
458 |
+
font-size: 18px;
|
459 |
+
}
|
460 |
+
|
461 |
+
.meta-info li a {
|
462 |
+
font-size: 14px;
|
463 |
+
font-weight: 400;
|
464 |
+
}
|
465 |
+
|
466 |
+
.blog-post .post-title a {
|
467 |
+
font-size: 18px;
|
468 |
+
font-weight: 500;
|
469 |
+
line-height: 28px;
|
470 |
+
}
|
471 |
+
|
472 |
+
.blog-post a.read-more {
|
473 |
+
font-size: 14px;
|
474 |
+
}
|
475 |
+
|
476 |
+
.single-post .post-title a {
|
477 |
+
font-size: 24px;
|
478 |
+
}
|
479 |
+
|
480 |
+
.media ul li {
|
481 |
+
font-size: 12px;
|
482 |
+
}
|
483 |
+
|
484 |
+
#page-404 h2 {
|
485 |
+
font-size: 140px;
|
486 |
+
font-weight: 600;
|
487 |
+
}
|
488 |
+
|
489 |
+
.coming-soon-wrapper h1 {
|
490 |
+
font-size: <?php echo $h1_font_size; ?>px!important;
|
491 |
+
font-weight: 600;
|
492 |
+
}
|
493 |
+
|
494 |
+
.count-area .text {
|
495 |
+
font-size: 24px;
|
496 |
+
text-transform: capitalize;
|
497 |
+
}
|
498 |
+
|
499 |
+
.subscribe-wrapper button {
|
500 |
+
font-size: 16px;
|
501 |
+
}
|
502 |
+
|
503 |
+
.coming-soon-wrapper footer .social a {
|
504 |
+
line-height: 35px;
|
505 |
+
font-size: 16px;
|
506 |
+
}
|
507 |
+
|
508 |
+
.count-area .time-wrap span {
|
509 |
+
font-size: 40px;
|
510 |
+
letter-spacing: .05em;
|
511 |
+
}
|
512 |
+
|
513 |
+
.copyright a {
|
514 |
+
font-size: 16px;
|
515 |
+
}
|
516 |
+
|
517 |
+
li.latest-news h6 {
|
518 |
+
font-weight: 400;
|
519 |
+
font-size: <?php echo $h6_font_size; ?>px;
|
520 |
+
line-height: <?php echo $h6_line_height; ?>px;
|
521 |
+
text-transform: <?php echo $h6_text_transform; ?>;
|
522 |
+
font-style: <?php echo $h6_font_weight; ?>;
|
523 |
+
}
|
524 |
+
|
525 |
+
li.latest-news p {
|
526 |
+
font-size: <?php echo $paragraph_font_size; ?>px;
|
527 |
+
line-height: <?php echo $paragraph_line_height; ?>px;
|
528 |
+
font-style: <?php echo $para_font_weight; ?>;
|
529 |
+
}
|
530 |
+
|
531 |
+
.widget_search input[type=button] {
|
532 |
+
font-size: 14px;
|
533 |
+
}
|
534 |
+
|
535 |
+
.widget_recent_entries ul li a {
|
536 |
+
font-size: <?php echo $h6_font_size; ?>px;
|
537 |
+
line-height: <?php echo $h6_line_height; ?>px;
|
538 |
+
text-transform: <?php echo $h6_text_transform; ?>;
|
539 |
+
font-style: <?php echo $h6_font_weight; ?>;
|
540 |
+
}
|
541 |
+
|
542 |
+
.widdget-instagram li .instagram-overlay a {
|
543 |
+
font-size: 36px;
|
544 |
+
}
|
545 |
+
|
546 |
+
.widget-acrhives li a {
|
547 |
+
font-size: 16px;
|
548 |
+
}
|
549 |
+
|
550 |
+
#blog-content .widget-calender .widget-title li {
|
551 |
+
font-size: 22px;
|
552 |
+
}
|
553 |
+
|
554 |
+
.calendar_wrap thead {
|
555 |
+
font-size: 18px;
|
556 |
+
}
|
557 |
+
|
558 |
+
#page-404 h3 {
|
559 |
+
font-size: <?php echo $h3_font_size; ?>px!important;
|
560 |
+
}
|
561 |
+
|
562 |
+
h1 {
|
563 |
+
font-size: <?php echo $h1_font_size; ?>px!important;
|
564 |
+
line-height: <?php echo $h1_line_height; ?>px!important;
|
565 |
+
text-transform: <?php echo $h1_text_transform; ?>!important;
|
566 |
+
font-style: <?php echo $h1_font_weight; ?>!important;
|
567 |
+
}
|
568 |
+
|
569 |
+
h2 {
|
570 |
+
font-size: <?php echo $h2_font_size; ?>px!important;
|
571 |
+
line-height: <?php echo $h2_line_height; ?>px!important;
|
572 |
+
text-transform:<?php echo $h2_text_transform; ?>!important;
|
573 |
+
font-style: <?php echo $h2_font_weight; ?>!important;
|
574 |
+
}
|
575 |
+
|
576 |
+
h3 {
|
577 |
+
font-size: <?php echo $h3_font_size; ?>px!important;
|
578 |
+
line-height: <?php echo $h3_line_height; ?>px!important;
|
579 |
+
text-transform: <?php echo $h3_text_transform; ?>!important;
|
580 |
+
font-style: <?php echo $h3_font_weight; ?>!important;
|
581 |
+
}
|
582 |
+
|
583 |
+
h4 {
|
584 |
+
font-size: <?php echo $h4_font_size; ?>px!important;
|
585 |
+
line-height: <?php echo $h4_line_height; ?>px!important;
|
586 |
+
text-transform:<?php echo $h4_text_transform; ?>!important;
|
587 |
+
font-style: <?php echo $h4_font_weight; ?>!important;
|
588 |
+
}
|
589 |
+
|
590 |
+
h5 {
|
591 |
+
font-size: <?php echo $h5_font_size; ?>px!important;
|
592 |
+
line-height: <?php echo $h5_line_height; ?>px!important;
|
593 |
+
text-transform: <?php echo $h5_text_transform; ?>!important;
|
594 |
+
font-style: <?php echo $h5_font_weight; ?>!important;
|
595 |
+
}
|
596 |
+
|
597 |
+
h6 {
|
598 |
+
font-size: <?php echo $h6_font_size; ?>px!important;
|
599 |
+
line-height: <?php echo $h6_line_height; ?>px!important;
|
600 |
+
text-transform: <?php echo $h6_text_transform; ?>!important;
|
601 |
+
font-style: <?php echo $h6_font_weight; ?>!important;
|
602 |
+
}
|
603 |
+
p {
|
604 |
+
font-family: 'Roboto', sans-serif;
|
605 |
+
font-size: <?php echo $paragraph_font_size; ?>px;
|
606 |
+
line-height: <?php echo $paragraph_line_height; ?>px;
|
607 |
+
font-style: <?php echo $para_font_weight; ?>;
|
608 |
+
font-weight: 400;
|
609 |
+
}
|
610 |
+
</style>
|
611 |
+
|
612 |
+
<?php endif;
|
613 |
+
}
|
614 |
+
add_action('wp_head','hantus_own_theme_typography');
|
615 |
+
?>
|
readme.txt
CHANGED
@@ -31,6 +31,9 @@ Clever Fox WordPress plugin is licensed under the GPL3 (https://www.gnu.org/lice
|
|
31 |
|
32 |
|
33 |
== Changelog ==
|
|
|
|
|
|
|
34 |
= 1.1.3 =
|
35 |
* Remove Unnecessary Code
|
36 |
|
31 |
|
32 |
|
33 |
== Changelog ==
|
34 |
+
= 1.1.4 =
|
35 |
+
* Hantus Theme Functionality Added
|
36 |
+
|
37 |
= 1.1.3 =
|
38 |
* Remove Unnecessary Code
|
39 |
|