WP ULike - Version 4.1.0

Version Description

  • Added: New professional configuration panel.
  • Added: New controller to filter post types.
  • Added: New MetaBox panel with amazing controllers. [PRO]
  • Added: New MusicPlaylist type for the schema. [PRO]
  • Added: New "Backup" section in the settings panel. [PRO]
  • Added: New custom Reviews for all schema types. [PRO]
  • Added: New MusicPlaylist type for schema list. [PRO]
  • Added: More flexible button text/image option for each content type.
  • Added: Simple tool to convert old settings values to new settings values.
  • Updated: Language files.
  • Fixed: Some issues.
Download this release

Release Info

Developer alimir
Plugin Icon 128x128 WP ULike
Version 4.1.0
Comparing to
See all releases

Code changes from version 4.0.5 to 4.1.0

Files changed (107) hide show
  1. admin/admin-ajax.php +97 -2
  2. admin/admin-functions.php +1 -1
  3. admin/admin-hooks.php +32 -2
  4. admin/assets/css/admin.css +24 -120
  5. admin/assets/css/plugins.css +18 -594
  6. admin/assets/js/plugins.js +3 -2413
  7. admin/assets/js/scripts.js +0 -369
  8. admin/classes/class-wp-ulike-admin-assets.php +10 -10
  9. admin/classes/class-wp-ulike-admin-pages.php +5 -2
  10. admin/classes/class-wp-ulike-admin-panel.php +566 -0
  11. admin/classes/class-wp-ulike-notices.php +31 -1
  12. admin/classes/class-wp-ulike-pagination.php +1 -1
  13. admin/classes/class-wp-ulike-settings.php +1 -1
  14. admin/classes/class-wp-ulike-stats.php +4 -3
  15. admin/classes/class-wp-ulike-widget.php +1 -1
  16. admin/includes/templates/about.php +1 -1
  17. admin/includes/templates/activities-logs.php +1 -1
  18. admin/includes/templates/comments-logs.php +1 -1
  19. admin/includes/templates/go-pro.php +11 -1
  20. admin/includes/templates/posts-logs.php +1 -1
  21. admin/includes/templates/statistics.php +1 -1
  22. admin/includes/templates/topics-logs.php +1 -1
  23. admin/index.php +7 -5
  24. admin/settings/assets/css/csf-rtl.css +517 -0
  25. admin/settings/assets/css/csf-rtl.min.css +1 -0
  26. admin/settings/assets/css/csf.css +4132 -0
  27. admin/settings/assets/css/csf.min.css +1 -0
  28. admin/settings/assets/images/checkerboard.png +0 -0
  29. admin/settings/assets/images/wp-logo.svg +1 -0
  30. admin/settings/assets/images/wp-plugin-logo.svg +1 -0
  31. admin/settings/assets/js/csf-gutenberg-block.js +79 -0
  32. admin/settings/assets/js/csf-plugins.js +2092 -0
  33. admin/settings/assets/js/csf-plugins.min.js +3 -0
  34. admin/settings/assets/js/csf.js +3336 -0
  35. admin/settings/assets/js/csf.min.js +3 -0
  36. admin/settings/assets/scss/csf-rtl.scss +646 -0
  37. admin/settings/assets/scss/csf.scss +94 -0
  38. admin/settings/assets/scss/vendor/_base.scss +446 -0
  39. admin/settings/assets/scss/vendor/_chosen.scss +405 -0
  40. admin/settings/assets/scss/vendor/_customizer.scss +185 -0
  41. admin/settings/assets/scss/vendor/_fields.scss +2193 -0
  42. admin/settings/assets/scss/vendor/_helper.scss +183 -0
  43. admin/settings/assets/scss/vendor/_mixins.scss +3 -0
  44. admin/settings/assets/scss/vendor/_modal.scss +339 -0
  45. admin/settings/assets/scss/vendor/_profile.scss +66 -0
  46. admin/settings/assets/scss/vendor/_responsive.scss +141 -0
  47. admin/settings/assets/scss/vendor/_taxonomy.scss +112 -0
  48. admin/settings/assets/scss/vendor/_themes.scss +204 -0
  49. admin/settings/assets/scss/vendor/_welcome.scss +346 -0
  50. admin/settings/assets/scss/vendor/_widget.scss +48 -0
  51. admin/settings/classes/abstract.class.php +118 -0
  52. admin/settings/classes/comment-metabox.class.php +337 -0
  53. admin/settings/classes/customize-options.class.php +279 -0
  54. admin/settings/classes/fields.class.php +379 -0
  55. admin/settings/classes/metabox.class.php +401 -0
  56. admin/settings/classes/options.class.php +705 -0
  57. admin/settings/classes/profile-options.class.php +227 -0
  58. admin/settings/classes/setup.class.php +586 -0
  59. admin/settings/classes/shortcoder.class.php +326 -0
  60. admin/settings/classes/taxonomy-options.class.php +244 -0
  61. admin/settings/classes/widgets.class.php +129 -0
  62. admin/settings/fields/accordion/accordion.php +64 -0
  63. admin/settings/fields/background/background.php +332 -0
  64. admin/settings/fields/backup/backup.php +42 -0
  65. admin/settings/fields/border/border.php +178 -0
  66. admin/settings/fields/button_set/button_set.php +57 -0
  67. admin/settings/fields/checkbox/checkbox.php +82 -0
  68. admin/settings/fields/code_editor/code_editor.php +57 -0
  69. admin/settings/fields/color/color.php +52 -0
  70. admin/settings/fields/color_group/color_group.php +44 -0
  71. admin/settings/fields/content/content.php +22 -0
  72. admin/settings/fields/date/date.php +64 -0
  73. admin/settings/fields/dimensions/dimensions.php +101 -0
  74. admin/settings/fields/fieldset/fieldset.php +41 -0
  75. admin/settings/fields/gallery/gallery.php +53 -0
  76. admin/settings/fields/group/group.php +145 -0
  77. admin/settings/fields/heading/heading.php +24 -0
  78. admin/settings/fields/icon/default-icons.php +13 -0
  79. admin/settings/fields/icon/icon.php +41 -0
  80. admin/settings/fields/image_select/image_select.php +76 -0
  81. admin/settings/fields/index.php +1 -0
  82. admin/settings/fields/link_color/link_color.php +91 -0
  83. admin/settings/fields/map/map.php +99 -0
  84. admin/settings/fields/media/media.php +86 -0
  85. admin/settings/fields/notice/notice.php +26 -0
  86. admin/settings/fields/number/number.php +61 -0
  87. admin/settings/fields/palette/palette.php +60 -0
  88. admin/settings/fields/radio/radio.php +76 -0
  89. admin/settings/fields/repeater/repeater.php +116 -0
  90. admin/settings/fields/select/select.php +131 -0
  91. admin/settings/fields/slider/slider.php +78 -0
  92. admin/settings/fields/sortable/sortable.php +81 -0
  93. admin/settings/fields/sorter/sorter.php +75 -0
  94. admin/settings/fields/spacing/spacing.php +150 -0
  95. admin/settings/fields/spinner/spinner.php +68 -0
  96. admin/settings/fields/subheading/subheading.php +24 -0
  97. admin/settings/fields/submessage/submessage.php +26 -0
  98. admin/settings/fields/switcher/switcher.php +42 -0
  99. admin/settings/fields/tabbed/tabbed.php +64 -0
  100. admin/settings/fields/text/text.php +30 -0
  101. admin/settings/fields/textarea/textarea.php +49 -0
  102. admin/settings/fields/typography/google-fonts.php +981 -0
  103. admin/settings/fields/typography/typography.php +527 -0
  104. admin/settings/fields/upload/upload.php +41 -0
  105. admin/settings/fields/wp_editor/wp_editor.php +103 -0
  106. admin/settings/functions/actions.php +202 -0
  107. admin/settings/functions/customize.php +60 -0
admin/admin-ajax.php CHANGED
@@ -3,7 +3,7 @@
3
  * Back-end AJAX Functionalities
4
  *
5
  * @package wp-ulike
6
- * @author TechnoWich 2019
7
  * @link https://wpulike.com
8
  */
9
 
@@ -83,4 +83,99 @@ function wp_ulike_logs_process(){
83
  }
84
 
85
  }
86
- add_action('wp_ajax_ulikelogs','wp_ulike_logs_process');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  * Back-end AJAX Functionalities
4
  *
5
  * @package wp-ulike
6
+ * @author TechnoWich 2020
7
  * @link https://wpulike.com
8
  */
9
 
83
  }
84
 
85
  }
86
+ add_action('wp_ajax_ulikelogs','wp_ulike_logs_process');
87
+
88
+ /**
89
+ * Upgarde old option values
90
+ *
91
+ * @return void
92
+ */
93
+ function wp_ulike_upgrade_option_panel(){
94
+ if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( $_POST['nonce'], '_notice_nonce' ) && current_user_can( 'manage_options' ) ) {
95
+ wp_send_json_error( __( 'Token Error.', WP_ULIKE_SLUG ) );
96
+ }
97
+
98
+ // get old values
99
+ $old_data = array (
100
+ 'enable_kilobyte_format' => wp_ulike_get_setting( 'wp_ulike_general', 'format_number' ),
101
+ 'enable_toast_notice' => wp_ulike_get_setting( 'wp_ulike_general', 'notifications' ),
102
+ 'enable_anonymise_ip' => wp_ulike_get_setting( 'wp_ulike_general', 'anonymise' ),
103
+ 'disable_admin_notice' => wp_ulike_get_setting( 'wp_ulike_general', 'hide_admin_notice' ),
104
+ 'enable_meta_values' => wp_ulike_get_setting( 'wp_ulike_general', 'enable_meta_values' ),
105
+ 'posts_group' => array (
106
+ 'template' => wp_ulike_get_setting( 'wp_ulike_posts', 'theme' ),
107
+ 'enable_auto_display' => wp_ulike_get_setting( 'wp_ulike_posts', 'auto_display' ),
108
+ 'auto_display_position' => wp_ulike_get_setting( 'wp_ulike_posts', 'auto_display_position' ),
109
+ 'logging_method' => wp_ulike_get_setting( 'wp_ulike_posts', 'logging_method' ),
110
+ 'enable_only_logged_in_users' => wp_ulike_get_setting( 'wp_ulike_posts', 'only_registered_users' ),
111
+ 'logged_out_display_type' => wp_ulike_get_setting( 'wp_ulike_general', 'login_type' ),
112
+ 'enable_likers_box' => wp_ulike_get_setting( 'wp_ulike_posts', 'users_liked_box' ),
113
+ 'disable_likers_pophover' => wp_ulike_get_setting( 'wp_ulike_posts', 'disable_likers_pophover' ),
114
+ 'likers_gravatar_size' => wp_ulike_get_setting( 'wp_ulike_posts', 'users_liked_box_avatar_size' ),
115
+ 'likers_count' => wp_ulike_get_setting( 'wp_ulike_posts', 'number_of_users' ),
116
+ 'likers_template' => wp_ulike_get_setting( 'wp_ulike_posts', 'users_liked_box_template' )
117
+ ),
118
+ 'comments_group' => array (
119
+ 'template' => wp_ulike_get_setting( 'wp_ulike_comments', 'theme' ),
120
+ 'enable_auto_display' => wp_ulike_get_setting( 'wp_ulike_comments', 'auto_display' ),
121
+ 'auto_display_position' => wp_ulike_get_setting( 'wp_ulike_comments', 'auto_display_position' ),
122
+ 'logging_method' => wp_ulike_get_setting( 'wp_ulike_comments', 'logging_method' ),
123
+ 'enable_only_logged_in_users' => wp_ulike_get_setting( 'wp_ulike_comments', 'only_registered_users' ),
124
+ 'logged_out_display_type' => wp_ulike_get_setting( 'wp_ulike_general', 'login_type' ),
125
+ 'enable_likers_box' => wp_ulike_get_setting( 'wp_ulike_comments', 'users_liked_box' ),
126
+ 'disable_likers_pophover' => wp_ulike_get_setting( 'wp_ulike_comments', 'disable_likers_pophover' ),
127
+ 'likers_gravatar_size' => wp_ulike_get_setting( 'wp_ulike_comments', 'users_liked_box_avatar_size' ),
128
+ 'likers_count' => wp_ulike_get_setting( 'wp_ulike_comments', 'number_of_users' ),
129
+ 'likers_template' => wp_ulike_get_setting( 'wp_ulike_comments', 'users_liked_box_template' )
130
+ ),
131
+ 'buddypress_group' => array (
132
+ 'template' => wp_ulike_get_setting( 'wp_ulike_buddypress', 'theme' ),
133
+ 'enable_auto_display' => wp_ulike_get_setting( 'wp_ulike_buddypress', 'auto_display' ),
134
+ 'auto_display_position' => wp_ulike_get_setting( 'wp_ulike_buddypress', 'auto_display_position' ),
135
+ 'logging_method' => wp_ulike_get_setting( 'wp_ulike_buddypress', 'logging_method' ),
136
+ 'enable_only_logged_in_users' => wp_ulike_get_setting( 'wp_ulike_buddypress', 'only_registered_users' ),
137
+ 'logged_out_display_type' => wp_ulike_get_setting( 'wp_ulike_general', 'login_type' ),
138
+ 'enable_likers_box' => wp_ulike_get_setting( 'wp_ulike_buddypress', 'users_liked_box' ),
139
+ 'disable_likers_pophover' => wp_ulike_get_setting( 'wp_ulike_buddypress', 'disable_likers_pophover' ),
140
+ 'likers_gravatar_size' => wp_ulike_get_setting( 'wp_ulike_buddypress', 'users_liked_box_avatar_size' ),
141
+ 'likers_count' => wp_ulike_get_setting( 'wp_ulike_buddypress', 'number_of_users' ),
142
+ 'likers_template' => wp_ulike_get_setting( 'wp_ulike_buddypress', 'users_liked_box_template' ),
143
+ 'enable_comments' => wp_ulike_get_setting( 'wp_ulike_buddypress', 'activity_comment' ),
144
+ 'enable_add_bp_activity' => wp_ulike_get_setting( 'wp_ulike_buddypress', 'new_likes_activity' ),
145
+ 'posts_notification_template' => wp_ulike_get_setting( 'wp_ulike_buddypress', 'bp_post_activity_add_header' ),
146
+ 'comments_notification_template' => wp_ulike_get_setting( 'wp_ulike_buddypress', 'bp_comment_activity_add_header' ),
147
+ 'enable_add_notification' => wp_ulike_get_setting( 'wp_ulike_buddypress', 'custom_notification' ),
148
+ ),
149
+ 'bbpress_group' => array (
150
+ 'template' => wp_ulike_get_setting( 'wp_ulike_bbpress', 'theme' ),
151
+ 'enable_auto_display' => wp_ulike_get_setting( 'wp_ulike_bbpress', 'auto_display' ),
152
+ 'auto_display_position' => wp_ulike_get_setting( 'wp_ulike_bbpress', 'auto_display_position' ),
153
+ 'logging_method' => wp_ulike_get_setting( 'wp_ulike_bbpress', 'logging_method' ),
154
+ 'enable_only_logged_in_users' => wp_ulike_get_setting( 'wp_ulike_bbpress', 'only_registered_users' ),
155
+ 'logged_out_display_type' => wp_ulike_get_setting( 'wp_ulike_general', 'login_type' ),
156
+ 'enable_likers_box' => wp_ulike_get_setting( 'wp_ulike_bbpress', 'users_liked_box' ),
157
+ 'disable_likers_pophover' => wp_ulike_get_setting( 'wp_ulike_bbpress', 'disable_likers_pophover' ),
158
+ 'likers_gravatar_size' => wp_ulike_get_setting( 'wp_ulike_bbpress', 'users_liked_box_avatar_size' ),
159
+ 'likers_count' => wp_ulike_get_setting( 'wp_ulike_bbpress', 'number_of_users' ),
160
+ 'likers_template' => wp_ulike_get_setting( 'wp_ulike_bbpress', 'users_liked_box_template' )
161
+ ),
162
+ 'already_registered_notice' => wp_ulike_get_setting( 'wp_ulike_general', 'permission_text' ),
163
+ 'login_required_notice' => wp_ulike_get_setting( 'wp_ulike_general', 'login_text' ),
164
+ 'like_notice' => wp_ulike_get_setting( 'wp_ulike_general', 'like_notice' ),
165
+ 'unlike_notice' => wp_ulike_get_setting( 'wp_ulike_general', 'unlike_notice' ),
166
+ 'dislike_notice' => wp_ulike_get_setting( 'wp_ulike_general', 'dislike_notice' ),
167
+ 'undislike_notice' => wp_ulike_get_setting( 'wp_ulike_general', 'undislike_notice' ),
168
+ 'custom_css' => wp_ulike_get_setting( 'wp_ulike_customize', 'custom_css' )
169
+ );
170
+
171
+ $update_status = update_option( 'wp_ulike_settings', $old_data );
172
+ // Update flag option
173
+ update_option( 'wp_ulike_upgrade_option_panel_status', true );
174
+
175
+ if( !$update_status ){
176
+ wp_send_json_error( __( 'Error: Something Wrong Happened!', WP_ULIKE_SLUG ) );
177
+ }
178
+
179
+ wp_send_json_success( __( 'It\'s Ok!', WP_ULIKE_SLUG ) );
180
+ }
181
+ add_action('wp_ajax_wp_ulike_upgrade_option_panel','wp_ulike_upgrade_option_panel');
admin/admin-functions.php CHANGED
@@ -3,7 +3,7 @@
3
  * Admin Functions
4
  *
5
  * @package wp-ulike
6
- * @author TechnoWich 2019
7
  * @link https://wpulike.com
8
  */
9
 
3
  * Admin Functions
4
  *
5
  * @package wp-ulike
6
+ * @author TechnoWich 2020
7
  * @link https://wpulike.com
8
  */
9
 
admin/admin-hooks.php CHANGED
@@ -3,7 +3,7 @@
3
  * Admin Hooks
4
  *
5
  * @package wp-ulike
6
- * @author TechnoWich 2019
7
  * @link https://wpulike.com
8
  */
9
 
@@ -126,6 +126,36 @@ function wp_ulike_notice_manager(){
126
  $screen = get_current_screen();
127
  $notice_list = [];
128
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
129
  if( $count_logs > 1000 ){
130
  $notice_list[ 'wp_ulike_leave_a_review' ] = new wp_ulike_notices([
131
  'id' => 'wp_ulike_leave_a_review',
@@ -251,7 +281,7 @@ add_filter( 'wp_ulike_admin_pages', 'wp_ulike_go_pro_admin_menu', 1, 10 );
251
 
252
  function wp_ulike_hide_admin_notifications( $notice_list ){
253
  $screen = get_current_screen();
254
- $hide_admin_notice = wp_ulike_get_setting( 'wp_ulike_general', 'hide_admin_notice', false );
255
  return wp_ulike_is_true( $hide_admin_notice ) && strpos( $screen->base, WP_ULIKE_SLUG ) === false ? array() : $notice_list;
256
  }
257
  add_filter( 'wp_ulike_admin_notices_instances', 'wp_ulike_hide_admin_notifications', 1, 20 );
3
  * Admin Hooks
4
  *
5
  * @package wp-ulike
6
+ * @author TechnoWich 2020
7
  * @link https://wpulike.com
8
  */
9
 
126
  $screen = get_current_screen();
127
  $notice_list = [];
128
 
129
+ if( ! wp_ulike_is_true( get_option( 'wp_ulike_upgrade_option_panel_status', false ) ) && '' !== get_option( 'wp_ulike_general' ) ){
130
+ $notice_list[ 'wp_ulike_upgrade_option_panel' ] = new wp_ulike_notices([
131
+ 'id' => 'wp_ulike_upgrade_option_panel',
132
+ 'title' => __( 'Upgrade Settings Panel', WP_ULIKE_SLUG ),
133
+ 'description' => __( "In the current version, we have released our new settings panel that is much more powerful than the previous one. This update may have disabled your old settings. if you want to reset those, click the button below. \nHowever, we recommend that you skip this option, and re-config the plugin once." , WP_ULIKE_SLUG ),
134
+ 'skin' => 'warning',
135
+ 'has_close' => true,
136
+ 'buttons' => array(
137
+ array(
138
+ 'label' => __( "Start Recovery", WP_ULIKE_SLUG ),
139
+ 'link' => 'https://wordpress.org/support/plugin/wp-ulike/reviews/?filter=5',
140
+ 'ajax_request' => array(
141
+ 'action' => 'wp_ulike_upgrade_option_panel'
142
+ )
143
+ ),
144
+ array(
145
+ 'label' => __('Go to Settings', WP_ULIKE_SLUG),
146
+ 'link' => self_admin_url( 'admin.php?page=wp-ulike-settings' ),
147
+ 'color_name' => 'info',
148
+ ),
149
+ array(
150
+ 'label' => __('No thanks and never ask me again', WP_ULIKE_SLUG),
151
+ 'type' => 'skip',
152
+ 'color_name' => 'error',
153
+ 'expiration' => YEAR_IN_SECONDS * 10
154
+ )
155
+ )
156
+ ]);
157
+ }
158
+
159
  if( $count_logs > 1000 ){
160
  $notice_list[ 'wp_ulike_leave_a_review' ] = new wp_ulike_notices([
161
  'id' => 'wp_ulike_leave_a_review',
281
 
282
  function wp_ulike_hide_admin_notifications( $notice_list ){
283
  $screen = get_current_screen();
284
+ $hide_admin_notice = wp_ulike_get_option( 'disable_admin_notice', false );
285
  return wp_ulike_is_true( $hide_admin_notice ) && strpos( $screen->base, WP_ULIKE_SLUG ) === false ? array() : $notice_list;
286
  }
287
  add_filter( 'wp_ulike_admin_notices_instances', 'wp_ulike_hide_admin_notifications', 1, 20 );
admin/assets/css/admin.css CHANGED
@@ -185,103 +185,19 @@ https://wordpress.org/plugins/wp-ulike/
185
  }
186
 
187
  /**
188
- * Settings Page
189
  */
190
- form.wp-ulike h2 {
191
- display: inline-block;
192
- margin-right: 20px;
193
- }
194
- form.wp-ulike p.submit {
195
- display: inline-block;
196
- margin-right: 20px;
197
- }
198
- form.wp-ulike p.submit .button {
199
- height: 50px !important;
200
- line-height: 50px !important;
201
- padding: 0 25px !important;
202
- font-size: 18px !important;
203
- }
204
- form.wp-ulike p.submit .button:active {
205
- vertical-align: inherit;
206
- }
207
- form.wp-ulike td .settings-error {
208
- overflow: hidden;
209
- }
210
- form.wp-ulike td .settings-error p {
211
- margin: 0.5em 0;
212
- }
213
- form.wp-ulike .wp-ulike-settings-tabs h2 {
214
- float: left;
215
- padding: 10px 15px;
216
- margin: 1em 0 0;
217
- font-weight: 500;
218
- border: 1px solid #e0e0e0;
219
- border-right: none;
220
- border-bottom: none;
221
- cursor: pointer;
222
- }
223
- form.wp-ulike .wp-ulike-settings-tabs h2:hover {
224
- background-color: #f9f9f9;
225
- }
226
- form.wp-ulike .wp-ulike-settings-tabs h2:last-child {
227
- border-right: 1px solid #e0e0e0;
228
- }
229
- form.wp-ulike .wp-ulike-settings-tabs h2.active {
230
- background-color: #ffffff;
231
- border-bottom: 1px solid #fff;
232
- margin-bottom: -1px;
233
  }
234
- form.wp-ulike .toggle-switch input[type=checkbox] {
235
- display: none;
236
- }
237
- form.wp-ulike .toggle-switch label {
238
- cursor: pointer;
239
- text-indent: -9999px;
240
- width: 50px;
241
- height: 30px;
242
- background: #757575;
243
- display: block;
244
- border-radius: 100px;
245
- position: relative;
246
- }
247
- form.wp-ulike .toggle-switch label:after {
248
- content: '';
249
- position: absolute;
250
- top: 5px;
251
- left: 5px;
252
- width: 20px;
253
- height: 20px;
254
- background: #fff;
255
- border-radius: 50%;
256
- transition: 0.3s;
257
- }
258
- form.wp-ulike .toggle-switch input:checked + label {
259
- background: #0077a3;
260
- }
261
- form.wp-ulike .toggle-switch input:checked + label:after {
262
- left: calc(100% - 5px);
263
- transform: translateX(-100%);
264
- }
265
- form.wp-ulike .wp-ulike-settings-license-activation {
266
- display: flex;
267
- align-items: center;
268
- flex-wrap: wrap;
269
- }
270
- form.wp-ulike .wp-ulike-settings-license-activation .settings-error {
271
- flex: 0 1 100%;
272
- }
273
- form.wp-ulike .wp-ulike-settings-license-activation .regular-text {
274
- font-size: 18px;
275
- font-weight: 600;
276
- width: 400px;
277
- height: 45px;
278
- }
279
- form.wp-ulike .wp-ulike-settings-license-activation .button {
280
- height: 45px;
281
- font-weight: 700;
282
- padding: 0 20px;
283
  }
284
 
 
 
 
285
  .wp-ulike-settings-notice, .wp-ulike-notice-wrapper {
286
  position: relative;
287
  }
@@ -357,36 +273,24 @@ form.wp-ulike .wp-ulike-settings-license-activation .button {
357
  text-decoration: none;
358
  }
359
 
360
- .wp-ulike-settings-tab {
361
- padding: 2em;
362
- border: 1px solid #e0e0e0;
363
- clear: both;
364
- background: #fff;
365
- }
366
-
367
- tr.hide-label th {
368
- display: none;
369
- }
370
- tr.hide-label td {
371
- padding-left: 0;
372
  }
373
-
374
- .wp-ulike-settings-tabs .dashicons-bbpress:before {
375
- content: "\f449";
376
  }
377
- .wp-ulike-settings-tabs .dashicons-buddypress:before {
378
- content: "\f452";
 
 
 
379
  }
380
-
381
- #wp_ulike_customize_custom_css {
382
- font-family: Consolas, Monaco, monospace;
383
- direction: ltr;
384
- font-size: 13px;
385
- width: 97%;
386
- background: none repeat scroll 0% 0% #F9F9F9;
387
- outline: 0px none;
388
- width: 60%;
389
- min-height: 300px;
390
  }
391
 
392
  .wp-ulike-btn {
185
  }
186
 
187
  /**
188
+ * Visual Select
189
  */
190
+ .wp-ulike-visual-select .csf--image.csf--active > img {
191
+ filter: brightness(40%) sepia(100%) hue-rotate(170deg) saturate(250%);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
192
  }
193
+ .wp-ulike-visual-select .csf--image > img {
194
+ height: 40px;
195
+ padding: 10px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
196
  }
197
 
198
+ /**
199
+ * Settings Page
200
+ */
201
  .wp-ulike-settings-notice, .wp-ulike-notice-wrapper {
202
  position: relative;
203
  }
273
  text-decoration: none;
274
  }
275
 
276
+ .wp-ulike-settings-license-activation {
277
+ display: flex;
278
+ align-items: center;
279
+ flex-wrap: wrap;
 
 
 
 
 
 
 
 
280
  }
281
+ .wp-ulike-settings-license-activation .settings-error {
282
+ flex: 0 1 100%;
 
283
  }
284
+ .wp-ulike-settings-license-activation .regular-text {
285
+ font-size: 18px;
286
+ font-weight: 600;
287
+ width: 400px;
288
+ height: 45px;
289
  }
290
+ .wp-ulike-settings-license-activation .button {
291
+ height: 45px;
292
+ font-weight: 700;
293
+ padding: 0 20px;
 
 
 
 
 
 
294
  }
295
 
296
  .wp-ulike-btn {
admin/assets/css/plugins.css CHANGED
@@ -14,600 +14,6 @@ https://wordpress.org/plugins/wp-ulike/
14
 
15
  \------------------------------------------/
16
  */
17
- /***
18
- Spectrum Colorpicker v1.8.0
19
- https://github.com/bgrins/spectrum
20
- Author: Brian Grinstead
21
- License: MIT
22
- ***/
23
- .sp-container {
24
- position: absolute;
25
- top: 0;
26
- left: 0;
27
- display: inline-block;
28
- *display: inline;
29
- *zoom: 1;
30
- /* https://github.com/bgrins/spectrum/issues/40 */
31
- z-index: 9999994;
32
- overflow: hidden;
33
- }
34
-
35
- .sp-container.sp-flat {
36
- position: relative;
37
- }
38
-
39
- /* Fix for * { box-sizing: border-box; } */
40
- .sp-container,
41
- .sp-container * {
42
- -webkit-box-sizing: content-box;
43
- -moz-box-sizing: content-box;
44
- box-sizing: content-box;
45
- }
46
-
47
- /* http://ansciath.tumblr.com/post/7347495869/css-aspect-ratio */
48
- .sp-top {
49
- position: relative;
50
- width: 100%;
51
- display: inline-block;
52
- }
53
-
54
- .sp-top-inner {
55
- position: absolute;
56
- top: 0;
57
- left: 0;
58
- bottom: 0;
59
- right: 0;
60
- }
61
-
62
- .sp-color {
63
- position: absolute;
64
- top: 0;
65
- left: 0;
66
- bottom: 0;
67
- right: 20%;
68
- }
69
-
70
- .sp-hue {
71
- position: absolute;
72
- top: 0;
73
- right: 0;
74
- bottom: 0;
75
- left: 84%;
76
- height: 100%;
77
- }
78
-
79
- .sp-clear-enabled .sp-hue {
80
- top: 33px;
81
- height: 77.5%;
82
- }
83
-
84
- .sp-fill {
85
- padding-top: 80%;
86
- }
87
-
88
- .sp-sat, .sp-val {
89
- position: absolute;
90
- top: 0;
91
- left: 0;
92
- right: 0;
93
- bottom: 0;
94
- }
95
-
96
- .sp-alpha-enabled .sp-top {
97
- margin-bottom: 18px;
98
- }
99
-
100
- .sp-alpha-enabled .sp-alpha {
101
- display: block;
102
- }
103
-
104
- .sp-alpha-handle {
105
- position: absolute;
106
- top: -4px;
107
- bottom: -4px;
108
- width: 6px;
109
- left: 50%;
110
- cursor: pointer;
111
- border: 1px solid black;
112
- background: white;
113
- opacity: .8;
114
- }
115
-
116
- .sp-alpha {
117
- display: none;
118
- position: absolute;
119
- bottom: -14px;
120
- right: 0;
121
- left: 0;
122
- height: 8px;
123
- }
124
-
125
- .sp-alpha-inner {
126
- border: solid 1px #333;
127
- }
128
-
129
- .sp-clear {
130
- display: none;
131
- }
132
-
133
- .sp-clear.sp-clear-display {
134
- background-position: center;
135
- }
136
-
137
- .sp-clear-enabled .sp-clear {
138
- display: block;
139
- position: absolute;
140
- top: 0px;
141
- right: 0;
142
- bottom: 0;
143
- left: 84%;
144
- height: 28px;
145
- }
146
-
147
- /* Don't allow text selection */
148
- .sp-container, .sp-replacer, .sp-preview, .sp-dragger, .sp-slider, .sp-alpha, .sp-clear, .sp-alpha-handle, .sp-container.sp-dragging .sp-input, .sp-container button {
149
- -webkit-user-select: none;
150
- -moz-user-select: -moz-none;
151
- -o-user-select: none;
152
- user-select: none;
153
- }
154
-
155
- .sp-container.sp-input-disabled .sp-input-container {
156
- display: none;
157
- }
158
-
159
- .sp-container.sp-buttons-disabled .sp-button-container {
160
- display: none;
161
- }
162
-
163
- .sp-container.sp-palette-buttons-disabled .sp-palette-button-container {
164
- display: none;
165
- }
166
-
167
- .sp-palette-only .sp-picker-container {
168
- display: none;
169
- }
170
-
171
- .sp-palette-disabled .sp-palette-container {
172
- display: none;
173
- }
174
-
175
- .sp-initial-disabled .sp-initial {
176
- display: none;
177
- }
178
-
179
- /* Gradients for hue, saturation and value instead of images. Not pretty... but it works */
180
- .sp-sat {
181
- background-image: -webkit-gradient(linear, 0 0, 100% 0, from(#FFF), to(rgba(204, 154, 129, 0)));
182
- background-image: -webkit-linear-gradient(left, #FFF, rgba(204, 154, 129, 0));
183
- background-image: -moz-linear-gradient(left, #fff, rgba(204, 154, 129, 0));
184
- background-image: -o-linear-gradient(left, #fff, rgba(204, 154, 129, 0));
185
- background-image: -ms-linear-gradient(left, #fff, rgba(204, 154, 129, 0));
186
- background-image: linear-gradient(to right, #ffffff, rgba(204, 154, 129, 0));
187
- -ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr=#FFFFFFFF, endColorstr=#00CC9A81)";
188
- filter: progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr='#FFFFFFFF', endColorstr='#00CC9A81');
189
- }
190
-
191
- .sp-val {
192
- background-image: -webkit-gradient(linear, 0 100%, 0 0, from(#000000), to(rgba(204, 154, 129, 0)));
193
- background-image: -webkit-linear-gradient(bottom, #000000, rgba(204, 154, 129, 0));
194
- background-image: -moz-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));
195
- background-image: -o-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));
196
- background-image: -ms-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));
197
- background-image: linear-gradient(to top, #000000, rgba(204, 154, 129, 0));
198
- -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#00CC9A81, endColorstr=#FF000000)";
199
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00CC9A81', endColorstr='#FF000000');
200
- }
201
-
202
- .sp-hue {
203
- background: -moz-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
204
- background: -ms-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
205
- background: -o-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
206
- background: -webkit-gradient(linear, left top, left bottom, from(#ff0000), color-stop(0.17, #ffff00), color-stop(0.33, #00ff00), color-stop(0.5, #00ffff), color-stop(0.67, #0000ff), color-stop(0.83, #ff00ff), to(#ff0000));
207
- background: -webkit-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
208
- background: linear-gradient(to bottom, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
209
- }
210
-
211
- /* IE filters do not support multiple color stops.
212
- Generate 6 divs, line them up, and do two color gradients for each.
213
- Yes, really.
214
- */
215
- .sp-1 {
216
- height: 17%;
217
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0000', endColorstr='#ffff00');
218
- }
219
-
220
- .sp-2 {
221
- height: 16%;
222
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffff00', endColorstr='#00ff00');
223
- }
224
-
225
- .sp-3 {
226
- height: 17%;
227
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00ff00', endColorstr='#00ffff');
228
- }
229
-
230
- .sp-4 {
231
- height: 17%;
232
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00ffff', endColorstr='#0000ff');
233
- }
234
-
235
- .sp-5 {
236
- height: 16%;
237
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0000ff', endColorstr='#ff00ff');
238
- }
239
-
240
- .sp-6 {
241
- height: 17%;
242
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff00ff', endColorstr='#ff0000');
243
- }
244
-
245
- .sp-hidden {
246
- display: none !important;
247
- }
248
-
249
- /* Clearfix hack */
250
- .sp-cf:before, .sp-cf:after {
251
- content: "";
252
- display: table;
253
- }
254
-
255
- .sp-cf:after {
256
- clear: both;
257
- }
258
-
259
- .sp-cf {
260
- *zoom: 1;
261
- }
262
-
263
- /* Mobile devices, make hue slider bigger so it is easier to slide */
264
- @media (max-device-width: 480px) {
265
- .sp-color {
266
- right: 40%;
267
- }
268
-
269
- .sp-hue {
270
- left: 63%;
271
- }
272
-
273
- .sp-fill {
274
- padding-top: 60%;
275
- }
276
- }
277
- .sp-dragger {
278
- border-radius: 5px;
279
- height: 5px;
280
- width: 5px;
281
- border: 1px solid #fff;
282
- background: #000;
283
- cursor: pointer;
284
- position: absolute;
285
- top: 0;
286
- left: 0;
287
- }
288
-
289
- .sp-slider {
290
- position: absolute;
291
- top: 0;
292
- cursor: pointer;
293
- height: 3px;
294
- left: -1px;
295
- right: -1px;
296
- border: 1px solid #000;
297
- background: white;
298
- opacity: .8;
299
- }
300
-
301
- /*
302
- Theme authors:
303
- Here are the basic themeable display options (colors, fonts, global widths).
304
- See http://bgrins.github.io/spectrum/themes/ for instructions.
305
- */
306
- .sp-container {
307
- border-radius: 0;
308
- background-color: #ECECEC;
309
- border: solid 1px #f0c49B;
310
- padding: 0;
311
- }
312
-
313
- .sp-container, .sp-container button, .sp-container input, .sp-color, .sp-hue, .sp-clear {
314
- font: normal 12px "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif;
315
- -webkit-box-sizing: border-box;
316
- -moz-box-sizing: border-box;
317
- -ms-box-sizing: border-box;
318
- box-sizing: border-box;
319
- }
320
-
321
- .sp-top {
322
- margin-bottom: 3px;
323
- }
324
-
325
- .sp-color, .sp-hue, .sp-clear {
326
- border: solid 1px #666;
327
- }
328
-
329
- /* Input */
330
- .sp-input-container {
331
- float: right;
332
- width: 100px;
333
- margin-bottom: 4px;
334
- }
335
-
336
- .sp-initial-disabled .sp-input-container {
337
- width: 100%;
338
- }
339
-
340
- .sp-input {
341
- font-size: 12px !important;
342
- border: 1px inset;
343
- padding: 4px 5px;
344
- margin: 0;
345
- width: 100%;
346
- background: transparent;
347
- border-radius: 3px;
348
- color: #222;
349
- }
350
-
351
- .sp-input:focus {
352
- border: 1px solid orange;
353
- }
354
-
355
- .sp-input.sp-validation-error {
356
- border: 1px solid red;
357
- background: #fdd;
358
- }
359
-
360
- .sp-picker-container, .sp-palette-container {
361
- float: left;
362
- position: relative;
363
- padding: 10px;
364
- padding-bottom: 300px;
365
- margin-bottom: -290px;
366
- }
367
-
368
- .sp-picker-container {
369
- width: 172px;
370
- border-left: solid 1px #fff;
371
- }
372
-
373
- /* Palettes */
374
- .sp-palette-container {
375
- border-right: solid 1px #ccc;
376
- }
377
-
378
- .sp-palette-only .sp-palette-container {
379
- border: 0;
380
- }
381
-
382
- .sp-palette .sp-thumb-el {
383
- display: block;
384
- position: relative;
385
- float: left;
386
- width: 24px;
387
- height: 15px;
388
- margin: 3px;
389
- cursor: pointer;
390
- border: solid 2px transparent;
391
- }
392
-
393
- .sp-palette .sp-thumb-el:hover, .sp-palette .sp-thumb-el.sp-thumb-active {
394
- border-color: orange;
395
- }
396
-
397
- .sp-thumb-el {
398
- position: relative;
399
- }
400
-
401
- /* Initial */
402
- .sp-initial {
403
- float: left;
404
- border: solid 1px #333;
405
- }
406
-
407
- .sp-initial span {
408
- width: 30px;
409
- height: 25px;
410
- border: none;
411
- display: block;
412
- float: left;
413
- margin: 0;
414
- }
415
-
416
- .sp-initial .sp-clear-display {
417
- background-position: center;
418
- }
419
-
420
- /* Buttons */
421
- .sp-palette-button-container,
422
- .sp-button-container {
423
- float: right;
424
- }
425
-
426
- /* Replacer (the little preview div that shows up instead of the <input>) */
427
- .sp-replacer {
428
- margin: 0;
429
- overflow: hidden;
430
- cursor: pointer;
431
- padding: 4px;
432
- display: inline-block;
433
- *zoom: 1;
434
- *display: inline;
435
- border: solid 1px #91765d;
436
- background: #eee;
437
- color: #333;
438
- vertical-align: middle;
439
- }
440
-
441
- .sp-replacer:hover, .sp-replacer.sp-active {
442
- border-color: #F0C49B;
443
- color: #111;
444
- }
445
-
446
- .sp-replacer.sp-disabled {
447
- cursor: default;
448
- border-color: silver;
449
- color: silver;
450
- }
451
-
452
- .sp-dd {
453
- padding: 2px 0;
454
- height: 16px;
455
- line-height: 16px;
456
- float: left;
457
- font-size: 10px;
458
- }
459
-
460
- .sp-preview {
461
- position: relative;
462
- width: 25px;
463
- height: 20px;
464
- border: solid 1px #222;
465
- margin-right: 5px;
466
- float: left;
467
- z-index: 0;
468
- }
469
-
470
- .sp-palette {
471
- *width: 220px;
472
- max-width: 220px;
473
- }
474
-
475
- .sp-palette .sp-thumb-el {
476
- width: 16px;
477
- height: 16px;
478
- margin: 2px 1px;
479
- border: solid 1px #d0d0d0;
480
- }
481
-
482
- .sp-container {
483
- padding-bottom: 0;
484
- }
485
-
486
- /* Buttons: http://hellohappy.org/css3-buttons/ */
487
- .sp-container button {
488
- background-color: #eeeeee;
489
- background-image: -webkit-linear-gradient(top, #eeeeee, #cccccc);
490
- background-image: -moz-linear-gradient(top, #eeeeee, #cccccc);
491
- background-image: -ms-linear-gradient(top, #eeeeee, #cccccc);
492
- background-image: -o-linear-gradient(top, #eeeeee, #cccccc);
493
- background-image: linear-gradient(to bottom, #eeeeee, #cccccc);
494
- border: 1px solid #ccc;
495
- border-bottom: 1px solid #bbb;
496
- border-radius: 3px;
497
- color: #333;
498
- font-size: 14px;
499
- line-height: 1;
500
- padding: 5px 4px;
501
- text-align: center;
502
- text-shadow: 0 1px 0 #eee;
503
- vertical-align: middle;
504
- }
505
-
506
- .sp-container button:hover {
507
- background-color: #dddddd;
508
- background-image: -webkit-linear-gradient(top, #dddddd, #bbbbbb);
509
- background-image: -moz-linear-gradient(top, #dddddd, #bbbbbb);
510
- background-image: -ms-linear-gradient(top, #dddddd, #bbbbbb);
511
- background-image: -o-linear-gradient(top, #dddddd, #bbbbbb);
512
- background-image: linear-gradient(to bottom, #dddddd, #bbbbbb);
513
- border: 1px solid #bbb;
514
- border-bottom: 1px solid #999;
515
- cursor: pointer;
516
- text-shadow: 0 1px 0 #ddd;
517
- }
518
-
519
- .sp-container button:active {
520
- border: 1px solid #aaa;
521
- border-bottom: 1px solid #888;
522
- -webkit-box-shadow: inset 0 0 5px 2px #aaaaaa, 0 1px 0 0 #eeeeee;
523
- -moz-box-shadow: inset 0 0 5px 2px #aaaaaa, 0 1px 0 0 #eeeeee;
524
- -ms-box-shadow: inset 0 0 5px 2px #aaaaaa, 0 1px 0 0 #eeeeee;
525
- -o-box-shadow: inset 0 0 5px 2px #aaaaaa, 0 1px 0 0 #eeeeee;
526
- box-shadow: inset 0 0 5px 2px #aaaaaa, 0 1px 0 0 #eeeeee;
527
- }
528
-
529
- .sp-cancel {
530
- font-size: 11px;
531
- color: #d93f3f !important;
532
- margin: 0;
533
- padding: 2px;
534
- margin-right: 5px;
535
- vertical-align: middle;
536
- text-decoration: none;
537
- }
538
-
539
- .sp-cancel:hover {
540
- color: #d93f3f !important;
541
- text-decoration: underline;
542
- }
543
-
544
- .sp-palette span:hover, .sp-palette span.sp-thumb-active {
545
- border-color: #000;
546
- }
547
-
548
- .sp-preview, .sp-alpha, .sp-thumb-el {
549
- position: relative;
550
- background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==);
551
- }
552
-
553
- .sp-preview-inner, .sp-alpha-inner, .sp-thumb-inner {
554
- display: block;
555
- position: absolute;
556
- top: 0;
557
- left: 0;
558
- bottom: 0;
559
- right: 0;
560
- }
561
-
562
- .sp-palette .sp-thumb-inner {
563
- background-position: 50% 50%;
564
- background-repeat: no-repeat;
565
- }
566
-
567
- .sp-palette .sp-thumb-light.sp-thumb-active .sp-thumb-inner {
568
- background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAIVJREFUeNpiYBhsgJFMffxAXABlN5JruT4Q3wfi/0DsT64h8UD8HmpIPCWG/KemIfOJCUB+Aoacx6EGBZyHBqI+WsDCwuQ9mhxeg2A210Ntfo8klk9sOMijaURm7yc1UP2RNCMbKE9ODK1HM6iegYLkfx8pligC9lCD7KmRof0ZhjQACDAAceovrtpVBRkAAAAASUVORK5CYII=);
569
- }
570
-
571
- .sp-palette .sp-thumb-dark.sp-thumb-active .sp-thumb-inner {
572
- background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAMdJREFUOE+tkgsNwzAMRMugEAahEAahEAZhEAqlEAZhEAohEAYh81X2dIm8fKpEspLGvudPOsUYpxE2BIJCroJmEW9qJ+MKaBFhEMNabSy9oIcIPwrB+afvAUFoK4H0tMaQ3XtlrggDhOVVMuT4E5MMG0FBbCEYzjYT7OxLEvIHQLY2zWwQ3D+9luyOQTfKDiFD3iUIfPk8VqrKjgAiSfGFPecrg6HN6m/iBcwiDAo7WiBeawa+Kwh7tZoSCGLMqwlSAzVDhoK+6vH4G0P5wdkAAAAASUVORK5CYII=);
573
- }
574
-
575
- .sp-clear-display {
576
- background-repeat: no-repeat;
577
- background-position: center;
578
- background-image: url(data:image/gif;base64,R0lGODlhFAAUAPcAAAAAAJmZmZ2dnZ6enqKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq/Hx8fLy8vT09PX19ff39/j4+Pn5+fr6+vv7+wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAP8ALAAAAAAUABQAAAihAP9FoPCvoMGDBy08+EdhQAIJCCMybCDAAYUEARBAlFiQQoMABQhKUJBxY0SPICEYHBnggEmDKAuoPMjS5cGYMxHW3IiT478JJA8M/CjTZ0GgLRekNGpwAsYABHIypcAgQMsITDtWJYBR6NSqMico9cqR6tKfY7GeBCuVwlipDNmefAtTrkSzB1RaIAoXodsABiZAEFB06gIBWC1mLVgBa0AAOw==);
579
- }
580
-
581
- /**
582
- * Visual Select
583
- */
584
- .wp-ulike-visual-select {
585
- height: auto;
586
- display: inline-block;
587
- width: 100%;
588
- max-width: 900px;
589
- }
590
- .wp-ulike-visual-select .radio-img-item {
591
- display: inline-block;
592
- margin-right: 10px;
593
- margin-bottom: 10px;
594
- border: 3px solid #d8d8d8;
595
- padding: 4px 15px;
596
- width: 110px;
597
- height: 60px;
598
- cursor: pointer;
599
- }
600
- .wp-ulike-visual-select .radio-img-item.item-checked {
601
- -webkit-filter: brightness(40%) sepia(100%) hue-rotate(170deg) saturate(250%);
602
- filter: brightness(40%) sepia(100%) hue-rotate(170deg) saturate(250%);
603
- }
604
- .wp-ulike-visual-select .radio-img-item img {
605
- display: block;
606
- clear: both;
607
- width: 100%;
608
- height: 100%;
609
- }
610
-
611
  .wp-ulike-container {
612
  width: 100%;
613
  margin-left: auto;
@@ -850,6 +256,24 @@ See http://bgrins.github.io/spectrum/themes/ for instructions.
850
  z-index: 9;
851
  }
852
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
853
  .wp-ulike-pro-stats-banner .wp-ulike-inner {
854
  padding: 20px 40px;
855
  }
14
 
15
  \------------------------------------------/
16
  */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  .wp-ulike-container {
18
  width: 100%;
19
  margin-left: auto;
256
  z-index: 9;
257
  }
258
 
259
+ .wp-ulike-btn-is-loading {
260
+ position: relative;
261
+ }
262
+ .wp-ulike-btn-is-loading .wp-ulike-text {
263
+ visibility: hidden;
264
+ }
265
+ .wp-ulike-btn-is-loading:before {
266
+ content: "";
267
+ position: absolute;
268
+ top: 50%;
269
+ left: 50%;
270
+ width: 25px;
271
+ height: 25px;
272
+ transform: translateX(-50%) translateY(-50%);
273
+ background-image: url(../../../assets/img/svg/button-spinner.svg);
274
+ z-index: 9;
275
+ }
276
+
277
  .wp-ulike-pro-stats-banner .wp-ulike-inner {
278
  padding: 20px 40px;
279
  }
admin/assets/js/plugins.js CHANGED
@@ -1,6 +1,6 @@
1
- /*! WP ULike - v4.0.5
2
  * https://wpulike.com
3
- * TechnoWich 2019;
4
  */
5
 
6
 
@@ -33,2414 +33,4 @@ r._afterUpdate=null,r._rows=a,r._parse=n,r._parseOptions=i,r._apply=function(e,o
33
  "padding-bottom":"0","margin-top":"0","margin-bottom":"0","border-top-width":"0","border-bottom-width":"0",height:"100px",overflow:"hidden"})}),l=a(h),h.each(function(){var e=t(this);e.attr("style",e.data("style-cache")||"")})),t.each(l,function(e,o){var a=t(o),i=0;if(s.target)i=s.target.outerHeight(!1);else{if(s.byRow&&a.length<=1)return void a.css(s.property,"");a.each(function(){var e=t(this),o=e.attr("style"),n=e.css("display");"inline-block"!==n&&"flex"!==n&&"inline-flex"!==n&&(n="block");var a={
34
  display:n};a[s.property]="",e.css(a),e.outerHeight(!1)>i&&(i=e.outerHeight(!1)),o?e.attr("style",o):e.css("display","")})}a.each(function(){var e=t(this),o=0;s.target&&e.is(s.target)||("border-box"!==e.css("box-sizing")&&(o+=n(e.css("border-top-width"))+n(e.css("border-bottom-width")),o+=n(e.css("padding-top"))+n(e.css("padding-bottom"))),e.css(s.property,i-o+"px"))})}),u.each(function(){var e=t(this);e.attr("style",e.data("style-cache")||null)}),r._maintainScroll&&t(window).scrollTop(c/p*t("html").outerHeight(!0)),
35
  this},r._applyDataApi=function(){var e={};t("[data-match-height], [data-mh]").each(function(){var o=t(this),n=o.attr("data-mh")||o.attr("data-match-height");n in e?e[n]=e[n].add(o):e[n]=o}),t.each(e,function(){this.matchHeight(!0)})};var s=function(e){r._beforeUpdate&&r._beforeUpdate(e,r._groups),t.each(r._groups,function(){r._apply(this.elements,this.options)}),r._afterUpdate&&r._afterUpdate(e,r._groups)};r._update=function(n,a){if(a&&"resize"===a.type){var i=t(window).width();if(i===e)return;e=i;
36
- }n?o===-1&&(o=setTimeout(function(){s(a),o=-1},r._throttle)):s(a)},t(r._applyDataApi);var h=t.fn.on?"on":"bind";t(window)[h]("load",function(t){r._update(!1,t)}),t(window)[h]("resize orientationchange",function(t){r._update(!0,t)})});
37
-
38
-
39
- /* ================== admin/assets/js/src/plugins/spectrum.js =================== */
40
-
41
-
42
- // Spectrum Colorpicker v1.8.0
43
- // https://github.com/bgrins/spectrum
44
- // Author: Brian Grinstead
45
- // License: MIT
46
-
47
- (function (factory) {
48
- "use strict";
49
-
50
- if (typeof define === 'function' && define.amd) { // AMD
51
- define(['jquery'], factory);
52
- }
53
- else if (typeof exports == "object" && typeof module == "object") { // CommonJS
54
- module.exports = factory(require('jquery'));
55
- }
56
- else { // Browser
57
- factory(jQuery);
58
- }
59
- })(function($, undefined) {
60
- "use strict";
61
-
62
- var defaultOpts = {
63
-
64
- // Callbacks
65
- beforeShow: noop,
66
- move: noop,
67
- change: noop,
68
- show: noop,
69
- hide: noop,
70
-
71
- // Options
72
- color: false,
73
- flat: false,
74
- showInput: false,
75
- allowEmpty: false,
76
- showButtons: true,
77
- clickoutFiresChange: true,
78
- showInitial: false,
79
- showPalette: false,
80
- showPaletteOnly: false,
81
- hideAfterPaletteSelect: false,
82
- togglePaletteOnly: false,
83
- showSelectionPalette: true,
84
- localStorageKey: false,
85
- appendTo: "body",
86
- maxSelectionSize: 7,
87
- cancelText: "cancel",
88
- chooseText: "choose",
89
- togglePaletteMoreText: "more",
90
- togglePaletteLessText: "less",
91
- clearText: "Clear Color Selection",
92
- noColorSelectedText: "No Color Selected",
93
- preferredFormat: false,
94
- className: "", // Deprecated - use containerClassName and replacerClassName instead.
95
- containerClassName: "",
96
- replacerClassName: "",
97
- showAlpha: false,
98
- theme: "sp-light",
99
- palette: [["#ffffff", "#000000", "#ff0000", "#ff8000", "#ffff00", "#008000", "#0000ff", "#4b0082", "#9400d3"]],
100
- selectionPalette: [],
101
- disabled: false,
102
- offset: null
103
- },
104
- spectrums = [],
105
- IE = !!/msie/i.exec( window.navigator.userAgent ),
106
- rgbaSupport = (function() {
107
- function contains( str, substr ) {
108
- return !!~('' + str).indexOf(substr);
109
- }
110
-
111
- var elem = document.createElement('div');
112
- var style = elem.style;
113
- style.cssText = 'background-color:rgba(0,0,0,.5)';
114
- return contains(style.backgroundColor, 'rgba') || contains(style.backgroundColor, 'hsla');
115
- })(),
116
- replaceInput = [
117
- "<div class='sp-replacer'>",
118
- "<div class='sp-preview'><div class='sp-preview-inner'></div></div>",
119
- "<div class='sp-dd'>&#9660;</div>",
120
- "</div>"
121
- ].join(''),
122
- markup = (function () {
123
-
124
- // IE does not support gradients with multiple stops, so we need to simulate
125
- // that for the rainbow slider with 8 divs that each have a single gradient
126
- var gradientFix = "";
127
- if (IE) {
128
- for (var i = 1; i <= 6; i++) {
129
- gradientFix += "<div class='sp-" + i + "'></div>";
130
- }
131
- }
132
-
133
- return [
134
- "<div class='sp-container sp-hidden'>",
135
- "<div class='sp-palette-container'>",
136
- "<div class='sp-palette sp-thumb sp-cf'></div>",
137
- "<div class='sp-palette-button-container sp-cf'>",
138
- "<button type='button' class='sp-palette-toggle'></button>",
139
- "</div>",
140
- "</div>",
141
- "<div class='sp-picker-container'>",
142
- "<div class='sp-top sp-cf'>",
143
- "<div class='sp-fill'></div>",
144
- "<div class='sp-top-inner'>",
145
- "<div class='sp-color'>",
146
- "<div class='sp-sat'>",
147
- "<div class='sp-val'>",
148
- "<div class='sp-dragger'></div>",
149
- "</div>",
150
- "</div>",
151
- "</div>",
152
- "<div class='sp-clear sp-clear-display'>",
153
- "</div>",
154
- "<div class='sp-hue'>",
155
- "<div class='sp-slider'></div>",
156
- gradientFix,
157
- "</div>",
158
- "</div>",
159
- "<div class='sp-alpha'><div class='sp-alpha-inner'><div class='sp-alpha-handle'></div></div></div>",
160
- "</div>",
161
- "<div class='sp-input-container sp-cf'>",
162
- "<input class='sp-input' type='text' spellcheck='false' />",
163
- "</div>",
164
- "<div class='sp-initial sp-thumb sp-cf'></div>",
165
- "<div class='sp-button-container sp-cf'>",
166
- "<a class='sp-cancel' href='#'></a>",
167
- "<button type='button' class='sp-choose'></button>",
168
- "</div>",
169
- "</div>",
170
- "</div>"
171
- ].join("");
172
- })();
173
-
174
- function paletteTemplate (p, color, className, opts) {
175
- var html = [];
176
- for (var i = 0; i < p.length; i++) {
177
- var current = p[i];
178
- if(current) {
179
- var tiny = tinycolor(current);
180
- var c = tiny.toHsl().l < 0.5 ? "sp-thumb-el sp-thumb-dark" : "sp-thumb-el sp-thumb-light";
181
- c += (tinycolor.equals(color, current)) ? " sp-thumb-active" : "";
182
- var formattedString = tiny.toString(opts.preferredFormat || "rgb");
183
- var swatchStyle = rgbaSupport ? ("background-color:" + tiny.toRgbString()) : "filter:" + tiny.toFilter();
184
- html.push('<span title="' + formattedString + '" data-color="' + tiny.toRgbString() + '" class="' + c + '"><span class="sp-thumb-inner" style="' + swatchStyle + ';" /></span>');
185
- } else {
186
- var cls = 'sp-clear-display';
187
- html.push($('<div />')
188
- .append($('<span data-color="" style="background-color:transparent;" class="' + cls + '"></span>')
189
- .attr('title', opts.noColorSelectedText)
190
- )
191
- .html()
192
- );
193
- }
194
- }
195
- return "<div class='sp-cf " + className + "'>" + html.join('') + "</div>";
196
- }
197
-
198
- function hideAll() {
199
- for (var i = 0; i < spectrums.length; i++) {
200
- if (spectrums[i]) {
201
- spectrums[i].hide();
202
- }
203
- }
204
- }
205
-
206
- function instanceOptions(o, callbackContext) {
207
- var opts = $.extend({}, defaultOpts, o);
208
- opts.callbacks = {
209
- 'move': bind(opts.move, callbackContext),
210
- 'change': bind(opts.change, callbackContext),
211
- 'show': bind(opts.show, callbackContext),
212
- 'hide': bind(opts.hide, callbackContext),
213
- 'beforeShow': bind(opts.beforeShow, callbackContext)
214
- };
215
-
216
- return opts;
217
- }
218
-
219
- function spectrum(element, o) {
220
-
221
- var opts = instanceOptions(o, element),
222
- flat = opts.flat,
223
- showSelectionPalette = opts.showSelectionPalette,
224
- localStorageKey = opts.localStorageKey,
225
- theme = opts.theme,
226
- callbacks = opts.callbacks,
227
- resize = throttle(reflow, 10),
228
- visible = false,
229
- isDragging = false,
230
- dragWidth = 0,
231
- dragHeight = 0,
232
- dragHelperHeight = 0,
233
- slideHeight = 0,
234
- slideWidth = 0,
235
- alphaWidth = 0,
236
- alphaSlideHelperWidth = 0,
237
- slideHelperHeight = 0,
238
- currentHue = 0,
239
- currentSaturation = 0,
240
- currentValue = 0,
241
- currentAlpha = 1,
242
- palette = [],
243
- paletteArray = [],
244
- paletteLookup = {},
245
- selectionPalette = opts.selectionPalette.slice(0),
246
- maxSelectionSize = opts.maxSelectionSize,
247
- draggingClass = "sp-dragging",
248
- shiftMovementDirection = null;
249
-
250
- var doc = element.ownerDocument,
251
- body = doc.body,
252
- boundElement = $(element),
253
- disabled = false,
254
- container = $(markup, doc).addClass(theme),
255
- pickerContainer = container.find(".sp-picker-container"),
256
- dragger = container.find(".sp-color"),
257
- dragHelper = container.find(".sp-dragger"),
258
- slider = container.find(".sp-hue"),
259
- slideHelper = container.find(".sp-slider"),
260
- alphaSliderInner = container.find(".sp-alpha-inner"),
261
- alphaSlider = container.find(".sp-alpha"),
262
- alphaSlideHelper = container.find(".sp-alpha-handle"),
263
- textInput = container.find(".sp-input"),
264
- paletteContainer = container.find(".sp-palette"),
265
- initialColorContainer = container.find(".sp-initial"),
266
- cancelButton = container.find(".sp-cancel"),
267
- clearButton = container.find(".sp-clear"),
268
- chooseButton = container.find(".sp-choose"),
269
- toggleButton = container.find(".sp-palette-toggle"),
270
- isInput = boundElement.is("input"),
271
- isInputTypeColor = isInput && boundElement.attr("type") === "color" && inputTypeColorSupport(),
272
- shouldReplace = isInput && !flat,
273
- replacer = (shouldReplace) ? $(replaceInput).addClass(theme).addClass(opts.className).addClass(opts.replacerClassName) : $([]),
274
- offsetElement = (shouldReplace) ? replacer : boundElement,
275
- previewElement = replacer.find(".sp-preview-inner"),
276
- initialColor = opts.color || (isInput && boundElement.val()),
277
- colorOnShow = false,
278
- currentPreferredFormat = opts.preferredFormat,
279
- clickoutFiresChange = !opts.showButtons || opts.clickoutFiresChange,
280
- isEmpty = !initialColor,
281
- allowEmpty = opts.allowEmpty && !isInputTypeColor;
282
-
283
- function applyOptions() {
284
-
285
- if (opts.showPaletteOnly) {
286
- opts.showPalette = true;
287
- }
288
-
289
- toggleButton.text(opts.showPaletteOnly ? opts.togglePaletteMoreText : opts.togglePaletteLessText);
290
-
291
- if (opts.palette) {
292
- palette = opts.palette.slice(0);
293
- paletteArray = $.isArray(palette[0]) ? palette : [palette];
294
- paletteLookup = {};
295
- for (var i = 0; i < paletteArray.length; i++) {
296
- for (var j = 0; j < paletteArray[i].length; j++) {
297
- var rgb = tinycolor(paletteArray[i][j]).toRgbString();
298
- paletteLookup[rgb] = true;
299
- }
300
- }
301
- }
302
-
303
- container.toggleClass("sp-flat", flat);
304
- container.toggleClass("sp-input-disabled", !opts.showInput);
305
- container.toggleClass("sp-alpha-enabled", opts.showAlpha);
306
- container.toggleClass("sp-clear-enabled", allowEmpty);
307
- container.toggleClass("sp-buttons-disabled", !opts.showButtons);
308
- container.toggleClass("sp-palette-buttons-disabled", !opts.togglePaletteOnly);
309
- container.toggleClass("sp-palette-disabled", !opts.showPalette);
310
- container.toggleClass("sp-palette-only", opts.showPaletteOnly);
311
- container.toggleClass("sp-initial-disabled", !opts.showInitial);
312
- container.addClass(opts.className).addClass(opts.containerClassName);
313
-
314
- reflow();
315
- }
316
-
317
- function initialize() {
318
-
319
- if (IE) {
320
- container.find("*:not(input)").attr("unselectable", "on");
321
- }
322
-
323
- applyOptions();
324
-
325
- if (shouldReplace) {
326
- boundElement.after(replacer).hide();
327
- }
328
-
329
- if (!allowEmpty) {
330
- clearButton.hide();
331
- }
332
-
333
- if (flat) {
334
- boundElement.after(container).hide();
335
- }
336
- else {
337
-
338
- var appendTo = opts.appendTo === "parent" ? boundElement.parent() : $(opts.appendTo);
339
- if (appendTo.length !== 1) {
340
- appendTo = $("body");
341
- }
342
-
343
- appendTo.append(container);
344
- }
345
-
346
- updateSelectionPaletteFromStorage();
347
-
348
- offsetElement.bind("click.spectrum touchstart.spectrum", function (e) {
349
- if (!disabled) {
350
- toggle();
351
- }
352
-
353
- e.stopPropagation();
354
-
355
- if (!$(e.target).is("input")) {
356
- e.preventDefault();
357
- }
358
- });
359
-
360
- if(boundElement.is(":disabled") || (opts.disabled === true)) {
361
- disable();
362
- }
363
-
364
- // Prevent clicks from bubbling up to document. This would cause it to be hidden.
365
- container.click(stopPropagation);
366
-
367
- // Handle user typed input
368
- textInput.change(setFromTextInput);
369
- textInput.bind("paste", function () {
370
- setTimeout(setFromTextInput, 1);
371
- });
372
- textInput.keydown(function (e) { if (e.keyCode == 13) { setFromTextInput(); } });
373
-
374
- cancelButton.text(opts.cancelText);
375
- cancelButton.bind("click.spectrum", function (e) {
376
- e.stopPropagation();
377
- e.preventDefault();
378
- revert();
379
- hide();
380
- });
381
-
382
- clearButton.attr("title", opts.clearText);
383
- clearButton.bind("click.spectrum", function (e) {
384
- e.stopPropagation();
385
- e.preventDefault();
386
- isEmpty = true;
387
- move();
388
-
389
- if(flat) {
390
- //for the flat style, this is a change event
391
- updateOriginalInput(true);
392
- }
393
- });
394
-
395
- chooseButton.text(opts.chooseText);
396
- chooseButton.bind("click.spectrum", function (e) {
397
- e.stopPropagation();
398
- e.preventDefault();
399
-
400
- if (IE && textInput.is(":focus")) {
401
- textInput.trigger('change');
402
- }
403
-
404
- if (isValid()) {
405
- updateOriginalInput(true);
406
- hide();
407
- }
408
- });
409
-
410
- toggleButton.text(opts.showPaletteOnly ? opts.togglePaletteMoreText : opts.togglePaletteLessText);
411
- toggleButton.bind("click.spectrum", function (e) {
412
- e.stopPropagation();
413
- e.preventDefault();
414
-
415
- opts.showPaletteOnly = !opts.showPaletteOnly;
416
-
417
- // To make sure the Picker area is drawn on the right, next to the
418
- // Palette area (and not below the palette), first move the Palette
419
- // to the left to make space for the picker, plus 5px extra.
420
- // The 'applyOptions' function puts the whole container back into place
421
- // and takes care of the button-text and the sp-palette-only CSS class.
422
- if (!opts.showPaletteOnly && !flat) {
423
- container.css('left', '-=' + (pickerContainer.outerWidth(true) + 5));
424
- }
425
- applyOptions();
426
- });
427
-
428
- draggable(alphaSlider, function (dragX, dragY, e) {
429
- currentAlpha = (dragX / alphaWidth);
430
- isEmpty = false;
431
- if (e.shiftKey) {
432
- currentAlpha = Math.round(currentAlpha * 10) / 10;
433
- }
434
-
435
- move();
436
- }, dragStart, dragStop);
437
-
438
- draggable(slider, function (dragX, dragY) {
439
- currentHue = parseFloat(dragY / slideHeight);
440
- isEmpty = false;
441
- if (!opts.showAlpha) {
442
- currentAlpha = 1;
443
- }
444
- move();
445
- }, dragStart, dragStop);
446
-
447
- draggable(dragger, function (dragX, dragY, e) {
448
-
449
- // shift+drag should snap the movement to either the x or y axis.
450
- if (!e.shiftKey) {
451
- shiftMovementDirection = null;
452
- }
453
- else if (!shiftMovementDirection) {
454
- var oldDragX = currentSaturation * dragWidth;
455
- var oldDragY = dragHeight - (currentValue * dragHeight);
456
- var furtherFromX = Math.abs(dragX - oldDragX) > Math.abs(dragY - oldDragY);
457
-
458
- shiftMovementDirection = furtherFromX ? "x" : "y";
459
- }
460
-
461
- var setSaturation = !shiftMovementDirection || shiftMovementDirection === "x";
462
- var setValue = !shiftMovementDirection || shiftMovementDirection === "y";
463
-
464
- if (setSaturation) {
465
- currentSaturation = parseFloat(dragX / dragWidth);
466
- }
467
- if (setValue) {
468
- currentValue = parseFloat((dragHeight - dragY) / dragHeight);
469
- }
470
-
471
- isEmpty = false;
472
- if (!opts.showAlpha) {
473
- currentAlpha = 1;
474
- }
475
-
476
- move();
477
-
478
- }, dragStart, dragStop);
479
-
480
- if (!!initialColor) {
481
- set(initialColor);
482
-
483
- // In case color was black - update the preview UI and set the format
484
- // since the set function will not run (default color is black).
485
- updateUI();
486
- currentPreferredFormat = opts.preferredFormat || tinycolor(initialColor).format;
487
-
488
- addColorToSelectionPalette(initialColor);
489
- }
490
- else {
491
- updateUI();
492
- }
493
-
494
- if (flat) {
495
- show();
496
- }
497
-
498
- function paletteElementClick(e) {
499
- if (e.data && e.data.ignore) {
500
- set($(e.target).closest(".sp-thumb-el").data("color"));
501
- move();
502
- }
503
- else {
504
- set($(e.target).closest(".sp-thumb-el").data("color"));
505
- move();
506
- updateOriginalInput(true);
507
- if (opts.hideAfterPaletteSelect) {
508
- hide();
509
- }
510
- }
511
-
512
- return false;
513
- }
514
-
515
- var paletteEvent = IE ? "mousedown.spectrum" : "click.spectrum touchstart.spectrum";
516
- paletteContainer.delegate(".sp-thumb-el", paletteEvent, paletteElementClick);
517
- initialColorContainer.delegate(".sp-thumb-el:nth-child(1)", paletteEvent, { ignore: true }, paletteElementClick);
518
- }
519
-
520
- function updateSelectionPaletteFromStorage() {
521
-
522
- if (localStorageKey && window.localStorage) {
523
-
524
- // Migrate old palettes over to new format. May want to remove this eventually.
525
- try {
526
- var oldPalette = window.localStorage[localStorageKey].split(",#");
527
- if (oldPalette.length > 1) {
528
- delete window.localStorage[localStorageKey];
529
- $.each(oldPalette, function(i, c) {
530
- addColorToSelectionPalette(c);
531
- });
532
- }
533
- }
534
- catch(e) { }
535
-
536
- try {
537
- selectionPalette = window.localStorage[localStorageKey].split(";");
538
- }
539
- catch (e) { }
540
- }
541
- }
542
-
543
- function addColorToSelectionPalette(color) {
544
- if (showSelectionPalette) {
545
- var rgb = tinycolor(color).toRgbString();
546
- if (!paletteLookup[rgb] && $.inArray(rgb, selectionPalette) === -1) {
547
- selectionPalette.push(rgb);
548
- while(selectionPalette.length > maxSelectionSize) {
549
- selectionPalette.shift();
550
- }
551
- }
552
-
553
- if (localStorageKey && window.localStorage) {
554
- try {
555
- window.localStorage[localStorageKey] = selectionPalette.join(";");
556
- }
557
- catch(e) { }
558
- }
559
- }
560
- }
561
-
562
- function getUniqueSelectionPalette() {
563
- var unique = [];
564
- if (opts.showPalette) {
565
- for (var i = 0; i < selectionPalette.length; i++) {
566
- var rgb = tinycolor(selectionPalette[i]).toRgbString();
567
-
568
- if (!paletteLookup[rgb]) {
569
- unique.push(selectionPalette[i]);
570
- }
571
- }
572
- }
573
-
574
- return unique.reverse().slice(0, opts.maxSelectionSize);
575
- }
576
-
577
- function drawPalette() {
578
-
579
- var currentColor = get();
580
-
581
- var html = $.map(paletteArray, function (palette, i) {
582
- return paletteTemplate(palette, currentColor, "sp-palette-row sp-palette-row-" + i, opts);
583
- });
584
-
585
- updateSelectionPaletteFromStorage();
586
-
587
- if (selectionPalette) {
588
- html.push(paletteTemplate(getUniqueSelectionPalette(), currentColor, "sp-palette-row sp-palette-row-selection", opts));
589
- }
590
-
591
- paletteContainer.html(html.join(""));
592
- }
593
-
594
- function drawInitial() {
595
- if (opts.showInitial) {
596
- var initial = colorOnShow;
597
- var current = get();
598
- initialColorContainer.html(paletteTemplate([initial, current], current, "sp-palette-row-initial", opts));
599
- }
600
- }
601
-
602
- function dragStart() {
603
- if (dragHeight <= 0 || dragWidth <= 0 || slideHeight <= 0) {
604
- reflow();
605
- }
606
- isDragging = true;
607
- container.addClass(draggingClass);
608
- shiftMovementDirection = null;
609
- boundElement.trigger('dragstart.spectrum', [ get() ]);
610
- }
611
-
612
- function dragStop() {
613
- isDragging = false;
614
- container.removeClass(draggingClass);
615
- boundElement.trigger('dragstop.spectrum', [ get() ]);
616
- }
617
-
618
- function setFromTextInput() {
619
-
620
- var value = textInput.val();
621
-
622
- if ((value === null || value === "") && allowEmpty) {
623
- set(null);
624
- updateOriginalInput(true);
625
- }
626
- else {
627
- var tiny = tinycolor(value);
628
- if (tiny.isValid()) {
629
- set(tiny);
630
- updateOriginalInput(true);
631
- }
632
- else {
633
- textInput.addClass("sp-validation-error");
634
- }
635
- }
636
- }
637
-
638
- function toggle() {
639
- if (visible) {
640
- hide();
641
- }
642
- else {
643
- show();
644
- }
645
- }
646
-
647
- function show() {
648
- var event = $.Event('beforeShow.spectrum');
649
-
650
- if (visible) {
651
- reflow();
652
- return;
653
- }
654
-
655
- boundElement.trigger(event, [ get() ]);
656
-
657
- if (callbacks.beforeShow(get()) === false || event.isDefaultPrevented()) {
658
- return;
659
- }
660
-
661
- hideAll();
662
- visible = true;
663
-
664
- $(doc).bind("keydown.spectrum", onkeydown);
665
- $(doc).bind("click.spectrum", clickout);
666
- $(window).bind("resize.spectrum", resize);
667
- replacer.addClass("sp-active");
668
- container.removeClass("sp-hidden");
669
-
670
- reflow();
671
- updateUI();
672
-
673
- colorOnShow = get();
674
-
675
- drawInitial();
676
- callbacks.show(colorOnShow);
677
- boundElement.trigger('show.spectrum', [ colorOnShow ]);
678
- }
679
-
680
- function onkeydown(e) {
681
- // Close on ESC
682
- if (e.keyCode === 27) {
683
- hide();
684
- }
685
- }
686
-
687
- function clickout(e) {
688
- // Return on right click.
689
- if (e.button == 2) { return; }
690
-
691
- // If a drag event was happening during the mouseup, don't hide
692
- // on click.
693
- if (isDragging) { return; }
694
-
695
- if (clickoutFiresChange) {
696
- updateOriginalInput(true);
697
- }
698
- else {
699
- revert();
700
- }
701
- hide();
702
- }
703
-
704
- function hide() {
705
- // Return if hiding is unnecessary
706
- if (!visible || flat) { return; }
707
- visible = false;
708
-
709
- $(doc).unbind("keydown.spectrum", onkeydown);
710
- $(doc).unbind("click.spectrum", clickout);
711
- $(window).unbind("resize.spectrum", resize);
712
-
713
- replacer.removeClass("sp-active");
714
- container.addClass("sp-hidden");
715
-
716
- callbacks.hide(get());
717
- boundElement.trigger('hide.spectrum', [ get() ]);
718
- }
719
-
720
- function revert() {
721
- set(colorOnShow, true);
722
- }
723
-
724
- function set(color, ignoreFormatChange) {
725
- if (tinycolor.equals(color, get())) {
726
- // Update UI just in case a validation error needs
727
- // to be cleared.
728
- updateUI();
729
- return;
730
- }
731
-
732
- var newColor, newHsv;
733
- if (!color && allowEmpty) {
734
- isEmpty = true;
735
- } else {
736
- isEmpty = false;
737
- newColor = tinycolor(color);
738
- newHsv = newColor.toHsv();
739
-
740
- currentHue = (newHsv.h % 360) / 360;
741
- currentSaturation = newHsv.s;
742
- currentValue = newHsv.v;
743
- currentAlpha = newHsv.a;
744
- }
745
- updateUI();
746
-
747
- if (newColor && newColor.isValid() && !ignoreFormatChange) {
748
- currentPreferredFormat = opts.preferredFormat || newColor.getFormat();
749
- }
750
- }
751
-
752
- function get(opts) {
753
- opts = opts || { };
754
-
755
- if (allowEmpty && isEmpty) {
756
- return null;
757
- }
758
-
759
- return tinycolor.fromRatio({
760
- h: currentHue,
761
- s: currentSaturation,
762
- v: currentValue,
763
- a: Math.round(currentAlpha * 100) / 100
764
- }, { format: opts.format || currentPreferredFormat });
765
- }
766
-
767
- function isValid() {
768
- return !textInput.hasClass("sp-validation-error");
769
- }
770
-
771
- function move() {
772
- updateUI();
773
-
774
- callbacks.move(get());
775
- boundElement.trigger('move.spectrum', [ get() ]);
776
- }
777
-
778
- function updateUI() {
779
-
780
- textInput.removeClass("sp-validation-error");
781
-
782
- updateHelperLocations();
783
-
784
- // Update dragger background color (gradients take care of saturation and value).
785
- var flatColor = tinycolor.fromRatio({ h: currentHue, s: 1, v: 1 });
786
- dragger.css("background-color", flatColor.toHexString());
787
-
788
- // Get a format that alpha will be included in (hex and names ignore alpha)
789
- var format = currentPreferredFormat;
790
- if (currentAlpha < 1 && !(currentAlpha === 0 && format === "name")) {
791
- if (format === "hex" || format === "hex3" || format === "hex6" || format === "name") {
792
- format = "rgb";
793
- }
794
- }
795
-
796
- var realColor = get({ format: format }),
797
- displayColor = '';
798
-
799
- //reset background info for preview element
800
- previewElement.removeClass("sp-clear-display");
801
- previewElement.css('background-color', 'transparent');
802
-
803
- if (!realColor && allowEmpty) {
804
- // Update the replaced elements background with icon indicating no color selection
805
- previewElement.addClass("sp-clear-display");
806
- }
807
- else {
808
- var realHex = realColor.toHexString(),
809
- realRgb = realColor.toRgbString();
810
-
811
- // Update the replaced elements background color (with actual selected color)
812
- if (rgbaSupport || realColor.alpha === 1) {
813
- previewElement.css("background-color", realRgb);
814
- }
815
- else {
816
- previewElement.css("background-color", "transparent");
817
- previewElement.css("filter", realColor.toFilter());
818
- }
819
-
820
- if (opts.showAlpha) {
821
- var rgb = realColor.toRgb();
822
- rgb.a = 0;
823
- var realAlpha = tinycolor(rgb).toRgbString();
824
- var gradient = "linear-gradient(left, " + realAlpha + ", " + realHex + ")";
825
-
826
- if (IE) {
827
- alphaSliderInner.css("filter", tinycolor(realAlpha).toFilter({ gradientType: 1 }, realHex));
828
- }
829
- else {
830
- alphaSliderInner.css("background", "-webkit-" + gradient);
831
- alphaSliderInner.css("background", "-moz-" + gradient);
832
- alphaSliderInner.css("background", "-ms-" + gradient);
833
- // Use current syntax gradient on unprefixed property.
834
- alphaSliderInner.css("background",
835
- "linear-gradient(to right, " + realAlpha + ", " + realHex + ")");
836
- }
837
- }
838
-
839
- displayColor = realColor.toString(format);
840
- }
841
-
842
- // Update the text entry input as it changes happen
843
- if (opts.showInput) {
844
- textInput.val(displayColor);
845
- }
846
-
847
- if (opts.showPalette) {
848
- drawPalette();
849
- }
850
-
851
- drawInitial();
852
- }
853
-
854
- function updateHelperLocations() {
855
- var s = currentSaturation;
856
- var v = currentValue;
857
-
858
- if(allowEmpty && isEmpty) {
859
- //if selected color is empty, hide the helpers
860
- alphaSlideHelper.hide();
861
- slideHelper.hide();
862
- dragHelper.hide();
863
- }
864
- else {
865
- //make sure helpers are visible
866
- alphaSlideHelper.show();
867
- slideHelper.show();
868
- dragHelper.show();
869
-
870
- // Where to show the little circle in that displays your current selected color
871
- var dragX = s * dragWidth;
872
- var dragY = dragHeight - (v * dragHeight);
873
- dragX = Math.max(
874
- -dragHelperHeight,
875
- Math.min(dragWidth - dragHelperHeight, dragX - dragHelperHeight)
876
- );
877
- dragY = Math.max(
878
- -dragHelperHeight,
879
- Math.min(dragHeight - dragHelperHeight, dragY - dragHelperHeight)
880
- );
881
- dragHelper.css({
882
- "top": dragY + "px",
883
- "left": dragX + "px"
884
- });
885
-
886
- var alphaX = currentAlpha * alphaWidth;
887
- alphaSlideHelper.css({
888
- "left": (alphaX - (alphaSlideHelperWidth / 2)) + "px"
889
- });
890
-
891
- // Where to show the bar that displays your current selected hue
892
- var slideY = (currentHue) * slideHeight;
893
- slideHelper.css({
894
- "top": (slideY - slideHelperHeight) + "px"
895
- });
896
- }
897
- }
898
-
899
- function updateOriginalInput(fireCallback) {
900
- var color = get(),
901
- displayColor = '',
902
- hasChanged = !tinycolor.equals(color, colorOnShow);
903
-
904
- if (color) {
905
- displayColor = color.toString(currentPreferredFormat);
906
- // Update the selection palette with the current color
907
- addColorToSelectionPalette(color);
908
- }
909
-
910
- if (isInput) {
911
- boundElement.val(displayColor);
912
- }
913
-
914
- if (fireCallback && hasChanged) {
915
- callbacks.change(color);
916
- boundElement.trigger('change', [ color ]);
917
- }
918
- }
919
-
920
- function reflow() {
921
- if (!visible) {
922
- return; // Calculations would be useless and wouldn't be reliable anyways
923
- }
924
- dragWidth = dragger.width();
925
- dragHeight = dragger.height();
926
- dragHelperHeight = dragHelper.height();
927
- slideWidth = slider.width();
928
- slideHeight = slider.height();
929
- slideHelperHeight = slideHelper.height();
930
- alphaWidth = alphaSlider.width();
931
- alphaSlideHelperWidth = alphaSlideHelper.width();
932
-
933
- if (!flat) {
934
- container.css("position", "absolute");
935
- if (opts.offset) {
936
- container.offset(opts.offset);
937
- } else {
938
- container.offset(getOffset(container, offsetElement));
939
- }
940
- }
941
-
942
- updateHelperLocations();
943
-
944
- if (opts.showPalette) {
945
- drawPalette();
946
- }
947
-
948
- boundElement.trigger('reflow.spectrum');
949
- }
950
-
951
- function destroy() {
952
- boundElement.show();
953
- offsetElement.unbind("click.spectrum touchstart.spectrum");
954
- container.remove();
955
- replacer.remove();
956
- spectrums[spect.id] = null;
957
- }
958
-
959
- function option(optionName, optionValue) {
960
- if (optionName === undefined) {
961
- return $.extend({}, opts);
962
- }
963
- if (optionValue === undefined) {
964
- return opts[optionName];
965
- }
966
-
967
- opts[optionName] = optionValue;
968
-
969
- if (optionName === "preferredFormat") {
970
- currentPreferredFormat = opts.preferredFormat;
971
- }
972
- applyOptions();
973
- }
974
-
975
- function enable() {
976
- disabled = false;
977
- boundElement.attr("disabled", false);
978
- offsetElement.removeClass("sp-disabled");
979
- }
980
-
981
- function disable() {
982
- hide();
983
- disabled = true;
984
- boundElement.attr("disabled", true);
985
- offsetElement.addClass("sp-disabled");
986
- }
987
-
988
- function setOffset(coord) {
989
- opts.offset = coord;
990
- reflow();
991
- }
992
-
993
- initialize();
994
-
995
- var spect = {
996
- show: show,
997
- hide: hide,
998
- toggle: toggle,
999
- reflow: reflow,
1000
- option: option,
1001
- enable: enable,
1002
- disable: disable,
1003
- offset: setOffset,
1004
- set: function (c) {
1005
- set(c);
1006
- updateOriginalInput();
1007
- },
1008
- get: get,
1009
- destroy: destroy,
1010
- container: container
1011
- };
1012
-
1013
- spect.id = spectrums.push(spect) - 1;
1014
-
1015
- return spect;
1016
- }
1017
-
1018
- /**
1019
- * checkOffset - get the offset below/above and left/right element depending on screen position
1020
- * Thanks https://github.com/jquery/jquery-ui/blob/master/ui/jquery.ui.datepicker.js
1021
- */
1022
- function getOffset(picker, input) {
1023
- var extraY = 0;
1024
- var dpWidth = picker.outerWidth();
1025
- var dpHeight = picker.outerHeight();
1026
- var inputHeight = input.outerHeight();
1027
- var doc = picker[0].ownerDocument;
1028
- var docElem = doc.documentElement;
1029
- var viewWidth = docElem.clientWidth + $(doc).scrollLeft();
1030
- var viewHeight = docElem.clientHeight + $(doc).scrollTop();
1031
- var offset = input.offset();
1032
- offset.top += inputHeight;
1033
-
1034
- offset.left -=
1035
- Math.min(offset.left, (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ?
1036
- Math.abs(offset.left + dpWidth - viewWidth) : 0);
1037
-
1038
- offset.top -=
1039
- Math.min(offset.top, ((offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ?
1040
- Math.abs(dpHeight + inputHeight - extraY) : extraY));
1041
-
1042
- return offset;
1043
- }
1044
-
1045
- /**
1046
- * noop - do nothing
1047
- */
1048
- function noop() {
1049
-
1050
- }
1051
-
1052
- /**
1053
- * stopPropagation - makes the code only doing this a little easier to read in line
1054
- */
1055
- function stopPropagation(e) {
1056
- e.stopPropagation();
1057
- }
1058
-
1059
- /**
1060
- * Create a function bound to a given object
1061
- * Thanks to underscore.js
1062
- */
1063
- function bind(func, obj) {
1064
- var slice = Array.prototype.slice;
1065
- var args = slice.call(arguments, 2);
1066
- return function () {
1067
- return func.apply(obj, args.concat(slice.call(arguments)));
1068
- };
1069
- }
1070
-
1071
- /**
1072
- * Lightweight drag helper. Handles containment within the element, so that
1073
- * when dragging, the x is within [0,element.width] and y is within [0,element.height]
1074
- */
1075
- function draggable(element, onmove, onstart, onstop) {
1076
- onmove = onmove || function () { };
1077
- onstart = onstart || function () { };
1078
- onstop = onstop || function () { };
1079
- var doc = document;
1080
- var dragging = false;
1081
- var offset = {};
1082
- var maxHeight = 0;
1083
- var maxWidth = 0;
1084
- var hasTouch = ('ontouchstart' in window);
1085
-
1086
- var duringDragEvents = {};
1087
- duringDragEvents["selectstart"] = prevent;
1088
- duringDragEvents["dragstart"] = prevent;
1089
- duringDragEvents["touchmove mousemove"] = move;
1090
- duringDragEvents["touchend mouseup"] = stop;
1091
-
1092
- function prevent(e) {
1093
- if (e.stopPropagation) {
1094
- e.stopPropagation();
1095
- }
1096
- if (e.preventDefault) {
1097
- e.preventDefault();
1098
- }
1099
- e.returnValue = false;
1100
- }
1101
-
1102
- function move(e) {
1103
- if (dragging) {
1104
- // Mouseup happened outside of window
1105
- if (IE && doc.documentMode < 9 && !e.button) {
1106
- return stop();
1107
- }
1108
-
1109
- var t0 = e.originalEvent && e.originalEvent.touches && e.originalEvent.touches[0];
1110
- var pageX = t0 && t0.pageX || e.pageX;
1111
- var pageY = t0 && t0.pageY || e.pageY;
1112
-
1113
- var dragX = Math.max(0, Math.min(pageX - offset.left, maxWidth));
1114
- var dragY = Math.max(0, Math.min(pageY - offset.top, maxHeight));
1115
-
1116
- if (hasTouch) {
1117
- // Stop scrolling in iOS
1118
- prevent(e);
1119
- }
1120
-
1121
- onmove.apply(element, [dragX, dragY, e]);
1122
- }
1123
- }
1124
-
1125
- function start(e) {
1126
- var rightclick = (e.which) ? (e.which == 3) : (e.button == 2);
1127
-
1128
- if (!rightclick && !dragging) {
1129
- if (onstart.apply(element, arguments) !== false) {
1130
- dragging = true;
1131
- maxHeight = $(element).height();
1132
- maxWidth = $(element).width();
1133
- offset = $(element).offset();
1134
-
1135
- $(doc).bind(duringDragEvents);
1136
- $(doc.body).addClass("sp-dragging");
1137
-
1138
- move(e);
1139
-
1140
- prevent(e);
1141
- }
1142
- }
1143
- }
1144
-
1145
- function stop() {
1146
- if (dragging) {
1147
- $(doc).unbind(duringDragEvents);
1148
- $(doc.body).removeClass("sp-dragging");
1149
-
1150
- // Wait a tick before notifying observers to allow the click event
1151
- // to fire in Chrome.
1152
- setTimeout(function() {
1153
- onstop.apply(element, arguments);
1154
- }, 0);
1155
- }
1156
- dragging = false;
1157
- }
1158
-
1159
- $(element).bind("touchstart mousedown", start);
1160
- }
1161
-
1162
- function throttle(func, wait, debounce) {
1163
- var timeout;
1164
- return function () {
1165
- var context = this, args = arguments;
1166
- var throttler = function () {
1167
- timeout = null;
1168
- func.apply(context, args);
1169
- };
1170
- if (debounce) clearTimeout(timeout);
1171
- if (debounce || !timeout) timeout = setTimeout(throttler, wait);
1172
- };
1173
- }
1174
-
1175
- function inputTypeColorSupport() {
1176
- return $.fn.spectrum.inputTypeColorSupport();
1177
- }
1178
-
1179
- /**
1180
- * Define a jQuery plugin
1181
- */
1182
- var dataID = "spectrum.id";
1183
- $.fn.spectrum = function (opts, extra) {
1184
-
1185
- if (typeof opts == "string") {
1186
-
1187
- var returnValue = this;
1188
- var args = Array.prototype.slice.call( arguments, 1 );
1189
-
1190
- this.each(function () {
1191
- var spect = spectrums[$(this).data(dataID)];
1192
- if (spect) {
1193
- var method = spect[opts];
1194
- if (!method) {
1195
- throw new Error( "Spectrum: no such method: '" + opts + "'" );
1196
- }
1197
-
1198
- if (opts == "get") {
1199
- returnValue = spect.get();
1200
- }
1201
- else if (opts == "container") {
1202
- returnValue = spect.container;
1203
- }
1204
- else if (opts == "option") {
1205
- returnValue = spect.option.apply(spect, args);
1206
- }
1207
- else if (opts == "destroy") {
1208
- spect.destroy();
1209
- $(this).removeData(dataID);
1210
- }
1211
- else {
1212
- method.apply(spect, args);
1213
- }
1214
- }
1215
- });
1216
-
1217
- return returnValue;
1218
- }
1219
-
1220
- // Initializing a new instance of spectrum
1221
- return this.spectrum("destroy").each(function () {
1222
- var options = $.extend({}, opts, $(this).data());
1223
- var spect = spectrum(this, options);
1224
- $(this).data(dataID, spect.id);
1225
- });
1226
- };
1227
-
1228
- $.fn.spectrum.load = true;
1229
- $.fn.spectrum.loadOpts = {};
1230
- $.fn.spectrum.draggable = draggable;
1231
- $.fn.spectrum.defaults = defaultOpts;
1232
- $.fn.spectrum.inputTypeColorSupport = function inputTypeColorSupport() {
1233
- if (typeof inputTypeColorSupport._cachedResult === "undefined") {
1234
- var colorInput = $("<input type='color'/>")[0]; // if color element is supported, value will default to not null
1235
- inputTypeColorSupport._cachedResult = colorInput.type === "color" && colorInput.value !== "";
1236
- }
1237
- return inputTypeColorSupport._cachedResult;
1238
- };
1239
-
1240
- $.spectrum = { };
1241
- $.spectrum.localization = { };
1242
- $.spectrum.palettes = { };
1243
-
1244
- $.fn.spectrum.processNativeColorInputs = function () {
1245
- var colorInputs = $("input[type=color]");
1246
- if (colorInputs.length && !inputTypeColorSupport()) {
1247
- colorInputs.spectrum({
1248
- preferredFormat: "hex6"
1249
- });
1250
- }
1251
- };
1252
-
1253
- // TinyColor v1.1.2
1254
- // https://github.com/bgrins/TinyColor
1255
- // Brian Grinstead, MIT License
1256
-
1257
- (function() {
1258
-
1259
- var trimLeft = /^[\s,#]+/,
1260
- trimRight = /\s+$/,
1261
- tinyCounter = 0,
1262
- math = Math,
1263
- mathRound = math.round,
1264
- mathMin = math.min,
1265
- mathMax = math.max,
1266
- mathRandom = math.random;
1267
-
1268
- var tinycolor = function(color, opts) {
1269
-
1270
- color = (color) ? color : '';
1271
- opts = opts || { };
1272
-
1273
- // If input is already a tinycolor, return itself
1274
- if (color instanceof tinycolor) {
1275
- return color;
1276
- }
1277
- // If we are called as a function, call using new instead
1278
- if (!(this instanceof tinycolor)) {
1279
- return new tinycolor(color, opts);
1280
- }
1281
-
1282
- var rgb = inputToRGB(color);
1283
- this._originalInput = color,
1284
- this._r = rgb.r,
1285
- this._g = rgb.g,
1286
- this._b = rgb.b,
1287
- this._a = rgb.a,
1288
- this._roundA = mathRound(100*this._a) / 100,
1289
- this._format = opts.format || rgb.format;
1290
- this._gradientType = opts.gradientType;
1291
-
1292
- // Don't let the range of [0,255] come back in [0,1].
1293
- // Potentially lose a little bit of precision here, but will fix issues where
1294
- // .5 gets interpreted as half of the total, instead of half of 1
1295
- // If it was supposed to be 128, this was already taken care of by `inputToRgb`
1296
- if (this._r < 1) { this._r = mathRound(this._r); }
1297
- if (this._g < 1) { this._g = mathRound(this._g); }
1298
- if (this._b < 1) { this._b = mathRound(this._b); }
1299
-
1300
- this._ok = rgb.ok;
1301
- this._tc_id = tinyCounter++;
1302
- };
1303
-
1304
- tinycolor.prototype = {
1305
- isDark: function() {
1306
- return this.getBrightness() < 128;
1307
- },
1308
- isLight: function() {
1309
- return !this.isDark();
1310
- },
1311
- isValid: function() {
1312
- return this._ok;
1313
- },
1314
- getOriginalInput: function() {
1315
- return this._originalInput;
1316
- },
1317
- getFormat: function() {
1318
- return this._format;
1319
- },
1320
- getAlpha: function() {
1321
- return this._a;
1322
- },
1323
- getBrightness: function() {
1324
- var rgb = this.toRgb();
1325
- return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;
1326
- },
1327
- setAlpha: function(value) {
1328
- this._a = boundAlpha(value);
1329
- this._roundA = mathRound(100*this._a) / 100;
1330
- return this;
1331
- },
1332
- toHsv: function() {
1333
- var hsv = rgbToHsv(this._r, this._g, this._b);
1334
- return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this._a };
1335
- },
1336
- toHsvString: function() {
1337
- var hsv = rgbToHsv(this._r, this._g, this._b);
1338
- var h = mathRound(hsv.h * 360), s = mathRound(hsv.s * 100), v = mathRound(hsv.v * 100);
1339
- return (this._a == 1) ?
1340
- "hsv(" + h + ", " + s + "%, " + v + "%)" :
1341
- "hsva(" + h + ", " + s + "%, " + v + "%, "+ this._roundA + ")";
1342
- },
1343
- toHsl: function() {
1344
- var hsl = rgbToHsl(this._r, this._g, this._b);
1345
- return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this._a };
1346
- },
1347
- toHslString: function() {
1348
- var hsl = rgbToHsl(this._r, this._g, this._b);
1349
- var h = mathRound(hsl.h * 360), s = mathRound(hsl.s * 100), l = mathRound(hsl.l * 100);
1350
- return (this._a == 1) ?
1351
- "hsl(" + h + ", " + s + "%, " + l + "%)" :
1352
- "hsla(" + h + ", " + s + "%, " + l + "%, "+ this._roundA + ")";
1353
- },
1354
- toHex: function(allow3Char) {
1355
- return rgbToHex(this._r, this._g, this._b, allow3Char);
1356
- },
1357
- toHexString: function(allow3Char) {
1358
- return '#' + this.toHex(allow3Char);
1359
- },
1360
- toHex8: function() {
1361
- return rgbaToHex(this._r, this._g, this._b, this._a);
1362
- },
1363
- toHex8String: function() {
1364
- return '#' + this.toHex8();
1365
- },
1366
- toRgb: function() {
1367
- return { r: mathRound(this._r), g: mathRound(this._g), b: mathRound(this._b), a: this._a };
1368
- },
1369
- toRgbString: function() {
1370
- return (this._a == 1) ?
1371
- "rgb(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ")" :
1372
- "rgba(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ", " + this._roundA + ")";
1373
- },
1374
- toPercentageRgb: function() {
1375
- return { r: mathRound(bound01(this._r, 255) * 100) + "%", g: mathRound(bound01(this._g, 255) * 100) + "%", b: mathRound(bound01(this._b, 255) * 100) + "%", a: this._a };
1376
- },
1377
- toPercentageRgbString: function() {
1378
- return (this._a == 1) ?
1379
- "rgb(" + mathRound(bound01(this._r, 255) * 100) + "%, " + mathRound(bound01(this._g, 255) * 100) + "%, " + mathRound(bound01(this._b, 255) * 100) + "%)" :
1380
- "rgba(" + mathRound(bound01(this._r, 255) * 100) + "%, " + mathRound(bound01(this._g, 255) * 100) + "%, " + mathRound(bound01(this._b, 255) * 100) + "%, " + this._roundA + ")";
1381
- },
1382
- toName: function() {
1383
- if (this._a === 0) {
1384
- return "transparent";
1385
- }
1386
-
1387
- if (this._a < 1) {
1388
- return false;
1389
- }
1390
-
1391
- return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false;
1392
- },
1393
- toFilter: function(secondColor) {
1394
- var hex8String = '#' + rgbaToHex(this._r, this._g, this._b, this._a);
1395
- var secondHex8String = hex8String;
1396
- var gradientType = this._gradientType ? "GradientType = 1, " : "";
1397
-
1398
- if (secondColor) {
1399
- var s = tinycolor(secondColor);
1400
- secondHex8String = s.toHex8String();
1401
- }
1402
-
1403
- return "progid:DXImageTransform.Microsoft.gradient("+gradientType+"startColorstr="+hex8String+",endColorstr="+secondHex8String+")";
1404
- },
1405
- toString: function(format) {
1406
- var formatSet = !!format;
1407
- format = format || this._format;
1408
-
1409
- var formattedString = false;
1410
- var hasAlpha = this._a < 1 && this._a >= 0;
1411
- var needsAlphaFormat = !formatSet && hasAlpha && (format === "hex" || format === "hex6" || format === "hex3" || format === "name");
1412
-
1413
- if (needsAlphaFormat) {
1414
- // Special case for "transparent", all other non-alpha formats
1415
- // will return rgba when there is transparency.
1416
- if (format === "name" && this._a === 0) {
1417
- return this.toName();
1418
- }
1419
- return this.toRgbString();
1420
- }
1421
- if (format === "rgb") {
1422
- formattedString = this.toRgbString();
1423
- }
1424
- if (format === "prgb") {
1425
- formattedString = this.toPercentageRgbString();
1426
- }
1427
- if (format === "hex" || format === "hex6") {
1428
- formattedString = this.toHexString();
1429
- }
1430
- if (format === "hex3") {
1431
- formattedString = this.toHexString(true);
1432
- }
1433
- if (format === "hex8") {
1434
- formattedString = this.toHex8String();
1435
- }
1436
- if (format === "name") {
1437
- formattedString = this.toName();
1438
- }
1439
- if (format === "hsl") {
1440
- formattedString = this.toHslString();
1441
- }
1442
- if (format === "hsv") {
1443
- formattedString = this.toHsvString();
1444
- }
1445
-
1446
- return formattedString || this.toHexString();
1447
- },
1448
-
1449
- _applyModification: function(fn, args) {
1450
- var color = fn.apply(null, [this].concat([].slice.call(args)));
1451
- this._r = color._r;
1452
- this._g = color._g;
1453
- this._b = color._b;
1454
- this.setAlpha(color._a);
1455
- return this;
1456
- },
1457
- lighten: function() {
1458
- return this._applyModification(lighten, arguments);
1459
- },
1460
- brighten: function() {
1461
- return this._applyModification(brighten, arguments);
1462
- },
1463
- darken: function() {
1464
- return this._applyModification(darken, arguments);
1465
- },
1466
- desaturate: function() {
1467
- return this._applyModification(desaturate, arguments);
1468
- },
1469
- saturate: function() {
1470
- return this._applyModification(saturate, arguments);
1471
- },
1472
- greyscale: function() {
1473
- return this._applyModification(greyscale, arguments);
1474
- },
1475
- spin: function() {
1476
- return this._applyModification(spin, arguments);
1477
- },
1478
-
1479
- _applyCombination: function(fn, args) {
1480
- return fn.apply(null, [this].concat([].slice.call(args)));
1481
- },
1482
- analogous: function() {
1483
- return this._applyCombination(analogous, arguments);
1484
- },
1485
- complement: function() {
1486
- return this._applyCombination(complement, arguments);
1487
- },
1488
- monochromatic: function() {
1489
- return this._applyCombination(monochromatic, arguments);
1490
- },
1491
- splitcomplement: function() {
1492
- return this._applyCombination(splitcomplement, arguments);
1493
- },
1494
- triad: function() {
1495
- return this._applyCombination(triad, arguments);
1496
- },
1497
- tetrad: function() {
1498
- return this._applyCombination(tetrad, arguments);
1499
- }
1500
- };
1501
-
1502
- // If input is an object, force 1 into "1.0" to handle ratios properly
1503
- // String input requires "1.0" as input, so 1 will be treated as 1
1504
- tinycolor.fromRatio = function(color, opts) {
1505
- if (typeof color == "object") {
1506
- var newColor = {};
1507
- for (var i in color) {
1508
- if (color.hasOwnProperty(i)) {
1509
- if (i === "a") {
1510
- newColor[i] = color[i];
1511
- }
1512
- else {
1513
- newColor[i] = convertToPercentage(color[i]);
1514
- }
1515
- }
1516
- }
1517
- color = newColor;
1518
- }
1519
-
1520
- return tinycolor(color, opts);
1521
- };
1522
-
1523
- // Given a string or object, convert that input to RGB
1524
- // Possible string inputs:
1525
- //
1526
- // "red"
1527
- // "#f00" or "f00"
1528
- // "#ff0000" or "ff0000"
1529
- // "#ff000000" or "ff000000"
1530
- // "rgb 255 0 0" or "rgb (255, 0, 0)"
1531
- // "rgb 1.0 0 0" or "rgb (1, 0, 0)"
1532
- // "rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1"
1533
- // "rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1"
1534
- // "hsl(0, 100%, 50%)" or "hsl 0 100% 50%"
1535
- // "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1"
1536
- // "hsv(0, 100%, 100%)" or "hsv 0 100% 100%"
1537
- //
1538
- function inputToRGB(color) {
1539
-
1540
- var rgb = { r: 0, g: 0, b: 0 };
1541
- var a = 1;
1542
- var ok = false;
1543
- var format = false;
1544
-
1545
- if (typeof color == "string") {
1546
- color = stringInputToObject(color);
1547
- }
1548
-
1549
- if (typeof color == "object") {
1550
- if (color.hasOwnProperty("r") && color.hasOwnProperty("g") && color.hasOwnProperty("b")) {
1551
- rgb = rgbToRgb(color.r, color.g, color.b);
1552
- ok = true;
1553
- format = String(color.r).substr(-1) === "%" ? "prgb" : "rgb";
1554
- }
1555
- else if (color.hasOwnProperty("h") && color.hasOwnProperty("s") && color.hasOwnProperty("v")) {
1556
- color.s = convertToPercentage(color.s);
1557
- color.v = convertToPercentage(color.v);
1558
- rgb = hsvToRgb(color.h, color.s, color.v);
1559
- ok = true;
1560
- format = "hsv";
1561
- }
1562
- else if (color.hasOwnProperty("h") && color.hasOwnProperty("s") && color.hasOwnProperty("l")) {
1563
- color.s = convertToPercentage(color.s);
1564
- color.l = convertToPercentage(color.l);
1565
- rgb = hslToRgb(color.h, color.s, color.l);
1566
- ok = true;
1567
- format = "hsl";
1568
- }
1569
-
1570
- if (color.hasOwnProperty("a")) {
1571
- a = color.a;
1572
- }
1573
- }
1574
-
1575
- a = boundAlpha(a);
1576
-
1577
- return {
1578
- ok: ok,
1579
- format: color.format || format,
1580
- r: mathMin(255, mathMax(rgb.r, 0)),
1581
- g: mathMin(255, mathMax(rgb.g, 0)),
1582
- b: mathMin(255, mathMax(rgb.b, 0)),
1583
- a: a
1584
- };
1585
- }
1586
-
1587
-
1588
- // Conversion Functions
1589
- // --------------------
1590
-
1591
- // `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:
1592
- // <http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript>
1593
-
1594
- // `rgbToRgb`
1595
- // Handle bounds / percentage checking to conform to CSS color spec
1596
- // <http://www.w3.org/TR/css3-color/>
1597
- // *Assumes:* r, g, b in [0, 255] or [0, 1]
1598
- // *Returns:* { r, g, b } in [0, 255]
1599
- function rgbToRgb(r, g, b){
1600
- return {
1601
- r: bound01(r, 255) * 255,
1602
- g: bound01(g, 255) * 255,
1603
- b: bound01(b, 255) * 255
1604
- };
1605
- }
1606
-
1607
- // `rgbToHsl`
1608
- // Converts an RGB color value to HSL.
1609
- // *Assumes:* r, g, and b are contained in [0, 255] or [0, 1]
1610
- // *Returns:* { h, s, l } in [0,1]
1611
- function rgbToHsl(r, g, b) {
1612
-
1613
- r = bound01(r, 255);
1614
- g = bound01(g, 255);
1615
- b = bound01(b, 255);
1616
-
1617
- var max = mathMax(r, g, b), min = mathMin(r, g, b);
1618
- var h, s, l = (max + min) / 2;
1619
-
1620
- if(max == min) {
1621
- h = s = 0; // achromatic
1622
- }
1623
- else {
1624
- var d = max - min;
1625
- s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
1626
- switch(max) {
1627
- case r: h = (g - b) / d + (g < b ? 6 : 0); break;
1628
- case g: h = (b - r) / d + 2; break;
1629
- case b: h = (r - g) / d + 4; break;
1630
- }
1631
-
1632
- h /= 6;
1633
- }
1634
-
1635
- return { h: h, s: s, l: l };
1636
- }
1637
-
1638
- // `hslToRgb`
1639
- // Converts an HSL color value to RGB.
1640
- // *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]
1641
- // *Returns:* { r, g, b } in the set [0, 255]
1642
- function hslToRgb(h, s, l) {
1643
- var r, g, b;
1644
-
1645
- h = bound01(h, 360);
1646
- s = bound01(s, 100);
1647
- l = bound01(l, 100);
1648
-
1649
- function hue2rgb(p, q, t) {
1650
- if(t < 0) t += 1;
1651
- if(t > 1) t -= 1;
1652
- if(t < 1/6) return p + (q - p) * 6 * t;
1653
- if(t < 1/2) return q;
1654
- if(t < 2/3) return p + (q - p) * (2/3 - t) * 6;
1655
- return p;
1656
- }
1657
-
1658
- if(s === 0) {
1659
- r = g = b = l; // achromatic
1660
- }
1661
- else {
1662
- var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
1663
- var p = 2 * l - q;
1664
- r = hue2rgb(p, q, h + 1/3);
1665
- g = hue2rgb(p, q, h);
1666
- b = hue2rgb(p, q, h - 1/3);
1667
- }
1668
-
1669
- return { r: r * 255, g: g * 255, b: b * 255 };
1670
- }
1671
-
1672
- // `rgbToHsv`
1673
- // Converts an RGB color value to HSV
1674
- // *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]
1675
- // *Returns:* { h, s, v } in [0,1]
1676
- function rgbToHsv(r, g, b) {
1677
-
1678
- r = bound01(r, 255);
1679
- g = bound01(g, 255);
1680
- b = bound01(b, 255);
1681
-
1682
- var max = mathMax(r, g, b), min = mathMin(r, g, b);
1683
- var h, s, v = max;
1684
-
1685
- var d = max - min;
1686
- s = max === 0 ? 0 : d / max;
1687
-
1688
- if(max == min) {
1689
- h = 0; // achromatic
1690
- }
1691
- else {
1692
- switch(max) {
1693
- case r: h = (g - b) / d + (g < b ? 6 : 0); break;
1694
- case g: h = (b - r) / d + 2; break;
1695
- case b: h = (r - g) / d + 4; break;
1696
- }
1697
- h /= 6;
1698
- }
1699
- return { h: h, s: s, v: v };
1700
- }
1701
-
1702
- // `hsvToRgb`
1703
- // Converts an HSV color value to RGB.
1704
- // *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]
1705
- // *Returns:* { r, g, b } in the set [0, 255]
1706
- function hsvToRgb(h, s, v) {
1707
-
1708
- h = bound01(h, 360) * 6;
1709
- s = bound01(s, 100);
1710
- v = bound01(v, 100);
1711
-
1712
- var i = math.floor(h),
1713
- f = h - i,
1714
- p = v * (1 - s),
1715
- q = v * (1 - f * s),
1716
- t = v * (1 - (1 - f) * s),
1717
- mod = i % 6,
1718
- r = [v, q, p, p, t, v][mod],
1719
- g = [t, v, v, q, p, p][mod],
1720
- b = [p, p, t, v, v, q][mod];
1721
-
1722
- return { r: r * 255, g: g * 255, b: b * 255 };
1723
- }
1724
-
1725
- // `rgbToHex`
1726
- // Converts an RGB color to hex
1727
- // Assumes r, g, and b are contained in the set [0, 255]
1728
- // Returns a 3 or 6 character hex
1729
- function rgbToHex(r, g, b, allow3Char) {
1730
-
1731
- var hex = [
1732
- pad2(mathRound(r).toString(16)),
1733
- pad2(mathRound(g).toString(16)),
1734
- pad2(mathRound(b).toString(16))
1735
- ];
1736
-
1737
- // Return a 3 character hex if possible
1738
- if (allow3Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1)) {
1739
- return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
1740
- }
1741
-
1742
- return hex.join("");
1743
- }
1744
- // `rgbaToHex`
1745
- // Converts an RGBA color plus alpha transparency to hex
1746
- // Assumes r, g, b and a are contained in the set [0, 255]
1747
- // Returns an 8 character hex
1748
- function rgbaToHex(r, g, b, a) {
1749
-
1750
- var hex = [
1751
- pad2(convertDecimalToHex(a)),
1752
- pad2(mathRound(r).toString(16)),
1753
- pad2(mathRound(g).toString(16)),
1754
- pad2(mathRound(b).toString(16))
1755
- ];
1756
-
1757
- return hex.join("");
1758
- }
1759
-
1760
- // `equals`
1761
- // Can be called with any tinycolor input
1762
- tinycolor.equals = function (color1, color2) {
1763
- if (!color1 || !color2) { return false; }
1764
- return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString();
1765
- };
1766
- tinycolor.random = function() {
1767
- return tinycolor.fromRatio({
1768
- r: mathRandom(),
1769
- g: mathRandom(),
1770
- b: mathRandom()
1771
- });
1772
- };
1773
-
1774
-
1775
- // Modification Functions
1776
- // ----------------------
1777
- // Thanks to less.js for some of the basics here
1778
- // <https://github.com/cloudhead/less.js/blob/master/lib/less/functions.js>
1779
-
1780
- function desaturate(color, amount) {
1781
- amount = (amount === 0) ? 0 : (amount || 10);
1782
- var hsl = tinycolor(color).toHsl();
1783
- hsl.s -= amount / 100;
1784
- hsl.s = clamp01(hsl.s);
1785
- return tinycolor(hsl);
1786
- }
1787
-
1788
- function saturate(color, amount) {
1789
- amount = (amount === 0) ? 0 : (amount || 10);
1790
- var hsl = tinycolor(color).toHsl();
1791
- hsl.s += amount / 100;
1792
- hsl.s = clamp01(hsl.s);
1793
- return tinycolor(hsl);
1794
- }
1795
-
1796
- function greyscale(color) {
1797
- return tinycolor(color).desaturate(100);
1798
- }
1799
-
1800
- function lighten (color, amount) {
1801
- amount = (amount === 0) ? 0 : (amount || 10);
1802
- var hsl = tinycolor(color).toHsl();
1803
- hsl.l += amount / 100;
1804
- hsl.l = clamp01(hsl.l);
1805
- return tinycolor(hsl);
1806
- }
1807
-
1808
- function brighten(color, amount) {
1809
- amount = (amount === 0) ? 0 : (amount || 10);
1810
- var rgb = tinycolor(color).toRgb();
1811
- rgb.r = mathMax(0, mathMin(255, rgb.r - mathRound(255 * - (amount / 100))));
1812
- rgb.g = mathMax(0, mathMin(255, rgb.g - mathRound(255 * - (amount / 100))));
1813
- rgb.b = mathMax(0, mathMin(255, rgb.b - mathRound(255 * - (amount / 100))));
1814
- return tinycolor(rgb);
1815
- }
1816
-
1817
- function darken (color, amount) {
1818
- amount = (amount === 0) ? 0 : (amount || 10);
1819
- var hsl = tinycolor(color).toHsl();
1820
- hsl.l -= amount / 100;
1821
- hsl.l = clamp01(hsl.l);
1822
- return tinycolor(hsl);
1823
- }
1824
-
1825
- // Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.
1826
- // Values outside of this range will be wrapped into this range.
1827
- function spin(color, amount) {
1828
- var hsl = tinycolor(color).toHsl();
1829
- var hue = (mathRound(hsl.h) + amount) % 360;
1830
- hsl.h = hue < 0 ? 360 + hue : hue;
1831
- return tinycolor(hsl);
1832
- }
1833
-
1834
- // Combination Functions
1835
- // ---------------------
1836
- // Thanks to jQuery xColor for some of the ideas behind these
1837
- // <https://github.com/infusion/jQuery-xcolor/blob/master/jquery.xcolor.js>
1838
-
1839
- function complement(color) {
1840
- var hsl = tinycolor(color).toHsl();
1841
- hsl.h = (hsl.h + 180) % 360;
1842
- return tinycolor(hsl);
1843
- }
1844
-
1845
- function triad(color) {
1846
- var hsl = tinycolor(color).toHsl();
1847
- var h = hsl.h;
1848
- return [
1849
- tinycolor(color),
1850
- tinycolor({ h: (h + 120) % 360, s: hsl.s, l: hsl.l }),
1851
- tinycolor({ h: (h + 240) % 360, s: hsl.s, l: hsl.l })
1852
- ];
1853
- }
1854
-
1855
- function tetrad(color) {
1856
- var hsl = tinycolor(color).toHsl();
1857
- var h = hsl.h;
1858
- return [
1859
- tinycolor(color),
1860
- tinycolor({ h: (h + 90) % 360, s: hsl.s, l: hsl.l }),
1861
- tinycolor({ h: (h + 180) % 360, s: hsl.s, l: hsl.l }),
1862
- tinycolor({ h: (h + 270) % 360, s: hsl.s, l: hsl.l })
1863
- ];
1864
- }
1865
-
1866
- function splitcomplement(color) {
1867
- var hsl = tinycolor(color).toHsl();
1868
- var h = hsl.h;
1869
- return [
1870
- tinycolor(color),
1871
- tinycolor({ h: (h + 72) % 360, s: hsl.s, l: hsl.l}),
1872
- tinycolor({ h: (h + 216) % 360, s: hsl.s, l: hsl.l})
1873
- ];
1874
- }
1875
-
1876
- function analogous(color, results, slices) {
1877
- results = results || 6;
1878
- slices = slices || 30;
1879
-
1880
- var hsl = tinycolor(color).toHsl();
1881
- var part = 360 / slices;
1882
- var ret = [tinycolor(color)];
1883
-
1884
- for (hsl.h = ((hsl.h - (part * results >> 1)) + 720) % 360; --results; ) {
1885
- hsl.h = (hsl.h + part) % 360;
1886
- ret.push(tinycolor(hsl));
1887
- }
1888
- return ret;
1889
- }
1890
-
1891
- function monochromatic(color, results) {
1892
- results = results || 6;
1893
- var hsv = tinycolor(color).toHsv();
1894
- var h = hsv.h, s = hsv.s, v = hsv.v;
1895
- var ret = [];
1896
- var modification = 1 / results;
1897
-
1898
- while (results--) {
1899
- ret.push(tinycolor({ h: h, s: s, v: v}));
1900
- v = (v + modification) % 1;
1901
- }
1902
-
1903
- return ret;
1904
- }
1905
-
1906
- // Utility Functions
1907
- // ---------------------
1908
-
1909
- tinycolor.mix = function(color1, color2, amount) {
1910
- amount = (amount === 0) ? 0 : (amount || 50);
1911
-
1912
- var rgb1 = tinycolor(color1).toRgb();
1913
- var rgb2 = tinycolor(color2).toRgb();
1914
-
1915
- var p = amount / 100;
1916
- var w = p * 2 - 1;
1917
- var a = rgb2.a - rgb1.a;
1918
-
1919
- var w1;
1920
-
1921
- if (w * a == -1) {
1922
- w1 = w;
1923
- } else {
1924
- w1 = (w + a) / (1 + w * a);
1925
- }
1926
-
1927
- w1 = (w1 + 1) / 2;
1928
-
1929
- var w2 = 1 - w1;
1930
-
1931
- var rgba = {
1932
- r: rgb2.r * w1 + rgb1.r * w2,
1933
- g: rgb2.g * w1 + rgb1.g * w2,
1934
- b: rgb2.b * w1 + rgb1.b * w2,
1935
- a: rgb2.a * p + rgb1.a * (1 - p)
1936
- };
1937
-
1938
- return tinycolor(rgba);
1939
- };
1940
-
1941
-
1942
- // Readability Functions
1943
- // ---------------------
1944
- // <http://www.w3.org/TR/AERT#color-contrast>
1945
-
1946
- // `readability`
1947
- // Analyze the 2 colors and returns an object with the following properties:
1948
- // `brightness`: difference in brightness between the two colors
1949
- // `color`: difference in color/hue between the two colors
1950
- tinycolor.readability = function(color1, color2) {
1951
- var c1 = tinycolor(color1);
1952
- var c2 = tinycolor(color2);
1953
- var rgb1 = c1.toRgb();
1954
- var rgb2 = c2.toRgb();
1955
- var brightnessA = c1.getBrightness();
1956
- var brightnessB = c2.getBrightness();
1957
- var colorDiff = (
1958
- Math.max(rgb1.r, rgb2.r) - Math.min(rgb1.r, rgb2.r) +
1959
- Math.max(rgb1.g, rgb2.g) - Math.min(rgb1.g, rgb2.g) +
1960
- Math.max(rgb1.b, rgb2.b) - Math.min(rgb1.b, rgb2.b)
1961
- );
1962
-
1963
- return {
1964
- brightness: Math.abs(brightnessA - brightnessB),
1965
- color: colorDiff
1966
- };
1967
- };
1968
-
1969
- // `readable`
1970
- // http://www.w3.org/TR/AERT#color-contrast
1971
- // Ensure that foreground and background color combinations provide sufficient contrast.
1972
- // *Example*
1973
- // tinycolor.isReadable("#000", "#111") => false
1974
- tinycolor.isReadable = function(color1, color2) {
1975
- var readability = tinycolor.readability(color1, color2);
1976
- return readability.brightness > 125 && readability.color > 500;
1977
- };
1978
-
1979
- // `mostReadable`
1980
- // Given a base color and a list of possible foreground or background
1981
- // colors for that base, returns the most readable color.
1982
- // *Example*
1983
- // tinycolor.mostReadable("#123", ["#fff", "#000"]) => "#000"
1984
- tinycolor.mostReadable = function(baseColor, colorList) {
1985
- var bestColor = null;
1986
- var bestScore = 0;
1987
- var bestIsReadable = false;
1988
- for (var i=0; i < colorList.length; i++) {
1989
-
1990
- // We normalize both around the "acceptable" breaking point,
1991
- // but rank brightness constrast higher than hue.
1992
-
1993
- var readability = tinycolor.readability(baseColor, colorList[i]);
1994
- var readable = readability.brightness > 125 && readability.color > 500;
1995
- var score = 3 * (readability.brightness / 125) + (readability.color / 500);
1996
-
1997
- if ((readable && ! bestIsReadable) ||
1998
- (readable && bestIsReadable && score > bestScore) ||
1999
- ((! readable) && (! bestIsReadable) && score > bestScore)) {
2000
- bestIsReadable = readable;
2001
- bestScore = score;
2002
- bestColor = tinycolor(colorList[i]);
2003
- }
2004
- }
2005
- return bestColor;
2006
- };
2007
-
2008
-
2009
- // Big List of Colors
2010
- // ------------------
2011
- // <http://www.w3.org/TR/css3-color/#svg-color>
2012
- var names = tinycolor.names = {
2013
- aliceblue: "f0f8ff",
2014
- antiquewhite: "faebd7",
2015
- aqua: "0ff",
2016
- aquamarine: "7fffd4",
2017
- azure: "f0ffff",
2018
- beige: "f5f5dc",
2019
- bisque: "ffe4c4",
2020
- black: "000",
2021
- blanchedalmond: "ffebcd",
2022
- blue: "00f",
2023
- blueviolet: "8a2be2",
2024
- brown: "a52a2a",
2025
- burlywood: "deb887",
2026
- burntsienna: "ea7e5d",
2027
- cadetblue: "5f9ea0",
2028
- chartreuse: "7fff00",
2029
- chocolate: "d2691e",
2030
- coral: "ff7f50",
2031
- cornflowerblue: "6495ed",
2032
- cornsilk: "fff8dc",
2033
- crimson: "dc143c",
2034
- cyan: "0ff",
2035
- darkblue: "00008b",
2036
- darkcyan: "008b8b",
2037
- darkgoldenrod: "b8860b",
2038
- darkgray: "a9a9a9",
2039
- darkgreen: "006400",
2040
- darkgrey: "a9a9a9",
2041
- darkkhaki: "bdb76b",
2042
- darkmagenta: "8b008b",
2043
- darkolivegreen: "556b2f",
2044
- darkorange: "ff8c00",
2045
- darkorchid: "9932cc",
2046
- darkred: "8b0000",
2047
- darksalmon: "e9967a",
2048
- darkseagreen: "8fbc8f",
2049
- darkslateblue: "483d8b",
2050
- darkslategray: "2f4f4f",
2051
- darkslategrey: "2f4f4f",
2052
- darkturquoise: "00ced1",
2053
- darkviolet: "9400d3",
2054
- deeppink: "ff1493",
2055
- deepskyblue: "00bfff",
2056
- dimgray: "696969",
2057
- dimgrey: "696969",
2058
- dodgerblue: "1e90ff",
2059
- firebrick: "b22222",
2060
- floralwhite: "fffaf0",
2061
- forestgreen: "228b22",
2062
- fuchsia: "f0f",
2063
- gainsboro: "dcdcdc",
2064
- ghostwhite: "f8f8ff",
2065
- gold: "ffd700",
2066
- goldenrod: "daa520",
2067
- gray: "808080",
2068
- green: "008000",
2069
- greenyellow: "adff2f",
2070
- grey: "808080",
2071
- honeydew: "f0fff0",
2072
- hotpink: "ff69b4",
2073
- indianred: "cd5c5c",
2074
- indigo: "4b0082",
2075
- ivory: "fffff0",
2076
- khaki: "f0e68c",
2077
- lavender: "e6e6fa",
2078
- lavenderblush: "fff0f5",
2079
- lawngreen: "7cfc00",
2080
- lemonchiffon: "fffacd",
2081
- lightblue: "add8e6",
2082
- lightcoral: "f08080",
2083
- lightcyan: "e0ffff",
2084
- lightgoldenrodyellow: "fafad2",
2085
- lightgray: "d3d3d3",
2086
- lightgreen: "90ee90",
2087
- lightgrey: "d3d3d3",
2088
- lightpink: "ffb6c1",
2089
- lightsalmon: "ffa07a",
2090
- lightseagreen: "20b2aa",
2091
- lightskyblue: "87cefa",
2092
- lightslategray: "789",
2093
- lightslategrey: "789",
2094
- lightsteelblue: "b0c4de",
2095
- lightyellow: "ffffe0",
2096
- lime: "0f0",
2097
- limegreen: "32cd32",
2098
- linen: "faf0e6",
2099
- magenta: "f0f",
2100
- maroon: "800000",
2101
- mediumaquamarine: "66cdaa",
2102
- mediumblue: "0000cd",
2103
- mediumorchid: "ba55d3",
2104
- mediumpurple: "9370db",
2105
- mediumseagreen: "3cb371",
2106
- mediumslateblue: "7b68ee",
2107
- mediumspringgreen: "00fa9a",
2108
- mediumturquoise: "48d1cc",
2109
- mediumvioletred: "c71585",
2110
- midnightblue: "191970",
2111
- mintcream: "f5fffa",
2112
- mistyrose: "ffe4e1",
2113
- moccasin: "ffe4b5",
2114
- navajowhite: "ffdead",
2115
- navy: "000080",
2116
- oldlace: "fdf5e6",
2117
- olive: "808000",
2118
- olivedrab: "6b8e23",
2119
- orange: "ffa500",
2120
- orangered: "ff4500",
2121
- orchid: "da70d6",
2122
- palegoldenrod: "eee8aa",
2123
- palegreen: "98fb98",
2124
- paleturquoise: "afeeee",
2125
- palevioletred: "db7093",
2126
- papayawhip: "ffefd5",
2127
- peachpuff: "ffdab9",
2128
- peru: "cd853f",
2129
- pink: "ffc0cb",
2130
- plum: "dda0dd",
2131
- powderblue: "b0e0e6",
2132
- purple: "800080",
2133
- rebeccapurple: "663399",
2134
- red: "f00",
2135
- rosybrown: "bc8f8f",
2136
- royalblue: "4169e1",
2137
- saddlebrown: "8b4513",
2138
- salmon: "fa8072",
2139
- sandybrown: "f4a460",
2140
- seagreen: "2e8b57",
2141
- seashell: "fff5ee",
2142
- sienna: "a0522d",
2143
- silver: "c0c0c0",
2144
- skyblue: "87ceeb",
2145
- slateblue: "6a5acd",
2146
- slategray: "708090",
2147
- slategrey: "708090",
2148
- snow: "fffafa",
2149
- springgreen: "00ff7f",
2150
- steelblue: "4682b4",
2151
- tan: "d2b48c",
2152
- teal: "008080",
2153
- thistle: "d8bfd8",
2154
- tomato: "ff6347",
2155
- turquoise: "40e0d0",
2156
- violet: "ee82ee",
2157
- wheat: "f5deb3",
2158
- white: "fff",
2159
- whitesmoke: "f5f5f5",
2160
- yellow: "ff0",
2161
- yellowgreen: "9acd32"
2162
- };
2163
-
2164
- // Make it easy to access colors via `hexNames[hex]`
2165
- var hexNames = tinycolor.hexNames = flip(names);
2166
-
2167
-
2168
- // Utilities
2169
- // ---------
2170
-
2171
- // `{ 'name1': 'val1' }` becomes `{ 'val1': 'name1' }`
2172
- function flip(o) {
2173
- var flipped = { };
2174
- for (var i in o) {
2175
- if (o.hasOwnProperty(i)) {
2176
- flipped[o[i]] = i;
2177
- }
2178
- }
2179
- return flipped;
2180
- }
2181
-
2182
- // Return a valid alpha value [0,1] with all invalid values being set to 1
2183
- function boundAlpha(a) {
2184
- a = parseFloat(a);
2185
-
2186
- if (isNaN(a) || a < 0 || a > 1) {
2187
- a = 1;
2188
- }
2189
-
2190
- return a;
2191
- }
2192
-
2193
- // Take input from [0, n] and return it as [0, 1]
2194
- function bound01(n, max) {
2195
- if (isOnePointZero(n)) { n = "100%"; }
2196
-
2197
- var processPercent = isPercentage(n);
2198
- n = mathMin(max, mathMax(0, parseFloat(n)));
2199
-
2200
- // Automatically convert percentage into number
2201
- if (processPercent) {
2202
- n = parseInt(n * max, 10) / 100;
2203
- }
2204
-
2205
- // Handle floating point rounding errors
2206
- if ((math.abs(n - max) < 0.000001)) {
2207
- return 1;
2208
- }
2209
-
2210
- // Convert into [0, 1] range if it isn't already
2211
- return (n % max) / parseFloat(max);
2212
- }
2213
-
2214
- // Force a number between 0 and 1
2215
- function clamp01(val) {
2216
- return mathMin(1, mathMax(0, val));
2217
- }
2218
-
2219
- // Parse a base-16 hex value into a base-10 integer
2220
- function parseIntFromHex(val) {
2221
- return parseInt(val, 16);
2222
- }
2223
-
2224
- // Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1
2225
- // <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0>
2226
- function isOnePointZero(n) {
2227
- return typeof n == "string" && n.indexOf('.') != -1 && parseFloat(n) === 1;
2228
- }
2229
-
2230
- // Check to see if string passed in is a percentage
2231
- function isPercentage(n) {
2232
- return typeof n === "string" && n.indexOf('%') != -1;
2233
- }
2234
-
2235
- // Force a hex value to have 2 characters
2236
- function pad2(c) {
2237
- return c.length == 1 ? '0' + c : '' + c;
2238
- }
2239
-
2240
- // Replace a decimal with it's percentage value
2241
- function convertToPercentage(n) {
2242
- if (n <= 1) {
2243
- n = (n * 100) + "%";
2244
- }
2245
-
2246
- return n;
2247
- }
2248
-
2249
- // Converts a decimal to a hex value
2250
- function convertDecimalToHex(d) {
2251
- return Math.round(parseFloat(d) * 255).toString(16);
2252
- }
2253
- // Converts a hex value to a decimal
2254
- function convertHexToDecimal(h) {
2255
- return (parseIntFromHex(h) / 255);
2256
- }
2257
-
2258
- var matchers = (function() {
2259
-
2260
- // <http://www.w3.org/TR/css3-values/#integers>
2261
- var CSS_INTEGER = "[-\\+]?\\d+%?";
2262
-
2263
- // <http://www.w3.org/TR/css3-values/#number-value>
2264
- var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?";
2265
-
2266
- // Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.
2267
- var CSS_UNIT = "(?:" + CSS_NUMBER + ")|(?:" + CSS_INTEGER + ")";
2268
-
2269
- // Actual matching.
2270
- // Parentheses and commas are optional, but not required.
2271
- // Whitespace can take the place of commas or opening paren
2272
- var PERMISSIVE_MATCH3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
2273
- var PERMISSIVE_MATCH4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
2274
-
2275
- return {
2276
- rgb: new RegExp("rgb" + PERMISSIVE_MATCH3),
2277
- rgba: new RegExp("rgba" + PERMISSIVE_MATCH4),
2278
- hsl: new RegExp("hsl" + PERMISSIVE_MATCH3),
2279
- hsla: new RegExp("hsla" + PERMISSIVE_MATCH4),
2280
- hsv: new RegExp("hsv" + PERMISSIVE_MATCH3),
2281
- hsva: new RegExp("hsva" + PERMISSIVE_MATCH4),
2282
- hex3: /^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
2283
- hex6: /^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
2284
- hex8: /^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
2285
- };
2286
- })();
2287
-
2288
- // `stringInputToObject`
2289
- // Permissive string parsing. Take in a number of formats, and output an object
2290
- // based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`
2291
- function stringInputToObject(color) {
2292
-
2293
- color = color.replace(trimLeft,'').replace(trimRight, '').toLowerCase();
2294
- var named = false;
2295
- if (names[color]) {
2296
- color = names[color];
2297
- named = true;
2298
- }
2299
- else if (color == 'transparent') {
2300
- return { r: 0, g: 0, b: 0, a: 0, format: "name" };
2301
- }
2302
-
2303
- // Try to match string input using regular expressions.
2304
- // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]
2305
- // Just return an object and let the conversion functions handle that.
2306
- // This way the result will be the same whether the tinycolor is initialized with string or object.
2307
- var match;
2308
- if ((match = matchers.rgb.exec(color))) {
2309
- return { r: match[1], g: match[2], b: match[3] };
2310
- }
2311
- if ((match = matchers.rgba.exec(color))) {
2312
- return { r: match[1], g: match[2], b: match[3], a: match[4] };
2313
- }
2314
- if ((match = matchers.hsl.exec(color))) {
2315
- return { h: match[1], s: match[2], l: match[3] };
2316
- }
2317
- if ((match = matchers.hsla.exec(color))) {
2318
- return { h: match[1], s: match[2], l: match[3], a: match[4] };
2319
- }
2320
- if ((match = matchers.hsv.exec(color))) {
2321
- return { h: match[1], s: match[2], v: match[3] };
2322
- }
2323
- if ((match = matchers.hsva.exec(color))) {
2324
- return { h: match[1], s: match[2], v: match[3], a: match[4] };
2325
- }
2326
- if ((match = matchers.hex8.exec(color))) {
2327
- return {
2328
- a: convertHexToDecimal(match[1]),
2329
- r: parseIntFromHex(match[2]),
2330
- g: parseIntFromHex(match[3]),
2331
- b: parseIntFromHex(match[4]),
2332
- format: named ? "name" : "hex8"
2333
- };
2334
- }
2335
- if ((match = matchers.hex6.exec(color))) {
2336
- return {
2337
- r: parseIntFromHex(match[1]),
2338
- g: parseIntFromHex(match[2]),
2339
- b: parseIntFromHex(match[3]),
2340
- format: named ? "name" : "hex"
2341
- };
2342
- }
2343
- if ((match = matchers.hex3.exec(color))) {
2344
- return {
2345
- r: parseIntFromHex(match[1] + '' + match[1]),
2346
- g: parseIntFromHex(match[2] + '' + match[2]),
2347
- b: parseIntFromHex(match[3] + '' + match[3]),
2348
- format: named ? "name" : "hex"
2349
- };
2350
- }
2351
-
2352
- return false;
2353
- }
2354
-
2355
- window.tinycolor = tinycolor;
2356
- })();
2357
-
2358
- $(function () {
2359
- if ($.fn.spectrum.load) {
2360
- $.fn.spectrum.processNativeColorInputs();
2361
- }
2362
- });
2363
-
2364
- });
2365
-
2366
-
2367
- /* ================== admin/assets/js/src/plugins/visual-select.js =================== */
2368
-
2369
-
2370
- /*!
2371
- * Radio image select
2372
- **/
2373
- (function($) {
2374
- // Register jQuery plugin.
2375
- $.fn.radioImageSelect = function(options) {
2376
- // Default var for options.
2377
- var defaults = {
2378
- // Img class.
2379
- imgItemClass: 'radio-img-item',
2380
- // Img Checked class.
2381
- imgItemCheckedClass: 'item-checked',
2382
- // Is need hide label connected?
2383
- hideLabel: true
2384
- },
2385
-
2386
- /**
2387
- * Method firing when need to update classes.
2388
- */
2389
- syncClassChecked = function(img) {
2390
- var radioName = img.prev('input[type="radio"]').attr('name');
2391
-
2392
- $('input[name="' + radioName + '"]').each(function() {
2393
- // Define img by radio name.
2394
- var myImg = $(this).next('img');
2395
-
2396
- // Add / Remove Checked class.
2397
- if ($(this).prop('checked')) {
2398
- myImg.addClass(options.imgItemCheckedClass);
2399
- } else {
2400
- myImg.removeClass(options.imgItemCheckedClass);
2401
- }
2402
- });
2403
- };
2404
-
2405
- // Parse args..
2406
- options = $.extend(defaults, options);
2407
-
2408
- // Start jQuery loop on elements..
2409
- return this.each(function() {
2410
- $(this)
2411
- // First all we are need to hide the radio input.
2412
- .hide()
2413
- // And add new img element by data-image source.
2414
- .after('<img src="' + $(this).data('image') + '" alt="radio image" />');
2415
-
2416
- // Define the new img element.
2417
- var img = $(this).next('img');
2418
- // Add item class.
2419
- img.addClass(options.imgItemClass);
2420
-
2421
- // Check if need to hide label connected.
2422
- if (options.hideLabel) {
2423
- $('label[for=' + $(this).attr('id') + ']').hide();
2424
- }
2425
-
2426
- // When we are created the img and radio get checked, we need add checked class.
2427
- if ($(this).prop('checked')) {
2428
- img.addClass(options.imgItemCheckedClass);
2429
- }
2430
-
2431
- // Create click event on img element.
2432
- img.on('click', function(e) {
2433
- $(this)
2434
- // Prev to current radio input.
2435
- .prev('input[type="radio"]')
2436
- // Set checked attr.
2437
- .prop('checked', true)
2438
- // Run change event for radio element.
2439
- .trigger('change');
2440
-
2441
- // Firing the sync classes.
2442
- syncClassChecked($(this));
2443
- });
2444
- });
2445
- }
2446
- })(jQuery);
1
+ /*! WP ULike - v4.1.0
2
  * https://wpulike.com
3
+ * TechnoWich 2020;
4
  */
5
 
6
 
33
  "padding-bottom":"0","margin-top":"0","margin-bottom":"0","border-top-width":"0","border-bottom-width":"0",height:"100px",overflow:"hidden"})}),l=a(h),h.each(function(){var e=t(this);e.attr("style",e.data("style-cache")||"")})),t.each(l,function(e,o){var a=t(o),i=0;if(s.target)i=s.target.outerHeight(!1);else{if(s.byRow&&a.length<=1)return void a.css(s.property,"");a.each(function(){var e=t(this),o=e.attr("style"),n=e.css("display");"inline-block"!==n&&"flex"!==n&&"inline-flex"!==n&&(n="block");var a={
34
  display:n};a[s.property]="",e.css(a),e.outerHeight(!1)>i&&(i=e.outerHeight(!1)),o?e.attr("style",o):e.css("display","")})}a.each(function(){var e=t(this),o=0;s.target&&e.is(s.target)||("border-box"!==e.css("box-sizing")&&(o+=n(e.css("border-top-width"))+n(e.css("border-bottom-width")),o+=n(e.css("padding-top"))+n(e.css("padding-bottom"))),e.css(s.property,i-o+"px"))})}),u.each(function(){var e=t(this);e.attr("style",e.data("style-cache")||null)}),r._maintainScroll&&t(window).scrollTop(c/p*t("html").outerHeight(!0)),
35
  this},r._applyDataApi=function(){var e={};t("[data-match-height], [data-mh]").each(function(){var o=t(this),n=o.attr("data-mh")||o.attr("data-match-height");n in e?e[n]=e[n].add(o):e[n]=o}),t.each(e,function(){this.matchHeight(!0)})};var s=function(e){r._beforeUpdate&&r._beforeUpdate(e,r._groups),t.each(r._groups,function(){r._apply(this.elements,this.options)}),r._afterUpdate&&r._afterUpdate(e,r._groups)};r._update=function(n,a){if(a&&"resize"===a.type){var i=t(window).width();if(i===e)return;e=i;
36
+ }n?o===-1&&(o=setTimeout(function(){s(a),o=-1},r._throttle)):s(a)},t(r._applyDataApi);var h=t.fn.on?"on":"bind";t(window)[h]("load",function(t){r._update(!1,t)}),t(window)[h]("resize orientationchange",function(t){r._update(!0,t)})});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/assets/js/scripts.js DELETED
@@ -1,369 +0,0 @@
1
- /*! WP ULike - v4.0.5
2
- * https://wpulike.com
3
- * TechnoWich 2019;
4
- */
5
-
6
-
7
- /* ================== admin/assets/js/src/settings.js =================== */
8
-
9
-
10
- /*!
11
- * Settings scripts
12
- **/
13
- (function($) {
14
- $(function() {
15
- var form = $("form.wrap"),
16
- page = $('input[name="option_page"]', form).val(),
17
- tabs = $(".wp-ulike-settings-tabs", form),
18
- current =
19
- parseInt(sessionStorage.getItem(page + "_current_tab"), 10) || 0;
20
- $(".wp-ulike-settings-section", form).each(function(i, el) {
21
- var setting = $(el).val(),
22
- title = $(el).prev("h2"),
23
- section = $("<div>").attr("id", page + "_" + setting);
24
- $(el)
25
- .nextAll()
26
- .each(function() {
27
- var tag = $(this).prop("tagName");
28
- if (tag === "H2" || tag === "INPUT") {
29
- return false;
30
- }
31
- $(this).appendTo(section);
32
- });
33
- if (tabs.length && title.length) {
34
- section.addClass("wp-ulike-settings-tab").hide();
35
- title.appendTo(tabs).click(function(e) {
36
- e.preventDefault();
37
- if (!title.hasClass("active")) {
38
- $(".wp-ulike-settings-tab.active", form).fadeOut(
39
- "fast",
40
- function() {
41
- $(".active", form).removeClass("active");
42
- title.addClass("active");
43
- section.fadeIn("fast").addClass("active");
44
- }
45
- );
46
- sessionStorage.setItem(page + "_current_tab", i);
47
- }
48
- });
49
- if (current === i) {
50
- title.addClass("active");
51
- section.show().addClass("active");
52
- }
53
- tabs.after(section);
54
- } else {
55
- title.prependTo(section);
56
- $(el).after(section);
57
- }
58
- });
59
- $('label[for="hidden"]', form).each(function() {
60
- $(this)
61
- .parents("tr")
62
- .addClass("hide-label");
63
- });
64
- $(".wp-ulike-settings-media", form).each(function() {
65
- var frame,
66
- select = $(".wp-ulike-select-media", this),
67
- remove = $(".wp-ulike-remove-media", this),
68
- input = $("input", this),
69
- preview = $("img", this),
70
- title = select.attr("title"),
71
- text = select.text();
72
- if (input.val() < 1) {
73
- preview = $('<img class="attachment-medium">');
74
- preview.prependTo(this).hide();
75
- remove.hide();
76
- }
77
- select.click(function(e) {
78
- e.preventDefault();
79
- if (frame) {
80
- frame.open();
81
- return;
82
- }
83
- frame = wp.media({
84
- title: title,
85
- button: {
86
- text: text
87
- },
88
- multiple: false
89
- });
90
- frame.on("select", function() {
91
- var attachment = frame
92
- .state()
93
- .get("selection")
94
- .first()
95
- .toJSON(),
96
- thumb;
97
- input.val(attachment.id);
98
- thumb = attachment.sizes.medium || attachment.sizes.full;
99
- preview.attr({
100
- src: thumb.url,
101
- width: thumb.width,
102
- height: thumb.height
103
- });
104
- preview.show();
105
- remove.show();
106
- });
107
- frame.open();
108
- });
109
- remove.click(function(e) {
110
- e.preventDefault();
111
- input.val("");
112
- preview.hide();
113
- remove.hide();
114
- });
115
- });
116
- $(".wp-ulike-settings-action", form).each(function() {
117
- var submit = $('[type="button"]', this),
118
- spinner = $("<img>")
119
- .attr({
120
- src: wp_ulike_admin.spinner,
121
- alt: "loading"
122
- })
123
- .insertAfter(submit)
124
- .hide(),
125
- notice = $("<div>")
126
- .addClass("settings-error")
127
- .insertBefore(submit)
128
- .hide(),
129
- action = {
130
- data: {
131
- action: submit.attr("id")
132
- },
133
- dataType: "json",
134
- type: "POST",
135
- url: ajaxurl,
136
- beforeSend: function() {
137
- spinner.fadeIn("fast");
138
- submit.hide();
139
- },
140
- success: function(r) {
141
- var noticeClass = "error",
142
- showNotice = function(msg) {
143
- notice
144
- .html("<p>" + String(msg) + "</p>")
145
- .addClass(noticeClass)
146
- .show();
147
- };
148
- if (typeof r === "object") {
149
- if (r.hasOwnProperty("success") && r.success) {
150
- noticeClass = "updated";
151
- }
152
- if (r.hasOwnProperty("data") && r.data) {
153
- if (typeof r.data === "object") {
154
- if (r.data.hasOwnProperty("reload") && r.data.reload) {
155
- document.location.reload();
156
- return;
157
- }
158
- if (r.data.hasOwnProperty("message") && r.data.message) {
159
- showNotice(r.data.message);
160
- }
161
- } else {
162
- showNotice(r.data);
163
- }
164
- }
165
- } else if (r) {
166
- showNotice(r);
167
- }
168
- spinner.hide();
169
- submit.fadeIn("fast");
170
- notice.show("fast");
171
- },
172
- error: function(jqXHR, textStatus, errorThrown) {
173
- notice
174
- .addClass("error")
175
- .append("<p>" + jqXHR.responseText + "</p>")
176
- .show("fast");
177
- console.log(textStatus, jqXHR, errorThrown);
178
- }
179
- };
180
- submit.click(function(e) {
181
- e.preventDefault();
182
- notice.hide("fast", function() {
183
- var r = confirm(
184
- "You Are About To Delete Ulike Data/Logs.\nThis Action Is Not Reversible.\n\n Choose 'Cancel' to stop, 'OK' to delete."
185
- );
186
- if (r == true) {
187
- notice.removeClass("error updated").empty();
188
- $.ajax(action);
189
- }
190
- });
191
- });
192
- });
193
-
194
- $(".wp-ulike-settings-license-activation", form).each(function() {
195
- var submit = $('[type="button"]', this),
196
- spinner = $("<img>")
197
- .attr({
198
- src: wp_ulike_admin.spinner,
199
- alt: "loading"
200
- })
201
- .insertAfter(submit)
202
- .hide(),
203
- notice = $("<div>")
204
- .addClass("settings-error")
205
- .insertBefore(submit)
206
- .hide();
207
- submit.click(function(e) {
208
- e.preventDefault();
209
- notice.hide("fast", function() {
210
- notice.removeClass("error updated").empty();
211
- $.ajax({
212
- data: {
213
- action: 'wp_ulike_activate_license',
214
- nonce: $('#wp_ulike_activate_license').val(),
215
- license: $(this).siblings('input.license-info').val()
216
- },
217
- dataType: "json",
218
- type: "POST",
219
- url: ajaxurl,
220
- beforeSend: function() {
221
- spinner.fadeIn("fast");
222
- $(this).hide();
223
- },
224
- success: function(r) {
225
- var noticeClass = "error",
226
- showNotice = function(msg) {
227
- notice
228
- .html("<p>" + String(msg) + "</p>")
229
- .addClass(noticeClass)
230
- .show();
231
- };
232
- if (typeof r === "object") {
233
- if (r.hasOwnProperty("success") && r.success) {
234
- noticeClass = "updated";
235
- submit.hide();
236
- }
237
- if (r.hasOwnProperty("data") && r.data) {
238
- if (typeof r.data === "object") {
239
- if (r.data.hasOwnProperty("reload") && r.data.reload) {
240
- document.location.reload();
241
- return;
242
- }
243
- if (r.data.hasOwnProperty("message") && r.data.message) {
244
- showNotice(r.data.message);
245
- }
246
- } else {
247
- showNotice(r.data);
248
- }
249
- }
250
- } else if (r) {
251
- showNotice(r);
252
- }
253
- spinner.hide();
254
- $(this).fadeIn("fast");
255
- notice.show("fast");
256
- },
257
- error: function(jqXHR, textStatus, errorThrown) {
258
- notice
259
- .addClass("error")
260
- .append("<p>" + jqXHR.responseText + "</p>")
261
- .show("fast");
262
- console.log(textStatus, jqXHR, errorThrown);
263
- }
264
- });
265
- });
266
- });
267
- });
268
-
269
- $(".wp-ulike-visual-select input").radioImageSelect();
270
-
271
- $(".wp-ulike-settings-color").spectrum({
272
- allowEmpty: true,
273
- showInput: true,
274
- showAlpha: true,
275
- disabled: false,
276
-
277
- showSelectionPalette: true,
278
- showPalette: true,
279
- hideAfterPaletteSelect: true,
280
- palette: [["black", "white", " "]],
281
- clickoutFiresChange: true,
282
- showInitial: true,
283
- containerClassName: "wp-ulike-sp-wrapper",
284
- localStorageKey: "wpulike.spectrum",
285
- preferredFormat: "hex6",
286
- change: function(color) {
287
- if (color === null) {
288
- $(this).val("");
289
- } else {
290
- $(this).val(color.toString());
291
- }
292
- }
293
- });
294
-
295
- $("#wp-ulike-settings_wp_ulike_customize tr:not(:first-child)").addClass(
296
- "custom-style-show"
297
- );
298
-
299
- function evaluate() {
300
- var item = $(this);
301
- var relatedItem = $(".custom-style-show");
302
-
303
- if (item.is(":checked")) {
304
- relatedItem.fadeIn();
305
- } else {
306
- relatedItem.fadeOut();
307
- }
308
- }
309
-
310
- $(".wp_ulike_custom_style_activation")
311
- .click(evaluate)
312
- .each(evaluate);
313
-
314
- $(
315
- "#wp-ulike-settings_wp_ulike_general tr:nth-child(2), #wp-ulike-settings_wp_ulike_general tr:nth-child(3)"
316
- ).addClass("button-text-show");
317
- $(
318
- "#wp-ulike-settings_wp_ulike_general tr:nth-child(4), #wp-ulike-settings_wp_ulike_general tr:nth-child(5)"
319
- ).addClass("button-icon-show");
320
-
321
- if (
322
- !$(".wp_ulike_check_text")
323
- .next("img")
324
- .hasClass("item-checked")
325
- ) {
326
- $(".button-text-show").hide();
327
- }
328
- if (
329
- !$(".wp_ulike_check_image")
330
- .next("img")
331
- .hasClass("item-checked")
332
- ) {
333
- $(".button-icon-show").hide();
334
- }
335
-
336
- $(".wp_ulike_check_text, .wp_ulike_check_image")
337
- .next("img")
338
- .click(function() {
339
- if (
340
- $(".wp_ulike_check_text")
341
- .next("img")
342
- .hasClass("item-checked")
343
- ) {
344
- $(".button-text-show").fadeIn();
345
- }
346
- if (
347
- !$(".wp_ulike_check_text")
348
- .next("img")
349
- .hasClass("item-checked")
350
- ) {
351
- $(".button-text-show").hide();
352
- }
353
- if (
354
- $(".wp_ulike_check_image")
355
- .next("img")
356
- .hasClass("item-checked")
357
- ) {
358
- $(".button-icon-show").fadeIn();
359
- }
360
- if (
361
- !$(".wp_ulike_check_image")
362
- .next("img")
363
- .hasClass("item-checked")
364
- ) {
365
- $(".button-icon-show").hide();
366
- }
367
- });
368
- });
369
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/classes/class-wp-ulike-admin-assets.php CHANGED
@@ -3,7 +3,7 @@
3
  * Wp ULike Admin Scripts Class.
4
  *
5
  * @package wp-ulike
6
- * @author TechnoWich 2019
7
  * @link https://wpulike.com
8
  */
9
 
@@ -90,25 +90,25 @@ if ( ! class_exists( 'wp_ulike_admin_assets' ) ) {
90
  );
91
 
92
  // Enqueue admin scripts
93
- wp_enqueue_script(
94
- 'wp_ulike_admin_scripts',
95
- WP_ULIKE_ADMIN_URL . '/assets/js/scripts.js',
96
- array( 'wp_ulike_admin_plugins', 'wp_ulike_vuejs'),
97
- false,
98
- true
99
- );
100
 
101
  // Enqueue statistics script
102
  wp_enqueue_script(
103
  'wp_ulike_admin_statistics_scripts',
104
  WP_ULIKE_ADMIN_URL . '/assets/js/solo/statistics.js',
105
- array( 'wp_ulike_admin_scripts'),
106
  false,
107
  true
108
  );
109
 
110
  // Localize scripts
111
- wp_localize_script( 'wp_ulike_admin_scripts', 'wp_ulike_admin', array(
112
  'hook_address' => esc_html( $this->hook ),
113
  'nonce_field' => wp_create_nonce( 'wp-ulike-ajax-nonce' ),
114
  'logs_notif' => __('Are you sure to remove this item?!',WP_ULIKE_SLUG),
3
  * Wp ULike Admin Scripts Class.
4
  *
5
  * @package wp-ulike
6
+ * @author TechnoWich 2020
7
  * @link https://wpulike.com
8
  */
9
 
90
  );
91
 
92
  // Enqueue admin scripts
93
+ // wp_enqueue_script(
94
+ // 'wp_ulike_admin_scripts',
95
+ // WP_ULIKE_ADMIN_URL . '/assets/js/scripts.js',
96
+ // array( 'wp_ulike_admin_plugins', 'wp_ulike_vuejs'),
97
+ // false,
98
+ // true
99
+ // );
100
 
101
  // Enqueue statistics script
102
  wp_enqueue_script(
103
  'wp_ulike_admin_statistics_scripts',
104
  WP_ULIKE_ADMIN_URL . '/assets/js/solo/statistics.js',
105
+ array( 'wp_ulike_admin_plugins'),
106
  false,
107
  true
108
  );
109
 
110
  // Localize scripts
111
+ wp_localize_script( 'wp_ulike_admin_plugins', 'wp_ulike_admin', array(
112
  'hook_address' => esc_html( $this->hook ),
113
  'nonce_field' => wp_create_nonce( 'wp-ulike-ajax-nonce' ),
114
  'logs_notif' => __('Are you sure to remove this item?!',WP_ULIKE_SLUG),
admin/classes/class-wp-ulike-admin-pages.php CHANGED
@@ -3,7 +3,7 @@
3
  * Wp ULike Admin Pages Class.
4
  *
5
  * @package wp-ulike
6
- * @author TechnoWich 2019
7
  * @link https://wpulike.com
8
  */
9
 
@@ -76,7 +76,10 @@ if ( ! class_exists( 'wp_ulike_admin_pages' ) ) {
76
  )
77
  ) );
78
 
79
- add_action( 'admin_menu', array( $this, 'menus' ) );
 
 
 
80
  }
81
 
82
  /**
3
  * Wp ULike Admin Pages Class.
4
  *
5
  * @package wp-ulike
6
+ * @author TechnoWich 2020
7
  * @link https://wpulike.com
8
  */
9
 
76
  )
77
  ) );
78
 
79
+ add_action( 'wp_ulike_settings_loaded', function(){
80
+ add_action( 'admin_menu', array( $this, 'menus' ) );
81
+ } );
82
+
83
  }
84
 
85
  /**
admin/classes/class-wp-ulike-admin-panel.php ADDED
@@ -0,0 +1,566 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Wp ULike Admin Panel
4
+ *
5
+ * @package wp-ulike
6
+ * @author TechnoWich 2020
7
+ * @link https://wpulike.com
8
+ */
9
+
10
+ // no direct access allowed
11
+ if ( ! defined('ABSPATH') ) {
12
+ die();
13
+ }
14
+
15
+ if ( ! class_exists( 'wp_ulike_admin_panel' ) ) {
16
+ class wp_ulike_admin_panel{
17
+
18
+ protected $option_domain = 'wp_ulike_settings';
19
+
20
+ /**
21
+ * __construct
22
+ */
23
+ function __construct() {
24
+ add_action( 'csf_loaded', array( $this, 'register_panel' ) );
25
+ add_action( 'wp_ulike_settings_loaded', array( $this, 'register_sections' ) );
26
+ add_action( 'wp_ulike_settings_loaded', array( $this, 'register_pages' ) );
27
+ }
28
+
29
+ /**
30
+ * Register setting panel
31
+ *
32
+ * @return void
33
+ */
34
+ public function register_panel(){
35
+ // Create options
36
+ CSF::createOptions( $this->option_domain, array(
37
+ 'framework_title' => apply_filters( 'wp_ulike_plugin_name', WP_ULIKE_NAME ),
38
+ 'menu_title' => apply_filters( 'wp_ulike_plugin_name', WP_ULIKE_NAME ),
39
+ 'sub_menu_title' => __( 'Settings', WP_ULIKE_SLUG ),
40
+ 'menu_slug' => 'wp-ulike-settings',
41
+ 'menu_capability' => 'manage_options',
42
+ 'menu_icon' => 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMjUgMjUiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDI1IDI1OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHBhdGggY2xhc3M9InN0MCIgZD0iTTIzLjksNy4xTDIzLjksNy4xYy0xLjUtMS41LTMuOS0xLjUtNS40LDBsLTEuNSwxLjVsMS40LDEuNGwxLjUtMS41YzAuNC0wLjQsMC44LTAuNiwxLjMtMC42YzAuNSwwLDEuMSwwLjIsMS40LDAuNmMwLjcsMC44LDAuNywyLTAuMSwyLjdsLTEsMWMtMC41LDAuNS0xLjIsMC41LTEuNiwwYy0wLjktMC45LTUuMS01LjEtNS4xLTUuMWMtMC43LTAuNy0xLjctMS4xLTIuNy0xLjFsMCwwYy0xLDAtMiwwLjQtMi43LDEuMUM5LDcuNCw4LjgsNy43LDguNiw4LjFMOC41LDguM2wxLjYsMS42bDAuMS0wLjVjMC4yLTEsMS4yLTEuNywyLjMtMS41YzAuNCwwLjEsMC43LDAuMiwxLDAuNWw1LjksNS45TDE2LjYsMTdMMTIuNywxM2wwLDBjLTAuMS0wLjEtMC40LTAuNC0yLjEtMi4xbC00LTRDNSw1LjQsMi42LDUuNCwxLjEsNi45Yy0xLjUsMS41LTEuNSwzLjksMCw1LjRsNiw2YzAuMywwLjMsMC44LDAuNSwxLjIsMC41bDAsMGMwLjUsMCwwLjktMC4yLDEuMi0wLjVsMi41LTIuNWwtMS40LTEuNGwtMi40LDIuNGwtNS45LTUuOWMtMC43LTAuOC0wLjctMiwwLjEtMi43YzAuNy0wLjcsMS45LTAuNywyLjYsMGw0LDRjMC4xLDAuMSwwLjEsMC4yLDAuMiwwLjJsNiw2YzAuMywwLjMsMC44LDAuNSwxLjMsMC41YzAsMCwwLDAsMCwwYzAuNSwwLDAuOS0wLjIsMS4yLTAuNWw2LTZDMjUuNCwxMSwyNS40LDguNiwyMy45LDcuMXoiLz48L3N2Zz4=',
43
+ 'menu_position' => 313,
44
+ 'show_bar_menu' => false,
45
+ 'show_sub_menu' => false,
46
+ 'show_network_menu' => false,
47
+ 'show_search' => false,
48
+ 'show_reset_all' => true,
49
+ 'show_reset_section' => true,
50
+ 'show_footer' => true,
51
+ 'show_all_options' => true,
52
+ 'show_form_warning' => true,
53
+ 'sticky_header' => true,
54
+ 'save_defaults' => true,
55
+ 'ajax_save' => true,
56
+ 'footer_credit' => 'Thank you for choosing <a href="https://wpulike.com/?utm_source=footer-link&amp;utm_campaign=plugin-uri&amp;utm_medium=wp-dash" title="Wordpress ULike" target="_blank">WP ULike</a>.',
57
+ 'footer_after' => '',
58
+ 'enqueue_webfont' => true,
59
+ 'async_webfont' => false,
60
+ 'output_css' => true,
61
+ 'theme' => 'light wp-ulike-settings-panel'
62
+ ) );
63
+
64
+ do_action( 'wp_ulike_settings_loaded' );
65
+ }
66
+
67
+ /**
68
+ * Register admin page
69
+ *
70
+ * @return void
71
+ */
72
+ public function register_pages(){
73
+ new wp_ulike_admin_pages();
74
+ }
75
+
76
+ /**
77
+ * Register setting sections
78
+ *
79
+ * @return void
80
+ */
81
+ public function register_sections(){
82
+
83
+ do_action( 'wp_ulike_panel_sections_started' );
84
+
85
+ /**
86
+ * Configuration Section
87
+ */
88
+ CSF::createSection( $this->option_domain, array(
89
+ 'id' => 'configuration',
90
+ 'title' => __( 'Configuration',WP_ULIKE_SLUG),
91
+ 'icon' => 'fa fa-home',
92
+ ) );
93
+ // General
94
+ CSF::createSection( $this->option_domain, array(
95
+ 'parent' => 'configuration',
96
+ 'title' => __( 'General',WP_ULIKE_SLUG),
97
+ 'fields' => apply_filters( 'wp_ulike_panel_general', array(
98
+ array(
99
+ 'id' => 'enable_kilobyte_format',
100
+ 'type' => 'switcher',
101
+ 'title' => __('Enable Convert Format', WP_ULIKE_SLUG),
102
+ 'desc' => __('Convert numbers of Likes with string (kilobyte) format.', WP_ULIKE_SLUG) . '<strong> (WHEN? likes>=1000)</strong>'
103
+ ),
104
+ array(
105
+ 'id' => 'enable_toast_notice',
106
+ 'type' => 'switcher',
107
+ 'title' => __('Enable Notifications', WP_ULIKE_SLUG),
108
+ 'default' => true,
109
+ 'desc' => __('Custom toast messages after each activity', WP_ULIKE_SLUG)
110
+ ),
111
+ array(
112
+ 'id' => 'enable_anonymise_ip',
113
+ 'type' => 'switcher',
114
+ 'title' => __('Enable Anonymize IP', WP_ULIKE_SLUG),
115
+ 'desc' => __('Anonymize the IP address for GDPR Compliance', WP_ULIKE_SLUG)
116
+ ),
117
+ array(
118
+ 'id' => 'disable_admin_notice',
119
+ 'type' => 'switcher',
120
+ 'title' => __('Hide Admin Notices', WP_ULIKE_SLUG),
121
+ 'desc' => __('Enabling this option will completely disable all admin notices.', WP_ULIKE_SLUG)
122
+ ),
123
+ array(
124
+ 'id' => 'enable_meta_values',
125
+ 'type' => 'switcher',
126
+ 'title' => __('Enable Old Meta Values', WP_ULIKE_SLUG),
127
+ 'desc' => sprintf( '%s<br><strong>* %s</strong>', __('By activating this option, users who have upgraded to version +4 and deleted their old logs can add the number of old likes to the new figures.', WP_ULIKE_SLUG), __('Attention: If you have been using WP ULike +v4 from the beginning Or you haven\'t deleted any logs yet, do not enable this option.', WP_ULIKE_SLUG) )
128
+ ),
129
+ array(
130
+ 'id' => 'disable_plugin_files',
131
+ 'type' => 'select',
132
+ 'title' => __( 'Disable Plugin Files',WP_ULIKE_SLUG ),
133
+ 'desc' => __('With this option, you can disable all plugin assets on these pages.', WP_ULIKE_SLUG),
134
+ 'chosen' => true,
135
+ 'multiple' => true,
136
+ 'options' => array(
137
+ 'home' => __('Home', WP_ULIKE_SLUG),
138
+ 'single' => __('Singular', WP_ULIKE_SLUG),
139
+ 'archive' => __('Archives', WP_ULIKE_SLUG),
140
+ 'category' => __('Categories', WP_ULIKE_SLUG),
141
+ 'search' => __('Search Results', WP_ULIKE_SLUG),
142
+ 'tag' => __('Tags', WP_ULIKE_SLUG),
143
+ 'author' => __('Author Page', WP_ULIKE_SLUG),
144
+ 'buddypress' => __('BuddyPress Pages', WP_ULIKE_SLUG),
145
+ 'bbpress' => __('bbPress Pages', WP_ULIKE_SLUG),
146
+ 'woocommerce' => __('WooCommerce Pages', WP_ULIKE_SLUG)
147
+ )
148
+ ),
149
+ ) )
150
+ ) );
151
+
152
+ // Get all content options
153
+ $get_content_options = apply_filters( 'wp_ulike_panel_content_options', $this->get_content_options() );
154
+ $get_content_fields = array();
155
+
156
+ // Generate posts fields
157
+ $get_content_fields['posts'] = $get_content_options;
158
+
159
+ // Generate comment fields
160
+ $get_content_fields['comments'] = $get_content_options;
161
+ unset( $get_content_fields['comments']['auto_display_filter'] );
162
+ unset( $get_content_fields['comments']['auto_display_filter_post_types'] );
163
+
164
+ // Generate buddypress fields
165
+ $get_content_fields['buddypress'] = $get_content_options;
166
+ unset( $get_content_fields['buddypress']['auto_display_filter'] );
167
+ unset( $get_content_fields['buddypress']['auto_display_filter_post_types'] );
168
+ $get_content_fields['buddypress']['auto_display_position']['options'] = array(
169
+ 'content' => __('Activity Content', WP_ULIKE_SLUG),
170
+ 'meta' => __('Activity Meta', WP_ULIKE_SLUG)
171
+ );
172
+ $get_content_fields['buddypress']['auto_display_position']['default'] = 'content';
173
+ $get_content_fields['buddypress']['enable_comments'] = array(
174
+ 'id' => 'enable_comments',
175
+ 'type' => 'switcher',
176
+ 'title' => __('Activity Comment', WP_ULIKE_SLUG),
177
+ 'desc' => __('Add the possibility to like Buddypress comments in the activity stream', WP_ULIKE_SLUG),
178
+ 'dependency' => array( 'enable_auto_display', '==', 'true' )
179
+ );
180
+ $get_content_fields['buddypress']['enable_add_bp_activity'] = array(
181
+ 'id' => 'enable_add_bp_activity',
182
+ 'type' => 'switcher',
183
+ 'title' => __('Enable Activity Notification', WP_ULIKE_SLUG),
184
+ 'desc' => __('Insert new likes in buddyPress activity page', WP_ULIKE_SLUG),
185
+ );
186
+ $get_content_fields['buddypress']['posts_notification_template'] = array(
187
+ 'id' => 'posts_notification_template',
188
+ 'type' => 'code_editor',
189
+ 'settings' => array(
190
+ 'theme' => 'shadowfox',
191
+ 'mode' => 'htmlmixed',
192
+ ),
193
+ 'default' => '<strong>%POST_LIKER%</strong> liked <a href="%POST_PERMALINK%" title="%POST_TITLE%">%POST_TITLE%</a>. (So far, This post has <span class="badge">%POST_COUNT%</span> likes)',
194
+ 'title' => __('Post Activity Text', WP_ULIKE_SLUG),
195
+ 'desc' => __('Allowed Variables:', WP_ULIKE_SLUG) . ' <code>%POST_LIKER%</code> , <code>%POST_PERMALINK%</code> , <code>%POST_COUNT%</code> , <code>%POST_TITLE%</code>',
196
+ 'dependency'=> array( 'enable_add_bp_activity', '==', 'true' ),
197
+ );
198
+ $get_content_fields['buddypress']['comments_notification_template'] = array(
199
+ 'id' => 'comments_notification_template',
200
+ 'type' => 'code_editor',
201
+ 'settings' => array(
202
+ 'theme' => 'shadowfox',
203
+ 'mode' => 'htmlmixed',
204
+ ),
205
+ 'default' => '<strong>%COMMENT_LIKER%</strong> liked <strong>%COMMENT_AUTHOR%</strong> comment. (So far, %COMMENT_AUTHOR% has <span class="badge">%COMMENT_COUNT%</span> likes for this comment)',
206
+ 'title' => __('Comment Activity Text', WP_ULIKE_SLUG),
207
+ 'desc' => __('Allowed Variables:', WP_ULIKE_SLUG) . ' <code>%COMMENT_LIKER%</code> , <code>%COMMENT_AUTHOR%</code> , <code>%COMMENT_COUNT%</code>, <code>%COMMENT_PERMALINK%</code>',
208
+ 'dependency'=> array( 'enable_add_bp_activity', '==', 'true' ),
209
+ );
210
+ $get_content_fields['buddypress']['enable_add_notification'] = array(
211
+ 'id' => 'enable_add_notification',
212
+ 'type' => 'switcher',
213
+ 'title' => __('Enable User Notification', WP_ULIKE_SLUG),
214
+ 'desc' => __('Sends out notifications when you get a like from someone', WP_ULIKE_SLUG),
215
+ );
216
+ $buddypress_options = array( array(
217
+ 'type' => 'content',
218
+ 'content' => sprintf( '<strong>%s</strong> %s', __( 'BuddyPress', WP_ULIKE_SLUG ), __( 'plugin is not installed or activated', WP_ULIKE_SLUG ) ),
219
+ ) );
220
+ if( function_exists('is_buddypress') ){
221
+ $buddypress_options = array_values( apply_filters( 'wp_ulike_panel_buddypress_type_options', $get_content_fields['buddypress'] ) );
222
+ }
223
+
224
+ // Generate bbPress fields
225
+ $get_content_fields['bbpress'] = $get_content_options;
226
+ unset( $get_content_fields['bbpress']['auto_display_filter'] );
227
+ unset( $get_content_fields['bbpress']['auto_display_filter_post_types'] );
228
+
229
+ $bbPress_options = array( array(
230
+ 'type' => 'content',
231
+ 'content' => sprintf( '<strong>%s</strong> %s', __( 'bbPress', WP_ULIKE_SLUG ), __( 'plugin is not installed or activated', WP_ULIKE_SLUG ) ),
232
+ ) );
233
+ if( function_exists('is_buddypress') ){
234
+ $bbPress_options = array_values( apply_filters( 'wp_ulike_panel_bbpress_type_options', $get_content_fields['bbpress'] ) );
235
+ }
236
+
237
+ // Content Groups
238
+ CSF::createSection( $this->option_domain, array(
239
+ 'parent' => 'configuration',
240
+ 'title' => __( 'Content Types',WP_ULIKE_SLUG),
241
+ 'fields' => array(
242
+ // Posts
243
+ array(
244
+ 'id' => 'posts_group',
245
+ 'type' => 'fieldset',
246
+ 'title' => __('Posts'),
247
+ 'fields' => array_values( apply_filters( 'wp_ulike_panel_post_type_options', $get_content_fields['posts'] ) )
248
+ ),
249
+ // Comments
250
+ array(
251
+ 'id' => 'comments_group',
252
+ 'type' => 'fieldset',
253
+ 'title' => __('Comments'),
254
+ 'fields' => array_values( apply_filters( 'wp_ulike_panel_comment_type_options', $get_content_fields['comments'] ) )
255
+ ),
256
+ // BuddyPress
257
+ array(
258
+ 'id' => 'buddypress_group',
259
+ 'type' => 'fieldset',
260
+ 'title' => __('BuddyPress'),
261
+ 'fields' => $buddypress_options
262
+ ),
263
+ // Posts
264
+ array(
265
+ 'id' => 'bbpress_group',
266
+ 'type' => 'fieldset',
267
+ 'title' => __('bbPress'),
268
+ 'fields' => $bbPress_options
269
+ )
270
+ // End
271
+ )
272
+ ) );
273
+
274
+ /**
275
+ * Translations Section
276
+ */
277
+ CSF::createSection( $this->option_domain, array(
278
+ 'title' => __( 'Translations',WP_ULIKE_SLUG),
279
+ 'icon' => 'fa fa-language',
280
+ 'fields' => apply_filters( 'wp_ulike_panel_translations', array(
281
+ array(
282
+ 'id' => 'already_registered_notice',
283
+ 'type' => 'text',
284
+ 'default' => __('You have already registered a vote.',WP_ULIKE_SLUG),
285
+ 'title' => __( 'Already Voted Message', WP_ULIKE_SLUG)
286
+ ),
287
+ array(
288
+ 'id' => 'login_required_notice',
289
+ 'type' => 'text',
290
+ 'default' => __('You Should Login To Submit Your Like',WP_ULIKE_SLUG),
291
+ 'title' => __( 'Login Required Message', WP_ULIKE_SLUG)
292
+ ),
293
+ array(
294
+ 'id' => 'like_notice',
295
+ 'type' => 'text',
296
+ 'default' => __('Thanks! You Liked This.',WP_ULIKE_SLUG),
297
+ 'title' => __( 'Liked Notice Message', WP_ULIKE_SLUG)
298
+ ),
299
+ array(
300
+ 'id' => 'unlike_notice',
301
+ 'type' => 'text',
302
+ 'default' => __('Sorry! You unliked this.',WP_ULIKE_SLUG),
303
+ 'title' => __( 'Unliked Notice Message', WP_ULIKE_SLUG)
304
+ ),
305
+ ) )
306
+ ) );
307
+
308
+ /**
309
+ * Customization Section
310
+ */
311
+ CSF::createSection( $this->option_domain, array(
312
+ 'title' => __( 'Customization',WP_ULIKE_SLUG),
313
+ 'icon' => 'fa fa-code',
314
+ 'fields' => apply_filters( 'wp_ulike_panel_customization', array(
315
+ array(
316
+ 'id' => 'custom_css',
317
+ 'type' => 'code_editor',
318
+ 'settings' => array(
319
+ 'theme' => 'mbo',
320
+ 'mode' => 'css',
321
+ ),
322
+ 'title' => 'Custom CSS',
323
+ ),
324
+ array(
325
+ 'id' => 'custom_spinner',
326
+ 'type' => 'upload',
327
+ 'title' => __('Custom Spinner',WP_ULIKE_SLUG),
328
+ 'library' => 'image',
329
+ 'placeholder' => 'http://'
330
+ )
331
+ ) )
332
+ ) );
333
+
334
+ do_action( 'wp_ulike_panel_sections_ended' );
335
+ }
336
+
337
+ /**
338
+ * Generate general content options
339
+ *
340
+ * @return void
341
+ */
342
+ public function get_content_options(){
343
+ return array(
344
+ 'template' => array(
345
+ 'id' => 'template',
346
+ 'type' => 'image_select',
347
+ 'title' => __( 'Select a Template',WP_ULIKE_SLUG),
348
+ 'desc' => sprintf( '%s <a target="_blank" href="%s" title="Click">%s</a>', __( 'Display online preview',WP_ULIKE_SLUG), WP_ULIKE_PLUGIN_URI . 'templates/?utm_source=settings-page&utm_campaign=plugin-uri&utm_medium=wp-dash',__( 'Here',WP_ULIKE_SLUG) ),
349
+ 'options' => $this->get_templates_option_array(),
350
+ 'default' => 'wpulike-default',
351
+ 'class' => 'wp-ulike-visual-select',
352
+ ),
353
+ 'button_type' => array(
354
+ 'id' => 'button_type',
355
+ 'type' => 'button_set',
356
+ 'title' => __( 'Button Type', WP_ULIKE_SLUG),
357
+ 'default' => 'image',
358
+ 'options' => array(
359
+ 'image' => __('Image', WP_ULIKE_SLUG),
360
+ 'text' => __('Text', WP_ULIKE_SLUG)
361
+ ),
362
+ 'dependency' => array( 'template', 'any', 'wpulike-default,wp-ulike-pro-default,wpulike-heart' ),
363
+ ),
364
+ 'text_group' => array(
365
+ 'id' => 'text_group',
366
+ 'type' => 'tabbed',
367
+ 'title' => __( 'Button Text', WP_ULIKE_SLUG),
368
+ 'tabs' => array(
369
+ array(
370
+ 'title' => __('Like',WP_ULIKE_SLUG),
371
+ 'fields' => array(
372
+ array(
373
+ 'id' => 'like',
374
+ 'type' => 'text',
375
+ 'title' => __('Button Text',WP_ULIKE_SLUG),
376
+ 'default' => 'Like'
377
+ ),
378
+ )
379
+ ),
380
+ array(
381
+ 'title' => __('Unlike',WP_ULIKE_SLUG),
382
+ 'fields' => array(
383
+ array(
384
+ 'id' => 'unlike',
385
+ 'type' => 'text',
386
+ 'title' => __('Button Text',WP_ULIKE_SLUG),
387
+ 'default' => 'Liked'
388
+ ),
389
+ )
390
+ ),
391
+ ),
392
+ 'dependency' => array( 'button_type|template', 'any|any', 'text|wpulike-default,wp-ulike-pro-default,wpulike-heart' ),
393
+ ),
394
+ 'image_group' => array(
395
+ 'id' => 'image_group',
396
+ 'type' => 'tabbed',
397
+ 'title' => __( 'Button Image', WP_ULIKE_SLUG),
398
+ 'tabs' => array(
399
+ array(
400
+ 'title' => __('Like',WP_ULIKE_SLUG),
401
+ 'fields' => array(
402
+ array(
403
+ 'id' => 'like',
404
+ 'type' => 'upload',
405
+ 'title' => __('Button Image',WP_ULIKE_SLUG),
406
+ 'library' => 'image',
407
+ 'placeholder' => 'http://'
408
+ ),
409
+ )
410
+ ),
411
+ array(
412
+ 'title' => __('Unlike',WP_ULIKE_SLUG),
413
+ 'fields' => array(
414
+ array(
415
+ 'id' => 'unlike',
416
+ 'type' => 'upload',
417
+ 'title' => __('Button Image',WP_ULIKE_SLUG),
418
+ 'library' => 'image',
419
+ 'placeholder' => 'http://'
420
+ ),
421
+ )
422
+ ),
423
+ ),
424
+ 'dependency' => array( 'button_type|template', 'any|any', 'image|wpulike-default,wp-ulike-pro-default,wpulike-heart' ),
425
+ ),
426
+ 'enable_auto_display' => array(
427
+ 'id' => 'enable_auto_display',
428
+ 'type' => 'switcher',
429
+ 'default' => true,
430
+ 'title' => __('Automatic display', WP_ULIKE_SLUG),
431
+ ),
432
+ 'auto_display_position' => array(
433
+ 'id' => 'auto_display_position',
434
+ 'type' => 'radio',
435
+ 'title' => __( 'Button Position',WP_ULIKE_SLUG ),
436
+ 'default' => 'bottom',
437
+ 'options' => array(
438
+ 'top' => __('Top of Content', WP_ULIKE_SLUG),
439
+ 'bottom' => __('Bottom of Content', WP_ULIKE_SLUG),
440
+ 'top_bottom' => __('Top and Bottom', WP_ULIKE_SLUG)
441
+ ),
442
+ 'dependency' => array( 'enable_auto_display', '==', 'true' ),
443
+ ),
444
+ 'auto_display_filter' => array(
445
+ 'id' => 'auto_display_filter',
446
+ 'type' => 'select',
447
+ 'title' => __( 'Automatic Display Restriction',WP_ULIKE_SLUG ),
448
+ 'desc' => __('With this option, you can disable automatic display on these pages.', WP_ULIKE_SLUG),
449
+ 'chosen' => true,
450
+ 'multiple' => true,
451
+ 'options' => array(
452
+ 'home' => __('Home', WP_ULIKE_SLUG),
453
+ 'single' => __('Singular', WP_ULIKE_SLUG),
454
+ 'archive' => __('Archives', WP_ULIKE_SLUG),
455
+ 'category' => __('Categories', WP_ULIKE_SLUG),
456
+ 'search' => __('Search Results', WP_ULIKE_SLUG),
457
+ 'tag' => __('Tags', WP_ULIKE_SLUG),
458
+ 'author' => __('Author Page', WP_ULIKE_SLUG)
459
+ ),
460
+ 'dependency' => array( 'enable_auto_display', '==', 'true' ),
461
+ ),
462
+ 'auto_display_filter_post_types' => array(
463
+ 'id' => 'auto_display_filter_post_types',
464
+ 'type' => 'select',
465
+ 'title' => __( 'Post Types Filter',WP_ULIKE_SLUG ),
466
+ 'placeholder' => __( 'Select a post type',WP_ULIKE_SLUG ),
467
+ 'desc' => __( 'Make these post types an exception and display the button on them.',WP_ULIKE_SLUG ),
468
+ 'chosen' => true,
469
+ 'multiple' => true,
470
+ 'default' => 'post',
471
+ 'options' => 'post_types',
472
+ 'dependency' => array( 'auto_display_filter|enable_auto_display', 'any|==', 'single|true' ),
473
+ ),
474
+ 'logging_method' => array(
475
+ 'id' => 'logging_method',
476
+ 'type' => 'select',
477
+ 'title' => __( 'Logging Method',WP_ULIKE_SLUG),
478
+ 'options' => array(
479
+ 'do_not_log' => __('Do Not Log', WP_ULIKE_SLUG),
480
+ 'by_cookie' => __('Logged By Cookie', WP_ULIKE_SLUG),
481
+ 'by_ip' => __('Logged By IP', WP_ULIKE_SLUG),
482
+ 'by_username' => __('Logged By Username', WP_ULIKE_SLUG)
483
+ ),
484
+ 'default' => 'by_username',
485
+ 'help' => sprintf( '<p>%s</p><p>%s</p><p>%s</p><p>%s</p>', __( 'If you select <strong>"Do Not Log"</strong> method: Any data logs can\'t save, There is no limitation in the like/dislike, unlike/undislike capacity do not work', WP_ULIKE_SLUG ), __( 'If you select <strong>"Logged By Cookie"</strong> method: Any data logs can\'t save, The like/dislike condition will be limited by SetCookie, unlike/undislike capacity do not work', WP_ULIKE_SLUG ), __( 'If you select <strong>"Logged By IP"</strong> method: Data logs will save for all users, the convey of like/dislike condition will check by user IP', WP_ULIKE_SLUG ), __( 'If you select <strong>"Logged By Username"</strong> method: data logs only is saved for registered users, the convey of like/dislike condition will check by username, There is no permission for guest users to unlike/undislike', WP_ULIKE_SLUG ) )
486
+ ),
487
+ 'enable_only_logged_in_users' => array(
488
+ 'id' => 'enable_only_logged_in_users',
489
+ 'type' => 'switcher',
490
+ 'title' => __('Only logged in users', WP_ULIKE_SLUG),
491
+ ),
492
+ 'logged_out_display_type' => array(
493
+ 'id' => 'logged_out_display_type',
494
+ 'type' => 'button_set',
495
+ 'title' => __( 'Display Type', WP_ULIKE_SLUG),
496
+ 'options' => array(
497
+ 'alert' => __('Alert', WP_ULIKE_SLUG),
498
+ 'button' => __('Button', WP_ULIKE_SLUG)
499
+ ),
500
+ 'default' => 'button',
501
+ 'dependency' => array( 'enable_only_logged_in_users', '==', 'true' ),
502
+ ),
503
+ 'enable_likers_box' => array(
504
+ 'id' => 'enable_likers_box',
505
+ 'type' => 'switcher',
506
+ 'title' => __('Display Likers Box', WP_ULIKE_SLUG),
507
+ ),
508
+ 'disable_likers_pophover' => array(
509
+ 'id' => 'disable_likers_pophover',
510
+ 'type' => 'switcher',
511
+ 'title' => __('Disable Pophover', WP_ULIKE_SLUG),
512
+ 'dependency' => array( 'enable_likers_box', '==', 'true' ),
513
+ 'desc' => __('Active this option to show liked users avatars in the bottom of button like.', WP_ULIKE_SLUG)
514
+ ),
515
+ 'likers_gravatar_size' => array(
516
+ 'id' => 'likers_gravatar_size',
517
+ 'type' => 'number',
518
+ 'title' => __( 'Size of Gravatars', WP_ULIKE_SLUG),
519
+ 'default' => 64,
520
+ 'unit' => 'px',
521
+ 'dependency' => array( 'enable_likers_box', '==', 'true' ),
522
+ ),
523
+ 'likers_count' => array(
524
+ 'id' => 'likers_count',
525
+ 'type' => 'number',
526
+ 'title' => __( 'Likers Count', WP_ULIKE_SLUG),
527
+ 'desc' => __('The number of users to show in the users liked box', WP_ULIKE_SLUG),
528
+ 'default' => 10,
529
+ 'unit' => 'users',
530
+ 'dependency' => array( 'enable_likers_box', '==', 'true' ),
531
+ ),
532
+ 'likers_template' => array(
533
+ 'id' => 'likers_template',
534
+ 'type' => 'code_editor',
535
+ 'settings' => array(
536
+ 'theme' => 'shadowfox',
537
+ 'mode' => 'htmlmixed',
538
+ ),
539
+ 'default' => '<div class="wp-ulike-likers-list">%START_WHILE%<span class="wp-ulike-liker"><a href="#" title="%USER_NAME%">%USER_AVATAR%</a></span>%END_WHILE%</div>',
540
+ 'title' => __('Custom HTML Template', WP_ULIKE_SLUG),
541
+ 'desc' => __('Allowed Variables:', WP_ULIKE_SLUG) . ' <code>%USER_AVATAR%</code> , <code>%BP_PROFILE_URL%</code> , <code>%UM_PROFILE_URL%</code> , <code>%USER_NAME%</code> , <code>%START_WHILE%</code> , <code>%END_WHILE%</code>',
542
+ 'dependency'=> array( 'enable_likers_box', '==', 'true' ),
543
+ )
544
+ );
545
+ }
546
+
547
+ /**
548
+ * Get templates option array
549
+ *
550
+ * @return array
551
+ */
552
+ public function get_templates_option_array(){
553
+ $options = wp_ulike_generate_templates_list();
554
+ $output = array();
555
+
556
+ if( !empty( $options ) ){
557
+ foreach ($options as $key => $args) {
558
+ $output[$key] = $args['symbol'];
559
+ }
560
+ }
561
+
562
+ return $output;
563
+ }
564
+
565
+ }
566
+ }
admin/classes/class-wp-ulike-notices.php CHANGED
@@ -3,7 +3,7 @@
3
  * Wp ULike Admin Notices
4
  *
5
  * @package wp-ulike
6
- * @author TechnoWich 2019
7
  * @link https://wpulike.com
8
  */
9
 
@@ -134,6 +134,9 @@ if ( ! class_exists( 'wp_ulike_notices' ) ) {
134
  'color_name' => 'default',
135
  'link' => '#',
136
  'expiration' => '',
 
 
 
137
  'extra_classes' => 'wp-ulike-notice-btn'
138
  ];
139
 
@@ -156,6 +159,33 @@ if ( ! class_exists( 'wp_ulike_notices' ) ) {
156
  unset( $btn_args['expiration'] );
157
 
158
  $this->buttons .= wp_ulike_widget_button_callback( $btn_args );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
159
  }
160
 
161
  return $this->buttons;
3
  * Wp ULike Admin Notices
4
  *
5
  * @package wp-ulike
6
+ * @author TechnoWich 2020
7
  * @link https://wpulike.com
8
  */
9
 
134
  'color_name' => 'default',
135
  'link' => '#',
136
  'expiration' => '',
137
+ 'ajax_request' => array(
138
+ 'action' => ''
139
+ ),
140
  'extra_classes' => 'wp-ulike-notice-btn'
141
  ];
142
 
159
  unset( $btn_args['expiration'] );
160
 
161
  $this->buttons .= wp_ulike_widget_button_callback( $btn_args );
162
+
163
+ if( !empty( $btn_args['ajax_request']['action'] ) ){
164
+ ob_start();
165
+ ?>
166
+ <script>
167
+ jQuery('.<?php echo esc_js( $this->get_unique_class() ); ?> .wp-ulike-notice-cta-btn').on( 'click' , function(e) {
168
+ e.preventDefault();
169
+ var $currentTargetElement = jQuery(event.currentTarget).addClass('wp-ulike-btn-is-loading');
170
+ jQuery.ajax({
171
+ url : ajaxurl,
172
+ type: 'post',
173
+ data: {
174
+ action : '<?php echo esc_js( $btn_args['ajax_request']['action'] ); ?>',
175
+ nonce : '<?php echo esc_js( wp_create_nonce( '_notice_nonce' ) ); ?>'
176
+ }
177
+ }).done(function( response ) {
178
+ $currentTargetElement.removeClass('wp-ulike-btn-is-loading');
179
+ jQuery(this).closest('.wp-ulike-notice-wrapper').fadeOut();
180
+ if(response.success) {
181
+ location.reload();
182
+ }
183
+ }.bind(this));
184
+ });
185
+ </script>
186
+ <?php
187
+ $this->buttons .= ob_get_clean();
188
+ }
189
  }
190
 
191
  return $this->buttons;
admin/classes/class-wp-ulike-pagination.php CHANGED
@@ -3,7 +3,7 @@
3
  * Class for pagination functionality
4
  *
5
  * @package wp-ulike
6
- * @author TechnoWich 2019
7
  * @link https://wpulike.com
8
  */
9
 
3
  * Class for pagination functionality
4
  *
5
  * @package wp-ulike
6
+ * @author TechnoWich 2020
7
  * @link https://wpulike.com
8
  */
9
 
admin/classes/class-wp-ulike-settings.php CHANGED
@@ -3,7 +3,7 @@
3
  * Class for settings panel
4
  *
5
  * @package wp-ulike
6
- * @author TechnoWich 2019
7
  * @link https://wpulike.com
8
  */
9
 
3
  * Class for settings panel
4
  *
5
  * @package wp-ulike
6
+ * @author TechnoWich 2020
7
  * @link https://wpulike.com
8
  */
9
 
admin/classes/class-wp-ulike-stats.php CHANGED
@@ -3,7 +3,7 @@
3
  * Class for statistics process
4
  *
5
  * @package wp-ulike
6
- * @author TechnoWich 2019
7
  * @link https://wpulike.com
8
  */
9
 
@@ -106,8 +106,8 @@ if ( ! class_exists( 'wp_ulike_stats' ) ) {
106
  $results = $this->select_data( $table );
107
  // Create chart dataset
108
  foreach( $results as $result ){
109
- $output['label'][] = date_i18n( "M j, Y", strtotime( $result->labels ) );
110
- $output['data'][] = $result->counts;
111
  }
112
  // Add chart options
113
  if( ! empty( $output['data'] ) ){
@@ -196,6 +196,7 @@ if ( ! class_exists( 'wp_ulike_stats' ) ) {
196
  $result = $this->wpdb->get_results( $query );
197
 
198
  if( empty( $result ) ) {
 
199
  $result->labels = $result->counts = NULL;
200
  }
201
 
3
  * Class for statistics process
4
  *
5
  * @package wp-ulike
6
+ * @author TechnoWich 2020
7
  * @link https://wpulike.com
8
  */
9
 
106
  $results = $this->select_data( $table );
107
  // Create chart dataset
108
  foreach( $results as $result ){
109
+ $output['label'][] = !empty( $result->labels ) ? date_i18n( "M j, Y", strtotime( $result->labels ) ) : array();
110
+ $output['data'][] = !empty( $result->counts ) ? $result->counts : array();
111
  }
112
  // Add chart options
113
  if( ! empty( $output['data'] ) ){
196
  $result = $this->wpdb->get_results( $query );
197
 
198
  if( empty( $result ) ) {
199
+ $result = new stdClass();
200
  $result->labels = $result->counts = NULL;
201
  }
202
 
admin/classes/class-wp-ulike-widget.php CHANGED
@@ -3,7 +3,7 @@
3
  * Class for our widget support
4
  *
5
  * @package wp-ulike
6
- * @author TechnoWich 2019
7
  * @link https://wpulike.com
8
  */
9
 
3
  * Class for our widget support
4
  *
5
  * @package wp-ulike
6
+ * @author TechnoWich 2020
7
  * @link https://wpulike.com
8
  */
9
 
admin/includes/templates/about.php CHANGED
@@ -3,7 +3,7 @@
3
  * About page template
4
  *
5
  * @package wp-ulike
6
- * @author TechnoWich 2019
7
  * @link https://wpulike.com
8
  */
9
 
3
  * About page template
4
  *
5
  * @package wp-ulike
6
+ * @author TechnoWich 2020
7
  * @link https://wpulike.com
8
  */
9
 
admin/includes/templates/activities-logs.php CHANGED
@@ -3,7 +3,7 @@
3
  * Activities logs page template
4
  *
5
  * @package wp-ulike
6
- * @author TechnoWich 2019
7
  * @link https://wpulike.com
8
  */
9
 
3
  * Activities logs page template
4
  *
5
  * @package wp-ulike
6
+ * @author TechnoWich 2020
7
  * @link https://wpulike.com
8
  */
9
 
admin/includes/templates/comments-logs.php CHANGED
@@ -3,7 +3,7 @@
3
  * Comments logs page template
4
  *
5
  * @package wp-ulike
6
- * @author TechnoWich 2019
7
  * @link https://wpulike.com
8
  */
9
 
3
  * Comments logs page template
4
  *
5
  * @package wp-ulike
6
+ * @author TechnoWich 2020
7
  * @link https://wpulike.com
8
  */
9
 
admin/includes/templates/go-pro.php CHANGED
@@ -3,7 +3,7 @@
3
  * About page template
4
  *
5
  * @package wp-ulike
6
- * @author TechnoWich 2019
7
  * @link https://wpulike.com
8
  */
9
 
@@ -64,6 +64,11 @@
64
  <td><img class="wp-ulike-table-icon" src="<?php echo WP_ULIKE_ASSETS_URL; ?>/img/svg/cross-remove.svg" alt="Cross Remove" /></td>
65
  <td><img class="wp-ulike-table-icon" src="<?php echo WP_ULIKE_ASSETS_URL; ?>/img/svg/checkmark.svg" alt="Checkmark" /></td>
66
  </tr>
 
 
 
 
 
67
  <tr>
68
  <td>+7 Professional Elementor Widgets</td>
69
  <td><img class="wp-ulike-table-icon" src="<?php echo WP_ULIKE_ASSETS_URL; ?>/img/svg/cross-remove.svg" alt="Cross Remove" /></td>
@@ -74,6 +79,11 @@
74
  <td><img class="wp-ulike-table-icon" src="<?php echo WP_ULIKE_ASSETS_URL; ?>/img/svg/cross-remove.svg" alt="Cross Remove" /></td>
75
  <td><img class="wp-ulike-table-icon" src="<?php echo WP_ULIKE_ASSETS_URL; ?>/img/svg/checkmark.svg" alt="Checkmark" /></td>
76
  </tr>
 
 
 
 
 
77
  <tr>
78
  <td>Professional Statistics Panel With date range & status controllers</td>
79
  <td><img class="wp-ulike-table-icon" src="<?php echo WP_ULIKE_ASSETS_URL; ?>/img/svg/cross-remove.svg" alt="Cross Remove" /></td>
3
  * About page template
4
  *
5
  * @package wp-ulike
6
+ * @author TechnoWich 2020
7
  * @link https://wpulike.com
8
  */
9
 
64
  <td><img class="wp-ulike-table-icon" src="<?php echo WP_ULIKE_ASSETS_URL; ?>/img/svg/cross-remove.svg" alt="Cross Remove" /></td>
65
  <td><img class="wp-ulike-table-icon" src="<?php echo WP_ULIKE_ASSETS_URL; ?>/img/svg/checkmark.svg" alt="Checkmark" /></td>
66
  </tr>
67
+ <tr>
68
+ <td>Advanced Settings Panel With Easy Backup and Flexible Customization Options</td>
69
+ <td><img class="wp-ulike-table-icon" src="<?php echo WP_ULIKE_ASSETS_URL; ?>/img/svg/cross-remove.svg" alt="Cross Remove" /></td>
70
+ <td><img class="wp-ulike-table-icon" src="<?php echo WP_ULIKE_ASSETS_URL; ?>/img/svg/checkmark.svg" alt="Checkmark" /></td>
71
+ </tr>
72
  <tr>
73
  <td>+7 Professional Elementor Widgets</td>
74
  <td><img class="wp-ulike-table-icon" src="<?php echo WP_ULIKE_ASSETS_URL; ?>/img/svg/cross-remove.svg" alt="Cross Remove" /></td>
79
  <td><img class="wp-ulike-table-icon" src="<?php echo WP_ULIKE_ASSETS_URL; ?>/img/svg/cross-remove.svg" alt="Cross Remove" /></td>
80
  <td><img class="wp-ulike-table-icon" src="<?php echo WP_ULIKE_ASSETS_URL; ?>/img/svg/checkmark.svg" alt="Checkmark" /></td>
81
  </tr>
82
+ <tr>
83
+ <td>Flexible Metabox Options with More Customization Settings For Each Post</td>
84
+ <td><img class="wp-ulike-table-icon" src="<?php echo WP_ULIKE_ASSETS_URL; ?>/img/svg/cross-remove.svg" alt="Cross Remove" /></td>
85
+ <td><img class="wp-ulike-table-icon" src="<?php echo WP_ULIKE_ASSETS_URL; ?>/img/svg/checkmark.svg" alt="Checkmark" /></td>
86
+ </tr>
87
  <tr>
88
  <td>Professional Statistics Panel With date range & status controllers</td>
89
  <td><img class="wp-ulike-table-icon" src="<?php echo WP_ULIKE_ASSETS_URL; ?>/img/svg/cross-remove.svg" alt="Cross Remove" /></td>
admin/includes/templates/posts-logs.php CHANGED
@@ -3,7 +3,7 @@
3
  * Posts logs page template
4
  *
5
  * @package wp-ulike
6
- * @author TechnoWich 2019
7
  * @link https://wpulike.com
8
  */
9
 
3
  * Posts logs page template
4
  *
5
  * @package wp-ulike
6
+ * @author TechnoWich 2020
7
  * @link https://wpulike.com
8
  */
9
 
admin/includes/templates/statistics.php CHANGED
@@ -3,7 +3,7 @@
3
  * Statistics page template
4
  *
5
  * @package wp-ulike
6
- * @author TechnoWich 2019
7
  * @link https://wpulike.com
8
  */
9
 
3
  * Statistics page template
4
  *
5
  * @package wp-ulike
6
+ * @author TechnoWich 2020
7
  * @link https://wpulike.com
8
  */
9
 
admin/includes/templates/topics-logs.php CHANGED
@@ -3,7 +3,7 @@
3
  * Topics logs page template
4
  *
5
  * @package wp-ulike
6
- * @author TechnoWich 2019
7
  * @link https://wpulike.com
8
  */
9
 
3
  * Topics logs page template
4
  *
5
  * @package wp-ulike
6
+ * @author TechnoWich 2020
7
  * @link https://wpulike.com
8
  */
9
 
admin/index.php CHANGED
@@ -3,7 +3,7 @@
3
  * Include admin files
4
  *
5
  * @package wp-ulike
6
- * @author TechnoWich 2019
7
  * @link https://wpulike.com
8
  */
9
 
@@ -12,10 +12,12 @@ if ( ! defined( 'WPINC' ) ) {
12
  die('No Naughty Business Please !');
13
  }
14
 
 
 
 
 
 
15
  //include about menu functions
16
  require_once( WP_ULIKE_ADMIN_DIR . '/admin-functions.php');
17
  //include logs menu functions
18
- require_once( WP_ULIKE_ADMIN_DIR . '/admin-hooks.php');
19
-
20
- // Register admin menus
21
- new wp_ulike_admin_pages();
3
  * Include admin files
4
  *
5
  * @package wp-ulike
6
+ * @author TechnoWich 2020
7
  * @link https://wpulike.com
8
  */
9
 
12
  die('No Naughty Business Please !');
13
  }
14
 
15
+ //include settings panel
16
+ require_once( WP_ULIKE_ADMIN_DIR . '/settings/classes/setup.class.php');
17
+ // Register admin menus
18
+ new wp_ulike_admin_panel();
19
+
20
  //include about menu functions
21
  require_once( WP_ULIKE_ADMIN_DIR . '/admin-functions.php');
22
  //include logs menu functions
23
+ require_once( WP_ULIKE_ADMIN_DIR . '/admin-hooks.php');
 
 
 
admin/settings/assets/css/csf-rtl.css ADDED
@@ -0,0 +1,517 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ *
3
+ * ---------------------------------------------------------
4
+ * CODESTAR FRAMEWORK RTL CSS MAP
5
+ * ---------------------------------------------------------
6
+ *
7
+ * 01. Base
8
+ * 01. 01. Header
9
+ * 01. 02. Header Buttons
10
+ * 01. 03. Navigation
11
+ * 01. 04. Content
12
+ * 01. 05. Section
13
+ * 01. 06. Show All Options
14
+ * 01. 07. Search Input
15
+ * 01. 08. Copyright
16
+ * 01. 09. Metabox
17
+ * 02. Fields
18
+ * 02. 01. Field: typography
19
+ * 02. 02. Field: checkbox, radio
20
+ * 02. 03. Field: switcher
21
+ * 02. 04. Field: upload
22
+ * 02. 05. Field: group
23
+ * 02. 06. Field: repeater
24
+ * 02. 07. Field: help
25
+ * 02. 08. Field: icon
26
+ * 02. 09. Field: gallery
27
+ * 02. 10. Field: sorter
28
+ * 02. 11. Field: tabbed
29
+ * 02. 12. Field: media
30
+ * 02. 13. Field: notice
31
+ * 02. 14. Field: border, spacing, dimensions
32
+ * 02. 15. Field: background
33
+ * 02. 16. Field: spinner
34
+ * 02. 17. Field: slider
35
+ * 02. 18. Field: button_set
36
+ * 02. 19. Field: link_color
37
+ * 02. 20. Field: color_group
38
+ * 02. 21. Field: palette
39
+ * 03. Taxonomy
40
+ * 04. Profile
41
+ * 05. Modal
42
+ * 06. Customizer
43
+ * 07. Responsive
44
+ * 08. Others
45
+ *
46
+ * ---------------------------------------------------------
47
+ *
48
+ */
49
+ /**
50
+ * 01. Base
51
+ */
52
+ .csf {
53
+ margin-left: 20px;
54
+ margin-right: 0;
55
+ }
56
+
57
+ /**
58
+ * 01. 01. Header
59
+ */
60
+ .csf-header h1 {
61
+ float: right;
62
+ }
63
+ .csf-header fieldset {
64
+ float: left;
65
+ }
66
+
67
+ /**
68
+ * 01. 02. Header Buttons
69
+ */
70
+ .csf-buttons {
71
+ float: left;
72
+ direction: ltr;
73
+ }
74
+
75
+ .csf-header-left {
76
+ float: right;
77
+ }
78
+
79
+ .csf-header-right {
80
+ float: left;
81
+ }
82
+
83
+ /**
84
+ * 01. 03. Navigation
85
+ */
86
+ .csf-nav {
87
+ float: right;
88
+ }
89
+ .csf-nav ul {
90
+ clear: right;
91
+ }
92
+ .csf-nav ul li .csf-section-active:after {
93
+ right: auto;
94
+ left: 0;
95
+ border-left-color: #fff;
96
+ border-right-color: transparent;
97
+ }
98
+ .csf-nav ul li .csf-arrow:after {
99
+ content: "\f053";
100
+ right: auto;
101
+ left: 10px;
102
+ }
103
+ .csf-nav ul li.csf-tab-active .csf-arrow:after {
104
+ -moz-transform: rotate(-90deg);
105
+ -ms-transform: rotate(-90deg);
106
+ -webkit-transform: rotate(-90deg);
107
+ transform: rotate(-90deg);
108
+ }
109
+ .csf-nav ul ul li a {
110
+ padding-right: 25px;
111
+ padding-left: 15px;
112
+ }
113
+ .csf-nav ul ul:before {
114
+ left: auto;
115
+ right: 15px;
116
+ }
117
+ .csf-nav .fa {
118
+ margin-left: 5px;
119
+ margin-right: 0;
120
+ }
121
+
122
+ .csf-nav-background {
123
+ left: auto;
124
+ right: 0;
125
+ }
126
+
127
+ /**
128
+ * 01. 04. Content
129
+ */
130
+ .csf-content {
131
+ margin-left: 0;
132
+ margin-right: 225px;
133
+ }
134
+
135
+ /**
136
+ * 01. 05. Section
137
+ */
138
+ .csf-sections {
139
+ float: right;
140
+ }
141
+
142
+ /**
143
+ * 01. 06. Show all options
144
+ */
145
+ .csf-show-all .csf-content {
146
+ margin-right: 0;
147
+ overflow: hidden;
148
+ }
149
+
150
+ .csf-expand-all {
151
+ float: right;
152
+ right: auto;
153
+ left: 40px;
154
+ margin-right: 0;
155
+ margin-left: 4px;
156
+ }
157
+
158
+ /**
159
+ * 01. 07. Search Input
160
+ */
161
+ .csf-search {
162
+ float: right;
163
+ }
164
+ .csf-search input {
165
+ margin: 0 0 0 5px;
166
+ }
167
+
168
+ /**
169
+ * 01. 08. Copyright
170
+ */
171
+ .csf-copyright {
172
+ float: right;
173
+ }
174
+
175
+ /**
176
+ * 01. 09. Metabox
177
+ */
178
+ .csf-metabox {
179
+ margin: -6px -12px -12px -12px;
180
+ }
181
+ .csf-metabox .csf-section-title {
182
+ padding: 20px;
183
+ }
184
+ .csf-metabox .csf-section-title .fa {
185
+ margin-left: 5px;
186
+ margin-right: 0;
187
+ }
188
+
189
+ .csf-section-title .fa {
190
+ margin-left: 5px;
191
+ margin-right: 0;
192
+ }
193
+
194
+ /**
195
+ * 02. Fields
196
+ */
197
+ .csf-field .csf-title {
198
+ float: right;
199
+ }
200
+ .csf-field .csf-fieldset {
201
+ margin-left: 0;
202
+ margin-right: 30%;
203
+ }
204
+
205
+ .csf-pseudo-field {
206
+ padding: 0 0 0 5px !important;
207
+ }
208
+
209
+ /**
210
+ * 02. 01. Field: typography
211
+ */
212
+ .csf-field-typography select {
213
+ margin: 0;
214
+ width: 100%;
215
+ }
216
+ .csf-field-typography .csf--blocks-inputs .csf--blocks {
217
+ flex-direction: row-reverse;
218
+ }
219
+
220
+ /**
221
+ * 02. 02. Field: checkbox, radio
222
+ */
223
+ .csf-field-checkbox .csf--inline-list li,
224
+ .csf-field-radio .csf--inline-list li {
225
+ margin-right: 0;
226
+ margin-left: 15px;
227
+ }
228
+
229
+ /**
230
+ * 02. 03. Field: switcher
231
+ */
232
+ .csf-field-switcher .csf--switcher {
233
+ float: right;
234
+ }
235
+ .csf-field-switcher .csf--label {
236
+ float: right;
237
+ margin-left: 0;
238
+ margin-right: 5px;
239
+ }
240
+
241
+ /**
242
+ * 02. 04. Field: upload
243
+ */
244
+ .csf-field-upload .csf--remove,
245
+ .csf-field-upload .csf--buttons {
246
+ margin-left: 0;
247
+ margin-right: 5px;
248
+ }
249
+
250
+ /**
251
+ * 02. 05. Field: group
252
+ */
253
+ .csf-field-group .csf-cloneable-title {
254
+ padding: 15px 10px 15px 65px;
255
+ }
256
+ .csf-field-group .csf-cloneable-helper {
257
+ right: auto;
258
+ left: 10px;
259
+ }
260
+
261
+ /**
262
+ * 02. 06. Field: repeater
263
+ */
264
+ .csf-field-repeater .csf-repeater-helper {
265
+ border-left: 0;
266
+ border-right: 1px solid #eee;
267
+ }
268
+
269
+ /**
270
+ * 02. 07. Field: help
271
+ */
272
+ .csf-help {
273
+ right: auto;
274
+ left: 5px;
275
+ }
276
+
277
+ /**
278
+ * 02. 08. Field: icon
279
+ */
280
+ .csf-field-icon .button {
281
+ margin-right: 0;
282
+ margin-left: 5px;
283
+ }
284
+ .csf-field-icon .csf-icon-preview i {
285
+ margin-right: 0;
286
+ margin-left: 5px;
287
+ }
288
+
289
+ /**
290
+ * 02. 09. Field: gallery
291
+ */
292
+ .csf-field-gallery ul li {
293
+ margin-right: 0;
294
+ margin-left: 5px;
295
+ }
296
+ .csf-field-gallery .button {
297
+ margin-right: 0;
298
+ margin-left: 5px;
299
+ }
300
+
301
+ /**
302
+ * 02. 11. Field: tabbed
303
+ */
304
+ .csf-field-tabbed .csf-tabbed-nav .fa {
305
+ padding-right: 0;
306
+ padding-left: 5px;
307
+ }
308
+ .csf-field-tabbed .csf-tabbed-nav a {
309
+ margin-right: 0;
310
+ margin-left: 5px;
311
+ }
312
+
313
+ /**
314
+ * 02. 12. Field: media
315
+ */
316
+ .csf-field-media .button {
317
+ margin-left: 0;
318
+ margin-right: 7px;
319
+ }
320
+ .csf-field-media .hidden + .button {
321
+ margin-right: 0;
322
+ }
323
+
324
+ /**
325
+ * 02. 13. Field: notice
326
+ */
327
+ .csf-notice {
328
+ border-left: none;
329
+ border-right-style: solid;
330
+ border-right-width: 4px;
331
+ }
332
+
333
+ /**
334
+ * 02. 14. Field: border, spacing, dimensions
335
+ */
336
+ .csf-field-dimensions .csf--input,
337
+ .csf-field-spacing .csf--input,
338
+ .csf-field-border .csf--input {
339
+ float: right;
340
+ margin-right: 0;
341
+ margin-left: 15px;
342
+ }
343
+ .csf-field-dimensions .csf--left,
344
+ .csf-field-spacing .csf--left,
345
+ .csf-field-border .csf--left {
346
+ float: right;
347
+ }
348
+
349
+ /**
350
+ * 02. 15. Field: background
351
+ */
352
+ .csf-field-background .csf--block {
353
+ float: right;
354
+ }
355
+ .csf-field-background .csf--select,
356
+ .csf-field-background .csf--media {
357
+ padding-right: 0;
358
+ }
359
+ .csf-field-background .csf--title {
360
+ margin-right: 0;
361
+ margin-left: 5px;
362
+ }
363
+
364
+ /**
365
+ * 02. 16. Field: spinner
366
+ */
367
+ .csf-field-spinner .csf--spin {
368
+ float: right;
369
+ }
370
+
371
+ /**
372
+ * 02. 17. Field: slider
373
+ */
374
+ .csf-field-slider .ui-slider {
375
+ direction: ltr;
376
+ }
377
+ .csf-field-slider input[type="text"] {
378
+ margin-left: 0;
379
+ margin-right: 15px;
380
+ }
381
+ .csf-field-slider em {
382
+ padding-left: 0;
383
+ padding-right: 5px;
384
+ }
385
+
386
+ /**
387
+ * 02. 18. Field: button_set
388
+ */
389
+ .csf-field-button_set .csf--button-group {
390
+ float: right;
391
+ }
392
+
393
+ /**
394
+ * 02. 19. Field: link_color
395
+ */
396
+ .csf-field-link_color .csf--left {
397
+ float: right;
398
+ margin-right: 0;
399
+ margin-left: 10px;
400
+ }
401
+
402
+ /**
403
+ * 02. 20. Field: color_group
404
+ */
405
+ .csf-field-color_group .csf--left {
406
+ float: right;
407
+ margin-right: 0;
408
+ margin-left: 10px;
409
+ }
410
+
411
+ /**
412
+ * 02. 21. Field: palette
413
+ */
414
+ .csf-field-palette .csf--palette {
415
+ margin-right: 0;
416
+ margin-left: 10px;
417
+ }
418
+
419
+ /**
420
+ * 03. Taxonomy
421
+ */
422
+ .csf-taxonomy-add-fields .csf-fieldset {
423
+ margin-right: 0;
424
+ }
425
+ .csf-taxonomy-add-fields .csf-field > .csf-fieldset > .csf-help {
426
+ left: -5px;
427
+ right: auto;
428
+ }
429
+
430
+ .csf-taxonomy-edit-fields .csf-fieldset {
431
+ margin-left: 0;
432
+ margin-right: 225px;
433
+ }
434
+ .csf-taxonomy-edit-fields .csf-field > .csf-fieldset > .csf-help {
435
+ right: auto;
436
+ left: -5px;
437
+ }
438
+
439
+ /**
440
+ * 04. Profile
441
+ */
442
+ .csf-profile > h2 > .fa {
443
+ padding-right: 0;
444
+ padding-left: 7px;
445
+ }
446
+ .csf-profile > .csf-field > .csf-fieldset {
447
+ margin-left: 0;
448
+ margin-right: 220px;
449
+ }
450
+ .csf-profile > .csf-field > .csf-help {
451
+ left: 0;
452
+ right: auto;
453
+ }
454
+
455
+ .csf-taxonomy-edit-fields .csf-fieldset {
456
+ margin-left: 0;
457
+ margin-right: 225px;
458
+ }
459
+ .csf-taxonomy-edit-fields .csf-field > .csf-fieldset > .csf-help {
460
+ right: auto;
461
+ left: -5px;
462
+ }
463
+
464
+ /**
465
+ * 05. Modal
466
+ */
467
+ .csf-modal-content .csf-field {
468
+ padding: 15px 15px 15px 30px;
469
+ }
470
+
471
+ .csf-modal-title {
472
+ padding: 0 16px 0 36px;
473
+ }
474
+
475
+ .csf-modal-close {
476
+ right: auto;
477
+ left: 0;
478
+ }
479
+
480
+ /**
481
+ * 06. Customizer
482
+ */
483
+ .control-section .csf-field .csf-fieldset {
484
+ margin-right: 0;
485
+ }
486
+
487
+ /**
488
+ * 07. Responsive
489
+ */
490
+ @media only screen and (max-width: 1200px) {
491
+ .csf-metabox .csf-field .csf-fieldset {
492
+ margin-left: 0;
493
+ }
494
+ }
495
+ @media only screen and (max-width: 782px) {
496
+ .csf .csf-fieldset,
497
+ .csf .csf-content {
498
+ margin-right: 0;
499
+ }
500
+ }
501
+ /**
502
+ * 08. Others
503
+ */
504
+ .csf-field .csf--transparent-slider {
505
+ margin-left: 0;
506
+ margin-right: 2px;
507
+ }
508
+ .csf-field .csf--transparent-slider .ui-slider-handle {
509
+ margin: 0 -11px;
510
+ }
511
+ .csf-field .csf--transparent-offset {
512
+ background-position: center right;
513
+ }
514
+ .csf-field .csf--transparent-text {
515
+ right: auto;
516
+ left: 10px;
517
+ }
admin/settings/assets/css/csf-rtl.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .csf{margin-left:20px;margin-right:0}.csf-header h1{float:right}.csf-header fieldset{float:left}.csf-buttons{float:left;direction:ltr}.csf-header-left{float:right}.csf-header-right{float:left}.csf-nav{float:right}.csf-nav ul{clear:right}.csf-nav ul li .csf-section-active:after{right:auto;left:0;border-left-color:#fff;border-right-color:transparent}.csf-nav ul li .csf-arrow:after{content:"\f053";right:auto;left:10px}.csf-nav ul li.csf-tab-active .csf-arrow:after{-moz-transform:rotate(-90deg);-ms-transform:rotate(-90deg);-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.csf-nav ul ul li a{padding-right:25px;padding-left:15px}.csf-nav ul ul:before{left:auto;right:15px}.csf-nav .fa{margin-left:5px;margin-right:0}.csf-nav-background{left:auto;right:0}.csf-content{margin-left:0;margin-right:225px}.csf-sections{float:right}.csf-show-all .csf-content{margin-right:0;overflow:hidden}.csf-expand-all{float:right;right:auto;left:40px;margin-right:0;margin-left:4px}.csf-search{float:right}.csf-search input{margin:0 0 0 5px}.csf-copyright{float:right}.csf-metabox{margin:-6px -12px -12px -12px}.csf-metabox .csf-section-title{padding:20px}.csf-metabox .csf-section-title .fa{margin-left:5px;margin-right:0}.csf-section-title .fa{margin-left:5px;margin-right:0}.csf-field .csf-title{float:right}.csf-field .csf-fieldset{margin-left:0;margin-right:30%}.csf-pseudo-field{padding:0 0 0 5px!important}.csf-field-typography select{margin:0;width:100%}.csf-field-typography .csf--blocks-inputs .csf--blocks{flex-direction:row-reverse}.csf-field-checkbox .csf--inline-list li,.csf-field-radio .csf--inline-list li{margin-right:0;margin-left:15px}.csf-field-switcher .csf--switcher{float:right}.csf-field-switcher .csf--label{float:right;margin-left:0;margin-right:5px}.csf-field-upload .csf--buttons,.csf-field-upload .csf--remove{margin-left:0;margin-right:5px}.csf-field-group .csf-cloneable-title{padding:15px 10px 15px 65px}.csf-field-group .csf-cloneable-helper{right:auto;left:10px}.csf-field-repeater .csf-repeater-helper{border-left:0;border-right:1px solid #eee}.csf-help{right:auto;left:5px}.csf-field-icon .button{margin-right:0;margin-left:5px}.csf-field-icon .csf-icon-preview i{margin-right:0;margin-left:5px}.csf-field-gallery ul li{margin-right:0;margin-left:5px}.csf-field-gallery .button{margin-right:0;margin-left:5px}.csf-field-tabbed .csf-tabbed-nav .fa{padding-right:0;padding-left:5px}.csf-field-tabbed .csf-tabbed-nav a{margin-right:0;margin-left:5px}.csf-field-media .button{margin-left:0;margin-right:7px}.csf-field-media .hidden+.button{margin-right:0}.csf-notice{border-left:none;border-right-style:solid;border-right-width:4px}.csf-field-border .csf--input,.csf-field-dimensions .csf--input,.csf-field-spacing .csf--input{float:right;margin-right:0;margin-left:15px}.csf-field-border .csf--left,.csf-field-dimensions .csf--left,.csf-field-spacing .csf--left{float:right}.csf-field-background .csf--block{float:right}.csf-field-background .csf--media,.csf-field-background .csf--select{padding-right:0}.csf-field-background .csf--title{margin-right:0;margin-left:5px}.csf-field-spinner .csf--spin{float:right}.csf-field-slider .ui-slider{direction:ltr}.csf-field-slider input[type=text]{margin-left:0;margin-right:15px}.csf-field-slider em{padding-left:0;padding-right:5px}.csf-field-button_set .csf--button-group{float:right}.csf-field-link_color .csf--left{float:right;margin-right:0;margin-left:10px}.csf-field-color_group .csf--left{float:right;margin-right:0;margin-left:10px}.csf-field-palette .csf--palette{margin-right:0;margin-left:10px}.csf-taxonomy-add-fields .csf-fieldset{margin-right:0}.csf-taxonomy-add-fields .csf-field>.csf-fieldset>.csf-help{left:-5px;right:auto}.csf-taxonomy-edit-fields .csf-fieldset{margin-left:0;margin-right:225px}.csf-taxonomy-edit-fields .csf-field>.csf-fieldset>.csf-help{right:auto;left:-5px}.csf-profile>h2>.fa{padding-right:0;padding-left:7px}.csf-profile>.csf-field>.csf-fieldset{margin-left:0;margin-right:220px}.csf-profile>.csf-field>.csf-help{left:0;right:auto}.csf-taxonomy-edit-fields .csf-fieldset{margin-left:0;margin-right:225px}.csf-taxonomy-edit-fields .csf-field>.csf-fieldset>.csf-help{right:auto;left:-5px}.csf-modal-content .csf-field{padding:15px 15px 15px 30px}.csf-modal-title{padding:0 16px 0 36px}.csf-modal-close{right:auto;left:0}.control-section .csf-field .csf-fieldset{margin-right:0}@media only screen and (max-width:1200px){.csf-metabox .csf-field .csf-fieldset{margin-left:0}}@media only screen and (max-width:782px){.csf .csf-content,.csf .csf-fieldset{margin-right:0}}.csf-field .csf--transparent-slider{margin-left:0;margin-right:2px}.csf-field .csf--transparent-slider .ui-slider-handle{margin:0 -11px}.csf-field .csf--transparent-offset{background-position:center right}.csf-field .csf--transparent-text{right:auto;left:10px}
admin/settings/assets/css/csf.css ADDED
@@ -0,0 +1,4132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ *
3
+ * ---------------------------------------------------------
4
+ * CODESTAR FRAMEWORK CSS MAP
5
+ * ---------------------------------------------------------
6
+ *
7
+ * 01. Base
8
+ * 01. 01. Header
9
+ * 01. 02. Sticky
10
+ * 01. 03. Header Buttons
11
+ * 01. 04. Navigation
12
+ * 01. 05. Wrapper
13
+ * 01. 06. Content
14
+ * 01. 07. Section
15
+ * 01. 08. Footer
16
+ * 01. 09. Copyright
17
+ * 01. 10. Show All Options
18
+ * 01. 11. Search Input
19
+ * 01. 12. Metabox
20
+ * 01. 13. Comment Metabox
21
+ * 01. 14. Help Tooltip
22
+ * 02. Themes
23
+ * 02. 01. Theme Dark
24
+ * 02. 02. Theme Light
25
+ * 03. Fields
26
+ * 03. 01. Field
27
+ * 03. 02. Field: accordion
28
+ * 03. 03. Field: background
29
+ * 03. 04. Field: backup
30
+ * 03. 05. Field: border, spacing, dimensions
31
+ * 03. 06. Field: button_set
32
+ * 03. 07. Field: checkbox, radio
33
+ * 03. 08. Field: code_editor
34
+ * 03. 09. Field: color
35
+ * 03. 10. Field: color_group
36
+ * 03. 11. Field: fieldset
37
+ * 03. 12. Field: date
38
+ * 03. 13. Field: gallery
39
+ * 03. 14. Field: group
40
+ * 03. 15. Field: icon
41
+ * 03. 16. Field: image_select
42
+ * 03. 17. Field: link_color
43
+ * 03. 18. Field: map
44
+ * 03. 19. Field: media
45
+ * 03. 20. Field: palette
46
+ * 03. 21. Field: repeater
47
+ * 03. 22. Field: select
48
+ * 03. 23. Field: slider
49
+ * 03. 24. Field: sortable
50
+ * 03. 25. Field: sorter
51
+ * 03. 26. Field: spinner
52
+ * 03. 27. Field: switcher
53
+ * 03. 28. Field: tabbed
54
+ * 03. 29. Field: text
55
+ * 03. 30. Field: textarea
56
+ * 03. 31. Field: typography
57
+ * 03. 32. Field: upload
58
+ * 03. 33. Field: wp_editor
59
+ * 03. 34. Field: heading
60
+ * 03. 35. Field: subheading
61
+ * 03. 36. Field: submessage
62
+ * 03. 37. Field: notice
63
+ * 03. 38. Field: number
64
+ * 03. 39. Field: others
65
+ * 04. Widget
66
+ * 05. Customizer
67
+ * 06. Taxonomy
68
+ * 07. Profile
69
+ * 08. Modal
70
+ * 08. 01. Shortcode Modal
71
+ * 08. 02. Gutenberg Modal
72
+ * 08. 03. Icon Modal
73
+ * 09. Helper
74
+ * 10. Welcome Page
75
+ * 11. Responsive
76
+ * 12. Others
77
+ *
78
+ * ---------------------------------------------------------
79
+ *
80
+ */
81
+ /**
82
+ * 01. Base
83
+ */
84
+ .csf {
85
+ position: relative;
86
+ }
87
+ .csf label {
88
+ padding: 0;
89
+ margin: 0;
90
+ display: inline-block;
91
+ }
92
+
93
+ .csf-ab-icon {
94
+ top: 2px;
95
+ }
96
+
97
+ #screen-meta-links + .csf-options {
98
+ margin-top: 40px;
99
+ }
100
+
101
+ .csf-options {
102
+ margin-top: 20px;
103
+ margin-right: 20px;
104
+ }
105
+
106
+ /**
107
+ * 01. 01. Header
108
+ */
109
+ .csf-header {
110
+ position: relative;
111
+ }
112
+
113
+ .csf-header-inner {
114
+ padding: 25px;
115
+ }
116
+ .csf-header-inner h1 {
117
+ float: left;
118
+ font-size: 1.5em;
119
+ line-height: 26px;
120
+ font-weight: 400;
121
+ margin: 0;
122
+ }
123
+ .csf-header-inner h1 small {
124
+ font-size: 11px;
125
+ font-weight: 500;
126
+ }
127
+
128
+ /**
129
+ * 01. 02. Sticky
130
+ */
131
+ .csf-sticky .csf-header-inner {
132
+ position: fixed;
133
+ z-index: 99999;
134
+ top: 32px;
135
+ -moz-box-shadow: 0 5px 25px rgba(0, 0, 0, 0.125);
136
+ -webkit-box-shadow: 0 5px 25px rgba(0, 0, 0, 0.125);
137
+ box-shadow: 0 5px 25px rgba(0, 0, 0, 0.125);
138
+ }
139
+
140
+ /**
141
+ * 01. 03. Header Buttons
142
+ */
143
+ .csf-buttons {
144
+ float: right;
145
+ -moz-transition: opacity 0.2s;
146
+ -o-transition: opacity 0.2s;
147
+ -webkit-transition: opacity 0.2s;
148
+ transition: opacity 0.2s;
149
+ }
150
+ .csf-buttons .button {
151
+ margin: 0 2px;
152
+ line-height: 26px;
153
+ }
154
+ .csf-buttons .button:focus {
155
+ outline: none !important;
156
+ box-shadow: none !important;
157
+ }
158
+ .csf-buttons .csf-save {
159
+ min-width: 72px;
160
+ }
161
+
162
+ .csf-header-left {
163
+ float: left;
164
+ }
165
+
166
+ .csf-header-right {
167
+ float: right;
168
+ }
169
+
170
+ /**
171
+ * 01. 04. Navigation
172
+ */
173
+ .csf-nav {
174
+ display: block;
175
+ position: relative;
176
+ z-index: 10;
177
+ float: left;
178
+ width: 225px;
179
+ }
180
+ .csf-nav ul {
181
+ clear: left;
182
+ margin: 0;
183
+ list-style-type: none;
184
+ }
185
+ .csf-nav ul li {
186
+ margin-bottom: 0;
187
+ }
188
+ .csf-nav ul li a {
189
+ font-size: 13px;
190
+ position: relative;
191
+ display: block;
192
+ padding: 14px 12px;
193
+ text-decoration: none;
194
+ -moz-transition: all 0.3s ease;
195
+ -o-transition: all 0.3s ease;
196
+ -webkit-transition: all 0.3s ease;
197
+ transition: all 0.3s ease;
198
+ }
199
+ .csf-nav ul li a:focus {
200
+ outline: none;
201
+ -moz-box-shadow: none;
202
+ -webkit-box-shadow: none;
203
+ box-shadow: none;
204
+ }
205
+ .csf-nav ul li .csf-section-active:after {
206
+ content: " ";
207
+ position: absolute;
208
+ right: 0;
209
+ top: 50%;
210
+ height: 0;
211
+ width: 0;
212
+ pointer-events: none;
213
+ border: solid transparent;
214
+ border-right-color: #fff;
215
+ border-width: 4px;
216
+ margin-top: -4px;
217
+ }
218
+ .csf-nav ul li .csf-arrow:after {
219
+ content: "\f054";
220
+ display: inline-block;
221
+ font-family: "FontAwesome";
222
+ font-size: 9px;
223
+ line-height: 1;
224
+ position: absolute;
225
+ right: 10px;
226
+ top: 50%;
227
+ margin-top: -4px;
228
+ -moz-transform: rotate(0);
229
+ -ms-transform: rotate(0);
230
+ -webkit-transform: rotate(0);
231
+ transform: rotate(0);
232
+ }
233
+ .csf-nav ul li.csf-tab-active .csf-arrow:after {
234
+ -moz-transform: rotate(90deg);
235
+ -ms-transform: rotate(90deg);
236
+ -webkit-transform: rotate(90deg);
237
+ transform: rotate(90deg);
238
+ }
239
+ .csf-nav ul li.csf-tab-active ul {
240
+ display: block;
241
+ }
242
+ .csf-nav ul ul {
243
+ display: none;
244
+ position: relative;
245
+ }
246
+ .csf-nav ul ul li a {
247
+ font-size: 12px;
248
+ padding: 12px 14px 12px 24px;
249
+ }
250
+ .csf-nav .fa {
251
+ width: 20px;
252
+ margin-right: 5px;
253
+ font-size: 14px;
254
+ text-align: center;
255
+ }
256
+ .csf-nav .csf-label-error {
257
+ margin-left: 4px;
258
+ vertical-align: top;
259
+ }
260
+
261
+ .csf-nav-background {
262
+ position: absolute;
263
+ top: 0;
264
+ left: 0;
265
+ bottom: 0;
266
+ z-index: 9;
267
+ width: 225px;
268
+ }
269
+
270
+ /**
271
+ * 01. 05. Wrapper
272
+ */
273
+ .csf-wrapper {
274
+ position: relative;
275
+ }
276
+
277
+ /**
278
+ * 01. 06. Content
279
+ */
280
+ .csf-content {
281
+ position: relative;
282
+ margin-left: 225px;
283
+ background-color: #fff;
284
+ -moz-transition: opacity 0.2s;
285
+ -o-transition: opacity 0.2s;
286
+ -webkit-transition: opacity 0.2s;
287
+ transition: opacity 0.2s;
288
+ }
289
+
290
+ /**
291
+ * 01. 07. Section
292
+ */
293
+ .csf-sections {
294
+ float: left;
295
+ width: 100%;
296
+ }
297
+
298
+ .csf-section {
299
+ display: none;
300
+ }
301
+
302
+ .csf-section-title {
303
+ display: none;
304
+ padding: 20px 30px;
305
+ background-color: #f5f5f5;
306
+ border-top: 1px solid #eee;
307
+ border-bottom: 1px solid #eee;
308
+ }
309
+ .csf-section-title h3 {
310
+ margin: 0;
311
+ padding: 0;
312
+ font-size: 13px;
313
+ font-weight: bold;
314
+ text-transform: uppercase;
315
+ }
316
+ .csf-section-title .fa {
317
+ margin-right: 5px;
318
+ }
319
+
320
+ /**
321
+ * 01. 08. Footer
322
+ */
323
+ .csf-footer {
324
+ padding: 20px;
325
+ font-size: 11px;
326
+ }
327
+
328
+ /**
329
+ * 01. 09. Copyright
330
+ */
331
+ .csf-copyright {
332
+ float: left;
333
+ margin-top: 5px;
334
+ }
335
+
336
+ /**
337
+ * 01. 10. Show All Options
338
+ */
339
+ .csf-search-all .csf-nav-background,
340
+ .csf-search-all .csf-nav,
341
+ .csf-show-all .csf-nav-background,
342
+ .csf-show-all .csf-nav {
343
+ display: none;
344
+ }
345
+ .csf-search-all .csf-content,
346
+ .csf-show-all .csf-content {
347
+ margin-left: 0;
348
+ }
349
+ .csf-search-all .csf-section-title,
350
+ .csf-search-all .csf-section,
351
+ .csf-show-all .csf-section-title,
352
+ .csf-show-all .csf-section {
353
+ display: block !important;
354
+ }
355
+
356
+ .csf-search-all .csf-section-title {
357
+ display: none !important;
358
+ }
359
+
360
+ .csf-expand-all {
361
+ float: left;
362
+ padding: 0 8px;
363
+ margin-right: 4px;
364
+ z-index: 1;
365
+ font-size: 14px;
366
+ line-height: 28px;
367
+ cursor: pointer;
368
+ user-select: none;
369
+ -moz-border-radius: 2px;
370
+ -webkit-border-radius: 2px;
371
+ border-radius: 2px;
372
+ -moz-transition: all 0.2s;
373
+ -o-transition: all 0.2s;
374
+ -webkit-transition: all 0.2s;
375
+ transition: all 0.2s;
376
+ }
377
+ .csf-expand-all span {
378
+ font-size: 11px;
379
+ vertical-align: middle;
380
+ }
381
+
382
+ /**
383
+ * 01. 11. Search Input
384
+ */
385
+ .csf-search {
386
+ float: left;
387
+ }
388
+ .csf-search input {
389
+ margin: 0 2px 0 0;
390
+ border: none;
391
+ font-size: 12px;
392
+ line-height: 28px;
393
+ min-height: 28px;
394
+ text-align: inherit;
395
+ padding: 0 10px;
396
+ -moz-border-radius: 2px;
397
+ -webkit-border-radius: 2px;
398
+ border-radius: 2px;
399
+ -moz-box-shadow: none;
400
+ -webkit-box-shadow: none;
401
+ box-shadow: none;
402
+ }
403
+ .csf-search input:focus {
404
+ -moz-box-shadow: none;
405
+ -webkit-box-shadow: none;
406
+ box-shadow: none;
407
+ }
408
+
409
+ .csf-saving .csf-buttons,
410
+ .csf-saving .csf-content {
411
+ cursor: default;
412
+ pointer-events: none;
413
+ opacity: 0.5;
414
+ }
415
+
416
+ /**
417
+ * 01. 12. Metabox
418
+ */
419
+ .csf-metabox {
420
+ margin: -6px -12px -12px -12px;
421
+ }
422
+ .csf-metabox .csf-section-title {
423
+ padding: 20px;
424
+ }
425
+
426
+ .block-editor-page .csf-metabox {
427
+ margin: -6px -14px -12px -14px;
428
+ }
429
+
430
+ .csf-restore-wrapper {
431
+ text-align: right;
432
+ padding: 10px;
433
+ border-top: 1px solid #eee;
434
+ }
435
+ .csf-restore-wrapper .csf-button-cancel,
436
+ .csf-restore-wrapper input {
437
+ display: none;
438
+ }
439
+ .csf-restore-wrapper span {
440
+ -webkit-user-select: none;
441
+ user-select: none;
442
+ }
443
+ .csf-restore-wrapper input:checked ~ .csf-button-restore {
444
+ display: none;
445
+ }
446
+ .csf-restore-wrapper input:checked ~ .csf-button-cancel {
447
+ display: inline-block;
448
+ }
449
+
450
+ #side-sortables .csf-section-title {
451
+ padding: 12px;
452
+ }
453
+ #side-sortables .csf-field {
454
+ padding: 12px;
455
+ }
456
+ #side-sortables .csf-field .csf-title {
457
+ float: none;
458
+ width: 100%;
459
+ margin-bottom: 10px;
460
+ }
461
+ #side-sortables .csf-field .csf-fieldset {
462
+ margin-left: 0;
463
+ }
464
+ #side-sortables .csf-notice {
465
+ padding: 12px;
466
+ }
467
+
468
+ /**
469
+ * 01. 13. Comment Metabox
470
+ */
471
+ .csf-comment-metabox {
472
+ margin: -6px -12px -12px -12px;
473
+ }
474
+ .csf-comment-metabox .csf-section-title {
475
+ padding: 20px;
476
+ }
477
+
478
+ /**
479
+ * 01. 14. Help Tooltip
480
+ */
481
+ .csf-tooltip {
482
+ position: absolute;
483
+ z-index: 5000001;
484
+ font-size: 12px;
485
+ line-height: 1.4;
486
+ text-align: center;
487
+ text-decoration: none;
488
+ padding: 6px 12px;
489
+ max-width: 200px;
490
+ color: #fff;
491
+ background-color: #000;
492
+ background-color: rgba(0, 0, 0, 0.85);
493
+ -moz-border-radius: 4px;
494
+ -webkit-border-radius: 4px;
495
+ border-radius: 4px;
496
+ }
497
+
498
+ /**
499
+ * 02. Themes
500
+ */
501
+ /**
502
+ * 02. 01. Theme Dark
503
+ */
504
+ .csf-theme-dark .csf-header-inner {
505
+ background-color: #050505;
506
+ }
507
+ .csf-theme-dark .csf-header-inner h1 {
508
+ color: #fff;
509
+ }
510
+ .csf-theme-dark .csf-header-inner h1 small {
511
+ color: #555;
512
+ }
513
+ .csf-theme-dark .csf-expand-all {
514
+ color: #999;
515
+ background-color: #222;
516
+ }
517
+ .csf-theme-dark .csf-expand-all:hover {
518
+ color: #fff;
519
+ background-color: #333;
520
+ }
521
+ .csf-theme-dark .csf-search input {
522
+ color: #fff;
523
+ background-color: #222;
524
+ }
525
+ .csf-theme-dark .csf-search:focus {
526
+ background-color: #444;
527
+ }
528
+ .csf-theme-dark .csf-search::-webkit-input-placeholder {
529
+ color: #666;
530
+ }
531
+ .csf-theme-dark .csf-nav ul li a {
532
+ color: #999;
533
+ background-color: #222;
534
+ border-bottom: 1px solid #2f2f2f;
535
+ }
536
+ .csf-theme-dark .csf-nav ul li a:hover {
537
+ color: #fff;
538
+ }
539
+ .csf-theme-dark .csf-nav ul li .csf-section-active {
540
+ color: #fff;
541
+ background-color: #111;
542
+ }
543
+ .csf-theme-dark .csf-nav ul ul li a {
544
+ background-color: #191919;
545
+ border-bottom: 1px solid #2f2f2f;
546
+ }
547
+ .csf-theme-dark .csf-nav ul ul li .csf-section-active {
548
+ background-color: #101010;
549
+ }
550
+ .csf-theme-dark .csf-nav ul ul:before {
551
+ background-color: rgba(34, 34, 34, 0.75);
552
+ }
553
+ .csf-theme-dark .csf-nav > ul > li:last-child > a {
554
+ border-bottom: none;
555
+ }
556
+ .csf-theme-dark .csf-nav-background {
557
+ background-color: #222;
558
+ }
559
+ .csf-theme-dark .csf-footer {
560
+ color: #555;
561
+ background-color: #050505;
562
+ }
563
+
564
+ /**
565
+ * 02. 02. Theme Light
566
+ */
567
+ .csf-theme-light .csf-container {
568
+ border: 1px solid #e5e5e5;
569
+ -moz-box-shadow: 0 0 15px rgba(0, 0, 0, 0.04);
570
+ -webkit-box-shadow: 0 0 15px rgba(0, 0, 0, 0.04);
571
+ box-shadow: 0 0 15px rgba(0, 0, 0, 0.04);
572
+ }
573
+ .csf-theme-light .csf-header-inner {
574
+ border-bottom: 1px solid #e5e5e5;
575
+ background-color: #f5f5f5;
576
+ background: linear-gradient(#fefefe, #f5f5f5);
577
+ }
578
+ .csf-theme-light .csf-header-inner h1 small {
579
+ color: #999;
580
+ }
581
+ .csf-theme-light .csf-expand-all {
582
+ color: #999;
583
+ background-color: #fff;
584
+ -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
585
+ -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
586
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
587
+ }
588
+ .csf-theme-light .csf-expand-all:hover {
589
+ color: #555;
590
+ }
591
+ .csf-theme-light .csf-search input {
592
+ color: #555;
593
+ background-color: #fff;
594
+ -moz-box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.05);
595
+ -webkit-box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.05);
596
+ box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.05);
597
+ }
598
+ .csf-theme-light .csf-search input::-webkit-input-placeholder {
599
+ color: #bbb;
600
+ }
601
+ .csf-theme-light .csf-nav ul li a {
602
+ color: #666;
603
+ background-color: #f5f5f5;
604
+ border-bottom: 1px solid #e5e5e5;
605
+ }
606
+ .csf-theme-light .csf-nav ul li a:hover {
607
+ color: #222;
608
+ }
609
+ .csf-theme-light .csf-nav ul li .csf-section-active {
610
+ color: #222;
611
+ background-color: #fff;
612
+ }
613
+ .csf-theme-light .csf-nav ul li .csf-section-active:after {
614
+ display: none;
615
+ }
616
+ .csf-theme-light .csf-nav ul ul li a {
617
+ background-color: #eee;
618
+ border-bottom: 1px solid #e5e5e5;
619
+ }
620
+ .csf-theme-light .csf-nav > ul > li:last-child > a {
621
+ border-bottom: none;
622
+ }
623
+ .csf-theme-light .csf-nav-background {
624
+ background-color: #f5f5f5;
625
+ }
626
+ .csf-theme-light .csf-footer {
627
+ color: #555;
628
+ border-top: 1px solid #e5e5e5;
629
+ background-color: #f5f5f5;
630
+ background: linear-gradient(#fafafa, #f5f5f5);
631
+ }
632
+
633
+ /**
634
+ * 03. Fields
635
+ */
636
+ .csf-field {
637
+ position: relative;
638
+ padding: 30px;
639
+ }
640
+ .csf-field + .csf-field:not(.hidden) {
641
+ border-top: 1px solid #eee;
642
+ }
643
+ .csf-field p:first-child {
644
+ margin-top: 0;
645
+ }
646
+ .csf-field p:last-child {
647
+ margin-bottom: 0;
648
+ }
649
+ .csf-field:after, .csf-field:before {
650
+ content: " ";
651
+ display: table;
652
+ }
653
+ .csf-field:after {
654
+ clear: both;
655
+ }
656
+ .csf-field h4 {
657
+ margin-top: 0;
658
+ }
659
+ .csf-field .csf-title {
660
+ position: relative;
661
+ width: 20%;
662
+ float: left;
663
+ }
664
+ .csf-field .csf-title h4 {
665
+ margin: 0;
666
+ color: #23282d;
667
+ }
668
+ .csf-field .csf-fieldset {
669
+ margin-left: 25%;
670
+ }
671
+
672
+ .csf-pseudo-field {
673
+ padding: 0 5px 0 0 !important;
674
+ display: inline-block;
675
+ }
676
+ .csf-pseudo-field + .csf-pseudo-field {
677
+ border: 0;
678
+ }
679
+ .csf-pseudo-field pre {
680
+ display: none;
681
+ }
682
+
683
+ /**
684
+ * 03. 02. Field: accordion
685
+ */
686
+ .csf-field-accordion .csf-accordion-item {
687
+ position: relative;
688
+ margin-bottom: 5px;
689
+ }
690
+ .csf-field-accordion .csf-accordion-item h4 {
691
+ font-size: 1em;
692
+ }
693
+ .csf-field-accordion .csf-accordion-title {
694
+ display: block;
695
+ cursor: pointer;
696
+ position: relative;
697
+ margin: 0;
698
+ padding: 15px;
699
+ min-height: 0;
700
+ font-size: 100%;
701
+ user-select: none;
702
+ border: 1px solid #ccd0d4;
703
+ background-color: #fafafa;
704
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
705
+ transition: border-color .15s;
706
+ }
707
+ .csf-field-accordion .csf-accordion-title:active, .csf-field-accordion .csf-accordion-title:hover, .csf-field-accordion .csf-accordion-title:focus {
708
+ outline: none;
709
+ border-color: #999;
710
+ }
711
+ .csf-field-accordion .csf-accordion-icon {
712
+ width: 14px;
713
+ text-align: center;
714
+ }
715
+ .csf-field-accordion .csf--icon {
716
+ width: 20px;
717
+ text-align: center;
718
+ }
719
+ .csf-field-accordion .csf-accordion-content {
720
+ display: none;
721
+ padding: 0;
722
+ border: 1px solid #ccd0d4;
723
+ border-top: none;
724
+ background-color: #fff;
725
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
726
+ }
727
+ .csf-field-accordion .csf-accordion-content > .csf-field {
728
+ padding: 15px;
729
+ }
730
+ .csf-field-accordion .csf-accordion-open {
731
+ display: block;
732
+ }
733
+
734
+ /**
735
+ * 03. 03. Field: background
736
+ */
737
+ .csf-field-background .csf-field {
738
+ border: 0 !important;
739
+ padding: 0;
740
+ margin-bottom: 6px;
741
+ margin-right: 6px;
742
+ }
743
+ .csf-field-background .csf--title {
744
+ color: #777;
745
+ font-size: 12px;
746
+ }
747
+ .csf-field-background .csf--background-colors {
748
+ display: flex;
749
+ }
750
+ .csf-field-background .csf--background-attributes {
751
+ display: flex;
752
+ flex-wrap: wrap;
753
+ }
754
+ .csf-field-background .csf--background-attributes select {
755
+ min-width: 100%;
756
+ margin: 0;
757
+ }
758
+ .csf-field-background .csf--background-attributes .csf-field {
759
+ flex: 1;
760
+ }
761
+ .csf-field-background .csf--attributes-hidden {
762
+ display: none;
763
+ }
764
+ .csf-field-background .wp-color-result.button {
765
+ margin-bottom: 0;
766
+ }
767
+
768
+ /**
769
+ * 03. 04. Field: backup
770
+ */
771
+ .csf-field-backup textarea {
772
+ width: 100%;
773
+ min-height: 200px;
774
+ margin-bottom: 5px;
775
+ }
776
+ .csf-field-backup small {
777
+ display: inline-block;
778
+ margin: 5px;
779
+ }
780
+ .csf-field-backup hr {
781
+ margin: 20px 0;
782
+ border: none;
783
+ border-bottom: 1px solid #e5e5e5;
784
+ }
785
+
786
+ /**
787
+ * 03. 05. Field: border, spacing, dimensions
788
+ */
789
+ .csf-field-border .csf--inputs,
790
+ .csf-field-spacing .csf--inputs,
791
+ .csf-field-dimensions .csf--inputs {
792
+ float: left;
793
+ display: flex;
794
+ flex-wrap: wrap;
795
+ }
796
+ .csf-field-border .csf--input,
797
+ .csf-field-spacing .csf--input,
798
+ .csf-field-dimensions .csf--input {
799
+ display: flex;
800
+ padding-right: 6px;
801
+ padding-bottom: 4px;
802
+ box-sizing: border-box;
803
+ }
804
+ .csf-field-border .csf--input select,
805
+ .csf-field-spacing .csf--input select,
806
+ .csf-field-dimensions .csf--input select {
807
+ margin: 0;
808
+ }
809
+ .csf-field-border .csf--input input,
810
+ .csf-field-spacing .csf--input input,
811
+ .csf-field-dimensions .csf--input input {
812
+ position: relative;
813
+ z-index: 1;
814
+ margin: 0;
815
+ width: 65px;
816
+ max-width: 100%;
817
+ text-align: center;
818
+ }
819
+ .csf-field-border .csf--color,
820
+ .csf-field-spacing .csf--color,
821
+ .csf-field-dimensions .csf--color {
822
+ float: left;
823
+ }
824
+ .csf-field-border .csf--label,
825
+ .csf-field-spacing .csf--label,
826
+ .csf-field-dimensions .csf--label {
827
+ display: flex;
828
+ flex-direction: column;
829
+ justify-content: center;
830
+ user-select: none;
831
+ min-width: 20px;
832
+ max-width: 100%;
833
+ padding: 0 4px;
834
+ font-size: 12px;
835
+ text-align: center;
836
+ color: #555;
837
+ border: 1px solid #7B776C;
838
+ background-color: #f5f5f5;
839
+ }
840
+ .csf-field-border .csf--icon,
841
+ .csf-field-spacing .csf--icon,
842
+ .csf-field-dimensions .csf--icon {
843
+ border-right: 0;
844
+ border-radius: 4px 0 0 4px;
845
+ }
846
+ .csf-field-border .csf--icon + input,
847
+ .csf-field-spacing .csf--icon + input,
848
+ .csf-field-dimensions .csf--icon + input {
849
+ border-top-left-radius: 0;
850
+ border-bottom-left-radius: 0;
851
+ }
852
+ .csf-field-border .csf--unit,
853
+ .csf-field-spacing .csf--unit,
854
+ .csf-field-dimensions .csf--unit {
855
+ border-left: 0;
856
+ border-radius: 0 4px 4px 0;
857
+ }
858
+ .csf-field-border .csf--is-unit,
859
+ .csf-field-spacing .csf--is-unit,
860
+ .csf-field-dimensions .csf--is-unit {
861
+ border-top-right-radius: 0;
862
+ border-bottom-right-radius: 0;
863
+ }
864
+
865
+ /**
866
+ * 03. 06. Field: button_set
867
+ */
868
+ .csf-field-button_set .csf--buttons {
869
+ display: inline-block;
870
+ }
871
+ .csf-field-button_set .csf--button {
872
+ position: relative;
873
+ z-index: 1;
874
+ float: left;
875
+ cursor: pointer;
876
+ padding: 7px 14px;
877
+ min-width: 40px;
878
+ text-align: center;
879
+ color: #555;
880
+ border: 1px solid #cccccc;
881
+ background-color: #f7f7f7;
882
+ user-select: none;
883
+ -webkit-user-select: none;
884
+ box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
885
+ }
886
+ .csf-field-button_set .csf--button:first-child {
887
+ border-radius: 4px 0 0 4px;
888
+ }
889
+ .csf-field-button_set .csf--button:last-child {
890
+ border-radius: 0 4px 4px 0;
891
+ }
892
+ .csf-field-button_set .csf--button:not(:first-child) {
893
+ margin-left: -1px;
894
+ }
895
+ .csf-field-button_set .csf--button:hover {
896
+ background-color: #eee;
897
+ }
898
+ .csf-field-button_set .csf--active:hover,
899
+ .csf-field-button_set .csf--active {
900
+ z-index: 2;
901
+ color: #fff;
902
+ border-color: #006799;
903
+ background-color: #0085ba;
904
+ }
905
+ .csf-field-button_set input {
906
+ display: none;
907
+ }
908
+
909
+ /**
910
+ * 03. 07. Field: checkbox, radio
911
+ */
912
+ .csf-field-checkbox ul,
913
+ .csf-field-radio ul {
914
+ margin: 0;
915
+ padding: 0 1px;
916
+ list-style-type: none;
917
+ overflow-y: auto;
918
+ max-height: 305px;
919
+ }
920
+ .csf-field-checkbox ul ul,
921
+ .csf-field-radio ul ul {
922
+ max-height: none;
923
+ }
924
+ .csf-field-checkbox .csf--inline-list li,
925
+ .csf-field-radio .csf--inline-list li {
926
+ display: inline-block;
927
+ margin-right: 15px;
928
+ }
929
+ .csf-field-checkbox input[type="radio"]:checked:before,
930
+ .csf-field-radio input[type="radio"]:checked:before {
931
+ line-height: 10px;
932
+ }
933
+ .csf-field-checkbox .csf-checker,
934
+ .csf-field-radio .csf-checker {
935
+ cursor: pointer;
936
+ }
937
+
938
+ /**
939
+ * 03. 08. Field: code_editor
940
+ */
941
+ .csf-field-code_editor .CodeMirror {
942
+ width: 100%;
943
+ height: 400px;
944
+ }
945
+ .csf-field-code_editor .cm-s-default {
946
+ border: 1px solid #ccd0d4;
947
+ }
948
+ .csf-field-code_editor textarea {
949
+ width: 100%;
950
+ height: 400px;
951
+ }
952
+
953
+ /**
954
+ * 03. 09. Field: color
955
+ */
956
+ .csf-field-color > input {
957
+ opacity: 0.75;
958
+ width: 115px;
959
+ max-width: 100%;
960
+ }
961
+ .csf-field-color .button.wp-picker-clear {
962
+ margin-left: 6px;
963
+ padding: 2px 8px;
964
+ }
965
+
966
+ /**
967
+ * 03. 10. Field: color_group
968
+ */
969
+ .csf-field-color_group .csf--left {
970
+ float: left;
971
+ margin-right: 10px;
972
+ margin-bottom: 5px;
973
+ }
974
+ .csf-field-color_group .csf--title {
975
+ color: #999;
976
+ margin-bottom: 5px;
977
+ }
978
+
979
+ /**
980
+ * 03. 11. Field: fieldset
981
+ */
982
+ .csf-field-fieldset .csf-fieldset-content {
983
+ border: 1px solid #ccd0d4;
984
+ background-color: #fff;
985
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
986
+ }
987
+ .csf-field-fieldset .csf-fieldset-content > .csf-field {
988
+ padding: 15px;
989
+ }
990
+ .csf-field-fieldset .csf-field-subheading {
991
+ font-size: 13px;
992
+ }
993
+
994
+ /**
995
+ * 03. 12. Field: date
996
+ */
997
+ .csf-field-date input {
998
+ margin: 0;
999
+ }
1000
+ .csf-field-date .csf--to {
1001
+ margin-left: 7px;
1002
+ }
1003
+
1004
+ .csf-datepicker-wrapper {
1005
+ margin-top: 5px;
1006
+ width: auto;
1007
+ background-color: #fff;
1008
+ z-index: 9999999 !important;
1009
+ -moz-box-shadow: 0 0 30px rgba(0, 0, 0, 0.15);
1010
+ -webkit-box-shadow: 0 0 30px rgba(0, 0, 0, 0.15);
1011
+ box-shadow: 0 0 30px rgba(0, 0, 0, 0.15);
1012
+ }
1013
+ .csf-datepicker-wrapper * {
1014
+ float: none;
1015
+ margin: 0;
1016
+ padding: 0;
1017
+ font-family: inherit;
1018
+ font-weight: normal;
1019
+ font-style: normal;
1020
+ text-decoration: none;
1021
+ border: 0;
1022
+ border-radius: 0;
1023
+ box-shadow: none;
1024
+ }
1025
+ .csf-datepicker-wrapper .ui-widget-header,
1026
+ .csf-datepicker-wrapper .ui-datepicker-header {
1027
+ color: #fff;
1028
+ background: #00a0d2;
1029
+ }
1030
+ .csf-datepicker-wrapper .ui-datepicker-header .ui-state-hover {
1031
+ cursor: pointer;
1032
+ }
1033
+ .csf-datepicker-wrapper .ui-datepicker-title {
1034
+ font-size: 14px;
1035
+ line-height: 40px;
1036
+ text-align: center;
1037
+ }
1038
+ .csf-datepicker-wrapper .ui-datepicker-prev,
1039
+ .csf-datepicker-wrapper .ui-datepicker-next {
1040
+ position: static;
1041
+ top: auto;
1042
+ left: auto;
1043
+ right: auto;
1044
+ font-family: "FontAwesome";
1045
+ font-size: 12px;
1046
+ text-align: center;
1047
+ width: 41px;
1048
+ height: 40px;
1049
+ line-height: 40px;
1050
+ color: #fff;
1051
+ background-color: rgba(255, 255, 255, 0.1);
1052
+ text-rendering: auto;
1053
+ -webkit-font-smoothing: antialiased;
1054
+ -moz-osx-font-smoothing: grayscale;
1055
+ }
1056
+ .csf-datepicker-wrapper .ui-datepicker-next span,
1057
+ .csf-datepicker-wrapper .ui-datepicker-prev span {
1058
+ display: none;
1059
+ }
1060
+ .csf-datepicker-wrapper .ui-datepicker-prev {
1061
+ float: left;
1062
+ }
1063
+ .csf-datepicker-wrapper .ui-datepicker-next {
1064
+ float: right;
1065
+ }
1066
+ .csf-datepicker-wrapper .ui-datepicker-prev:before {
1067
+ content: '\f053';
1068
+ }
1069
+ .csf-datepicker-wrapper .ui-datepicker-next:before {
1070
+ content: '\f054';
1071
+ }
1072
+ .csf-datepicker-wrapper .ui-datepicker-prev-hover,
1073
+ .csf-datepicker-wrapper .ui-datepicker-next-hover {
1074
+ opacity: 0.75;
1075
+ }
1076
+ .csf-datepicker-wrapper tbody .ui-datepicker-week-col {
1077
+ background-color: #f7f7f7;
1078
+ }
1079
+ .csf-datepicker-wrapper .ui-datepicker-buttonpane {
1080
+ padding: 10px;
1081
+ text-align: center;
1082
+ background-color: #f7f7f7;
1083
+ }
1084
+ .csf-datepicker-wrapper .ui-datepicker-buttonpane button {
1085
+ cursor: pointer;
1086
+ margin: 0 5px;
1087
+ padding: 7px 14px;
1088
+ border: 1px solid #eee;
1089
+ background-color: #fff;
1090
+ }
1091
+ .csf-datepicker-wrapper select {
1092
+ margin: 0 4px;
1093
+ }
1094
+ .csf-datepicker-wrapper select option {
1095
+ color: #555;
1096
+ }
1097
+ .csf-datepicker-wrapper table {
1098
+ font-size: 13px;
1099
+ border-collapse: collapse;
1100
+ width: 100%;
1101
+ }
1102
+ .csf-datepicker-wrapper thead {
1103
+ color: #fff;
1104
+ background: #32373c;
1105
+ }
1106
+ .csf-datepicker-wrapper th {
1107
+ text-align: center;
1108
+ padding: 7px;
1109
+ border: 1px solid #444;
1110
+ }
1111
+ .csf-datepicker-wrapper td {
1112
+ text-align: center;
1113
+ border: 1px solid #f4f4f4;
1114
+ }
1115
+ .csf-datepicker-wrapper td.ui-datepicker-other-month {
1116
+ border: transparent;
1117
+ }
1118
+ .csf-datepicker-wrapper td .ui-state-default {
1119
+ color: #555;
1120
+ width: auto;
1121
+ display: block;
1122
+ padding: 6px 12px;
1123
+ }
1124
+ .csf-datepicker-wrapper td .ui-state-active,
1125
+ .csf-datepicker-wrapper td .ui-state-hover {
1126
+ color: #fff;
1127
+ background-color: #0073aa;
1128
+ }
1129
+ .csf-datepicker-wrapper td.ui-state-disabled .ui-state-default {
1130
+ opacity: 0.5;
1131
+ }
1132
+
1133
+ /**
1134
+ * 03. 13. Field: gallery
1135
+ */
1136
+ .csf-field-gallery input {
1137
+ display: none;
1138
+ }
1139
+ .csf-field-gallery ul {
1140
+ margin: 0;
1141
+ padding: 0;
1142
+ list-style-type: none;
1143
+ }
1144
+ .csf-field-gallery ul li {
1145
+ display: inline-block;
1146
+ position: relative;
1147
+ padding: 4px;
1148
+ margin: 0 5px 10px 0;
1149
+ border: 1px solid #ccc;
1150
+ background-color: #f9f9f9;
1151
+ -moz-border-radius: 2px;
1152
+ -webkit-border-radius: 2px;
1153
+ border-radius: 2px;
1154
+ -moz-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
1155
+ -webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
1156
+ box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
1157
+ }
1158
+ .csf-field-gallery ul li img {
1159
+ max-height: 60px;
1160
+ display: inline-block;
1161
+ vertical-align: middle;
1162
+ }
1163
+ .csf-field-gallery .button {
1164
+ margin-right: 5px;
1165
+ margin-bottom: 5px;
1166
+ }
1167
+
1168
+ /**
1169
+ * 03. 14. Field: group
1170
+ */
1171
+ .csf-field-group .csf-cloneable-hidden {
1172
+ display: none !important;
1173
+ }
1174
+ .csf-field-group .csf-cloneable-wrapper {
1175
+ position: relative;
1176
+ }
1177
+ .csf-field-group .csf-cloneable-item {
1178
+ display: none;
1179
+ position: relative;
1180
+ margin-bottom: 5px;
1181
+ }
1182
+ .csf-field-group .csf-cloneable-item h4 {
1183
+ font-size: 1em;
1184
+ }
1185
+ .csf-field-group .ui-accordion .csf-cloneable-item {
1186
+ display: block;
1187
+ }
1188
+ .csf-field-group .csf-cloneable-content {
1189
+ border: 1px solid #ccd0d4;
1190
+ background-color: #fff;
1191
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
1192
+ }
1193
+ .csf-field-group .csf-cloneable-content > .csf-field {
1194
+ padding: 15px;
1195
+ }
1196
+ .csf-field-group .csf-cloneable-title {
1197
+ display: block;
1198
+ cursor: pointer;
1199
+ position: relative;
1200
+ user-select: none;
1201
+ margin: 0;
1202
+ padding: 15px 65px 15px 10px;
1203
+ min-height: 0;
1204
+ font-size: 100%;
1205
+ border: 1px solid #ccd0d4;
1206
+ background-color: #fafafa;
1207
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
1208
+ transition: border-color .15s;
1209
+ }
1210
+ .csf-field-group .csf-cloneable-title:active, .csf-field-group .csf-cloneable-title:hover, .csf-field-group .csf-cloneable-title:focus {
1211
+ border-color: #999;
1212
+ outline: none;
1213
+ }
1214
+ .csf-field-group .csf-cloneable-helper {
1215
+ position: absolute;
1216
+ top: 12px;
1217
+ right: 10px;
1218
+ z-index: 1;
1219
+ font-size: 14px;
1220
+ line-height: 1em;
1221
+ }
1222
+ .csf-field-group .csf-cloneable-helper i {
1223
+ display: inline-block;
1224
+ cursor: pointer;
1225
+ padding: 5px;
1226
+ color: #999;
1227
+ }
1228
+ .csf-field-group .csf-cloneable-helper i:hover {
1229
+ color: #555;
1230
+ }
1231
+ .csf-field-group .csf-cloneable-content {
1232
+ padding: 0;
1233
+ border-top: 0;
1234
+ }
1235
+ .csf-field-group .csf-cloneable-title-prefix,
1236
+ .csf-field-group .csf-cloneable-title-number {
1237
+ margin-right: 5px;
1238
+ }
1239
+ .csf-field-group .csf-cloneable-alert {
1240
+ display: none;
1241
+ margin-bottom: 5px;
1242
+ padding: 10px 20px;
1243
+ color: #a94442;
1244
+ border: 1px solid #ebccd1;
1245
+ background-color: #f2dede;
1246
+ }
1247
+ .csf-field-group .widget-placeholder {
1248
+ margin-bottom: 10px;
1249
+ border: 1px dashed #f1c40f;
1250
+ background-color: #fffae4;
1251
+ }
1252
+ .csf-field-group .csf-cloneable-header-icon {
1253
+ display: inline-block;
1254
+ text-align: center;
1255
+ font-size: 14px;
1256
+ width: 17px;
1257
+ text-indent: 0;
1258
+ vertical-align: text-top;
1259
+ }
1260
+ .csf-field-group .csf-cloneable-placeholder {
1261
+ background-color: #ddd;
1262
+ margin-top: 4px;
1263
+ width: 100px;
1264
+ height: 10px;
1265
+ font-size: 10px;
1266
+ line-height: 10px;
1267
+ display: inline-block;
1268
+ vertical-align: top;
1269
+ border-radius: 2px;
1270
+ }
1271
+
1272
+ /**
1273
+ * 03. 15. Field: icon
1274
+ */
1275
+ .csf-field-icon input {
1276
+ display: none;
1277
+ }
1278
+ .csf-field-icon .button {
1279
+ margin-right: 5px;
1280
+ }
1281
+ .csf-field-icon .csf-icon-preview i {
1282
+ display: inline-block;
1283
+ font-size: 14px;
1284
+ width: 30px;
1285
+ height: 26px;
1286
+ line-height: 26px;
1287
+ margin-right: 5px;
1288
+ text-align: center;
1289
+ vertical-align: top;
1290
+ color: #555;
1291
+ border: 1px solid #ccc;
1292
+ background-color: #f7f7f7;
1293
+ -moz-border-radius: 3px;
1294
+ -webkit-border-radius: 3px;
1295
+ border-radius: 3px;
1296
+ -moz-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
1297
+ -webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
1298
+ box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
1299
+ -moz-box-sizing: content-box;
1300
+ -webkit-box-sizing: content-box;
1301
+ box-sizing: content-box;
1302
+ }
1303
+
1304
+ /**
1305
+ * 03. 16. Field: image_select
1306
+ */
1307
+ .csf-field-image_select .csf--image {
1308
+ cursor: pointer;
1309
+ position: relative;
1310
+ display: inline-block;
1311
+ max-width: 100%;
1312
+ margin: 0 5px 5px 0;
1313
+ vertical-align: bottom;
1314
+ border: 2px solid transparent;
1315
+ background-color: #fff;
1316
+ user-select: none;
1317
+ -webkit-user-select: none;
1318
+ -moz-transition: all 0.2s;
1319
+ -o-transition: all 0.2s;
1320
+ -webkit-transition: all 0.2s;
1321
+ transition: all 0.2s;
1322
+ }
1323
+ .csf-field-image_select .csf--image:before {
1324
+ position: absolute;
1325
+ top: 0;
1326
+ left: 0;
1327
+ text-align: center;
1328
+ font-size: 11px;
1329
+ font-family: FontAwesome;
1330
+ content: "\f00c";
1331
+ width: 15px;
1332
+ height: 15px;
1333
+ line-height: 15px;
1334
+ opacity: 0;
1335
+ color: #fff;
1336
+ background-color: #222;
1337
+ transition: opacity .2s;
1338
+ }
1339
+ .csf-field-image_select .csf--active {
1340
+ border-color: #222;
1341
+ box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
1342
+ }
1343
+ .csf-field-image_select .csf--active:before {
1344
+ opacity: 1;
1345
+ }
1346
+ .csf-field-image_select img {
1347
+ vertical-align: top;
1348
+ }
1349
+ .csf-field-image_select input {
1350
+ display: none;
1351
+ }
1352
+
1353
+ /**
1354
+ * 03. 17. Field: link_color
1355
+ */
1356
+ .csf-field-link_color .csf--left {
1357
+ float: left;
1358
+ margin-right: 10px;
1359
+ margin-bottom: 5px;
1360
+ }
1361
+ .csf-field-link_color .csf--title {
1362
+ color: #777;
1363
+ margin-bottom: 5px;
1364
+ }
1365
+
1366
+ /**
1367
+ * 03. 18. Field: map
1368
+ */
1369
+ .csf-field-map input {
1370
+ width: 100%;
1371
+ }
1372
+ .csf-field-map input[type="text"].ui-autocomplete-loading {
1373
+ background-position-x: calc(100% - 5px);
1374
+ }
1375
+ .csf-field-map .csf--map-search + .csf--map-osm-wrap {
1376
+ margin-top: 10px;
1377
+ }
1378
+ .csf-field-map .csf--map-osm-wrap {
1379
+ position: relative;
1380
+ padding: 5px;
1381
+ border: 1px solid #eee;
1382
+ background-color: #fff;
1383
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
1384
+ }
1385
+ .csf-field-map .csf--map-osm {
1386
+ position: relative;
1387
+ z-index: 1;
1388
+ min-height: 250px;
1389
+ }
1390
+ .csf-field-map .csf--map-inputs {
1391
+ margin-top: 10px;
1392
+ display: flex;
1393
+ justify-content: space-between;
1394
+ }
1395
+ .csf-field-map .csf--map-input {
1396
+ flex: 1;
1397
+ }
1398
+ .csf-field-map .csf--map-input:last-child {
1399
+ padding-left: 10px;
1400
+ }
1401
+ .csf-field-map label {
1402
+ display: block;
1403
+ color: #777;
1404
+ font-size: 12px;
1405
+ margin: 0 0 2px 0;
1406
+ }
1407
+
1408
+ .csf-map-ui-autocomplate {
1409
+ z-index: 999999;
1410
+ border-radius: 4px;
1411
+ overflow: hidden;
1412
+ }
1413
+
1414
+ /**
1415
+ * 03. 19. Field: media
1416
+ */
1417
+ .csf-field-media .csf--placeholder {
1418
+ display: flex;
1419
+ }
1420
+ .csf-field-media .csf--placeholder input {
1421
+ width: 100%;
1422
+ margin: 0;
1423
+ }
1424
+ .csf-field-media .button {
1425
+ margin-left: 5px;
1426
+ }
1427
+ .csf-field-media .hidden + .button {
1428
+ margin-left: 0;
1429
+ }
1430
+ .csf-field-media .csf--preview {
1431
+ position: relative;
1432
+ }
1433
+ .csf-field-media .csf--preview .fa-times {
1434
+ position: absolute;
1435
+ z-index: 1;
1436
+ right: 4px;
1437
+ top: 4px;
1438
+ font-size: 14px;
1439
+ width: 22px;
1440
+ height: 22px;
1441
+ line-height: 22px;
1442
+ text-align: center;
1443
+ text-decoration: none;
1444
+ color: #fff;
1445
+ background-color: #dd3333;
1446
+ opacity: 0.8;
1447
+ transition: all .2s;
1448
+ }
1449
+ .csf-field-media .csf--preview .fa-times:hover {
1450
+ opacity: 1;
1451
+ }
1452
+ .csf-field-media .csf--preview .fa-times:focus {
1453
+ box-shadow: none;
1454
+ }
1455
+
1456
+ /**
1457
+ * 03. 20. Field: palette
1458
+ */
1459
+ .csf-field-palette .csf--palette {
1460
+ position: relative;
1461
+ display: inline-block;
1462
+ cursor: pointer;
1463
+ border: 2px solid #ddd;
1464
+ margin-right: 10px;
1465
+ margin-bottom: 10px;
1466
+ user-select: none;
1467
+ -webkit-user-select: none;
1468
+ transition: all .2s;
1469
+ }
1470
+ .csf-field-palette .csf--palette span {
1471
+ vertical-align: middle;
1472
+ display: inline-block;
1473
+ width: 22px;
1474
+ height: 60px;
1475
+ line-height: 60px;
1476
+ overflow: hidden;
1477
+ text-indent: -999px;
1478
+ }
1479
+ .csf-field-palette .csf--palette:before {
1480
+ position: absolute;
1481
+ top: 0;
1482
+ left: 0;
1483
+ text-align: center;
1484
+ font-size: 11px;
1485
+ font-family: FontAwesome;
1486
+ content: "\f00c";
1487
+ width: 15px;
1488
+ height: 15px;
1489
+ line-height: 15px;
1490
+ opacity: 0;
1491
+ color: #fff;
1492
+ background-color: #222;
1493
+ transition: opacity .2s;
1494
+ }
1495
+ .csf-field-palette .csf--active {
1496
+ border-color: #222;
1497
+ box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
1498
+ }
1499
+ .csf-field-palette .csf--active:before {
1500
+ opacity: 1;
1501
+ }
1502
+ .csf-field-palette input {
1503
+ display: none;
1504
+ }
1505
+
1506
+ /**
1507
+ * 03. 21. Field: repeater
1508
+ */
1509
+ .csf-field-repeater .csf-field-text input {
1510
+ width: 100%;
1511
+ }
1512
+ .csf-field-repeater .csf-repeater-hidden {
1513
+ display: none !important;
1514
+ }
1515
+ .csf-field-repeater .csf-repeater-wrapper .csf-repeater-item {
1516
+ display: table;
1517
+ width: 100%;
1518
+ margin-bottom: 5px;
1519
+ border: 1px solid #eee;
1520
+ }
1521
+ .csf-field-repeater .csf-repeater-wrapper .csf-repeater-item h4 {
1522
+ font-size: 1em;
1523
+ }
1524
+ .csf-field-repeater .csf-repeater-content {
1525
+ width: 100%;
1526
+ display: table-cell;
1527
+ vertical-align: middle;
1528
+ background-color: #fff;
1529
+ }
1530
+ .csf-field-repeater .csf-repeater-content > .csf-field {
1531
+ padding: 15px;
1532
+ }
1533
+ .csf-field-repeater .csf-repeater-helper {
1534
+ width: 100%;
1535
+ display: table-cell;
1536
+ vertical-align: middle;
1537
+ text-align: center;
1538
+ font-size: 14px;
1539
+ line-height: 1em;
1540
+ border-left: 1px solid #eee;
1541
+ background-color: #f7f7f7;
1542
+ }
1543
+ .csf-field-repeater .csf-repeater-helper i {
1544
+ display: inline-block;
1545
+ cursor: pointer;
1546
+ color: #999;
1547
+ padding: 5px;
1548
+ }
1549
+ .csf-field-repeater .csf-repeater-helper i:hover {
1550
+ color: #555;
1551
+ }
1552
+ .csf-field-repeater .csf-repeater-helper-inner {
1553
+ width: 75px;
1554
+ }
1555
+ .csf-field-repeater .csf-repeater-alert {
1556
+ display: none;
1557
+ margin-bottom: 5px;
1558
+ padding: 10px 20px;
1559
+ color: #a94442;
1560
+ border: 1px solid #ebccd1;
1561
+ background-color: #f2dede;
1562
+ }
1563
+ .csf-field-repeater .widget-placeholder {
1564
+ height: 50px;
1565
+ margin-bottom: 3px;
1566
+ border: 1px dashed #f1c40f;
1567
+ background-color: #fffae4;
1568
+ }
1569
+ .csf-field-repeater .ui-sortable-helper {
1570
+ height: 50px !important;
1571
+ overflow: hidden !important;
1572
+ border-color: #ccc !important;
1573
+ background-color: #eee !important;
1574
+ opacity: 0.5;
1575
+ }
1576
+ .csf-field-repeater .ui-sortable-helper .csf-repeater-helper,
1577
+ .csf-field-repeater .ui-sortable-helper .csf-repeater-content {
1578
+ display: none;
1579
+ }
1580
+
1581
+ /**
1582
+ * 03. 22. Field: select
1583
+ */
1584
+ .csf-field-select .csf-fieldset {
1585
+ min-height: 30px;
1586
+ }
1587
+ .csf-field-select .csf-chosen {
1588
+ display: none;
1589
+ }
1590
+ .csf-field-select select {
1591
+ max-width: 100%;
1592
+ margin: 0;
1593
+ }
1594
+
1595
+ /**
1596
+ * 03. 23. Field: slider
1597
+ */
1598
+ .csf-field-slider .csf--wrap {
1599
+ display: flex;
1600
+ align-items: center;
1601
+ }
1602
+ .csf-field-slider .csf--input {
1603
+ display: flex;
1604
+ }
1605
+ .csf-field-slider .csf--unit {
1606
+ display: flex;
1607
+ justify-content: center;
1608
+ flex-direction: column;
1609
+ user-select: none;
1610
+ padding: 0 6px;
1611
+ font-size: 11px;
1612
+ line-height: 1;
1613
+ border-radius: 0 4px 4px 0;
1614
+ color: #555;
1615
+ border: 1px solid #7e8993;
1616
+ border-left: 0;
1617
+ background-color: #f5f5f5;
1618
+ }
1619
+ .csf-field-slider input[type=number] {
1620
+ position: relative;
1621
+ z-index: 1;
1622
+ width: 50px;
1623
+ margin: 0 0 0 15px;
1624
+ text-align: center;
1625
+ }
1626
+ .csf-field-slider .csf--is-unit {
1627
+ border-top-right-radius: 0;
1628
+ border-bottom-right-radius: 0;
1629
+ }
1630
+ .csf-field-slider .ui-slider {
1631
+ position: relative;
1632
+ width: 100%;
1633
+ height: 3px;
1634
+ border: none;
1635
+ background: #ddd;
1636
+ border-radius: 2px;
1637
+ }
1638
+ .csf-field-slider .ui-slider-range {
1639
+ height: 3px;
1640
+ border: none;
1641
+ background: #333;
1642
+ border-radius: 2px;
1643
+ }
1644
+ .csf-field-slider .ui-slider-handle {
1645
+ position: absolute;
1646
+ width: 16px;
1647
+ height: 16px;
1648
+ top: -7px;
1649
+ margin-left: -8px;
1650
+ border: none;
1651
+ background: #333;
1652
+ border-radius: 2px;
1653
+ }
1654
+ .csf-field-slider .ui-state-active,
1655
+ .csf-field-slider .ui-slider-handle:hover {
1656
+ cursor: pointer;
1657
+ background: #111;
1658
+ }
1659
+
1660
+ /**
1661
+ * 03. 24. Field: sortable
1662
+ */
1663
+ .csf-field-sortable .csf-field-text input {
1664
+ width: 100%;
1665
+ max-width: 100%;
1666
+ }
1667
+ .csf-field-sortable .csf--sortable .csf--sortable-item {
1668
+ display: table;
1669
+ width: 100%;
1670
+ margin-bottom: 5px;
1671
+ border: 1px solid #eee;
1672
+ }
1673
+ .csf-field-sortable .csf--sortable .csf--sortable-item h4 {
1674
+ font-size: 1em;
1675
+ }
1676
+ .csf-field-sortable .csf--sortable-content {
1677
+ width: 100%;
1678
+ display: table-cell;
1679
+ vertical-align: middle;
1680
+ background-color: #fff;
1681
+ }
1682
+ .csf-field-sortable .csf--sortable-content > .csf-field {
1683
+ padding: 15px;
1684
+ }
1685
+ .csf-field-sortable .csf--sortable-helper {
1686
+ width: 100%;
1687
+ display: table-cell;
1688
+ vertical-align: middle;
1689
+ text-align: center;
1690
+ font-size: 14px;
1691
+ line-height: 1em;
1692
+ border-left: 1px solid #eee;
1693
+ background-color: #f7f7f7;
1694
+ }
1695
+ .csf-field-sortable .csf--sortable-helper .fa {
1696
+ display: inline-block;
1697
+ cursor: pointer;
1698
+ width: 50px;
1699
+ color: #555;
1700
+ }
1701
+ .csf-field-sortable .csf--sortable-helper .fa:hover {
1702
+ opacity: 0.5;
1703
+ }
1704
+ .csf-field-sortable .widget-placeholder {
1705
+ height: 50px;
1706
+ margin-bottom: 3px;
1707
+ border: 1px dashed #f1c40f;
1708
+ background-color: #fffae4;
1709
+ }
1710
+ .csf-field-sortable .ui-sortable-helper {
1711
+ height: 50px !important;
1712
+ overflow: hidden !important;
1713
+ border-color: #ccc !important;
1714
+ background-color: #eee !important;
1715
+ opacity: 0.5;
1716
+ }
1717
+ .csf-field-sortable .ui-sortable-helper .csf--sortable-helper,
1718
+ .csf-field-sortable .ui-sortable-helper .csf--sortable-content {
1719
+ display: none;
1720
+ }
1721
+
1722
+ /**
1723
+ * 03. 25. Field: sorter
1724
+ */
1725
+ .csf-field-sorter .ui-sortable-placeholder {
1726
+ height: 20px;
1727
+ border: 1px dashed #f1c40f;
1728
+ background-color: #fffae4;
1729
+ }
1730
+ .csf-field-sorter .csf-modules {
1731
+ float: left;
1732
+ width: 50%;
1733
+ box-sizing: border-box;
1734
+ }
1735
+ .csf-field-sorter .csf-modules:first-child {
1736
+ padding-right: 15px;
1737
+ }
1738
+ .csf-field-sorter .csf-modules:last-child {
1739
+ padding-left: 15px;
1740
+ }
1741
+ .csf-field-sorter .csf-disabled,
1742
+ .csf-field-sorter .csf-enabled {
1743
+ padding: 5px 15px;
1744
+ border: 1px dashed #ddd;
1745
+ background-color: #fff;
1746
+ }
1747
+ .csf-field-sorter .csf-disabled li {
1748
+ -moz-transition: opacity 0.15s;
1749
+ -o-transition: opacity 0.15s;
1750
+ -webkit-transition: opacity 0.15s;
1751
+ transition: opacity 0.15s;
1752
+ opacity: 0.5;
1753
+ }
1754
+ .csf-field-sorter .csf-disabled .ui-sortable-helper {
1755
+ opacity: 1;
1756
+ }
1757
+ .csf-field-sorter .csf-sorter-title {
1758
+ font-size: 13px;
1759
+ font-weight: 600;
1760
+ padding: 10px;
1761
+ text-align: center;
1762
+ border: 1px dashed #ddd;
1763
+ border-bottom: none;
1764
+ background-color: #f8f8f8;
1765
+ text-transform: uppercase;
1766
+ }
1767
+ .csf-field-sorter ul {
1768
+ list-style-type: none;
1769
+ margin: 0;
1770
+ padding: 0;
1771
+ min-height: 62px;
1772
+ }
1773
+ .csf-field-sorter ul li {
1774
+ margin: 10px 0;
1775
+ padding: 10px 15px;
1776
+ cursor: move;
1777
+ font-weight: bold;
1778
+ text-align: center;
1779
+ border: 1px solid #e5e5e5;
1780
+ background-color: #fafafa;
1781
+ -moz-transition: border-color 0.15s;
1782
+ -o-transition: border-color 0.15s;
1783
+ -webkit-transition: border-color 0.15s;
1784
+ transition: border-color 0.15s;
1785
+ }
1786
+ .csf-field-sorter ul li:hover {
1787
+ border-color: #bbb;
1788
+ }
1789
+
1790
+ /**
1791
+ * 03. 26. Field: spinner
1792
+ */
1793
+ .csf-field-spinner .csf--spin {
1794
+ display: flex;
1795
+ }
1796
+ .csf-field-spinner .ui-spinner {
1797
+ display: flex;
1798
+ }
1799
+ .csf-field-spinner .ui-button-text-only {
1800
+ display: flex;
1801
+ flex-direction: column;
1802
+ justify-content: center;
1803
+ text-align: center;
1804
+ min-width: 20px;
1805
+ padding: 0 4px;
1806
+ color: #555;
1807
+ border: 1px solid #7e8993;
1808
+ background-color: #f5f5f5;
1809
+ }
1810
+ .csf-field-spinner .ui-button {
1811
+ cursor: pointer;
1812
+ }
1813
+ .csf-field-spinner .ui-button:hover {
1814
+ background-color: #e7e7e7;
1815
+ }
1816
+ .csf-field-spinner .ui-button:active {
1817
+ background-color: #ddd;
1818
+ }
1819
+ .csf-field-spinner .ui-button:before {
1820
+ font-family: FontAwesome;
1821
+ font-size: 14px;
1822
+ }
1823
+ .csf-field-spinner .ui-spinner-down {
1824
+ order: 1;
1825
+ border-right: 0;
1826
+ border-radius: 4px 0 0 4px;
1827
+ }
1828
+ .csf-field-spinner .ui-spinner-down:before {
1829
+ content: "\f0d9";
1830
+ }
1831
+ .csf-field-spinner .ui-spinner-input {
1832
+ order: 2;
1833
+ }
1834
+ .csf-field-spinner .csf--unit {
1835
+ order: 3;
1836
+ border-left: 0;
1837
+ user-select: none;
1838
+ }
1839
+ .csf-field-spinner .ui-spinner-up {
1840
+ order: 4;
1841
+ border-left: 0;
1842
+ border-radius: 0 4px 4px 0;
1843
+ }
1844
+ .csf-field-spinner .ui-spinner-up:before {
1845
+ content: "\f0da";
1846
+ }
1847
+ .csf-field-spinner input {
1848
+ position: relative;
1849
+ z-index: 1;
1850
+ width: 50px;
1851
+ text-align: center;
1852
+ margin: 0;
1853
+ padding: 0 8px;
1854
+ border-radius: 0;
1855
+ }
1856
+ .csf-field-spinner .ui-button-text {
1857
+ display: none;
1858
+ }
1859
+
1860
+ /**
1861
+ * 03. 27. Field: switcher
1862
+ */
1863
+ .csf-field-switcher .csf--switcher {
1864
+ float: left;
1865
+ cursor: pointer;
1866
+ position: relative;
1867
+ width: 60px;
1868
+ height: 26px;
1869
+ padding: 0;
1870
+ margin: 0;
1871
+ overflow: hidden;
1872
+ border-radius: 4px;
1873
+ background-color: #ed6f6f;
1874
+ user-select: none;
1875
+ -webkit-user-select: none;
1876
+ }
1877
+ .csf-field-switcher .csf--ball {
1878
+ position: absolute;
1879
+ top: 4px;
1880
+ left: 4px;
1881
+ width: 24px;
1882
+ height: 18px;
1883
+ background-color: #fff;
1884
+ border-radius: 4px;
1885
+ transition: all .1s;
1886
+ box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.15);
1887
+ }
1888
+ .csf-field-switcher .csf--on,
1889
+ .csf-field-switcher .csf--off {
1890
+ position: absolute;
1891
+ top: 0;
1892
+ left: 0;
1893
+ right: 0;
1894
+ font-size: 11px;
1895
+ line-height: 26px;
1896
+ font-weight: 500;
1897
+ font-style: normal;
1898
+ text-align: center;
1899
+ text-transform: uppercase;
1900
+ color: #fff;
1901
+ padding-right: 28px;
1902
+ opacity: 0;
1903
+ transition: all .1s;
1904
+ }
1905
+ .csf-field-switcher .csf--off {
1906
+ padding-right: 0;
1907
+ padding-left: 28px;
1908
+ opacity: 1;
1909
+ }
1910
+ .csf-field-switcher .csf--active {
1911
+ background: #4fb845;
1912
+ }
1913
+ .csf-field-switcher .csf--active .csf--on {
1914
+ opacity: 1;
1915
+ }
1916
+ .csf-field-switcher .csf--active .csf--off {
1917
+ opacity: 0;
1918
+ }
1919
+ .csf-field-switcher .csf--active .csf--ball {
1920
+ left: 100%;
1921
+ margin-left: -28px;
1922
+ }
1923
+ .csf-field-switcher .csf--label {
1924
+ float: left;
1925
+ margin-top: 4px;
1926
+ margin-left: 8px;
1927
+ font-weight: 400;
1928
+ color: #999;
1929
+ }
1930
+ .csf-field-switcher input {
1931
+ display: none;
1932
+ }
1933
+
1934
+ /**
1935
+ * 03. 28. Field: tabbed
1936
+ */
1937
+ .csf-field-tabbed .csf-tabbed-section {
1938
+ border: 1px solid #ccd0d4;
1939
+ background-color: #fff;
1940
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
1941
+ }
1942
+ .csf-field-tabbed .csf-tabbed-section > .csf-field {
1943
+ padding: 15px;
1944
+ }
1945
+ .csf-field-tabbed .csf-tabbed-nav .csf--icon {
1946
+ padding-right: 5px;
1947
+ }
1948
+ .csf-field-tabbed .csf-tabbed-nav a {
1949
+ display: inline-block;
1950
+ padding: 12px 15px;
1951
+ margin-top: 1px;
1952
+ margin-right: 5px;
1953
+ margin-bottom: -1px;
1954
+ position: relative;
1955
+ text-decoration: none;
1956
+ color: #444;
1957
+ font-weight: 600;
1958
+ border: 1px solid #ccd0d4;
1959
+ background-color: #f3f3f3;
1960
+ transition: all .2s;
1961
+ }
1962
+ .csf-field-tabbed .csf-tabbed-nav a:hover {
1963
+ background-color: #f9f9f9;
1964
+ }
1965
+ .csf-field-tabbed .csf-tabbed-nav a.csf-tabbed-active {
1966
+ background-color: #fff;
1967
+ border-bottom-color: #fff;
1968
+ }
1969
+ .csf-field-tabbed .csf-tabbed-nav a:focus {
1970
+ outline: none;
1971
+ -moz-box-shadow: none;
1972
+ -webkit-box-shadow: none;
1973
+ box-shadow: none;
1974
+ }
1975
+
1976
+ /**
1977
+ * 03. 29. Field: text
1978
+ */
1979
+ .csf-field-text input {
1980
+ width: 50%;
1981
+ max-width: 100%;
1982
+ margin: 0;
1983
+ }
1984
+
1985
+ /**
1986
+ * 03. 30. Field: textarea
1987
+ */
1988
+ .csf-field-textarea textarea {
1989
+ width: 100%;
1990
+ max-width: 100%;
1991
+ min-height: 125px;
1992
+ }
1993
+ .csf-field-textarea .csf-shortcode-button {
1994
+ margin-bottom: 10px;
1995
+ margin-right: 5px;
1996
+ }
1997
+
1998
+ /**
1999
+ * 03. 31. Field: typography
2000
+ */
2001
+ .csf-field-typography textarea,
2002
+ .csf-field-typography select {
2003
+ min-width: 100%;
2004
+ margin: 0;
2005
+ }
2006
+ .csf-field-typography .csf--title {
2007
+ color: #777;
2008
+ margin: 0 0 2px 0;
2009
+ font-size: 12px;
2010
+ }
2011
+ .csf-field-typography .csf--title small {
2012
+ vertical-align: top;
2013
+ }
2014
+ .csf-field-typography .csf--blocks {
2015
+ display: flex;
2016
+ flex-wrap: wrap;
2017
+ }
2018
+ .csf-field-typography .csf--block {
2019
+ flex: 1;
2020
+ padding-right: 6px;
2021
+ padding-bottom: 6px;
2022
+ }
2023
+ .csf-field-typography .csf--input {
2024
+ margin: 0;
2025
+ min-width: 100%;
2026
+ }
2027
+ .csf-field-typography .csf--input-wrap {
2028
+ position: relative;
2029
+ }
2030
+ .csf-field-typography .csf--unit {
2031
+ position: absolute;
2032
+ z-index: 1;
2033
+ right: 4px;
2034
+ top: 4px;
2035
+ bottom: 4px;
2036
+ padding: 2px 6px;
2037
+ color: #666;
2038
+ font-size: 11px;
2039
+ line-height: 1;
2040
+ border-radius: 2px;
2041
+ background: #eee;
2042
+ user-select: none;
2043
+ display: flex;
2044
+ justify-content: center;
2045
+ flex-direction: column;
2046
+ }
2047
+ .csf-field-typography .csf--preview {
2048
+ font-size: 16px;
2049
+ line-height: 20px;
2050
+ padding: 20px;
2051
+ color: #222;
2052
+ border: 1px solid #eee;
2053
+ background-color: #fff;
2054
+ border-radius: 2.5px;
2055
+ user-select: none;
2056
+ -webkit-user-select: none;
2057
+ transition: background-color .2s, border-color .2s;
2058
+ }
2059
+ .csf-field-typography .csf--block-preview {
2060
+ cursor: pointer;
2061
+ position: relative;
2062
+ overflow: hidden;
2063
+ margin-top: 10px;
2064
+ max-width: 100%;
2065
+ }
2066
+ .csf-field-typography .csf--black-background {
2067
+ border-color: #000;
2068
+ background-color: #000;
2069
+ }
2070
+ .csf-field-typography .csf--toggle {
2071
+ position: absolute;
2072
+ top: 5px;
2073
+ right: 10px;
2074
+ color: #999;
2075
+ }
2076
+ .csf-field-typography .csf--block-extra-styles {
2077
+ margin-top: 5px;
2078
+ }
2079
+
2080
+ /**
2081
+ * 03. 32. Field: upload
2082
+ */
2083
+ .csf-field-upload input {
2084
+ width: 100%;
2085
+ margin: 0;
2086
+ }
2087
+ .csf-field-upload .csf--wrap {
2088
+ display: flex;
2089
+ }
2090
+ .csf-field-upload .button {
2091
+ margin-left: 5px;
2092
+ }
2093
+
2094
+ /**
2095
+ * 03. 33. Field: wp_editor
2096
+ */
2097
+ .csf-field-wp_editor .csf-wp-editor {
2098
+ float: left;
2099
+ width: 100%;
2100
+ }
2101
+ .csf-field-wp_editor .mce-toolbar-grp {
2102
+ border: none;
2103
+ }
2104
+ .csf-field-wp_editor .mce-btn.mce-active button,
2105
+ .csf-field-wp_editor .mce-btn.mce-active:hover button,
2106
+ .csf-field-wp_editor .mce-btn.mce-active i,
2107
+ .csf-field-wp_editor .mce-btn.mce-active:hover i {
2108
+ color: #23282d;
2109
+ }
2110
+ .csf-field-wp_editor .wp-media-buttons {
2111
+ position: relative;
2112
+ z-index: 2;
2113
+ }
2114
+ .csf-field-wp_editor .wp-editor-tabs {
2115
+ position: relative;
2116
+ z-index: 1;
2117
+ }
2118
+ .csf-field-wp_editor .csf-no-tinymce {
2119
+ border: 1px solid #e5e5e5;
2120
+ }
2121
+ .csf-field-wp_editor .csf-no-quicktags .wp-media-buttons {
2122
+ float: none;
2123
+ display: block;
2124
+ }
2125
+ .csf-field-wp_editor .csf-no-quicktags .mce-tinymce {
2126
+ box-shadow: none;
2127
+ border: 1px solid #e5e5e5;
2128
+ }
2129
+ .csf-field-wp_editor textarea {
2130
+ width: 100%;
2131
+ max-width: 100%;
2132
+ margin: 0;
2133
+ box-shadow: none;
2134
+ }
2135
+
2136
+ /**
2137
+ * 03. 34. Field: heading
2138
+ */
2139
+ .csf-field-heading {
2140
+ font-size: 1.5em;
2141
+ font-weight: bold;
2142
+ color: #23282d;
2143
+ background-color: #f5f5f5;
2144
+ }
2145
+
2146
+ /**
2147
+ * 03. 35. Field: subheading
2148
+ */
2149
+ .csf-field-subheading {
2150
+ font-size: 14px;
2151
+ font-weight: bold;
2152
+ padding-top: 17px;
2153
+ padding-bottom: 17px;
2154
+ color: #23282d;
2155
+ background-color: #f7f7f7;
2156
+ }
2157
+
2158
+ /**
2159
+ * 03. 36. Field: submessage
2160
+ */
2161
+ .csf-field-submessage {
2162
+ padding: 0 !important;
2163
+ border: 0 !important;
2164
+ }
2165
+ .csf-field-submessage + .csf-field {
2166
+ border-top: 0 !important;
2167
+ }
2168
+
2169
+ .csf-submessage {
2170
+ font-size: 12px;
2171
+ padding: 17px 30px;
2172
+ border-top: 1px solid transparent;
2173
+ border-bottom: 1px solid transparent;
2174
+ }
2175
+
2176
+ .csf-submessage-success {
2177
+ color: #3c763d;
2178
+ border-color: #d6e9c6;
2179
+ background-color: #dff0d8;
2180
+ }
2181
+
2182
+ .csf-submessage-info {
2183
+ color: #31708f;
2184
+ border-color: #bce8f1;
2185
+ background-color: #d9edf7;
2186
+ }
2187
+
2188
+ .csf-submessage-warning {
2189
+ color: #8a6d3b;
2190
+ border-color: #faebcc;
2191
+ background-color: #fcf8e3;
2192
+ }
2193
+
2194
+ .csf-submessage-danger {
2195
+ color: #a94442;
2196
+ border-color: #ebccd1;
2197
+ background-color: #f2dede;
2198
+ }
2199
+
2200
+ .csf-submessage-normal {
2201
+ color: #23282d;
2202
+ border-color: #eee;
2203
+ background-color: #f7f7f7;
2204
+ }
2205
+
2206
+ /**
2207
+ * 03. 37. Field: notice
2208
+ */
2209
+ .csf-field-notice {
2210
+ background-color: #f7f7f7;
2211
+ }
2212
+
2213
+ .csf-notice {
2214
+ padding: 12px;
2215
+ background-color: #fff;
2216
+ border-left-style: solid;
2217
+ border-left-width: 4px;
2218
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
2219
+ }
2220
+
2221
+ .csf-notice-success {
2222
+ border-color: #46b450;
2223
+ }
2224
+
2225
+ .csf-notice-info {
2226
+ border-color: #339fd4;
2227
+ }
2228
+
2229
+ .csf-notice-warning {
2230
+ border-color: #ffbc00;
2231
+ }
2232
+
2233
+ .csf-notice-danger {
2234
+ border-color: #dc3232;
2235
+ }
2236
+
2237
+ .csf-notice-normal {
2238
+ border-color: #222;
2239
+ }
2240
+
2241
+ /**
2242
+ * 03. 38. Field: number
2243
+ */
2244
+ .csf-field-number input {
2245
+ width: 100%;
2246
+ margin: 0;
2247
+ }
2248
+ .csf-field-number .csf--wrap {
2249
+ position: relative;
2250
+ float: left;
2251
+ width: 100px;
2252
+ }
2253
+ .csf-field-number .csf--unit {
2254
+ position: absolute;
2255
+ z-index: 1;
2256
+ right: 4px;
2257
+ top: 4px;
2258
+ bottom: 4px;
2259
+ padding: 2px 6px;
2260
+ color: #666;
2261
+ font-size: 11px;
2262
+ line-height: 1;
2263
+ border-radius: 2px;
2264
+ background: #eee;
2265
+ user-select: none;
2266
+ display: flex;
2267
+ justify-content: center;
2268
+ flex-direction: column;
2269
+ }
2270
+
2271
+ /**
2272
+ * 03. 39. others
2273
+ */
2274
+ .csf-help {
2275
+ cursor: help;
2276
+ position: absolute;
2277
+ top: 0;
2278
+ right: 0;
2279
+ padding: 5px;
2280
+ font-size: 14px;
2281
+ color: #aaa;
2282
+ }
2283
+ .csf-help .csf-help-text {
2284
+ display: none;
2285
+ }
2286
+
2287
+ .csf-image-preview {
2288
+ display: inline-block;
2289
+ position: relative;
2290
+ padding: 4px;
2291
+ min-width: 44px;
2292
+ min-height: 22px;
2293
+ margin-bottom: 10px;
2294
+ border: 1px solid #ccc;
2295
+ background-color: #f9f9f9;
2296
+ -moz-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
2297
+ -webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
2298
+ box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
2299
+ }
2300
+ .csf-image-preview img {
2301
+ max-height: 90px;
2302
+ display: inline-block;
2303
+ vertical-align: middle;
2304
+ }
2305
+
2306
+ .csf-field-custom .csf-field {
2307
+ padding: 0;
2308
+ }
2309
+
2310
+ .csf-field .chosen-container-single .chosen-single {
2311
+ height: 28px;
2312
+ line-height: 26px;
2313
+ }
2314
+ .csf-field .chosen-container-single .chosen-single abbr {
2315
+ top: 0;
2316
+ right: 20px;
2317
+ font-family: FontAwesome;
2318
+ font-size: 12px;
2319
+ height: 100%;
2320
+ width: 18px;
2321
+ color: #aaa;
2322
+ text-align: center;
2323
+ background: none;
2324
+ }
2325
+ .csf-field .chosen-container-single .chosen-single abbr:before {
2326
+ content: "\f00d";
2327
+ }
2328
+ .csf-field .chosen-container-single .chosen-single abbr:hover {
2329
+ color: #555;
2330
+ }
2331
+ .csf-field .chosen-container-multi .chosen-choices li.search-choice .search-choice-close {
2332
+ font-family: FontAwesome;
2333
+ font-size: 12px;
2334
+ height: 100%;
2335
+ width: 18px;
2336
+ color: #aaa;
2337
+ text-align: center;
2338
+ background: none;
2339
+ }
2340
+ .csf-field .chosen-container-multi .chosen-choices li.search-choice .search-choice-close:before {
2341
+ content: "\f00d";
2342
+ display: inline-block;
2343
+ padding-top: 3px;
2344
+ }
2345
+ .csf-field .chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover {
2346
+ color: #555;
2347
+ }
2348
+ .csf-field .chosen-container-single .chosen-single div b {
2349
+ font-family: FontAwesome;
2350
+ font-size: 14px;
2351
+ color: #aaa;
2352
+ background: none;
2353
+ }
2354
+ .csf-field .chosen-container-single .chosen-single div b:before {
2355
+ content: "\f107";
2356
+ }
2357
+ .csf-field .chosen-container-single .chosen-single div b:hover {
2358
+ color: #555;
2359
+ }
2360
+ .csf-field .chosen-container-multi .chosen-choices li.search-choice-placeholder {
2361
+ border: 1px dashed #aaa;
2362
+ margin: 3px 5px 3px 0;
2363
+ }
2364
+ .csf-field .chosen-container-multi .ui-sortable li.search-choice span {
2365
+ cursor: move;
2366
+ }
2367
+ .csf-field .chosen-container-active.chosen-with-drop .chosen-single div b:before {
2368
+ content: "\f106";
2369
+ }
2370
+ .csf-field .chosen-container-single .chosen-single-with-deselect span {
2371
+ margin-right: 40px;
2372
+ }
2373
+ .csf-field .chosen-container-single .chosen-search input[type="text"] {
2374
+ background: none;
2375
+ }
2376
+ .csf-field .chosen-container-single .chosen-search:before {
2377
+ font-family: FontAwesome;
2378
+ position: absolute;
2379
+ content: "\f002";
2380
+ font-size: 11px;
2381
+ right: 10px;
2382
+ top: 7px;
2383
+ color: #aaa;
2384
+ }
2385
+ .csf-field .wp-picker-container {
2386
+ display: inline-block;
2387
+ }
2388
+ .csf-field .csf--transparent-wrap {
2389
+ display: none;
2390
+ position: relative;
2391
+ top: -1px;
2392
+ width: 235px;
2393
+ padding: 9px 10px;
2394
+ border: 1px solid #dfdfdf;
2395
+ border-top: none;
2396
+ background-color: #fff;
2397
+ }
2398
+ .csf-field .wp-picker-active .csf--transparent-wrap {
2399
+ display: block;
2400
+ }
2401
+ .csf-field .csf--transparent-slider {
2402
+ position: absolute;
2403
+ width: 190px;
2404
+ margin-left: 2px;
2405
+ height: 18px;
2406
+ }
2407
+ .csf-field .csf--transparent-slider .ui-slider-handle {
2408
+ position: absolute;
2409
+ top: -3px;
2410
+ bottom: -3px;
2411
+ z-index: 5;
2412
+ border-color: #aaa;
2413
+ border-style: solid;
2414
+ border-width: 4px 3px;
2415
+ width: 10px;
2416
+ height: 16px;
2417
+ margin: 0 -5px;
2418
+ background: none;
2419
+ cursor: ew-resize;
2420
+ opacity: 0.9;
2421
+ -moz-border-radius: 4px;
2422
+ -webkit-border-radius: 4px;
2423
+ border-radius: 4px;
2424
+ -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
2425
+ -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
2426
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
2427
+ }
2428
+ .csf-field .csf--transparent-slider .ui-slider-handle:before {
2429
+ content: " ";
2430
+ position: absolute;
2431
+ left: -2px;
2432
+ right: -2px;
2433
+ top: -3px;
2434
+ bottom: -3px;
2435
+ border: 2px solid #fff;
2436
+ -moz-border-radius: 3px;
2437
+ -webkit-border-radius: 3px;
2438
+ border-radius: 3px;
2439
+ }
2440
+ .csf-field .csf--transparent-offset {
2441
+ height: 18px;
2442
+ width: 200px;
2443
+ background: url(../images/checkerboard.png) repeat-y center left scroll #fff;
2444
+ -moz-box-shadow: 0 0 5px rgba(0, 0, 0, 0.4) inset;
2445
+ -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.4) inset;
2446
+ box-shadow: 0 0 5px rgba(0, 0, 0, 0.4) inset;
2447
+ -moz-border-radius: 2px;
2448
+ -webkit-border-radius: 2px;
2449
+ border-radius: 2px;
2450
+ }
2451
+ .csf-field .csf--transparent-text {
2452
+ position: absolute;
2453
+ top: 12px;
2454
+ right: 10px;
2455
+ width: 30px;
2456
+ font-size: 12px;
2457
+ line-height: 12px;
2458
+ text-align: center;
2459
+ color: #999;
2460
+ }
2461
+ .csf-field .csf--transparent-button {
2462
+ cursor: pointer;
2463
+ user-select: none;
2464
+ margin-top: 10px;
2465
+ font-size: 11px;
2466
+ text-align: center;
2467
+ border-radius: 2px;
2468
+ padding: 3px 7px;
2469
+ box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
2470
+ letter-spacing: 0.2px;
2471
+ color: #777;
2472
+ border: 1px solid #ccc;
2473
+ background-color: #f7f7f7;
2474
+ transition: background-color .2s, border-color .2s, color .2s;
2475
+ }
2476
+ .csf-field .csf--transparent-active .wp-color-result {
2477
+ background-image: url(../images/checkerboard.png);
2478
+ background-size: 135px;
2479
+ background-position: center left;
2480
+ background-color: transparent !important;
2481
+ }
2482
+ .csf-field .csf--transparent-active .csf--transparent-button {
2483
+ color: #fff;
2484
+ border-color: #3ea032;
2485
+ background-color: #4fb845;
2486
+ }
2487
+ .csf-field .csf--transparent-active .fa:before {
2488
+ content: "\f205";
2489
+ }
2490
+
2491
+ /**
2492
+ * 04. Widget
2493
+ */
2494
+ .csf-widgets > .csf-field {
2495
+ position: relative;
2496
+ top: -1px;
2497
+ margin-right: -15px;
2498
+ margin-left: -15px;
2499
+ padding: 12px 15px;
2500
+ }
2501
+ .csf-widgets > .csf-field .csf-field {
2502
+ margin-left: 0;
2503
+ margin-right: 0;
2504
+ }
2505
+ .csf-widgets > .csf-field .csf-title {
2506
+ float: none;
2507
+ width: 100%;
2508
+ margin-bottom: 5px;
2509
+ }
2510
+ .csf-widgets > .csf-field .csf-fieldset {
2511
+ margin-left: 0;
2512
+ }
2513
+ .csf-widgets .csf-field-text input {
2514
+ width: 100%;
2515
+ }
2516
+ .csf-widgets .csf-field-notice .csf-notice {
2517
+ padding: 15px;
2518
+ }
2519
+
2520
+ .control-section .csf-widgets > .csf-field {
2521
+ margin-right: -10px;
2522
+ margin-left: -10px;
2523
+ padding: 10px 12px;
2524
+ }
2525
+
2526
+ /**
2527
+ * 05. Widget
2528
+ */
2529
+ .control-section .csf-field {
2530
+ padding: 0;
2531
+ }
2532
+ .control-section .csf-field .csf-title {
2533
+ float: none;
2534
+ width: 100%;
2535
+ margin-bottom: 6px;
2536
+ }
2537
+ .control-section .csf-field .csf-title h4 {
2538
+ display: block;
2539
+ font-size: 13px;
2540
+ line-height: 1;
2541
+ font-weight: 600;
2542
+ color: inherit;
2543
+ }
2544
+ .control-section .csf-field .csf-fieldset {
2545
+ margin-left: 0;
2546
+ }
2547
+ .control-section .csf-help {
2548
+ top: -5px;
2549
+ right: -5px;
2550
+ }
2551
+ .control-section .csf-field-select select {
2552
+ width: 100%;
2553
+ }
2554
+ .control-section .csf-field-heading {
2555
+ color: inherit;
2556
+ font-size: 14px;
2557
+ line-height: 1em;
2558
+ margin-right: -15px;
2559
+ margin-left: -15px;
2560
+ padding: 15px;
2561
+ }
2562
+ .control-section .csf-field-subheading {
2563
+ color: inherit;
2564
+ font-size: 11px;
2565
+ margin-right: -15px;
2566
+ margin-left: -15px;
2567
+ padding: 10px 15px;
2568
+ }
2569
+ .control-section .csf-text-subtitle {
2570
+ margin-top: 4px;
2571
+ font-size: 12px;
2572
+ }
2573
+ .control-section .csf-field-submessage .csf-submessage {
2574
+ margin-right: -15px;
2575
+ margin-left: -15px;
2576
+ padding: 15px;
2577
+ }
2578
+ .control-section .csf-fieldset .csf-field-submessage .csf-submessage,
2579
+ .control-section .csf-fieldset .csf-field-heading,
2580
+ .control-section .csf-fieldset .csf-field-subheading {
2581
+ margin-left: 0;
2582
+ margin-right: 0;
2583
+ }
2584
+ .control-section .csf-field-date .csf--to {
2585
+ margin-left: 0;
2586
+ }
2587
+ .control-section .csf-field-sorter ul li {
2588
+ padding: 5px;
2589
+ }
2590
+ .control-section .csf-field-sorter .csf-modules {
2591
+ float: none;
2592
+ width: 100%;
2593
+ }
2594
+ .control-section .csf-field-sorter .csf-modules:first-child {
2595
+ padding-right: 0;
2596
+ padding-bottom: 15px;
2597
+ }
2598
+ .control-section .csf-field-background .csf--background-attributes {
2599
+ flex-direction: column;
2600
+ }
2601
+ .control-section .csf-field-spacing input {
2602
+ width: 90px;
2603
+ }
2604
+ .control-section .csf-field-border .csf--input {
2605
+ flex: 1 50%;
2606
+ }
2607
+ .control-section .csf-field-border input,
2608
+ .control-section .csf-field-border select {
2609
+ width: 100%;
2610
+ }
2611
+ .control-section .csf-field-spinner input {
2612
+ width: 50px;
2613
+ }
2614
+ .control-section .csf-field-number .csf--wrap {
2615
+ width: 100%;
2616
+ }
2617
+ .control-section .csf-field-backup .csf-export-data {
2618
+ display: none;
2619
+ }
2620
+ .control-section .csf-field-fieldset .csf-fieldset-content {
2621
+ border-color: #e5e5e5;
2622
+ }
2623
+ .control-section .csf-field-fieldset .csf-field {
2624
+ padding: 10px;
2625
+ }
2626
+ .control-section .csf-field-fieldset .csf-field .csf-title {
2627
+ margin-bottom: 5px;
2628
+ }
2629
+ .control-section .csf-field-fieldset .csf-field h4 {
2630
+ font-size: 12px;
2631
+ }
2632
+ .control-section .csf-field-group .csf-field,
2633
+ .control-section .csf-field-tabbed .csf-field,
2634
+ .control-section .csf-field-sortable .csf-field,
2635
+ .control-section .csf-field-repeater .csf-field,
2636
+ .control-section .csf-field-accordion .csf-field {
2637
+ padding: 10px;
2638
+ }
2639
+ .control-section .csf-field-group .csf-field .csf-title,
2640
+ .control-section .csf-field-tabbed .csf-field .csf-title,
2641
+ .control-section .csf-field-sortable .csf-field .csf-title,
2642
+ .control-section .csf-field-repeater .csf-field .csf-title,
2643
+ .control-section .csf-field-accordion .csf-field .csf-title {
2644
+ margin-bottom: 5px;
2645
+ }
2646
+ .control-section .csf-field-group .csf-field h4,
2647
+ .control-section .csf-field-tabbed .csf-field h4,
2648
+ .control-section .csf-field-sortable .csf-field h4,
2649
+ .control-section .csf-field-repeater .csf-field h4,
2650
+ .control-section .csf-field-accordion .csf-field h4 {
2651
+ font-size: 12px;
2652
+ }
2653
+ .control-section .csf-dependency-control.hidden {
2654
+ display: none !important;
2655
+ }
2656
+
2657
+ /**
2658
+ * 06. Taxonomy
2659
+ */
2660
+ .csf-taxonomy > .csf-field {
2661
+ border-top: none !important;
2662
+ }
2663
+ .csf-taxonomy > .csf-field-heading {
2664
+ font-size: 1.1em;
2665
+ padding: 20px !important;
2666
+ border: 1px solid #ddd;
2667
+ }
2668
+ .csf-taxonomy > .csf-field-subheading {
2669
+ font-size: 12px;
2670
+ padding: 15px !important;
2671
+ border: 1px solid #ddd;
2672
+ }
2673
+ .csf-taxonomy > .csf-field-submessage .csf-submessage {
2674
+ padding: 15px;
2675
+ border-left-width: 1px;
2676
+ border-left-style: solid;
2677
+ border-right-width: 1px;
2678
+ border-right-style: solid;
2679
+ }
2680
+ .csf-taxonomy > .csf-field-notice {
2681
+ background-color: transparent;
2682
+ }
2683
+ .csf-taxonomy .csf-section-title {
2684
+ display: block;
2685
+ padding: 15px;
2686
+ background-color: #f9f9f9;
2687
+ border: 1px solid #e5e5e5;
2688
+ -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
2689
+ -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
2690
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
2691
+ }
2692
+
2693
+ .csf-taxonomy-add-fields > .csf-field {
2694
+ padding: 8px 0;
2695
+ }
2696
+ .csf-taxonomy-add-fields > .csf-field > .csf-title {
2697
+ float: none;
2698
+ width: 100%;
2699
+ padding: 2px 2px 4px 0;
2700
+ }
2701
+ .csf-taxonomy-add-fields > .csf-field > .csf-title h4 {
2702
+ font-size: 12px;
2703
+ font-weight: normal;
2704
+ }
2705
+ .csf-taxonomy-add-fields > .csf-field > .csf-fieldset {
2706
+ margin-left: 0;
2707
+ }
2708
+ .csf-taxonomy-add-fields > .csf-field > .csf-fieldset > .csf-help {
2709
+ right: -5px;
2710
+ }
2711
+ .csf-taxonomy-add-fields + p.submit {
2712
+ margin-top: 0;
2713
+ }
2714
+
2715
+ .csf-taxonomy-edit-fields > .csf-field {
2716
+ padding: 20px 0;
2717
+ }
2718
+ .csf-taxonomy-edit-fields > .csf-field > .csf-title {
2719
+ width: 225px;
2720
+ }
2721
+ .csf-taxonomy-edit-fields > .csf-field > .csf-title h4 {
2722
+ font-size: 14px;
2723
+ font-weight: 600;
2724
+ line-height: 1.3;
2725
+ display: inline-block;
2726
+ vertical-align: middle;
2727
+ }
2728
+ .csf-taxonomy-edit-fields > .csf-field > .csf-fieldset {
2729
+ margin-left: 225px;
2730
+ }
2731
+ .csf-taxonomy-edit-fields > .csf-field > .csf-fieldset > .csf-help {
2732
+ top: -5px;
2733
+ right: -5px;
2734
+ }
2735
+ .csf-taxonomy-edit-fields > .csf-field-submessage {
2736
+ margin: 20px 0;
2737
+ }
2738
+ .csf-taxonomy-edit-fields > .csf-field-subheading,
2739
+ .csf-taxonomy-edit-fields > .csf-field-heading {
2740
+ margin: 20px 0;
2741
+ border: 1px solid #ddd;
2742
+ }
2743
+
2744
+ /**
2745
+ * 06. Profile
2746
+ */
2747
+ .csf-profile > h2 > .fa {
2748
+ padding-right: 7px;
2749
+ }
2750
+ .csf-profile > .csf-field {
2751
+ padding: 15px 0;
2752
+ border-top: none !important;
2753
+ }
2754
+ .csf-profile > .csf-field > .csf-title {
2755
+ width: 220px;
2756
+ }
2757
+ .csf-profile > .csf-field > .csf-title h4 {
2758
+ font-size: 14px;
2759
+ font-weight: 600;
2760
+ line-height: 1.3;
2761
+ display: inline-block;
2762
+ vertical-align: middle;
2763
+ }
2764
+ .csf-profile > .csf-field > .csf-fieldset {
2765
+ margin-left: 220px;
2766
+ }
2767
+ .csf-profile > .csf-field > .csf-fieldset > .csf-help {
2768
+ top: -15px;
2769
+ right: -5px;
2770
+ }
2771
+ .csf-profile > .csf-field-heading {
2772
+ font-size: 1.1em;
2773
+ }
2774
+ .csf-profile > .csf-field-subheading {
2775
+ font-size: 12px;
2776
+ }
2777
+ .csf-profile > .csf-field-subheading,
2778
+ .csf-profile > .csf-field-heading {
2779
+ margin: 10px 0;
2780
+ padding: 15px !important;
2781
+ border: 1px solid #ddd;
2782
+ }
2783
+ .csf-profile > .csf-field-submessage {
2784
+ margin: 20px 0;
2785
+ }
2786
+ .csf-profile > .csf-field-submessage .csf-submessage {
2787
+ padding: 10px;
2788
+ border-left-width: 1px;
2789
+ border-left-style: solid;
2790
+ border-right-width: 1px;
2791
+ border-right-style: solid;
2792
+ }
2793
+ .csf-profile > .csf-field-notice {
2794
+ background-color: transparent;
2795
+ }
2796
+
2797
+ /**
2798
+ * 08. Modal
2799
+ */
2800
+ .csf-modal {
2801
+ display: none;
2802
+ position: fixed;
2803
+ z-index: 100101;
2804
+ top: 0;
2805
+ left: 0;
2806
+ width: 100%;
2807
+ height: 100%;
2808
+ }
2809
+
2810
+ .csf-modal-icon {
2811
+ z-index: 100102;
2812
+ }
2813
+
2814
+ .csf-modal-table {
2815
+ display: table;
2816
+ width: 100%;
2817
+ height: 100%;
2818
+ }
2819
+
2820
+ .csf-modal-table-cell {
2821
+ display: table-cell;
2822
+ vertical-align: middle;
2823
+ margin: 100px 0;
2824
+ }
2825
+
2826
+ .csf-modal-inner {
2827
+ position: relative;
2828
+ z-index: 10;
2829
+ width: 760px;
2830
+ height: 750px;
2831
+ margin: 0 auto;
2832
+ background-color: #fff;
2833
+ }
2834
+
2835
+ .csf-modal-content {
2836
+ position: relative;
2837
+ overflow: hidden;
2838
+ overflow-y: auto;
2839
+ height: 595px;
2840
+ }
2841
+ .csf-modal-content .csf-shortcode-button {
2842
+ display: none;
2843
+ }
2844
+ .csf-modal-content .csf-fieldset {
2845
+ margin-left: 25%;
2846
+ }
2847
+ .csf-modal-content .csf-title {
2848
+ width: 20%;
2849
+ }
2850
+ .csf-modal-content .csf-field {
2851
+ padding: 15px 30px 15px 15px;
2852
+ }
2853
+ .csf-modal-content a:active, .csf-modal-content a:focus {
2854
+ outline: none;
2855
+ -moz-box-shadow: none;
2856
+ -webkit-box-shadow: none;
2857
+ box-shadow: none;
2858
+ }
2859
+ .csf-modal-content h4 {
2860
+ font-size: 13px;
2861
+ }
2862
+ .csf-modal-content h4 small {
2863
+ font-style: italic;
2864
+ font-weight: 400;
2865
+ color: #aaa;
2866
+ }
2867
+
2868
+ .csf-modal-title {
2869
+ position: relative;
2870
+ background-color: #fcfcfc;
2871
+ border-bottom: 1px solid #ddd;
2872
+ height: 36px;
2873
+ font-size: 16px;
2874
+ font-weight: 600;
2875
+ line-height: 36px;
2876
+ margin: 0;
2877
+ padding: 0 36px 0 16px;
2878
+ }
2879
+
2880
+ .csf-modal-header {
2881
+ width: 100%;
2882
+ padding: 14px 0;
2883
+ background-color: #f5f5f5;
2884
+ border-bottom: 1px solid #eee;
2885
+ }
2886
+ .csf-modal-header select {
2887
+ display: block;
2888
+ width: 250px;
2889
+ margin: 0 auto;
2890
+ font-size: 13px;
2891
+ line-height: 1;
2892
+ height: 30px;
2893
+ min-height: 30px;
2894
+ background-color: #fff;
2895
+ }
2896
+
2897
+ .csf-modal-close {
2898
+ color: #666;
2899
+ padding: 0;
2900
+ position: absolute;
2901
+ top: 0;
2902
+ right: 0;
2903
+ width: 36px;
2904
+ height: 36px;
2905
+ text-align: center;
2906
+ background: none;
2907
+ border: none;
2908
+ cursor: pointer;
2909
+ }
2910
+ .csf-modal-close:before {
2911
+ font: normal 20px/36px dashicons;
2912
+ content: "\f158";
2913
+ vertical-align: top;
2914
+ width: 36px;
2915
+ height: 36px;
2916
+ }
2917
+ .csf-modal-close:hover {
2918
+ opacity: 0.5;
2919
+ }
2920
+
2921
+ .csf-modal-insert-wrapper {
2922
+ text-align: center;
2923
+ width: 100%;
2924
+ padding: 15px 0;
2925
+ background-color: #f5f5f5;
2926
+ border-top: 1px solid #eee;
2927
+ }
2928
+
2929
+ .csf-modal-overlay {
2930
+ position: absolute;
2931
+ top: 0;
2932
+ left: 0;
2933
+ width: 100%;
2934
+ height: 100%;
2935
+ background-color: #000;
2936
+ opacity: 0.5;
2937
+ }
2938
+
2939
+ /**
2940
+ * 08. 01. Shortcode Modal
2941
+ */
2942
+ .csf--repeatable {
2943
+ padding: 15px 15px 0 15px;
2944
+ }
2945
+
2946
+ .csf--repeat-button-block {
2947
+ text-align: center;
2948
+ padding-bottom: 15px;
2949
+ }
2950
+
2951
+ .csf--repeat-shortcode {
2952
+ position: relative;
2953
+ margin-bottom: 15px;
2954
+ border: 1px dashed #ddd;
2955
+ }
2956
+ .csf--repeat-shortcode:first-child .csf-repeat-remove {
2957
+ display: none;
2958
+ }
2959
+ .csf--repeat-shortcode .csf-repeat-remove {
2960
+ position: absolute;
2961
+ right: 10px;
2962
+ top: 10px;
2963
+ z-index: 10;
2964
+ cursor: pointer;
2965
+ display: inline-block;
2966
+ font-size: 11px;
2967
+ width: 18px;
2968
+ height: 18px;
2969
+ line-height: 18px;
2970
+ text-align: center;
2971
+ border-radius: 2px;
2972
+ color: #fff;
2973
+ background-color: #e14d43;
2974
+ opacity: 0.5;
2975
+ }
2976
+ .csf--repeat-shortcode .csf-repeat-remove:hover {
2977
+ opacity: 1;
2978
+ }
2979
+
2980
+ .csf-shortcode-single .csf-modal-inner {
2981
+ height: 750px;
2982
+ }
2983
+ .csf-shortcode-single .csf-modal-content {
2984
+ height: 652px;
2985
+ }
2986
+
2987
+ .elementor-editor-active .csf-shortcode-button {
2988
+ margin-left: 5px;
2989
+ }
2990
+ .elementor-editor-active .csf-modal .hidden {
2991
+ display: none !important;
2992
+ }
2993
+
2994
+ /**
2995
+ * 08. 02. Gutenberg Modal
2996
+ */
2997
+ .csf-shortcode-block {
2998
+ text-align: center;
2999
+ padding: 14px;
3000
+ font-size: 13px;
3001
+ background-color: #f5f5f5;
3002
+ font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
3003
+ }
3004
+
3005
+ .csf-shortcode-block .button {
3006
+ margin: 10px 0;
3007
+ }
3008
+
3009
+ /**
3010
+ * 08. 03. Icon Modal
3011
+ */
3012
+ .csf-modal-icon .csf-icon-title {
3013
+ padding: 15px 0;
3014
+ margin: 4px;
3015
+ font-size: 14px;
3016
+ font-weight: bold;
3017
+ text-align: center;
3018
+ border: 1px solid #eee;
3019
+ background-color: #f7f7f7;
3020
+ }
3021
+ .csf-modal-icon .csf-icon-search {
3022
+ width: 250px;
3023
+ height: 40px;
3024
+ line-height: 40px;
3025
+ }
3026
+ .csf-modal-icon a {
3027
+ display: inline-block;
3028
+ padding: 4px;
3029
+ cursor: pointer;
3030
+ }
3031
+ .csf-modal-icon a .csf-icon {
3032
+ position: relative;
3033
+ padding: 4px;
3034
+ display: inline-block;
3035
+ font-size: 14px;
3036
+ width: 30px;
3037
+ height: 26px;
3038
+ line-height: 26px;
3039
+ text-align: center;
3040
+ vertical-align: top;
3041
+ color: #555;
3042
+ border: 1px solid #ccc;
3043
+ background-color: #f7f7f7;
3044
+ -moz-border-radius: 3px;
3045
+ -webkit-border-radius: 3px;
3046
+ border-radius: 3px;
3047
+ -moz-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
3048
+ -webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
3049
+ box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
3050
+ -moz-box-sizing: content-box;
3051
+ -webkit-box-sizing: content-box;
3052
+ box-sizing: content-box;
3053
+ }
3054
+ .csf-modal-icon a:hover .csf-icon {
3055
+ color: #fff;
3056
+ border-color: #222;
3057
+ background-color: #222;
3058
+ }
3059
+ .csf-modal-icon .csf-modal-content {
3060
+ padding: 10px;
3061
+ height: 618px;
3062
+ }
3063
+ .csf-modal-icon .csf-text-error {
3064
+ padding: 10px;
3065
+ }
3066
+
3067
+ .csf-modal-loading {
3068
+ display: none;
3069
+ position: absolute;
3070
+ left: 15px;
3071
+ top: 15px;
3072
+ }
3073
+
3074
+ .csf-loading {
3075
+ position: relative;
3076
+ width: 20px;
3077
+ height: 20px;
3078
+ background: #ccc;
3079
+ -moz-border-radius: 20px;
3080
+ -webkit-border-radius: 20px;
3081
+ border-radius: 20px;
3082
+ -moz-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.07);
3083
+ -webkit-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.07);
3084
+ box-shadow: 0 2px 5px rgba(0, 0, 0, 0.07);
3085
+ }
3086
+ .csf-loading:after {
3087
+ position: absolute;
3088
+ top: 50%;
3089
+ left: 50%;
3090
+ width: 4px;
3091
+ height: 4px;
3092
+ content: "";
3093
+ margin-top: -2px;
3094
+ margin-left: -2px;
3095
+ background-color: white;
3096
+ -moz-animation-duration: 0.5s;
3097
+ -webkit-animation-duration: 0.5s;
3098
+ animation-duration: 0.5s;
3099
+ -moz-animation-iteration-count: infinite;
3100
+ -webkit-animation-iteration-count: infinite;
3101
+ animation-iteration-count: infinite;
3102
+ -moz-animation-timing-function: linear;
3103
+ -webkit-animation-timing-function: linear;
3104
+ animation-timing-function: linear;
3105
+ -moz-animation-name: csfLoader;
3106
+ -webkit-animation-name: csfLoader;
3107
+ animation-name: csfLoader;
3108
+ -moz-border-radius: 4px;
3109
+ -webkit-border-radius: 4px;
3110
+ border-radius: 4px;
3111
+ }
3112
+
3113
+ @-moz-keyframes csfLoader {
3114
+ 0% {
3115
+ -moz-transform: rotate(0deg) translateX(-6px) rotate(0deg);
3116
+ transform: rotate(0deg) translateX(-6px) rotate(0deg);
3117
+ }
3118
+ 100% {
3119
+ -moz-transform: rotate(360deg) translateX(-6px) rotate(-360deg);
3120
+ transform: rotate(360deg) translateX(-6px) rotate(-360deg);
3121
+ }
3122
+ }
3123
+ @-webkit-keyframes csfLoader {
3124
+ 0% {
3125
+ -webkit-transform: rotate(0deg) translateX(-6px) rotate(0deg);
3126
+ transform: rotate(0deg) translateX(-6px) rotate(0deg);
3127
+ }
3128
+ 100% {
3129
+ -webkit-transform: rotate(360deg) translateX(-6px) rotate(-360deg);
3130
+ transform: rotate(360deg) translateX(-6px) rotate(-360deg);
3131
+ }
3132
+ }
3133
+ @keyframes csfLoader {
3134
+ 0% {
3135
+ -moz-transform: rotate(0deg) translateX(-6px) rotate(0deg);
3136
+ -ms-transform: rotate(0deg) translateX(-6px) rotate(0deg);
3137
+ -webkit-transform: rotate(0deg) translateX(-6px) rotate(0deg);
3138
+ transform: rotate(0deg) translateX(-6px) rotate(0deg);
3139
+ }
3140
+ 100% {
3141
+ -moz-transform: rotate(360deg) translateX(-6px) rotate(-360deg);
3142
+ -ms-transform: rotate(360deg) translateX(-6px) rotate(-360deg);
3143
+ -webkit-transform: rotate(360deg) translateX(-6px) rotate(-360deg);
3144
+ transform: rotate(360deg) translateX(-6px) rotate(-360deg);
3145
+ }
3146
+ }
3147
+ /**
3148
+ * 08. Helper
3149
+ */
3150
+ .csf-text-desc,
3151
+ .csf-text-subtitle {
3152
+ font-weight: 400;
3153
+ margin-top: 10px;
3154
+ color: #999;
3155
+ }
3156
+
3157
+ .csf-text-success {
3158
+ color: #2b542c;
3159
+ }
3160
+
3161
+ .csf-text-error {
3162
+ color: #d02c21;
3163
+ }
3164
+
3165
+ .csf-text-info {
3166
+ color: #31708f;
3167
+ }
3168
+
3169
+ .csf-text-warning {
3170
+ color: #ffb900;
3171
+ }
3172
+
3173
+ .csf-text-muted {
3174
+ color: #aaa;
3175
+ }
3176
+
3177
+ .csf-text-left {
3178
+ text-align: left;
3179
+ }
3180
+
3181
+ .csf-text-center {
3182
+ text-align: center;
3183
+ }
3184
+
3185
+ .csf-text-right {
3186
+ text-align: right;
3187
+ }
3188
+
3189
+ .csf-block-left {
3190
+ float: left;
3191
+ }
3192
+
3193
+ .csf-block-right {
3194
+ float: right;
3195
+ }
3196
+
3197
+ .csf-full-width {
3198
+ width: 100%;
3199
+ }
3200
+
3201
+ .csf-full-half {
3202
+ width: 50%;
3203
+ }
3204
+
3205
+ .csf-table {
3206
+ width: 100%;
3207
+ display: table;
3208
+ }
3209
+
3210
+ .csf-table-cell {
3211
+ display: table-cell;
3212
+ vertical-align: middle;
3213
+ }
3214
+
3215
+ .csf-table-expanded {
3216
+ width: 100%;
3217
+ }
3218
+
3219
+ .csf-nowrap {
3220
+ white-space: nowrap;
3221
+ }
3222
+
3223
+ .csf-text-highlight {
3224
+ padding: 2px 4px;
3225
+ font-size: 90%;
3226
+ color: #c7254e;
3227
+ background-color: #f9f2f4;
3228
+ -moz-border-radius: 2px;
3229
+ -webkit-border-radius: 2px;
3230
+ border-radius: 2px;
3231
+ }
3232
+
3233
+ .csf-text-highlight-gray {
3234
+ padding: 2px 4px;
3235
+ font-size: 90%;
3236
+ background-color: #f0f0f0;
3237
+ -moz-border-radius: 2px;
3238
+ -webkit-border-radius: 2px;
3239
+ border-radius: 2px;
3240
+ }
3241
+
3242
+ .csf-hidden {
3243
+ display: none;
3244
+ }
3245
+
3246
+ .csf-hide {
3247
+ display: none !important;
3248
+ }
3249
+
3250
+ .csf-show {
3251
+ display: block !important;
3252
+ }
3253
+
3254
+ .csf-opacity {
3255
+ opacity: 0.5;
3256
+ }
3257
+
3258
+ .csf-warning-primary {
3259
+ color: #fff !important;
3260
+ border-color: #dc3545 !important;
3261
+ background: #dc3545 !important;
3262
+ }
3263
+ .csf-warning-primary:hover, .csf-warning-primary:focus {
3264
+ border-color: #bd2130 !important;
3265
+ background: #bd2130 !important;
3266
+ }
3267
+ .csf-warning-primary:focus {
3268
+ box-shadow: 0 0 0 1px #fff, 0 0 0 3px #bd2130 !important;
3269
+ }
3270
+ .csf-warning-primary:active {
3271
+ border-color: #bd2130 !important;
3272
+ background: #bd2130 !important;
3273
+ }
3274
+
3275
+ .csf-form-result {
3276
+ display: none;
3277
+ float: left;
3278
+ padding: 0 8px;
3279
+ margin-right: 4px;
3280
+ font-size: 11px;
3281
+ line-height: 28px;
3282
+ user-select: none;
3283
+ border-radius: 2px;
3284
+ }
3285
+
3286
+ .csf-form-show {
3287
+ display: block;
3288
+ }
3289
+
3290
+ .csf-form-success {
3291
+ color: #fff;
3292
+ background-color: #46b450;
3293
+ }
3294
+
3295
+ .csf-form-warning {
3296
+ color: #8a6d3b;
3297
+ background-color: #faebcc;
3298
+ }
3299
+
3300
+ .csf-label-error {
3301
+ position: relative;
3302
+ top: -2px;
3303
+ display: inline-block;
3304
+ font-size: 10px;
3305
+ line-height: 10px;
3306
+ height: 10px;
3307
+ width: 10px;
3308
+ padding: 1px;
3309
+ font-style: normal;
3310
+ text-align: center;
3311
+ color: #fff;
3312
+ vertical-align: middle;
3313
+ background-color: #e10000;
3314
+ -moz-border-radius: 2px;
3315
+ -webkit-border-radius: 2px;
3316
+ border-radius: 2px;
3317
+ }
3318
+
3319
+ .csf-no-option {
3320
+ padding: 30px;
3321
+ }
3322
+
3323
+ .csf-input-number {
3324
+ -moz-appearance: textfield;
3325
+ }
3326
+
3327
+ .csf-input-number::-webkit-inner-spin-button,
3328
+ .csf-input-number::-webkit-outer-spin-button {
3329
+ -webkit-appearance: none;
3330
+ margin: 0;
3331
+ }
3332
+
3333
+ /**
3334
+ * 10. Welcome Page
3335
+ */
3336
+ .csf-welcome-wrap {
3337
+ position: relative;
3338
+ margin: 25px 40px 0 20px;
3339
+ font-size: 15px;
3340
+ max-width: 1200px;
3341
+ }
3342
+ .csf-welcome-wrap p {
3343
+ font-size: 14px;
3344
+ line-height: 1.5;
3345
+ }
3346
+ .csf-welcome-wrap h1 {
3347
+ margin: 0.2em 200px 0 0;
3348
+ padding: 0;
3349
+ color: #32373c;
3350
+ line-height: 1.2em;
3351
+ font-size: 2.8em;
3352
+ font-weight: 400;
3353
+ }
3354
+ .csf-welcome-wrap .csf-logo {
3355
+ position: absolute;
3356
+ overflow: hidden;
3357
+ top: 0;
3358
+ right: 0;
3359
+ height: 160px;
3360
+ width: 140px;
3361
+ background-image: linear-gradient(45deg, #2d67cb, #ad19f3);
3362
+ box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25), inset 0 0 0 4px rgba(0, 0, 0, 0.25);
3363
+ }
3364
+ .csf-welcome-wrap .csf-logo .csf--effects i {
3365
+ position: absolute;
3366
+ width: 200px;
3367
+ height: 100px;
3368
+ background-color: rgba(0, 0, 0, 0.15);
3369
+ transform: rotate(-45deg);
3370
+ }
3371
+ .csf-welcome-wrap .csf-logo .csf--effects i:nth-child(1) {
3372
+ bottom: -20px;
3373
+ right: -70px;
3374
+ }
3375
+ .csf-welcome-wrap .csf-logo .csf--effects i:nth-child(2) {
3376
+ bottom: -35px;
3377
+ right: -80px;
3378
+ }
3379
+ .csf-welcome-wrap .csf-logo .csf--effects i:nth-child(3) {
3380
+ bottom: -50px;
3381
+ right: -90px;
3382
+ }
3383
+ .csf-welcome-wrap .csf-logo .csf--effects i:nth-child(4) {
3384
+ bottom: -65px;
3385
+ right: -100px;
3386
+ }
3387
+ .csf-welcome-wrap .csf-logo .csf--wp-logos {
3388
+ position: relative;
3389
+ padding-top: 25px;
3390
+ text-align: center;
3391
+ }
3392
+ .csf-welcome-wrap .csf-logo .csf--wp-logo {
3393
+ position: absolute;
3394
+ left: 20px;
3395
+ width: 20px;
3396
+ height: 20px;
3397
+ background-repeat: no-repeat;
3398
+ background-position: center center;
3399
+ background-image: url(../images/wp-logo.svg);
3400
+ }
3401
+ .csf-welcome-wrap .csf-logo .csf--wp-plugin-logo {
3402
+ display: inline-block;
3403
+ width: 50px;
3404
+ height: 50px;
3405
+ border: 3px solid #fff;
3406
+ background-size: 40px;
3407
+ background-repeat: no-repeat;
3408
+ background-position: center center;
3409
+ background-image: url(../images/wp-plugin-logo.svg);
3410
+ border-radius: 100%;
3411
+ vertical-align: middle;
3412
+ }
3413
+ .csf-welcome-wrap .csf-logo .csf--text {
3414
+ position: absolute;
3415
+ left: 0;
3416
+ right: 0;
3417
+ top: 90px;
3418
+ color: #fff;
3419
+ font-size: 13px;
3420
+ line-height: 1.2em;
3421
+ font-weight: 600;
3422
+ text-align: center;
3423
+ text-transform: uppercase;
3424
+ text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.25);
3425
+ }
3426
+ .csf-welcome-wrap .csf-logo .csf--version {
3427
+ top: auto;
3428
+ left: auto;
3429
+ right: 8px;
3430
+ bottom: 4px;
3431
+ font-size: 11px;
3432
+ text-transform: lowercase;
3433
+ }
3434
+ .csf-welcome-wrap .csf-about-text {
3435
+ font-weight: 400;
3436
+ line-height: 1.6em;
3437
+ font-size: 19px;
3438
+ margin: 1em 200px 1em 0;
3439
+ color: #555d66;
3440
+ }
3441
+ .csf-welcome-wrap .csf-demo-button {
3442
+ margin: 1em 200px 2em 0;
3443
+ }
3444
+ .csf-welcome-wrap .nav-tab-wrapper {
3445
+ margin-bottom: 20px;
3446
+ }
3447
+ .csf-welcome-wrap ul {
3448
+ list-style-type: disc;
3449
+ padding-left: 15px;
3450
+ }
3451
+ .csf-welcome-wrap .csf--col {
3452
+ float: left;
3453
+ padding-right: 20px;
3454
+ box-sizing: border-box;
3455
+ }
3456
+ .csf-welcome-wrap .csf--col-2 {
3457
+ width: 50%;
3458
+ }
3459
+ .csf-welcome-wrap .csf--col-3 {
3460
+ width: 33.333%;
3461
+ }
3462
+ .csf-welcome-wrap .csf--col-4 {
3463
+ width: 25%;
3464
+ }
3465
+ .csf-welcome-wrap .csf--col-5 {
3466
+ width: 20%;
3467
+ }
3468
+ .csf-welcome-wrap .csf--col-last {
3469
+ padding-right: 0;
3470
+ }
3471
+ .csf-welcome-wrap .csf--col-upgrade {
3472
+ padding: 10px 0;
3473
+ text-align: center;
3474
+ border-top: 1px solid #e5e5e5;
3475
+ }
3476
+
3477
+ .csf--table-compare thead td,
3478
+ .csf--table-compare tfoot td {
3479
+ text-align: center;
3480
+ }
3481
+ .csf--table-compare td {
3482
+ font-size: 14px;
3483
+ text-align: center;
3484
+ vertical-align: middle;
3485
+ padding: 10px;
3486
+ }
3487
+ .csf--table-compare td:first-child {
3488
+ text-align: left;
3489
+ }
3490
+ .csf--table-compare tfoot td {
3491
+ padding: 15px 0;
3492
+ }
3493
+ .csf--table-compare .fa {
3494
+ font-size: 18px;
3495
+ }
3496
+ .csf--table-compare .fa-check-circle {
3497
+ color: #46b450;
3498
+ }
3499
+ .csf--table-compare .fa-times-circle {
3500
+ color: #dc3232;
3501
+ }
3502
+
3503
+ .csf-welcome-cols {
3504
+ clear: both;
3505
+ margin: 20px 0;
3506
+ background-color: #fff;
3507
+ padding: 0 0;
3508
+ border-radius: 2px;
3509
+ border: 1px solid #e5e5e5;
3510
+ }
3511
+ .csf-welcome-cols .csf--col {
3512
+ width: 25%;
3513
+ float: left;
3514
+ padding: 20px;
3515
+ text-align: center;
3516
+ box-sizing: border-box;
3517
+ min-height: 200px;
3518
+ border-right: 1px solid #e5e5e5;
3519
+ }
3520
+ .csf-welcome-cols .csf--left,
3521
+ .csf-welcome-cols .csf--block {
3522
+ float: left;
3523
+ width: 20%;
3524
+ padding: 0 30px;
3525
+ text-align: center;
3526
+ box-sizing: border-box;
3527
+ }
3528
+ .csf-welcome-cols .csf--block {
3529
+ width: 80%;
3530
+ }
3531
+ .csf-welcome-cols .csf--col-first {
3532
+ border-bottom: 1px solid #e5e5e5;
3533
+ }
3534
+ .csf-welcome-cols .csf--last {
3535
+ border-right: none;
3536
+ }
3537
+ .csf-welcome-cols .csf--space {
3538
+ height: 20px;
3539
+ }
3540
+ .csf-welcome-cols .csf--icon {
3541
+ display: inline-block;
3542
+ font-size: 20px;
3543
+ width: 30px;
3544
+ height: 30px;
3545
+ line-height: 30px;
3546
+ text-align: center;
3547
+ margin-bottom: 10px;
3548
+ color: #fff;
3549
+ background-color: #555;
3550
+ border-radius: 30px;
3551
+ }
3552
+ .csf-welcome-cols .csf--active {
3553
+ background-color: #5cb85c;
3554
+ }
3555
+ .csf-welcome-cols .csf--deactive {
3556
+ background-color: #e14d43;
3557
+ }
3558
+ .csf-welcome-cols .csf--title {
3559
+ font-weight: bold;
3560
+ display: block;
3561
+ }
3562
+ .csf-welcome-cols p:last-child {
3563
+ margin-bottom: 0;
3564
+ }
3565
+
3566
+ .csf-features-cols .csf--key-features {
3567
+ width: 30%;
3568
+ }
3569
+ .csf-features-cols .csf--available-fields {
3570
+ width: 70%;
3571
+ }
3572
+
3573
+ .csf-code-block {
3574
+ margin: 20px 0;
3575
+ padding: 5px 20px;
3576
+ background-color: #fff;
3577
+ border-radius: 2px;
3578
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
3579
+ }
3580
+ .csf-code-block pre {
3581
+ font-size: 13px;
3582
+ color: #0073aa;
3583
+ }
3584
+ .csf-code-block pre span {
3585
+ color: #999;
3586
+ }
3587
+
3588
+ .csf--table-fields td {
3589
+ font-size: 14px;
3590
+ }
3591
+
3592
+ .csf--upgrade a {
3593
+ color: #5cb85c;
3594
+ font-weight: bold;
3595
+ }
3596
+ .csf--upgrade a:focus, .csf--upgrade a:hover {
3597
+ color: #4aa14a;
3598
+ outline: none;
3599
+ box-shadow: none;
3600
+ }
3601
+
3602
+ @media only screen and (max-width: 782px) {
3603
+ .csf-welcome-cols .csf--col {
3604
+ width: 100%;
3605
+ min-height: auto;
3606
+ border-right: none;
3607
+ border-bottom: 1px solid #e5e5e5;
3608
+ }
3609
+
3610
+ .csf-features-cols .csf--key-features {
3611
+ width: 100%;
3612
+ }
3613
+ .csf-features-cols .csf--available-fields {
3614
+ width: 100%;
3615
+ }
3616
+ }
3617
+ /**
3618
+ * 11. Responsive
3619
+ */
3620
+ @media only screen and (max-width: 1200px) {
3621
+ .csf-metabox .csf-field .csf-title {
3622
+ float: none;
3623
+ width: 100%;
3624
+ margin-bottom: 10px;
3625
+ }
3626
+ .csf-metabox .csf-field .csf-fieldset {
3627
+ margin-left: 0;
3628
+ }
3629
+ }
3630
+ @media only screen and (max-width: 782px) {
3631
+ .csf-header-inner {
3632
+ text-align: center;
3633
+ }
3634
+ .csf-header-inner h1 {
3635
+ width: 100%;
3636
+ margin-bottom: 10px;
3637
+ }
3638
+
3639
+ .csf-form-result {
3640
+ float: none;
3641
+ margin-right: 0;
3642
+ margin-bottom: 10px;
3643
+ }
3644
+
3645
+ .csf-search,
3646
+ .csf-header-right,
3647
+ .csf-header-left {
3648
+ width: 100%;
3649
+ }
3650
+
3651
+ .csf-search {
3652
+ text-align: center;
3653
+ margin-bottom: 15px;
3654
+ }
3655
+
3656
+ .csf-footer {
3657
+ text-align: center;
3658
+ }
3659
+
3660
+ .csf-buttons {
3661
+ float: none;
3662
+ }
3663
+
3664
+ .csf-copyright {
3665
+ float: none;
3666
+ margin-top: 10px;
3667
+ }
3668
+
3669
+ .csf-nav,
3670
+ .csf-expand-all,
3671
+ .csf-reset-section,
3672
+ .csf-nav-background {
3673
+ display: none !important;
3674
+ }
3675
+
3676
+ .csf-content {
3677
+ margin-left: 0;
3678
+ }
3679
+
3680
+ .csf-section-title,
3681
+ .csf-section {
3682
+ display: block !important;
3683
+ }
3684
+
3685
+ .csf-field .csf-title {
3686
+ float: none;
3687
+ width: 100%;
3688
+ margin-bottom: 10px;
3689
+ }
3690
+ .csf-field .csf-fieldset {
3691
+ margin-left: 0;
3692
+ }
3693
+
3694
+ .csf-modal-inner {
3695
+ width: 350px;
3696
+ height: 400px;
3697
+ }
3698
+
3699
+ .csf-modal-content {
3700
+ height: 237px;
3701
+ }
3702
+
3703
+ .csf-icon-dialog .csf-modal-inner {
3704
+ width: 305px;
3705
+ height: 380px;
3706
+ }
3707
+ .csf-icon-dialog .csf-modal-content {
3708
+ height: 267px;
3709
+ }
3710
+
3711
+ .csf-modal-icon .csf-modal-inner {
3712
+ width: 330px;
3713
+ height: 385px;
3714
+ }
3715
+ .csf-modal-icon .csf-modal-content {
3716
+ height: 252px;
3717
+ }
3718
+
3719
+ .csf-profile > .csf-field > .csf-title {
3720
+ float: none;
3721
+ width: 100%;
3722
+ margin-bottom: 10px;
3723
+ }
3724
+ .csf-profile > .csf-field > .csf-fieldset {
3725
+ margin-left: 0;
3726
+ }
3727
+ }
3728
+ /**
3729
+ * Chosen JS Styles
3730
+ */
3731
+ .chosen-container {
3732
+ position: relative;
3733
+ display: inline-block;
3734
+ vertical-align: middle;
3735
+ font-size: 13px;
3736
+ user-select: none;
3737
+ }
3738
+
3739
+ .chosen-container * {
3740
+ box-sizing: border-box;
3741
+ }
3742
+
3743
+ .chosen-container .chosen-drop {
3744
+ position: absolute;
3745
+ top: 100%;
3746
+ z-index: 1010;
3747
+ width: 100%;
3748
+ border: 1px solid #aaa;
3749
+ border-top: 0;
3750
+ background: #fff;
3751
+ box-shadow: 0 4px 5px rgba(0, 0, 0, 0.15);
3752
+ clip: rect(0, 0, 0, 0);
3753
+ clip-path: inset(100% 100%);
3754
+ }
3755
+
3756
+ .chosen-container.chosen-with-drop .chosen-drop {
3757
+ clip: auto;
3758
+ clip-path: none;
3759
+ }
3760
+
3761
+ .chosen-container a {
3762
+ cursor: pointer;
3763
+ }
3764
+
3765
+ .chosen-container .search-choice .group-name, .chosen-container .chosen-single .group-name {
3766
+ margin-right: 4px;
3767
+ overflow: hidden;
3768
+ white-space: nowrap;
3769
+ text-overflow: ellipsis;
3770
+ font-weight: normal;
3771
+ color: #999999;
3772
+ }
3773
+
3774
+ .chosen-container .search-choice .group-name:after, .chosen-container .chosen-single .group-name:after {
3775
+ content: ":";
3776
+ padding-left: 2px;
3777
+ vertical-align: top;
3778
+ }
3779
+
3780
+ .chosen-container-single .chosen-single {
3781
+ position: relative;
3782
+ display: block;
3783
+ overflow: hidden;
3784
+ padding: 0 0 0 8px;
3785
+ height: 25px;
3786
+ border: 1px solid #aaa;
3787
+ border-radius: 5px;
3788
+ background-color: #fff;
3789
+ background: linear-gradient(#ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
3790
+ background-clip: padding-box;
3791
+ box-shadow: 0 0 3px #fff inset, 0 1px 1px rgba(0, 0, 0, 0.1);
3792
+ color: #444;
3793
+ text-decoration: none;
3794
+ white-space: nowrap;
3795
+ line-height: 24px;
3796
+ }
3797
+
3798
+ .chosen-container-single .chosen-default {
3799
+ color: #999;
3800
+ }
3801
+
3802
+ .chosen-container-single .chosen-single span {
3803
+ display: block;
3804
+ overflow: hidden;
3805
+ margin-right: 26px;
3806
+ text-overflow: ellipsis;
3807
+ white-space: nowrap;
3808
+ }
3809
+
3810
+ .chosen-container-single .chosen-single-with-deselect span {
3811
+ margin-right: 38px;
3812
+ }
3813
+
3814
+ .chosen-container-single .chosen-single abbr {
3815
+ position: absolute;
3816
+ top: 6px;
3817
+ right: 26px;
3818
+ display: block;
3819
+ width: 12px;
3820
+ height: 12px;
3821
+ font-size: 1px;
3822
+ }
3823
+
3824
+ .chosen-container-single .chosen-single div {
3825
+ position: absolute;
3826
+ top: 0;
3827
+ right: 0;
3828
+ display: block;
3829
+ width: 18px;
3830
+ height: 100%;
3831
+ }
3832
+
3833
+ .chosen-container-single .chosen-single div b {
3834
+ display: block;
3835
+ width: 100%;
3836
+ height: 100%;
3837
+ }
3838
+
3839
+ .chosen-container-single .chosen-search {
3840
+ position: relative;
3841
+ z-index: 1010;
3842
+ margin: 0;
3843
+ padding: 3px 4px;
3844
+ white-space: nowrap;
3845
+ }
3846
+
3847
+ .chosen-container-single .chosen-search input[type="text"] {
3848
+ margin: 1px 0;
3849
+ padding: 4px 20px 4px 5px;
3850
+ width: 100%;
3851
+ height: auto;
3852
+ outline: 0;
3853
+ border: 1px solid #aaa;
3854
+ font-size: 1em;
3855
+ font-family: sans-serif;
3856
+ line-height: normal;
3857
+ border-radius: 0;
3858
+ }
3859
+
3860
+ .chosen-container-single .chosen-drop {
3861
+ margin-top: -1px;
3862
+ border-radius: 0 0 4px 4px;
3863
+ background-clip: padding-box;
3864
+ }
3865
+
3866
+ .chosen-container-single.chosen-container-single-nosearch .chosen-search {
3867
+ position: absolute;
3868
+ clip: rect(0, 0, 0, 0);
3869
+ clip-path: inset(100% 100%);
3870
+ }
3871
+
3872
+ .chosen-container .chosen-results {
3873
+ color: #444;
3874
+ position: relative;
3875
+ overflow-x: hidden;
3876
+ overflow-y: auto;
3877
+ margin: 0 4px 4px 0;
3878
+ padding: 0 0 0 4px;
3879
+ max-height: 240px;
3880
+ -webkit-overflow-scrolling: touch;
3881
+ }
3882
+
3883
+ .chosen-container .chosen-results li {
3884
+ display: none;
3885
+ margin: 0;
3886
+ padding: 5px 6px;
3887
+ list-style: none;
3888
+ line-height: 15px;
3889
+ word-wrap: break-word;
3890
+ -webkit-touch-callout: none;
3891
+ }
3892
+
3893
+ .chosen-container .chosen-results li.active-result {
3894
+ display: list-item;
3895
+ cursor: pointer;
3896
+ }
3897
+
3898
+ .chosen-container .chosen-results li.disabled-result {
3899
+ display: list-item;
3900
+ color: #ccc;
3901
+ cursor: default;
3902
+ }
3903
+
3904
+ .chosen-container .chosen-results li.highlighted {
3905
+ background-color: #3875d7;
3906
+ background-image: linear-gradient(#3875d7 20%, #2a62bc 90%);
3907
+ color: #fff;
3908
+ }
3909
+
3910
+ .chosen-container .chosen-results li.no-results {
3911
+ color: #777;
3912
+ display: list-item;
3913
+ background: #f4f4f4;
3914
+ }
3915
+
3916
+ .chosen-container .chosen-results li.group-result {
3917
+ display: list-item;
3918
+ font-weight: bold;
3919
+ cursor: default;
3920
+ }
3921
+
3922
+ .chosen-container .chosen-results li.group-option {
3923
+ padding-left: 15px;
3924
+ }
3925
+
3926
+ .chosen-container .chosen-results li em {
3927
+ font-style: normal;
3928
+ text-decoration: underline;
3929
+ }
3930
+
3931
+ .chosen-container-multi .chosen-choices {
3932
+ position: relative;
3933
+ overflow: hidden;
3934
+ margin: 0;
3935
+ padding: 0 5px;
3936
+ width: 100%;
3937
+ height: auto;
3938
+ border: 1px solid #aaa;
3939
+ background-color: #fff;
3940
+ background-image: linear-gradient(#eeeeee 1%, #ffffff 15%);
3941
+ cursor: text;
3942
+ }
3943
+
3944
+ .chosen-container-multi .chosen-choices li {
3945
+ float: left;
3946
+ list-style: none;
3947
+ }
3948
+
3949
+ .chosen-container-multi .chosen-choices li.search-field {
3950
+ margin: 0;
3951
+ padding: 0;
3952
+ white-space: nowrap;
3953
+ }
3954
+
3955
+ .chosen-container-multi .chosen-choices li.search-field input[type="text"] {
3956
+ margin: 1px 0;
3957
+ padding: 0;
3958
+ outline: 0;
3959
+ border: 0 !important;
3960
+ background: transparent !important;
3961
+ box-shadow: none;
3962
+ color: #999;
3963
+ font-size: 100%;
3964
+ font-family: sans-serif;
3965
+ line-height: normal;
3966
+ border-radius: 0;
3967
+ width: 25px;
3968
+ height: 25px;
3969
+ min-height: 25px;
3970
+ }
3971
+
3972
+ .chosen-container-multi .chosen-choices li.search-choice {
3973
+ position: relative;
3974
+ margin: 3px 5px 3px 0;
3975
+ padding: 3px 20px 3px 6px;
3976
+ border: 1px solid #aaa;
3977
+ max-width: 100%;
3978
+ border-radius: 3px;
3979
+ background-color: #eeeeee;
3980
+ background-image: linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
3981
+ background-size: 100% 19px;
3982
+ background-repeat: repeat-x;
3983
+ background-clip: padding-box;
3984
+ box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05);
3985
+ color: #333;
3986
+ line-height: 13px;
3987
+ cursor: default;
3988
+ }
3989
+
3990
+ .chosen-container-multi .chosen-choices li.search-choice span {
3991
+ word-wrap: break-word;
3992
+ white-space: nowrap;
3993
+ }
3994
+
3995
+ .chosen-container-multi .chosen-choices li.search-choice .search-choice-close {
3996
+ position: absolute;
3997
+ top: 0;
3998
+ right: 0;
3999
+ display: block;
4000
+ width: 12px;
4001
+ height: 12px;
4002
+ font-size: 1px;
4003
+ }
4004
+
4005
+ .chosen-container-multi .chosen-choices li.search-choice-disabled {
4006
+ padding-right: 5px;
4007
+ border: 1px solid #ccc;
4008
+ background-color: #e4e4e4;
4009
+ background-image: linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
4010
+ color: #666;
4011
+ }
4012
+
4013
+ .chosen-container-multi .chosen-choices li.search-choice-focus {
4014
+ background: #d4d4d4;
4015
+ }
4016
+
4017
+ .chosen-container-multi .chosen-results {
4018
+ margin: 0;
4019
+ padding: 0;
4020
+ }
4021
+
4022
+ .chosen-container-multi .chosen-drop .result-selected {
4023
+ display: list-item;
4024
+ color: #ccc;
4025
+ cursor: default;
4026
+ }
4027
+
4028
+ .chosen-container-active .chosen-single {
4029
+ border: 1px solid #5897fb;
4030
+ box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
4031
+ }
4032
+
4033
+ .chosen-container-active.chosen-with-drop .chosen-single {
4034
+ border: 1px solid #aaa;
4035
+ border-bottom-right-radius: 0;
4036
+ border-bottom-left-radius: 0;
4037
+ background-image: linear-gradient(#eeeeee 20%, #ffffff 80%);
4038
+ box-shadow: 0 1px 0 #fff inset;
4039
+ }
4040
+
4041
+ .chosen-container-active.chosen-with-drop .chosen-single div {
4042
+ border-left: none;
4043
+ background: transparent;
4044
+ }
4045
+
4046
+ .chosen-container-active .chosen-choices {
4047
+ border: 1px solid #5897fb;
4048
+ box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
4049
+ }
4050
+
4051
+ .chosen-container-active .chosen-choices li.search-field input[type="text"] {
4052
+ color: #222 !important;
4053
+ }
4054
+
4055
+ .chosen-disabled {
4056
+ opacity: 0.5 !important;
4057
+ cursor: default;
4058
+ }
4059
+
4060
+ .chosen-disabled .chosen-single {
4061
+ cursor: default;
4062
+ }
4063
+
4064
+ .chosen-disabled .chosen-choices .search-choice .search-choice-close {
4065
+ cursor: default;
4066
+ }
4067
+
4068
+ .chosen-rtl {
4069
+ text-align: right;
4070
+ }
4071
+
4072
+ .chosen-rtl .chosen-single {
4073
+ overflow: visible;
4074
+ padding: 0 8px 0 0;
4075
+ }
4076
+
4077
+ .chosen-rtl .chosen-single span {
4078
+ margin-right: 0;
4079
+ margin-left: 26px;
4080
+ direction: rtl;
4081
+ }
4082
+
4083
+ .chosen-rtl .chosen-single-with-deselect span {
4084
+ margin-left: 38px;
4085
+ }
4086
+
4087
+ .chosen-rtl .chosen-single div {
4088
+ right: auto;
4089
+ left: 3px;
4090
+ }
4091
+
4092
+ .chosen-rtl .chosen-single abbr {
4093
+ right: auto;
4094
+ left: 26px;
4095
+ }
4096
+
4097
+ .chosen-rtl .chosen-choices li {
4098
+ float: right;
4099
+ }
4100
+
4101
+ .chosen-rtl .chosen-choices li.search-field input[type="text"] {
4102
+ direction: rtl;
4103
+ }
4104
+
4105
+ .chosen-rtl .chosen-choices li.search-choice {
4106
+ margin: 3px 5px 3px 0;
4107
+ padding: 3px 5px 3px 19px;
4108
+ }
4109
+
4110
+ .chosen-rtl .chosen-choices li.search-choice .search-choice-close {
4111
+ right: auto;
4112
+ left: 4px;
4113
+ }
4114
+
4115
+ .chosen-rtl.chosen-container-single .chosen-results {
4116
+ margin: 0 0 4px 4px;
4117
+ padding: 0 4px 0 0;
4118
+ }
4119
+
4120
+ .chosen-rtl .chosen-results li.group-option {
4121
+ padding-right: 15px;
4122
+ padding-left: 0;
4123
+ }
4124
+
4125
+ .chosen-rtl.chosen-container-active.chosen-with-drop .chosen-single div {
4126
+ border-right: none;
4127
+ }
4128
+
4129
+ .chosen-rtl .chosen-search input[type="text"] {
4130
+ padding: 4px 5px 4px 20px;
4131
+ direction: rtl;
4132
+ }
admin/settings/assets/css/csf.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .csf{position:relative}.csf label{padding:0;margin:0;display:inline-block}.csf-ab-icon{top:2px}#screen-meta-links+.csf-options{margin-top:40px}.csf-options{margin-top:20px;margin-right:20px}.csf-header{position:relative}.csf-header-inner{padding:25px}.csf-header-inner h1{float:left;font-size:1.5em;line-height:26px;font-weight:400;margin:0}.csf-header-inner h1 small{font-size:11px;font-weight:500}.csf-sticky .csf-header-inner{position:fixed;z-index:99999;top:32px;-moz-box-shadow:0 5px 25px rgba(0,0,0,.125);-webkit-box-shadow:0 5px 25px rgba(0,0,0,.125);box-shadow:0 5px 25px rgba(0,0,0,.125)}.csf-buttons{float:right;-moz-transition:opacity .2s;-o-transition:opacity .2s;-webkit-transition:opacity .2s;transition:opacity .2s}.csf-buttons .button{margin:0 2px;line-height:26px}.csf-buttons .button:focus{outline:0!important;box-shadow:none!important}.csf-buttons .csf-save{min-width:72px}.csf-header-left{float:left}.csf-header-right{float:right}.csf-nav{display:block;position:relative;z-index:10;float:left;width:225px}.csf-nav ul{clear:left;margin:0;list-style-type:none}.csf-nav ul li{margin-bottom:0}.csf-nav ul li a{font-size:13px;position:relative;display:block;padding:14px 12px;text-decoration:none;-moz-transition:all .3s ease;-o-transition:all .3s ease;-webkit-transition:all .3s ease;transition:all .3s ease}.csf-nav ul li a:focus{outline:0;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.csf-nav ul li .csf-section-active:after{content:" ";position:absolute;right:0;top:50%;height:0;width:0;pointer-events:none;border:solid transparent;border-right-color:#fff;border-width:4px;margin-top:-4px}.csf-nav ul li .csf-arrow:after{content:"\f054";display:inline-block;font-family:FontAwesome;font-size:9px;line-height:1;position:absolute;right:10px;top:50%;margin-top:-4px;-moz-transform:rotate(0);-ms-transform:rotate(0);-webkit-transform:rotate(0);transform:rotate(0)}.csf-nav ul li.csf-tab-active .csf-arrow:after{-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-webkit-transform:rotate(90deg);transform:rotate(90deg)}.csf-nav ul li.csf-tab-active ul{display:block}.csf-nav ul ul{display:none;position:relative}.csf-nav ul ul li a{font-size:12px;padding:12px 14px 12px 24px}.csf-nav .fa{width:20px;margin-right:5px;font-size:14px;text-align:center}.csf-nav .csf-label-error{margin-left:4px;vertical-align:top}.csf-nav-background{position:absolute;top:0;left:0;bottom:0;z-index:9;width:225px}.csf-wrapper{position:relative}.csf-content{position:relative;margin-left:225px;background-color:#fff;-moz-transition:opacity .2s;-o-transition:opacity .2s;-webkit-transition:opacity .2s;transition:opacity .2s}.csf-sections{float:left;width:100%}.csf-section{display:none}.csf-section-title{display:none;padding:20px 30px;background-color:#f5f5f5;border-top:1px solid #eee;border-bottom:1px solid #eee}.csf-section-title h3{margin:0;padding:0;font-size:13px;font-weight:700;text-transform:uppercase}.csf-section-title .fa{margin-right:5px}.csf-footer{padding:20px;font-size:11px}.csf-copyright{float:left;margin-top:5px}.csf-search-all .csf-nav,.csf-search-all .csf-nav-background,.csf-show-all .csf-nav,.csf-show-all .csf-nav-background{display:none}.csf-search-all .csf-content,.csf-show-all .csf-content{margin-left:0}.csf-search-all .csf-section,.csf-search-all .csf-section-title,.csf-show-all .csf-section,.csf-show-all .csf-section-title{display:block!important}.csf-search-all .csf-section-title{display:none!important}.csf-expand-all{float:left;padding:0 8px;margin-right:4px;z-index:1;font-size:14px;line-height:28px;cursor:pointer;user-select:none;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;-moz-transition:all .2s;-o-transition:all .2s;-webkit-transition:all .2s;transition:all .2s}.csf-expand-all span{font-size:11px;vertical-align:middle}.csf-search{float:left}.csf-search input{margin:0 2px 0 0;border:none;font-size:12px;line-height:28px;min-height:28px;text-align:inherit;padding:0 10px;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.csf-search input:focus{-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.csf-saving .csf-buttons,.csf-saving .csf-content{cursor:default;pointer-events:none;opacity:.5}.csf-metabox{margin:-6px -12px -12px -12px}.csf-metabox .csf-section-title{padding:20px}.block-editor-page .csf-metabox{margin:-6px -14px -12px -14px}.csf-restore-wrapper{text-align:right;padding:10px;border-top:1px solid #eee}.csf-restore-wrapper .csf-button-cancel,.csf-restore-wrapper input{display:none}.csf-restore-wrapper span{-webkit-user-select:none;user-select:none}.csf-restore-wrapper input:checked~.csf-button-restore{display:none}.csf-restore-wrapper input:checked~.csf-button-cancel{display:inline-block}#side-sortables .csf-section-title{padding:12px}#side-sortables .csf-field{padding:12px}#side-sortables .csf-field .csf-title{float:none;width:100%;margin-bottom:10px}#side-sortables .csf-field .csf-fieldset{margin-left:0}#side-sortables .csf-notice{padding:12px}.csf-comment-metabox{margin:-6px -12px -12px -12px}.csf-comment-metabox .csf-section-title{padding:20px}.csf-tooltip{position:absolute;z-index:5000001;font-size:12px;line-height:1.4;text-align:center;text-decoration:none;padding:6px 12px;max-width:200px;color:#fff;background-color:#000;background-color:rgba(0,0,0,.85);-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px}.csf-theme-dark .csf-header-inner{background-color:#050505}.csf-theme-dark .csf-header-inner h1{color:#fff}.csf-theme-dark .csf-header-inner h1 small{color:#555}.csf-theme-dark .csf-expand-all{color:#999;background-color:#222}.csf-theme-dark .csf-expand-all:hover{color:#fff;background-color:#333}.csf-theme-dark .csf-search input{color:#fff;background-color:#222}.csf-theme-dark .csf-search:focus{background-color:#444}.csf-theme-dark .csf-search::-webkit-input-placeholder{color:#666}.csf-theme-dark .csf-nav ul li a{color:#999;background-color:#222;border-bottom:1px solid #2f2f2f}.csf-theme-dark .csf-nav ul li a:hover{color:#fff}.csf-theme-dark .csf-nav ul li .csf-section-active{color:#fff;background-color:#111}.csf-theme-dark .csf-nav ul ul li a{background-color:#191919;border-bottom:1px solid #2f2f2f}.csf-theme-dark .csf-nav ul ul li .csf-section-active{background-color:#101010}.csf-theme-dark .csf-nav ul ul:before{background-color:rgba(34,34,34,.75)}.csf-theme-dark .csf-nav>ul>li:last-child>a{border-bottom:none}.csf-theme-dark .csf-nav-background{background-color:#222}.csf-theme-dark .csf-footer{color:#555;background-color:#050505}.csf-theme-light .csf-container{border:1px solid #e5e5e5;-moz-box-shadow:0 0 15px rgba(0,0,0,.04);-webkit-box-shadow:0 0 15px rgba(0,0,0,.04);box-shadow:0 0 15px rgba(0,0,0,.04)}.csf-theme-light .csf-header-inner{border-bottom:1px solid #e5e5e5;background-color:#f5f5f5;background:linear-gradient(#fefefe,#f5f5f5)}.csf-theme-light .csf-header-inner h1 small{color:#999}.csf-theme-light .csf-expand-all{color:#999;background-color:#fff;-moz-box-shadow:0 1px 1px rgba(0,0,0,.05);-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}.csf-theme-light .csf-expand-all:hover{color:#555}.csf-theme-light .csf-search input{color:#555;background-color:#fff;-moz-box-shadow:0 1px 1px rgba(0,0,0,.05);-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}.csf-theme-light .csf-search input::-webkit-input-placeholder{color:#bbb}.csf-theme-light .csf-nav ul li a{color:#666;background-color:#f5f5f5;border-bottom:1px solid #e5e5e5}.csf-theme-light .csf-nav ul li a:hover{color:#222}.csf-theme-light .csf-nav ul li .csf-section-active{color:#222;background-color:#fff}.csf-theme-light .csf-nav ul li .csf-section-active:after{display:none}.csf-theme-light .csf-nav ul ul li a{background-color:#eee;border-bottom:1px solid #e5e5e5}.csf-theme-light .csf-nav>ul>li:last-child>a{border-bottom:none}.csf-theme-light .csf-nav-background{background-color:#f5f5f5}.csf-theme-light .csf-footer{color:#555;border-top:1px solid #e5e5e5;background-color:#f5f5f5;background:linear-gradient(#fafafa,#f5f5f5)}.csf-field{position:relative;padding:30px}.csf-field+.csf-field:not(.hidden){border-top:1px solid #eee}.csf-field p:first-child{margin-top:0}.csf-field p:last-child{margin-bottom:0}.csf-field:after,.csf-field:before{content:" ";display:table}.csf-field:after{clear:both}.csf-field h4{margin-top:0}.csf-field .csf-title{position:relative;width:20%;float:left}.csf-field .csf-title h4{margin:0;color:#23282d}.csf-field .csf-fieldset{margin-left:25%}.csf-pseudo-field{padding:0 5px 0 0!important;display:inline-block}.csf-pseudo-field+.csf-pseudo-field{border:0}.csf-pseudo-field pre{display:none}.csf-field-accordion .csf-accordion-item{position:relative;margin-bottom:5px}.csf-field-accordion .csf-accordion-item h4{font-size:1em}.csf-field-accordion .csf-accordion-title{display:block;cursor:pointer;position:relative;margin:0;padding:15px;min-height:0;font-size:100%;user-select:none;border:1px solid #ccd0d4;background-color:#fafafa;box-shadow:0 1px 1px rgba(0,0,0,.04);transition:border-color .15s}.csf-field-accordion .csf-accordion-title:active,.csf-field-accordion .csf-accordion-title:focus,.csf-field-accordion .csf-accordion-title:hover{outline:0;border-color:#999}.csf-field-accordion .csf-accordion-icon{width:14px;text-align:center}.csf-field-accordion .csf--icon{width:20px;text-align:center}.csf-field-accordion .csf-accordion-content{display:none;padding:0;border:1px solid #ccd0d4;border-top:none;background-color:#fff;box-shadow:0 1px 1px rgba(0,0,0,.04)}.csf-field-accordion .csf-accordion-content>.csf-field{padding:15px}.csf-field-accordion .csf-accordion-open{display:block}.csf-field-background .csf-field{border:0!important;padding:0;margin-bottom:6px;margin-right:6px}.csf-field-background .csf--title{color:#777;font-size:12px}.csf-field-background .csf--background-colors{display:flex}.csf-field-background .csf--background-attributes{display:flex;flex-wrap:wrap}.csf-field-background .csf--background-attributes select{min-width:100%;margin:0}.csf-field-background .csf--background-attributes .csf-field{flex:1}.csf-field-background .csf--attributes-hidden{display:none}.csf-field-background .wp-color-result.button{margin-bottom:0}.csf-field-backup textarea{width:100%;min-height:200px;margin-bottom:5px}.csf-field-backup small{display:inline-block;margin:5px}.csf-field-backup hr{margin:20px 0;border:none;border-bottom:1px solid #e5e5e5}.csf-field-border .csf--inputs,.csf-field-dimensions .csf--inputs,.csf-field-spacing .csf--inputs{float:left;display:flex;flex-wrap:wrap}.csf-field-border .csf--input,.csf-field-dimensions .csf--input,.csf-field-spacing .csf--input{display:flex;padding-right:6px;padding-bottom:4px;box-sizing:border-box}.csf-field-border .csf--input select,.csf-field-dimensions .csf--input select,.csf-field-spacing .csf--input select{margin:0}.csf-field-border .csf--input input,.csf-field-dimensions .csf--input input,.csf-field-spacing .csf--input input{position:relative;z-index:1;margin:0;width:65px;max-width:100%;text-align:center}.csf-field-border .csf--color,.csf-field-dimensions .csf--color,.csf-field-spacing .csf--color{float:left}.csf-field-border .csf--label,.csf-field-dimensions .csf--label,.csf-field-spacing .csf--label{display:flex;flex-direction:column;justify-content:center;user-select:none;min-width:20px;max-width:100%;padding:0 4px;font-size:12px;text-align:center;color:#555;border:1px solid #7b776c;background-color:#f5f5f5}.csf-field-border .csf--icon,.csf-field-dimensions .csf--icon,.csf-field-spacing .csf--icon{border-right:0;border-radius:4px 0 0 4px}.csf-field-border .csf--icon+input,.csf-field-dimensions .csf--icon+input,.csf-field-spacing .csf--icon+input{border-top-left-radius:0;border-bottom-left-radius:0}.csf-field-border .csf--unit,.csf-field-dimensions .csf--unit,.csf-field-spacing .csf--unit{border-left:0;border-radius:0 4px 4px 0}.csf-field-border .csf--is-unit,.csf-field-dimensions .csf--is-unit,.csf-field-spacing .csf--is-unit{border-top-right-radius:0;border-bottom-right-radius:0}.csf-field-button_set .csf--buttons{display:inline-block}.csf-field-button_set .csf--button{position:relative;z-index:1;float:left;cursor:pointer;padding:7px 14px;min-width:40px;text-align:center;color:#555;border:1px solid #ccc;background-color:#f7f7f7;user-select:none;-webkit-user-select:none;box-shadow:0 1px 0 rgba(0,0,0,.1)}.csf-field-button_set .csf--button:first-child{border-radius:4px 0 0 4px}.csf-field-button_set .csf--button:last-child{border-radius:0 4px 4px 0}.csf-field-button_set .csf--button:not(:first-child){margin-left:-1px}.csf-field-button_set .csf--button:hover{background-color:#eee}.csf-field-button_set .csf--active,.csf-field-button_set .csf--active:hover{z-index:2;color:#fff;border-color:#006799;background-color:#0085ba}.csf-field-button_set input{display:none}.csf-field-checkbox ul,.csf-field-radio ul{margin:0;padding:0 1px;list-style-type:none;overflow-y:auto;max-height:305px}.csf-field-checkbox ul ul,.csf-field-radio ul ul{max-height:none}.csf-field-checkbox .csf--inline-list li,.csf-field-radio .csf--inline-list li{display:inline-block;margin-right:15px}.csf-field-checkbox input[type=radio]:checked:before,.csf-field-radio input[type=radio]:checked:before{line-height:10px}.csf-field-checkbox .csf-checker,.csf-field-radio .csf-checker{cursor:pointer}.csf-field-code_editor .CodeMirror{width:100%;height:400px}.csf-field-code_editor .cm-s-default{border:1px solid #ccd0d4}.csf-field-code_editor textarea{width:100%;height:400px}.csf-field-color>input{opacity:.75;width:115px;max-width:100%}.csf-field-color .button.wp-picker-clear{margin-left:6px;padding:2px 8px}.csf-field-color_group .csf--left{float:left;margin-right:10px;margin-bottom:5px}.csf-field-color_group .csf--title{color:#999;margin-bottom:5px}.csf-field-fieldset .csf-fieldset-content{border:1px solid #ccd0d4;background-color:#fff;box-shadow:0 1px 1px rgba(0,0,0,.04)}.csf-field-fieldset .csf-fieldset-content>.csf-field{padding:15px}.csf-field-fieldset .csf-field-subheading{font-size:13px}.csf-field-date input{margin:0}.csf-field-date .csf--to{margin-left:7px}.csf-datepicker-wrapper{margin-top:5px;width:auto;background-color:#fff;z-index:9999999!important;-moz-box-shadow:0 0 30px rgba(0,0,0,.15);-webkit-box-shadow:0 0 30px rgba(0,0,0,.15);box-shadow:0 0 30px rgba(0,0,0,.15)}.csf-datepicker-wrapper *{float:none;margin:0;padding:0;font-family:inherit;font-weight:400;font-style:normal;text-decoration:none;border:0;border-radius:0;box-shadow:none}.csf-datepicker-wrapper .ui-datepicker-header,.csf-datepicker-wrapper .ui-widget-header{color:#fff;background:#00a0d2}.csf-datepicker-wrapper .ui-datepicker-header .ui-state-hover{cursor:pointer}.csf-datepicker-wrapper .ui-datepicker-title{font-size:14px;line-height:40px;text-align:center}.csf-datepicker-wrapper .ui-datepicker-next,.csf-datepicker-wrapper .ui-datepicker-prev{position:static;top:auto;left:auto;right:auto;font-family:FontAwesome;font-size:12px;text-align:center;width:41px;height:40px;line-height:40px;color:#fff;background-color:rgba(255,255,255,.1);text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.csf-datepicker-wrapper .ui-datepicker-next span,.csf-datepicker-wrapper .ui-datepicker-prev span{display:none}.csf-datepicker-wrapper .ui-datepicker-prev{float:left}.csf-datepicker-wrapper .ui-datepicker-next{float:right}.csf-datepicker-wrapper .ui-datepicker-prev:before{content:'\f053'}.csf-datepicker-wrapper .ui-datepicker-next:before{content:'\f054'}.csf-datepicker-wrapper .ui-datepicker-next-hover,.csf-datepicker-wrapper .ui-datepicker-prev-hover{opacity:.75}.csf-datepicker-wrapper tbody .ui-datepicker-week-col{background-color:#f7f7f7}.csf-datepicker-wrapper .ui-datepicker-buttonpane{padding:10px;text-align:center;background-color:#f7f7f7}.csf-datepicker-wrapper .ui-datepicker-buttonpane button{cursor:pointer;margin:0 5px;padding:7px 14px;border:1px solid #eee;background-color:#fff}.csf-datepicker-wrapper select{margin:0 4px}.csf-datepicker-wrapper select option{color:#555}.csf-datepicker-wrapper table{font-size:13px;border-collapse:collapse;width:100%}.csf-datepicker-wrapper thead{color:#fff;background:#32373c}.csf-datepicker-wrapper th{text-align:center;padding:7px;border:1px solid #444}.csf-datepicker-wrapper td{text-align:center;border:1px solid #f4f4f4}.csf-datepicker-wrapper td.ui-datepicker-other-month{border:transparent}.csf-datepicker-wrapper td .ui-state-default{color:#555;width:auto;display:block;padding:6px 12px}.csf-datepicker-wrapper td .ui-state-active,.csf-datepicker-wrapper td .ui-state-hover{color:#fff;background-color:#0073aa}.csf-datepicker-wrapper td.ui-state-disabled .ui-state-default{opacity:.5}.csf-field-gallery input{display:none}.csf-field-gallery ul{margin:0;padding:0;list-style-type:none}.csf-field-gallery ul li{display:inline-block;position:relative;padding:4px;margin:0 5px 10px 0;border:1px solid #ccc;background-color:#f9f9f9;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;-moz-box-shadow:0 1px 0 rgba(0,0,0,.08);-webkit-box-shadow:0 1px 0 rgba(0,0,0,.08);box-shadow:0 1px 0 rgba(0,0,0,.08)}.csf-field-gallery ul li img{max-height:60px;display:inline-block;vertical-align:middle}.csf-field-gallery .button{margin-right:5px;margin-bottom:5px}.csf-field-group .csf-cloneable-hidden{display:none!important}.csf-field-group .csf-cloneable-wrapper{position:relative}.csf-field-group .csf-cloneable-item{display:none;position:relative;margin-bottom:5px}.csf-field-group .csf-cloneable-item h4{font-size:1em}.csf-field-group .ui-accordion .csf-cloneable-item{display:block}.csf-field-group .csf-cloneable-content{border:1px solid #ccd0d4;background-color:#fff;box-shadow:0 1px 1px rgba(0,0,0,.04)}.csf-field-group .csf-cloneable-content>.csf-field{padding:15px}.csf-field-group .csf-cloneable-title{display:block;cursor:pointer;position:relative;user-select:none;margin:0;padding:15px 65px 15px 10px;min-height:0;font-size:100%;border:1px solid #ccd0d4;background-color:#fafafa;box-shadow:0 1px 1px rgba(0,0,0,.04);transition:border-color .15s}.csf-field-group .csf-cloneable-title:active,.csf-field-group .csf-cloneable-title:focus,.csf-field-group .csf-cloneable-title:hover{border-color:#999;outline:0}.csf-field-group .csf-cloneable-helper{position:absolute;top:12px;right:10px;z-index:1;font-size:14px;line-height:1em}.csf-field-group .csf-cloneable-helper i{display:inline-block;cursor:pointer;padding:5px;color:#999}.csf-field-group .csf-cloneable-helper i:hover{color:#555}.csf-field-group .csf-cloneable-content{padding:0;border-top:0}.csf-field-group .csf-cloneable-title-number,.csf-field-group .csf-cloneable-title-prefix{margin-right:5px}.csf-field-group .csf-cloneable-alert{display:none;margin-bottom:5px;padding:10px 20px;color:#a94442;border:1px solid #ebccd1;background-color:#f2dede}.csf-field-group .widget-placeholder{margin-bottom:10px;border:1px dashed #f1c40f;background-color:#fffae4}.csf-field-group .csf-cloneable-header-icon{display:inline-block;text-align:center;font-size:14px;width:17px;text-indent:0;vertical-align:text-top}.csf-field-group .csf-cloneable-placeholder{background-color:#ddd;margin-top:4px;width:100px;height:10px;font-size:10px;line-height:10px;display:inline-block;vertical-align:top;border-radius:2px}.csf-field-icon input{display:none}.csf-field-icon .button{margin-right:5px}.csf-field-icon .csf-icon-preview i{display:inline-block;font-size:14px;width:30px;height:26px;line-height:26px;margin-right:5px;text-align:center;vertical-align:top;color:#555;border:1px solid #ccc;background-color:#f7f7f7;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;-moz-box-shadow:0 1px 0 rgba(0,0,0,.08);-webkit-box-shadow:0 1px 0 rgba(0,0,0,.08);box-shadow:0 1px 0 rgba(0,0,0,.08);-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}.csf-field-image_select .csf--image{cursor:pointer;position:relative;display:inline-block;max-width:100%;margin:0 5px 5px 0;vertical-align:bottom;border:2px solid transparent;background-color:#fff;user-select:none;-webkit-user-select:none;-moz-transition:all .2s;-o-transition:all .2s;-webkit-transition:all .2s;transition:all .2s}.csf-field-image_select .csf--image:before{position:absolute;top:0;left:0;text-align:center;font-size:11px;font-family:FontAwesome;content:"\f00c";width:15px;height:15px;line-height:15px;opacity:0;color:#fff;background-color:#222;transition:opacity .2s}.csf-field-image_select .csf--active{border-color:#222;box-shadow:0 0 20px rgba(0,0,0,.2)}.csf-field-image_select .csf--active:before{opacity:1}.csf-field-image_select img{vertical-align:top}.csf-field-image_select input{display:none}.csf-field-link_color .csf--left{float:left;margin-right:10px;margin-bottom:5px}.csf-field-link_color .csf--title{color:#777;margin-bottom:5px}.csf-field-map input{width:100%}.csf-field-map input[type=text].ui-autocomplete-loading{background-position-x:calc(100% - 5px)}.csf-field-map .csf--map-search+.csf--map-osm-wrap{margin-top:10px}.csf-field-map .csf--map-osm-wrap{position:relative;padding:5px;border:1px solid #eee;background-color:#fff;box-shadow:0 1px 1px rgba(0,0,0,.04)}.csf-field-map .csf--map-osm{position:relative;z-index:1;min-height:250px}.csf-field-map .csf--map-inputs{margin-top:10px;display:flex;justify-content:space-between}.csf-field-map .csf--map-input{flex:1}.csf-field-map .csf--map-input:last-child{padding-left:10px}.csf-field-map label{display:block;color:#777;font-size:12px;margin:0 0 2px 0}.csf-map-ui-autocomplate{z-index:999999;border-radius:4px;overflow:hidden}.csf-field-media .csf--placeholder{display:flex}.csf-field-media .csf--placeholder input{width:100%;margin:0}.csf-field-media .button{margin-left:5px}.csf-field-media .hidden+.button{margin-left:0}.csf-field-media .csf--preview{position:relative}.csf-field-media .csf--preview .fa-times{position:absolute;z-index:1;right:4px;top:4px;font-size:14px;width:22px;height:22px;line-height:22px;text-align:center;text-decoration:none;color:#fff;background-color:#d33;opacity:.8;transition:all .2s}.csf-field-media .csf--preview .fa-times:hover{opacity:1}.csf-field-media .csf--preview .fa-times:focus{box-shadow:none}.csf-field-palette .csf--palette{position:relative;display:inline-block;cursor:pointer;border:2px solid #ddd;margin-right:10px;margin-bottom:10px;user-select:none;-webkit-user-select:none;transition:all .2s}.csf-field-palette .csf--palette span{vertical-align:middle;display:inline-block;width:22px;height:60px;line-height:60px;overflow:hidden;text-indent:-999px}.csf-field-palette .csf--palette:before{position:absolute;top:0;left:0;text-align:center;font-size:11px;font-family:FontAwesome;content:"\f00c";width:15px;height:15px;line-height:15px;opacity:0;color:#fff;background-color:#222;transition:opacity .2s}.csf-field-palette .csf--active{border-color:#222;box-shadow:0 0 20px rgba(0,0,0,.2)}.csf-field-palette .csf--active:before{opacity:1}.csf-field-palette input{display:none}.csf-field-repeater .csf-field-text input{width:100%}.csf-field-repeater .csf-repeater-hidden{display:none!important}.csf-field-repeater .csf-repeater-wrapper .csf-repeater-item{display:table;width:100%;margin-bottom:5px;border:1px solid #eee}.csf-field-repeater .csf-repeater-wrapper .csf-repeater-item h4{font-size:1em}.csf-field-repeater .csf-repeater-content{width:100%;display:table-cell;vertical-align:middle;background-color:#fff}.csf-field-repeater .csf-repeater-content>.csf-field{padding:15px}.csf-field-repeater .csf-repeater-helper{width:100%;display:table-cell;vertical-align:middle;text-align:center;font-size:14px;line-height:1em;border-left:1px solid #eee;background-color:#f7f7f7}.csf-field-repeater .csf-repeater-helper i{display:inline-block;cursor:pointer;color:#999;padding:5px}.csf-field-repeater .csf-repeater-helper i:hover{color:#555}.csf-field-repeater .csf-repeater-helper-inner{width:75px}.csf-field-repeater .csf-repeater-alert{display:none;margin-bottom:5px;padding:10px 20px;color:#a94442;border:1px solid #ebccd1;background-color:#f2dede}.csf-field-repeater .widget-placeholder{height:50px;margin-bottom:3px;border:1px dashed #f1c40f;background-color:#fffae4}.csf-field-repeater .ui-sortable-helper{height:50px!important;overflow:hidden!important;border-color:#ccc!important;background-color:#eee!important;opacity:.5}.csf-field-repeater .ui-sortable-helper .csf-repeater-content,.csf-field-repeater .ui-sortable-helper .csf-repeater-helper{display:none}.csf-field-select .csf-fieldset{min-height:30px}.csf-field-select .csf-chosen{display:none}.csf-field-select select{max-width:100%;margin:0}.csf-field-slider .csf--wrap{display:flex;align-items:center}.csf-field-slider .csf--input{display:flex}.csf-field-slider .csf--unit{display:flex;justify-content:center;flex-direction:column;user-select:none;padding:0 6px;font-size:11px;line-height:1;border-radius:0 4px 4px 0;color:#555;border:1px solid #7e8993;border-left:0;background-color:#f5f5f5}.csf-field-slider input[type=number]{position:relative;z-index:1;width:50px;margin:0 0 0 15px;text-align:center}.csf-field-slider .csf--is-unit{border-top-right-radius:0;border-bottom-right-radius:0}.csf-field-slider .ui-slider{position:relative;width:100%;height:3px;border:none;background:#ddd;border-radius:2px}.csf-field-slider .ui-slider-range{height:3px;border:none;background:#333;border-radius:2px}.csf-field-slider .ui-slider-handle{position:absolute;width:16px;height:16px;top:-7px;margin-left:-8px;border:none;background:#333;border-radius:2px}.csf-field-slider .ui-slider-handle:hover,.csf-field-slider .ui-state-active{cursor:pointer;background:#111}.csf-field-sortable .csf-field-text input{width:100%;max-width:100%}.csf-field-sortable .csf--sortable .csf--sortable-item{display:table;width:100%;margin-bottom:5px;border:1px solid #eee}.csf-field-sortable .csf--sortable .csf--sortable-item h4{font-size:1em}.csf-field-sortable .csf--sortable-content{width:100%;display:table-cell;vertical-align:middle;background-color:#fff}.csf-field-sortable .csf--sortable-content>.csf-field{padding:15px}.csf-field-sortable .csf--sortable-helper{width:100%;display:table-cell;vertical-align:middle;text-align:center;font-size:14px;line-height:1em;border-left:1px solid #eee;background-color:#f7f7f7}.csf-field-sortable .csf--sortable-helper .fa{display:inline-block;cursor:pointer;width:50px;color:#555}.csf-field-sortable .csf--sortable-helper .fa:hover{opacity:.5}.csf-field-sortable .widget-placeholder{height:50px;margin-bottom:3px;border:1px dashed #f1c40f;background-color:#fffae4}.csf-field-sortable .ui-sortable-helper{height:50px!important;overflow:hidden!important;border-color:#ccc!important;background-color:#eee!important;opacity:.5}.csf-field-sortable .ui-sortable-helper .csf--sortable-content,.csf-field-sortable .ui-sortable-helper .csf--sortable-helper{display:none}.csf-field-sorter .ui-sortable-placeholder{height:20px;border:1px dashed #f1c40f;background-color:#fffae4}.csf-field-sorter .csf-modules{float:left;width:50%;box-sizing:border-box}.csf-field-sorter .csf-modules:first-child{padding-right:15px}.csf-field-sorter .csf-modules:last-child{padding-left:15px}.csf-field-sorter .csf-disabled,.csf-field-sorter .csf-enabled{padding:5px 15px;border:1px dashed #ddd;background-color:#fff}.csf-field-sorter .csf-disabled li{-moz-transition:opacity .15s;-o-transition:opacity .15s;-webkit-transition:opacity .15s;transition:opacity .15s;opacity:.5}.csf-field-sorter .csf-disabled .ui-sortable-helper{opacity:1}.csf-field-sorter .csf-sorter-title{font-size:13px;font-weight:600;padding:10px;text-align:center;border:1px dashed #ddd;border-bottom:none;background-color:#f8f8f8;text-transform:uppercase}.csf-field-sorter ul{list-style-type:none;margin:0;padding:0;min-height:62px}.csf-field-sorter ul li{margin:10px 0;padding:10px 15px;cursor:move;font-weight:700;text-align:center;border:1px solid #e5e5e5;background-color:#fafafa;-moz-transition:border-color .15s;-o-transition:border-color .15s;-webkit-transition:border-color .15s;transition:border-color .15s}.csf-field-sorter ul li:hover{border-color:#bbb}.csf-field-spinner .csf--spin{display:flex}.csf-field-spinner .ui-spinner{display:flex}.csf-field-spinner .ui-button-text-only{display:flex;flex-direction:column;justify-content:center;text-align:center;min-width:20px;padding:0 4px;color:#555;border:1px solid #7e8993;background-color:#f5f5f5}.csf-field-spinner .ui-button{cursor:pointer}.csf-field-spinner .ui-button:hover{background-color:#e7e7e7}.csf-field-spinner .ui-button:active{background-color:#ddd}.csf-field-spinner .ui-button:before{font-family:FontAwesome;font-size:14px}.csf-field-spinner .ui-spinner-down{order:1;border-right:0;border-radius:4px 0 0 4px}.csf-field-spinner .ui-spinner-down:before{content:"\f0d9"}.csf-field-spinner .ui-spinner-input{order:2}.csf-field-spinner .csf--unit{order:3;border-left:0;user-select:none}.csf-field-spinner .ui-spinner-up{order:4;border-left:0;border-radius:0 4px 4px 0}.csf-field-spinner .ui-spinner-up:before{content:"\f0da"}.csf-field-spinner input{position:relative;z-index:1;width:50px;text-align:center;margin:0;padding:0 8px;border-radius:0}.csf-field-spinner .ui-button-text{display:none}.csf-field-switcher .csf--switcher{float:left;cursor:pointer;position:relative;width:60px;height:26px;padding:0;margin:0;overflow:hidden;border-radius:4px;background-color:#ed6f6f;user-select:none;-webkit-user-select:none}.csf-field-switcher .csf--ball{position:absolute;top:4px;left:4px;width:24px;height:18px;background-color:#fff;border-radius:4px;transition:all .1s;box-shadow:1px 1px 1px rgba(0,0,0,.15)}.csf-field-switcher .csf--off,.csf-field-switcher .csf--on{position:absolute;top:0;left:0;right:0;font-size:11px;line-height:26px;font-weight:500;font-style:normal;text-align:center;text-transform:uppercase;color:#fff;padding-right:28px;opacity:0;transition:all .1s}.csf-field-switcher .csf--off{padding-right:0;padding-left:28px;opacity:1}.csf-field-switcher .csf--active{background:#4fb845}.csf-field-switcher .csf--active .csf--on{opacity:1}.csf-field-switcher .csf--active .csf--off{opacity:0}.csf-field-switcher .csf--active .csf--ball{left:100%;margin-left:-28px}.csf-field-switcher .csf--label{float:left;margin-top:4px;margin-left:8px;font-weight:400;color:#999}.csf-field-switcher input{display:none}.csf-field-tabbed .csf-tabbed-section{border:1px solid #ccd0d4;background-color:#fff;box-shadow:0 1px 1px rgba(0,0,0,.04)}.csf-field-tabbed .csf-tabbed-section>.csf-field{padding:15px}.csf-field-tabbed .csf-tabbed-nav .csf--icon{padding-right:5px}.csf-field-tabbed .csf-tabbed-nav a{display:inline-block;padding:12px 15px;margin-top:1px;margin-right:5px;margin-bottom:-1px;position:relative;text-decoration:none;color:#444;font-weight:600;border:1px solid #ccd0d4;background-color:#f3f3f3;transition:all .2s}.csf-field-tabbed .csf-tabbed-nav a:hover{background-color:#f9f9f9}.csf-field-tabbed .csf-tabbed-nav a.csf-tabbed-active{background-color:#fff;border-bottom-color:#fff}.csf-field-tabbed .csf-tabbed-nav a:focus{outline:0;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.csf-field-text input{width:50%;max-width:100%;margin:0}.csf-field-textarea textarea{width:100%;max-width:100%;min-height:125px}.csf-field-textarea .csf-shortcode-button{margin-bottom:10px;margin-right:5px}.csf-field-typography select,.csf-field-typography textarea{min-width:100%;margin:0}.csf-field-typography .csf--title{color:#777;margin:0 0 2px 0;font-size:12px}.csf-field-typography .csf--title small{vertical-align:top}.csf-field-typography .csf--blocks{display:flex;flex-wrap:wrap}.csf-field-typography .csf--block{flex:1;padding-right:6px;padding-bottom:6px}.csf-field-typography .csf--input{margin:0;min-width:100%}.csf-field-typography .csf--input-wrap{position:relative}.csf-field-typography .csf--unit{position:absolute;z-index:1;right:4px;top:4px;bottom:4px;padding:2px 6px;color:#666;font-size:11px;line-height:1;border-radius:2px;background:#eee;user-select:none;display:flex;justify-content:center;flex-direction:column}.csf-field-typography .csf--preview{font-size:16px;line-height:20px;padding:20px;color:#222;border:1px solid #eee;background-color:#fff;border-radius:2.5px;user-select:none;-webkit-user-select:none;transition:background-color .2s,border-color .2s}.csf-field-typography .csf--block-preview{cursor:pointer;position:relative;overflow:hidden;margin-top:10px;max-width:100%}.csf-field-typography .csf--black-background{border-color:#000;background-color:#000}.csf-field-typography .csf--toggle{position:absolute;top:5px;right:10px;color:#999}.csf-field-typography .csf--block-extra-styles{margin-top:5px}.csf-field-upload input{width:100%;margin:0}.csf-field-upload .csf--wrap{display:flex}.csf-field-upload .button{margin-left:5px}.csf-field-wp_editor .csf-wp-editor{float:left;width:100%}.csf-field-wp_editor .mce-toolbar-grp{border:none}.csf-field-wp_editor .mce-btn.mce-active button,.csf-field-wp_editor .mce-btn.mce-active i,.csf-field-wp_editor .mce-btn.mce-active:hover button,.csf-field-wp_editor .mce-btn.mce-active:hover i{color:#23282d}.csf-field-wp_editor .wp-media-buttons{position:relative;z-index:2}.csf-field-wp_editor .wp-editor-tabs{position:relative;z-index:1}.csf-field-wp_editor .csf-no-tinymce{border:1px solid #e5e5e5}.csf-field-wp_editor .csf-no-quicktags .wp-media-buttons{float:none;display:block}.csf-field-wp_editor .csf-no-quicktags .mce-tinymce{box-shadow:none;border:1px solid #e5e5e5}.csf-field-wp_editor textarea{width:100%;max-width:100%;margin:0;box-shadow:none}.csf-field-heading{font-size:1.5em;font-weight:700;color:#23282d;background-color:#f5f5f5}.csf-field-subheading{font-size:14px;font-weight:700;padding-top:17px;padding-bottom:17px;color:#23282d;background-color:#f7f7f7}.csf-field-submessage{padding:0!important;border:0!important}.csf-field-submessage+.csf-field{border-top:0!important}.csf-submessage{font-size:12px;padding:17px 30px;border-top:1px solid transparent;border-bottom:1px solid transparent}.csf-submessage-success{color:#3c763d;border-color:#d6e9c6;background-color:#dff0d8}.csf-submessage-info{color:#31708f;border-color:#bce8f1;background-color:#d9edf7}.csf-submessage-warning{color:#8a6d3b;border-color:#faebcc;background-color:#fcf8e3}.csf-submessage-danger{color:#a94442;border-color:#ebccd1;background-color:#f2dede}.csf-submessage-normal{color:#23282d;border-color:#eee;background-color:#f7f7f7}.csf-field-notice{background-color:#f7f7f7}.csf-notice{padding:12px;background-color:#fff;border-left-style:solid;border-left-width:4px;box-shadow:0 1px 1px rgba(0,0,0,.1)}.csf-notice-success{border-color:#46b450}.csf-notice-info{border-color:#339fd4}.csf-notice-warning{border-color:#ffbc00}.csf-notice-danger{border-color:#dc3232}.csf-notice-normal{border-color:#222}.csf-field-number input{width:100%;margin:0}.csf-field-number .csf--wrap{position:relative;float:left;width:100px}.csf-field-number .csf--unit{position:absolute;z-index:1;right:4px;top:4px;bottom:4px;padding:2px 6px;color:#666;font-size:11px;line-height:1;border-radius:2px;background:#eee;user-select:none;display:flex;justify-content:center;flex-direction:column}.csf-help{cursor:help;position:absolute;top:0;right:0;padding:5px;font-size:14px;color:#aaa}.csf-help .csf-help-text{display:none}.csf-image-preview{display:inline-block;position:relative;padding:4px;min-width:44px;min-height:22px;margin-bottom:10px;border:1px solid #ccc;background-color:#f9f9f9;-moz-box-shadow:0 1px 0 rgba(0,0,0,.08);-webkit-box-shadow:0 1px 0 rgba(0,0,0,.08);box-shadow:0 1px 0 rgba(0,0,0,.08)}.csf-image-preview img{max-height:90px;display:inline-block;vertical-align:middle}.csf-field-custom .csf-field{padding:0}.csf-field .chosen-container-single .chosen-single{height:28px;line-height:26px}.csf-field .chosen-container-single .chosen-single abbr{top:0;right:20px;font-family:FontAwesome;font-size:12px;height:100%;width:18px;color:#aaa;text-align:center;background:0 0}.csf-field .chosen-container-single .chosen-single abbr:before{content:"\f00d"}.csf-field .chosen-container-single .chosen-single abbr:hover{color:#555}.csf-field .chosen-container-multi .chosen-choices li.search-choice .search-choice-close{font-family:FontAwesome;font-size:12px;height:100%;width:18px;color:#aaa;text-align:center;background:0 0}.csf-field .chosen-container-multi .chosen-choices li.search-choice .search-choice-close:before{content:"\f00d";display:inline-block;padding-top:3px}.csf-field .chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover{color:#555}.csf-field .chosen-container-single .chosen-single div b{font-family:FontAwesome;font-size:14px;color:#aaa;background:0 0}.csf-field .chosen-container-single .chosen-single div b:before{content:"\f107"}.csf-field .chosen-container-single .chosen-single div b:hover{color:#555}.csf-field .chosen-container-multi .chosen-choices li.search-choice-placeholder{border:1px dashed #aaa;margin:3px 5px 3px 0}.csf-field .chosen-container-multi .ui-sortable li.search-choice span{cursor:move}.csf-field .chosen-container-active.chosen-with-drop .chosen-single div b:before{content:"\f106"}.csf-field .chosen-container-single .chosen-single-with-deselect span{margin-right:40px}.csf-field .chosen-container-single .chosen-search input[type=text]{background:0 0}.csf-field .chosen-container-single .chosen-search:before{font-family:FontAwesome;position:absolute;content:"\f002";font-size:11px;right:10px;top:7px;color:#aaa}.csf-field .wp-picker-container{display:inline-block}.csf-field .csf--transparent-wrap{display:none;position:relative;top:-1px;width:235px;padding:9px 10px;border:1px solid #dfdfdf;border-top:none;background-color:#fff}.csf-field .wp-picker-active .csf--transparent-wrap{display:block}.csf-field .csf--transparent-slider{position:absolute;width:190px;margin-left:2px;height:18px}.csf-field .csf--transparent-slider .ui-slider-handle{position:absolute;top:-3px;bottom:-3px;z-index:5;border-color:#aaa;border-style:solid;border-width:4px 3px;width:10px;height:16px;margin:0 -5px;background:0 0;cursor:ew-resize;opacity:.9;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;-moz-box-shadow:0 1px 2px rgba(0,0,0,.2);-webkit-box-shadow:0 1px 2px rgba(0,0,0,.2);box-shadow:0 1px 2px rgba(0,0,0,.2)}.csf-field .csf--transparent-slider .ui-slider-handle:before{content:" ";position:absolute;left:-2px;right:-2px;top:-3px;bottom:-3px;border:2px solid #fff;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px}.csf-field .csf--transparent-offset{height:18px;width:200px;background:url(../images/checkerboard.png) repeat-y center left scroll #fff;-moz-box-shadow:0 0 5px rgba(0,0,0,.4) inset;-webkit-box-shadow:0 0 5px rgba(0,0,0,.4) inset;box-shadow:0 0 5px rgba(0,0,0,.4) inset;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px}.csf-field .csf--transparent-text{position:absolute;top:12px;right:10px;width:30px;font-size:12px;line-height:12px;text-align:center;color:#999}.csf-field .csf--transparent-button{cursor:pointer;user-select:none;margin-top:10px;font-size:11px;text-align:center;border-radius:2px;padding:3px 7px;box-shadow:0 1px 0 rgba(0,0,0,.1);letter-spacing:.2px;color:#777;border:1px solid #ccc;background-color:#f7f7f7;transition:background-color .2s,border-color .2s,color .2s}.csf-field .csf--transparent-active .wp-color-result{background-image:url(../images/checkerboard.png);background-size:135px;background-position:center left;background-color:transparent!important}.csf-field .csf--transparent-active .csf--transparent-button{color:#fff;border-color:#3ea032;background-color:#4fb845}.csf-field .csf--transparent-active .fa:before{content:"\f205"}.csf-widgets>.csf-field{position:relative;top:-1px;margin-right:-15px;margin-left:-15px;padding:12px 15px}.csf-widgets>.csf-field .csf-field{margin-left:0;margin-right:0}.csf-widgets>.csf-field .csf-title{float:none;width:100%;margin-bottom:5px}.csf-widgets>.csf-field .csf-fieldset{margin-left:0}.csf-widgets .csf-field-text input{width:100%}.csf-widgets .csf-field-notice .csf-notice{padding:15px}.control-section .csf-widgets>.csf-field{margin-right:-10px;margin-left:-10px;padding:10px 12px}.control-section .csf-field{padding:0}.control-section .csf-field .csf-title{float:none;width:100%;margin-bottom:6px}.control-section .csf-field .csf-title h4{display:block;font-size:13px;line-height:1;font-weight:600;color:inherit}.control-section .csf-field .csf-fieldset{margin-left:0}.control-section .csf-help{top:-5px;right:-5px}.control-section .csf-field-select select{width:100%}.control-section .csf-field-heading{color:inherit;font-size:14px;line-height:1em;margin-right:-15px;margin-left:-15px;padding:15px}.control-section .csf-field-subheading{color:inherit;font-size:11px;margin-right:-15px;margin-left:-15px;padding:10px 15px}.control-section .csf-text-subtitle{margin-top:4px;font-size:12px}.control-section .csf-field-submessage .csf-submessage{margin-right:-15px;margin-left:-15px;padding:15px}.control-section .csf-fieldset .csf-field-heading,.control-section .csf-fieldset .csf-field-subheading,.control-section .csf-fieldset .csf-field-submessage .csf-submessage{margin-left:0;margin-right:0}.control-section .csf-field-date .csf--to{margin-left:0}.control-section .csf-field-sorter ul li{padding:5px}.control-section .csf-field-sorter .csf-modules{float:none;width:100%}.control-section .csf-field-sorter .csf-modules:first-child{padding-right:0;padding-bottom:15px}.control-section .csf-field-background .csf--background-attributes{flex-direction:column}.control-section .csf-field-spacing input{width:90px}.control-section .csf-field-border .csf--input{flex:1 50%}.control-section .csf-field-border input,.control-section .csf-field-border select{width:100%}.control-section .csf-field-spinner input{width:50px}.control-section .csf-field-number .csf--wrap{width:100%}.control-section .csf-field-backup .csf-export-data{display:none}.control-section .csf-field-fieldset .csf-fieldset-content{border-color:#e5e5e5}.control-section .csf-field-fieldset .csf-field{padding:10px}.control-section .csf-field-fieldset .csf-field .csf-title{margin-bottom:5px}.control-section .csf-field-fieldset .csf-field h4{font-size:12px}.control-section .csf-field-accordion .csf-field,.control-section .csf-field-group .csf-field,.control-section .csf-field-repeater .csf-field,.control-section .csf-field-sortable .csf-field,.control-section .csf-field-tabbed .csf-field{padding:10px}.control-section .csf-field-accordion .csf-field .csf-title,.control-section .csf-field-group .csf-field .csf-title,.control-section .csf-field-repeater .csf-field .csf-title,.control-section .csf-field-sortable .csf-field .csf-title,.control-section .csf-field-tabbed .csf-field .csf-title{margin-bottom:5px}.control-section .csf-field-accordion .csf-field h4,.control-section .csf-field-group .csf-field h4,.control-section .csf-field-repeater .csf-field h4,.control-section .csf-field-sortable .csf-field h4,.control-section .csf-field-tabbed .csf-field h4{font-size:12px}.control-section .csf-dependency-control.hidden{display:none!important}.csf-taxonomy>.csf-field{border-top:none!important}.csf-taxonomy>.csf-field-heading{font-size:1.1em;padding:20px!important;border:1px solid #ddd}.csf-taxonomy>.csf-field-subheading{font-size:12px;padding:15px!important;border:1px solid #ddd}.csf-taxonomy>.csf-field-submessage .csf-submessage{padding:15px;border-left-width:1px;border-left-style:solid;border-right-width:1px;border-right-style:solid}.csf-taxonomy>.csf-field-notice{background-color:transparent}.csf-taxonomy .csf-section-title{display:block;padding:15px;background-color:#f9f9f9;border:1px solid #e5e5e5;-moz-box-shadow:0 1px 1px rgba(0,0,0,.04);-webkit-box-shadow:0 1px 1px rgba(0,0,0,.04);box-shadow:0 1px 1px rgba(0,0,0,.04)}.csf-taxonomy-add-fields>.csf-field{padding:8px 0}.csf-taxonomy-add-fields>.csf-field>.csf-title{float:none;width:100%;padding:2px 2px 4px 0}.csf-taxonomy-add-fields>.csf-field>.csf-title h4{font-size:12px;font-weight:400}.csf-taxonomy-add-fields>.csf-field>.csf-fieldset{margin-left:0}.csf-taxonomy-add-fields>.csf-field>.csf-fieldset>.csf-help{right:-5px}.csf-taxonomy-add-fields+p.submit{margin-top:0}.csf-taxonomy-edit-fields>.csf-field{padding:20px 0}.csf-taxonomy-edit-fields>.csf-field>.csf-title{width:225px}.csf-taxonomy-edit-fields>.csf-field>.csf-title h4{font-size:14px;font-weight:600;line-height:1.3;display:inline-block;vertical-align:middle}.csf-taxonomy-edit-fields>.csf-field>.csf-fieldset{margin-left:225px}.csf-taxonomy-edit-fields>.csf-field>.csf-fieldset>.csf-help{top:-5px;right:-5px}.csf-taxonomy-edit-fields>.csf-field-submessage{margin:20px 0}.csf-taxonomy-edit-fields>.csf-field-heading,.csf-taxonomy-edit-fields>.csf-field-subheading{margin:20px 0;border:1px solid #ddd}.csf-profile>h2>.fa{padding-right:7px}.csf-profile>.csf-field{padding:15px 0;border-top:none!important}.csf-profile>.csf-field>.csf-title{width:220px}.csf-profile>.csf-field>.csf-title h4{font-size:14px;font-weight:600;line-height:1.3;display:inline-block;vertical-align:middle}.csf-profile>.csf-field>.csf-fieldset{margin-left:220px}.csf-profile>.csf-field>.csf-fieldset>.csf-help{top:-15px;right:-5px}.csf-profile>.csf-field-heading{font-size:1.1em}.csf-profile>.csf-field-subheading{font-size:12px}.csf-profile>.csf-field-heading,.csf-profile>.csf-field-subheading{margin:10px 0;padding:15px!important;border:1px solid #ddd}.csf-profile>.csf-field-submessage{margin:20px 0}.csf-profile>.csf-field-submessage .csf-submessage{padding:10px;border-left-width:1px;border-left-style:solid;border-right-width:1px;border-right-style:solid}.csf-profile>.csf-field-notice{background-color:transparent}.csf-modal{display:none;position:fixed;z-index:100101;top:0;left:0;width:100%;height:100%}.csf-modal-icon{z-index:100102}.csf-modal-table{display:table;width:100%;height:100%}.csf-modal-table-cell{display:table-cell;vertical-align:middle;margin:100px 0}.csf-modal-inner{position:relative;z-index:10;width:760px;height:750px;margin:0 auto;background-color:#fff}.csf-modal-content{position:relative;overflow:hidden;overflow-y:auto;height:595px}.csf-modal-content .csf-shortcode-button{display:none}.csf-modal-content .csf-fieldset{margin-left:25%}.csf-modal-content .csf-title{width:20%}.csf-modal-content .csf-field{padding:15px 30px 15px 15px}.csf-modal-content a:active,.csf-modal-content a:focus{outline:0;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.csf-modal-content h4{font-size:13px}.csf-modal-content h4 small{font-style:italic;font-weight:400;color:#aaa}.csf-modal-title{position:relative;background-color:#fcfcfc;border-bottom:1px solid #ddd;height:36px;font-size:16px;font-weight:600;line-height:36px;margin:0;padding:0 36px 0 16px}.csf-modal-header{width:100%;padding:14px 0;background-color:#f5f5f5;border-bottom:1px solid #eee}.csf-modal-header select{display:block;width:250px;margin:0 auto;font-size:13px;line-height:1;height:30px;min-height:30px;background-color:#fff}.csf-modal-close{color:#666;padding:0;position:absolute;top:0;right:0;width:36px;height:36px;text-align:center;background:0 0;border:none;cursor:pointer}.csf-modal-close:before{font:normal 20px/36px dashicons;content:"\f158";vertical-align:top;width:36px;height:36px}.csf-modal-close:hover{opacity:.5}.csf-modal-insert-wrapper{text-align:center;width:100%;padding:15px 0;background-color:#f5f5f5;border-top:1px solid #eee}.csf-modal-overlay{position:absolute;top:0;left:0;width:100%;height:100%;background-color:#000;opacity:.5}.csf--repeatable{padding:15px 15px 0 15px}.csf--repeat-button-block{text-align:center;padding-bottom:15px}.csf--repeat-shortcode{position:relative;margin-bottom:15px;border:1px dashed #ddd}.csf--repeat-shortcode:first-child .csf-repeat-remove{display:none}.csf--repeat-shortcode .csf-repeat-remove{position:absolute;right:10px;top:10px;z-index:10;cursor:pointer;display:inline-block;font-size:11px;width:18px;height:18px;line-height:18px;text-align:center;border-radius:2px;color:#fff;background-color:#e14d43;opacity:.5}.csf--repeat-shortcode .csf-repeat-remove:hover{opacity:1}.csf-shortcode-single .csf-modal-inner{height:750px}.csf-shortcode-single .csf-modal-content{height:652px}.elementor-editor-active .csf-shortcode-button{margin-left:5px}.elementor-editor-active .csf-modal .hidden{display:none!important}.csf-shortcode-block{text-align:center;padding:14px;font-size:13px;background-color:#f5f5f5;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif}.csf-shortcode-block .button{margin:10px 0}.csf-modal-icon .csf-icon-title{padding:15px 0;margin:4px;font-size:14px;font-weight:700;text-align:center;border:1px solid #eee;background-color:#f7f7f7}.csf-modal-icon .csf-icon-search{width:250px;height:40px;line-height:40px}.csf-modal-icon a{display:inline-block;padding:4px;cursor:pointer}.csf-modal-icon a .csf-icon{position:relative;padding:4px;display:inline-block;font-size:14px;width:30px;height:26px;line-height:26px;text-align:center;vertical-align:top;color:#555;border:1px solid #ccc;background-color:#f7f7f7;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;-moz-box-shadow:0 1px 0 rgba(0,0,0,.08);-webkit-box-shadow:0 1px 0 rgba(0,0,0,.08);box-shadow:0 1px 0 rgba(0,0,0,.08);-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}.csf-modal-icon a:hover .csf-icon{color:#fff;border-color:#222;background-color:#222}.csf-modal-icon .csf-modal-content{padding:10px;height:618px}.csf-modal-icon .csf-text-error{padding:10px}.csf-modal-loading{display:none;position:absolute;left:15px;top:15px}.csf-loading{position:relative;width:20px;height:20px;background:#ccc;-moz-border-radius:20px;-webkit-border-radius:20px;border-radius:20px;-moz-box-shadow:0 2px 5px rgba(0,0,0,.07);-webkit-box-shadow:0 2px 5px rgba(0,0,0,.07);box-shadow:0 2px 5px rgba(0,0,0,.07)}.csf-loading:after{position:absolute;top:50%;left:50%;width:4px;height:4px;content:"";margin-top:-2px;margin-left:-2px;background-color:#fff;-moz-animation-duration:.5s;-webkit-animation-duration:.5s;animation-duration:.5s;-moz-animation-iteration-count:infinite;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-moz-animation-timing-function:linear;-webkit-animation-timing-function:linear;animation-timing-function:linear;-moz-animation-name:csfLoader;-webkit-animation-name:csfLoader;animation-name:csfLoader;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px}@-moz-keyframes csfLoader{0%{-moz-transform:rotate(0) translateX(-6px) rotate(0);transform:rotate(0) translateX(-6px) rotate(0)}100%{-moz-transform:rotate(360deg) translateX(-6px) rotate(-360deg);transform:rotate(360deg) translateX(-6px) rotate(-360deg)}}@-webkit-keyframes csfLoader{0%{-webkit-transform:rotate(0) translateX(-6px) rotate(0);transform:rotate(0) translateX(-6px) rotate(0)}100%{-webkit-transform:rotate(360deg) translateX(-6px) rotate(-360deg);transform:rotate(360deg) translateX(-6px) rotate(-360deg)}}@keyframes csfLoader{0%{-moz-transform:rotate(0) translateX(-6px) rotate(0);-ms-transform:rotate(0) translateX(-6px) rotate(0);-webkit-transform:rotate(0) translateX(-6px) rotate(0);transform:rotate(0) translateX(-6px) rotate(0)}100%{-moz-transform:rotate(360deg) translateX(-6px) rotate(-360deg);-ms-transform:rotate(360deg) translateX(-6px) rotate(-360deg);-webkit-transform:rotate(360deg) translateX(-6px) rotate(-360deg);transform:rotate(360deg) translateX(-6px) rotate(-360deg)}}.csf-text-desc,.csf-text-subtitle{font-weight:400;margin-top:10px;color:#999}.csf-text-success{color:#2b542c}.csf-text-error{color:#d02c21}.csf-text-info{color:#31708f}.csf-text-warning{color:#ffb900}.csf-text-muted{color:#aaa}.csf-text-left{text-align:left}.csf-text-center{text-align:center}.csf-text-right{text-align:right}.csf-block-left{float:left}.csf-block-right{float:right}.csf-full-width{width:100%}.csf-full-half{width:50%}.csf-table{width:100%;display:table}.csf-table-cell{display:table-cell;vertical-align:middle}.csf-table-expanded{width:100%}.csf-nowrap{white-space:nowrap}.csf-text-highlight{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px}.csf-text-highlight-gray{padding:2px 4px;font-size:90%;background-color:#f0f0f0;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px}.csf-hidden{display:none}.csf-hide{display:none!important}.csf-show{display:block!important}.csf-opacity{opacity:.5}.csf-warning-primary{color:#fff!important;border-color:#dc3545!important;background:#dc3545!important}.csf-warning-primary:focus,.csf-warning-primary:hover{border-color:#bd2130!important;background:#bd2130!important}.csf-warning-primary:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px #bd2130!important}.csf-warning-primary:active{border-color:#bd2130!important;background:#bd2130!important}.csf-form-result{display:none;float:left;padding:0 8px;margin-right:4px;font-size:11px;line-height:28px;user-select:none;border-radius:2px}.csf-form-show{display:block}.csf-form-success{color:#fff;background-color:#46b450}.csf-form-warning{color:#8a6d3b;background-color:#faebcc}.csf-label-error{position:relative;top:-2px;display:inline-block;font-size:10px;line-height:10px;height:10px;width:10px;padding:1px;font-style:normal;text-align:center;color:#fff;vertical-align:middle;background-color:#e10000;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px}.csf-no-option{padding:30px}.csf-input-number{-moz-appearance:textfield}.csf-input-number::-webkit-inner-spin-button,.csf-input-number::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.csf-welcome-wrap{position:relative;margin:25px 40px 0 20px;font-size:15px;max-width:1200px}.csf-welcome-wrap p{font-size:14px;line-height:1.5}.csf-welcome-wrap h1{margin:.2em 200px 0 0;padding:0;color:#32373c;line-height:1.2em;font-size:2.8em;font-weight:400}.csf-welcome-wrap .csf-logo{position:absolute;overflow:hidden;top:0;right:0;height:160px;width:140px;background-image:linear-gradient(45deg,#2d67cb,#ad19f3);box-shadow:0 1px 4px rgba(0,0,0,.25),inset 0 0 0 4px rgba(0,0,0,.25)}.csf-welcome-wrap .csf-logo .csf--effects i{position:absolute;width:200px;height:100px;background-color:rgba(0,0,0,.15);transform:rotate(-45deg)}.csf-welcome-wrap .csf-logo .csf--effects i:nth-child(1){bottom:-20px;right:-70px}.csf-welcome-wrap .csf-logo .csf--effects i:nth-child(2){bottom:-35px;right:-80px}.csf-welcome-wrap .csf-logo .csf--effects i:nth-child(3){bottom:-50px;right:-90px}.csf-welcome-wrap .csf-logo .csf--effects i:nth-child(4){bottom:-65px;right:-100px}.csf-welcome-wrap .csf-logo .csf--wp-logos{position:relative;padding-top:25px;text-align:center}.csf-welcome-wrap .csf-logo .csf--wp-logo{position:absolute;left:20px;width:20px;height:20px;background-repeat:no-repeat;background-position:center center;background-image:url(../images/wp-logo.svg)}.csf-welcome-wrap .csf-logo .csf--wp-plugin-logo{display:inline-block;width:50px;height:50px;border:3px solid #fff;background-size:40px;background-repeat:no-repeat;background-position:center center;background-image:url(../images/wp-plugin-logo.svg);border-radius:100%;vertical-align:middle}.csf-welcome-wrap .csf-logo .csf--text{position:absolute;left:0;right:0;top:90px;color:#fff;font-size:13px;line-height:1.2em;font-weight:600;text-align:center;text-transform:uppercase;text-shadow:1px 1px 0 rgba(0,0,0,.25)}.csf-welcome-wrap .csf-logo .csf--version{top:auto;left:auto;right:8px;bottom:4px;font-size:11px;text-transform:lowercase}.csf-welcome-wrap .csf-about-text{font-weight:400;line-height:1.6em;font-size:19px;margin:1em 200px 1em 0;color:#555d66}.csf-welcome-wrap .csf-demo-button{margin:1em 200px 2em 0}.csf-welcome-wrap .nav-tab-wrapper{margin-bottom:20px}.csf-welcome-wrap ul{list-style-type:disc;padding-left:15px}.csf-welcome-wrap .csf--col{float:left;padding-right:20px;box-sizing:border-box}.csf-welcome-wrap .csf--col-2{width:50%}.csf-welcome-wrap .csf--col-3{width:33.333%}.csf-welcome-wrap .csf--col-4{width:25%}.csf-welcome-wrap .csf--col-5{width:20%}.csf-welcome-wrap .csf--col-last{padding-right:0}.csf-welcome-wrap .csf--col-upgrade{padding:10px 0;text-align:center;border-top:1px solid #e5e5e5}.csf--table-compare tfoot td,.csf--table-compare thead td{text-align:center}.csf--table-compare td{font-size:14px;text-align:center;vertical-align:middle;padding:10px}.csf--table-compare td:first-child{text-align:left}.csf--table-compare tfoot td{padding:15px 0}.csf--table-compare .fa{font-size:18px}.csf--table-compare .fa-check-circle{color:#46b450}.csf--table-compare .fa-times-circle{color:#dc3232}.csf-welcome-cols{clear:both;margin:20px 0;background-color:#fff;padding:0 0;border-radius:2px;border:1px solid #e5e5e5}.csf-welcome-cols .csf--col{width:25%;float:left;padding:20px;text-align:center;box-sizing:border-box;min-height:200px;border-right:1px solid #e5e5e5}.csf-welcome-cols .csf--block,.csf-welcome-cols .csf--left{float:left;width:20%;padding:0 30px;text-align:center;box-sizing:border-box}.csf-welcome-cols .csf--block{width:80%}.csf-welcome-cols .csf--col-first{border-bottom:1px solid #e5e5e5}.csf-welcome-cols .csf--last{border-right:none}.csf-welcome-cols .csf--space{height:20px}.csf-welcome-cols .csf--icon{display:inline-block;font-size:20px;width:30px;height:30px;line-height:30px;text-align:center;margin-bottom:10px;color:#fff;background-color:#555;border-radius:30px}.csf-welcome-cols .csf--active{background-color:#5cb85c}.csf-welcome-cols .csf--deactive{background-color:#e14d43}.csf-welcome-cols .csf--title{font-weight:700;display:block}.csf-welcome-cols p:last-child{margin-bottom:0}.csf-features-cols .csf--key-features{width:30%}.csf-features-cols .csf--available-fields{width:70%}.csf-code-block{margin:20px 0;padding:5px 20px;background-color:#fff;border-radius:2px;box-shadow:0 1px 1px rgba(0,0,0,.15)}.csf-code-block pre{font-size:13px;color:#0073aa}.csf-code-block pre span{color:#999}.csf--table-fields td{font-size:14px}.csf--upgrade a{color:#5cb85c;font-weight:700}.csf--upgrade a:focus,.csf--upgrade a:hover{color:#4aa14a;outline:0;box-shadow:none}@media only screen and (max-width:782px){.csf-welcome-cols .csf--col{width:100%;min-height:auto;border-right:none;border-bottom:1px solid #e5e5e5}.csf-features-cols .csf--key-features{width:100%}.csf-features-cols .csf--available-fields{width:100%}}@media only screen and (max-width:1200px){.csf-metabox .csf-field .csf-title{float:none;width:100%;margin-bottom:10px}.csf-metabox .csf-field .csf-fieldset{margin-left:0}}@media only screen and (max-width:782px){.csf-header-inner{text-align:center}.csf-header-inner h1{width:100%;margin-bottom:10px}.csf-form-result{float:none;margin-right:0;margin-bottom:10px}.csf-header-left,.csf-header-right,.csf-search{width:100%}.csf-search{text-align:center;margin-bottom:15px}.csf-footer{text-align:center}.csf-buttons{float:none}.csf-copyright{float:none;margin-top:10px}.csf-expand-all,.csf-nav,.csf-nav-background,.csf-reset-section{display:none!important}.csf-content{margin-left:0}.csf-section,.csf-section-title{display:block!important}.csf-field .csf-title{float:none;width:100%;margin-bottom:10px}.csf-field .csf-fieldset{margin-left:0}.csf-modal-inner{width:350px;height:400px}.csf-modal-content{height:237px}.csf-icon-dialog .csf-modal-inner{width:305px;height:380px}.csf-icon-dialog .csf-modal-content{height:267px}.csf-modal-icon .csf-modal-inner{width:330px;height:385px}.csf-modal-icon .csf-modal-content{height:252px}.csf-profile>.csf-field>.csf-title{float:none;width:100%;margin-bottom:10px}.csf-profile>.csf-field>.csf-fieldset{margin-left:0}}.chosen-container{position:relative;display:inline-block;vertical-align:middle;font-size:13px;user-select:none}.chosen-container *{box-sizing:border-box}.chosen-container .chosen-drop{position:absolute;top:100%;z-index:1010;width:100%;border:1px solid #aaa;border-top:0;background:#fff;box-shadow:0 4px 5px rgba(0,0,0,.15);clip:rect(0,0,0,0);clip-path:inset(100% 100%)}.chosen-container.chosen-with-drop .chosen-drop{clip:auto;clip-path:none}.chosen-container a{cursor:pointer}.chosen-container .chosen-single .group-name,.chosen-container .search-choice .group-name{margin-right:4px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:400;color:#999}.chosen-container .chosen-single .group-name:after,.chosen-container .search-choice .group-name:after{content:":";padding-left:2px;vertical-align:top}.chosen-container-single .chosen-single{position:relative;display:block;overflow:hidden;padding:0 0 0 8px;height:25px;border:1px solid #aaa;border-radius:5px;background-color:#fff;background:linear-gradient(#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background-clip:padding-box;box-shadow:0 0 3px #fff inset,0 1px 1px rgba(0,0,0,.1);color:#444;text-decoration:none;white-space:nowrap;line-height:24px}.chosen-container-single .chosen-default{color:#999}.chosen-container-single .chosen-single span{display:block;overflow:hidden;margin-right:26px;text-overflow:ellipsis;white-space:nowrap}.chosen-container-single .chosen-single-with-deselect span{margin-right:38px}.chosen-container-single .chosen-single abbr{position:absolute;top:6px;right:26px;display:block;width:12px;height:12px;font-size:1px}.chosen-container-single .chosen-single div{position:absolute;top:0;right:0;display:block;width:18px;height:100%}.chosen-container-single .chosen-single div b{display:block;width:100%;height:100%}.chosen-container-single .chosen-search{position:relative;z-index:1010;margin:0;padding:3px 4px;white-space:nowrap}.chosen-container-single .chosen-search input[type=text]{margin:1px 0;padding:4px 20px 4px 5px;width:100%;height:auto;outline:0;border:1px solid #aaa;font-size:1em;font-family:sans-serif;line-height:normal;border-radius:0}.chosen-container-single .chosen-drop{margin-top:-1px;border-radius:0 0 4px 4px;background-clip:padding-box}.chosen-container-single.chosen-container-single-nosearch .chosen-search{position:absolute;clip:rect(0,0,0,0);clip-path:inset(100% 100%)}.chosen-container .chosen-results{color:#444;position:relative;overflow-x:hidden;overflow-y:auto;margin:0 4px 4px 0;padding:0 0 0 4px;max-height:240px;-webkit-overflow-scrolling:touch}.chosen-container .chosen-results li{display:none;margin:0;padding:5px 6px;list-style:none;line-height:15px;word-wrap:break-word;-webkit-touch-callout:none}.chosen-container .chosen-results li.active-result{display:list-item;cursor:pointer}.chosen-container .chosen-results li.disabled-result{display:list-item;color:#ccc;cursor:default}.chosen-container .chosen-results li.highlighted{background-color:#3875d7;background-image:linear-gradient(#3875d7 20%,#2a62bc 90%);color:#fff}.chosen-container .chosen-results li.no-results{color:#777;display:list-item;background:#f4f4f4}.chosen-container .chosen-results li.group-result{display:list-item;font-weight:700;cursor:default}.chosen-container .chosen-results li.group-option{padding-left:15px}.chosen-container .chosen-results li em{font-style:normal;text-decoration:underline}.chosen-container-multi .chosen-choices{position:relative;overflow:hidden;margin:0;padding:0 5px;width:100%;height:auto;border:1px solid #aaa;background-color:#fff;background-image:linear-gradient(#eee 1%,#fff 15%);cursor:text}.chosen-container-multi .chosen-choices li{float:left;list-style:none}.chosen-container-multi .chosen-choices li.search-field{margin:0;padding:0;white-space:nowrap}.chosen-container-multi .chosen-choices li.search-field input[type=text]{margin:1px 0;padding:0;outline:0;border:0!important;background:0 0!important;box-shadow:none;color:#999;font-size:100%;font-family:sans-serif;line-height:normal;border-radius:0;width:25px;height:25px;min-height:25px}.chosen-container-multi .chosen-choices li.search-choice{position:relative;margin:3px 5px 3px 0;padding:3px 20px 3px 6px;border:1px solid #aaa;max-width:100%;border-radius:3px;background-color:#eee;background-image:linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-size:100% 19px;background-repeat:repeat-x;background-clip:padding-box;box-shadow:0 0 2px #fff inset,0 1px 0 rgba(0,0,0,.05);color:#333;line-height:13px;cursor:default}.chosen-container-multi .chosen-choices li.search-choice span{word-wrap:break-word;white-space:nowrap}.chosen-container-multi .chosen-choices li.search-choice .search-choice-close{position:absolute;top:0;right:0;display:block;width:12px;height:12px;font-size:1px}.chosen-container-multi .chosen-choices li.search-choice-disabled{padding-right:5px;border:1px solid #ccc;background-color:#e4e4e4;background-image:linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);color:#666}.chosen-container-multi .chosen-choices li.search-choice-focus{background:#d4d4d4}.chosen-container-multi .chosen-results{margin:0;padding:0}.chosen-container-multi .chosen-drop .result-selected{display:list-item;color:#ccc;cursor:default}.chosen-container-active .chosen-single{border:1px solid #5897fb;box-shadow:0 0 5px rgba(0,0,0,.3)}.chosen-container-active.chosen-with-drop .chosen-single{border:1px solid #aaa;border-bottom-right-radius:0;border-bottom-left-radius:0;background-image:linear-gradient(#eee 20%,#fff 80%);box-shadow:0 1px 0 #fff inset}.chosen-container-active.chosen-with-drop .chosen-single div{border-left:none;background:0 0}.chosen-container-active .chosen-choices{border:1px solid #5897fb;box-shadow:0 0 5px rgba(0,0,0,.3)}.chosen-container-active .chosen-choices li.search-field input[type=text]{color:#222!important}.chosen-disabled{opacity:.5!important;cursor:default}.chosen-disabled .chosen-single{cursor:default}.chosen-disabled .chosen-choices .search-choice .search-choice-close{cursor:default}.chosen-rtl{text-align:right}.chosen-rtl .chosen-single{overflow:visible;padding:0 8px 0 0}.chosen-rtl .chosen-single span{margin-right:0;margin-left:26px;direction:rtl}.chosen-rtl .chosen-single-with-deselect span{margin-left:38px}.chosen-rtl .chosen-single div{right:auto;left:3px}.chosen-rtl .chosen-single abbr{right:auto;left:26px}.chosen-rtl .chosen-choices li{float:right}.chosen-rtl .chosen-choices li.search-field input[type=text]{direction:rtl}.chosen-rtl .chosen-choices li.search-choice{margin:3px 5px 3px 0;padding:3px 5px 3px 19px}.chosen-rtl .chosen-choices li.search-choice .search-choice-close{right:auto;left:4px}.chosen-rtl.chosen-container-single .chosen-results{margin:0 0 4px 4px;padding:0 4px 0 0}.chosen-rtl .chosen-results li.group-option{padding-right:15px;padding-left:0}.chosen-rtl.chosen-container-active.chosen-with-drop .chosen-single div{border-right:none}.chosen-rtl .chosen-search input[type=text]{padding:4px 5px 4px 20px;direction:rtl}
admin/settings/assets/images/checkerboard.png ADDED
Binary file
admin/settings/assets/images/wp-logo.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><rect x="0" fill="none" width="20" height="20"/><g><g fill="#fff"><path d="M20 10c0-5.52-4.48-10-10-10S0 4.48 0 10s4.48 10 10 10 10-4.48 10-10zM10 1.01c4.97 0 8.99 4.02 8.99 8.99s-4.02 8.99-8.99 8.99S1.01 14.97 1.01 10 5.03 1.01 10 1.01zM8.01 14.82L4.96 6.61c.49-.03 1.05-.08 1.05-.08.43-.05.38-1.01-.06-.99 0 0-1.29.1-2.13.1-.15 0-.33 0-.52-.01 1.44-2.17 3.9-3.6 6.7-3.6 2.09 0 3.99.79 5.41 2.09-.6-.08-1.45.35-1.45 1.42 0 .66.38 1.22.79 1.88.31.54.5 1.22.5 2.21 0 1.34-1.27 4.48-1.27 4.48l-2.71-7.5c.48-.03.75-.16.75-.16.43-.05.38-1.1-.05-1.08 0 0-1.3.11-2.14.11-.78 0-2.11-.11-2.11-.11-.43-.02-.48 1.06-.05 1.08l.84.08 1.12 3.04zm6.02 2.15L16.64 10s.67-1.69.39-3.81c.63 1.14.94 2.42.94 3.81 0 2.96-1.56 5.58-3.94 6.97zM2.68 6.77L6.5 17.25c-2.67-1.3-4.47-4.08-4.47-7.25 0-1.16.2-2.23.65-3.23zm7.45 4.53l2.29 6.25c-.75.27-1.57.42-2.42.42-.72 0-1.41-.11-2.06-.3z"/></g></g></svg>
admin/settings/assets/images/wp-plugin-logo.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><rect x="0" fill="none" width="20" height="20"/><g><g fill="#fff"><path d="M13.11 4.36L9.87 7.6 8 5.73l3.24-3.24c.35-.34 1.05-.2 1.56.32.52.51.66 1.21.31 1.55zm-8 1.77l.91-1.12 9.01 9.01-1.19.84c-.71.71-2.63 1.16-3.82 1.16H6.14L4.9 17.26c-.59.59-1.54.59-2.12 0-.59-.58-.59-1.53 0-2.12l1.24-1.24v-3.88c0-1.13.4-3.19 1.09-3.89zm7.26 3.97l3.24-3.24c.34-.35 1.04-.21 1.55.31.52.51.66 1.21.31 1.55l-3.24 3.25z"/></g></g></svg>
admin/settings/assets/js/csf-gutenberg-block.js ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ *
3
+ * -----------------------------------------------------------
4
+ *
5
+ * Codestar Framework Gutenberg Block
6
+ * A Simple and Lightweight WordPress Option Framework
7
+ *
8
+ * -----------------------------------------------------------
9
+ *
10
+ */
11
+ ( function( blocks, editor, element, components ) {
12
+
13
+ if( !window.csf_gutenberg_blocks ) { return; }
14
+
15
+ window.csf_gutenberg_blocks.forEach( function( block ) {
16
+
17
+ var registerBlockType = blocks.registerBlockType;
18
+ var PlainText = editor.PlainText;
19
+ var createElement = element.createElement;
20
+ var RawHTML = element.RawHTML;
21
+ var Button = components.Button;
22
+
23
+ registerBlockType('csf-gutenberg-block/block-'+block.hash, {
24
+ title: block.gutenberg.title,
25
+ icon: block.gutenberg.icon,
26
+ category: block.gutenberg.category,
27
+ description: block.gutenberg.description,
28
+ keywords: block.gutenberg.keywords,
29
+ supports: {
30
+ html: false,
31
+ className: false,
32
+ customClassName: false,
33
+ },
34
+ attributes: {
35
+ shortcode: {
36
+ string: 'string',
37
+ source: 'text',
38
+ }
39
+ },
40
+ edit: function (props) {
41
+ return (
42
+ createElement('div', {className: 'csf-shortcode-block'},
43
+
44
+ createElement(Button, {
45
+ 'data-modal-id': block.modal_id,
46
+ 'data-gutenberg-id': block.hash,
47
+ className: 'button is-button is-default is-large csf-shortcode-button',
48
+ onClick: function () {
49
+ window.csf_gutenberg_props = props;
50
+ },
51
+ }, block.button_title ),
52
+
53
+ createElement(PlainText, {
54
+ placeholder: block.gutenberg.placeholder,
55
+ className: 'input-control',
56
+ onChange: function (value) {
57
+ props.setAttributes({
58
+ shortcode: value
59
+ })
60
+ },
61
+ value: props.attributes.shortcode
62
+ })
63
+
64
+ )
65
+ );
66
+ },
67
+ save: function (props) {
68
+ return createElement(RawHTML, {}, props.attributes.shortcode);
69
+ }
70
+ });
71
+
72
+ });
73
+
74
+ })(
75
+ window.wp.blocks,
76
+ window.wp.editor,
77
+ window.wp.element,
78
+ window.wp.components
79
+ );
admin/settings/assets/js/csf-plugins.js ADDED
@@ -0,0 +1,2092 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ *
3
+ * jQuery Chosen AJAX Autocomplete Library
4
+ *
5
+ * https://github.com/meltingice/ajax-chosen
6
+ * https://github.com/michaelperrin/ajax-chosen
7
+ *
8
+ * MIT License
9
+ *
10
+ * Customized by Codestar
11
+ *
12
+ */
13
+ (function($) {
14
+
15
+ function CSFAjaxChosen(element, options) {
16
+ this.element = $(element);
17
+ this.options = options;
18
+ this.init();
19
+ };
20
+
21
+ CSFAjaxChosen.prototype.init = function() {
22
+ this.element.chosen(this.options);
23
+ this.container = this.element.next('.chosen-container');
24
+ this.search_field = this.container.find('.chosen-search-input');
25
+ this.is_multiple = this.container.hasClass('chosen-container-multi');
26
+ this.is_typing = false;
27
+ this.chosenXhr = null;
28
+ this.events();
29
+ };
30
+
31
+ CSFAjaxChosen.prototype.events = function() {
32
+
33
+ var _this = this;
34
+
35
+ this.search_field.on('compositionstart', function() {
36
+ _this.is_typing = true;
37
+ });
38
+
39
+ this.search_field.on('compositionend', function() {
40
+ _this.is_typing = false;
41
+ _this.update_list();
42
+ });
43
+
44
+ this.search_field.on('keyup', function() {
45
+ _this.update_list();
46
+ });
47
+
48
+ this.search_field.on('focus', function() {
49
+ _this.search_field_focused();
50
+ });
51
+
52
+ };
53
+
54
+ CSFAjaxChosen.prototype.search_field_focused = function() {
55
+ this.search_welcome_message();
56
+ if ( this.options.min_length === 0 && this.search_field.val().length === 0 ) {
57
+ this.update_list();
58
+ }
59
+ };
60
+
61
+ CSFAjaxChosen.prototype.search_welcome_message = function() {
62
+
63
+ var value = $.trim(this.search_field.val());
64
+ var results = this.container.find('.chosen-results');
65
+
66
+ if ( results.children().length === 0 && value.length === 0 ) {
67
+ results.html('<li class="no-results">' + this.options.typing_text.replace('%s', this.options.min_length - value.length) + '</li>');
68
+ }
69
+
70
+ };
71
+
72
+ CSFAjaxChosen.prototype.update_list = function() {
73
+
74
+ var _this = this;
75
+
76
+ this.search_welcome_message();
77
+
78
+ if ( this.is_typing ) { return; }
79
+
80
+ var value = $.trim(this.search_field.val());
81
+ var message = ( value.length < this.options.min_length ) ? this.options.typing_text.replace('%s', this.options.min_length - value.length) : this.options.searching_text;
82
+
83
+ this.container.find('.no-results').text(message);
84
+
85
+ if ( value === this.search_field.data('prevVal') ) { return; }
86
+
87
+ this.search_field.data('prevVal', value);
88
+
89
+ if (this.timer) {
90
+ clearTimeout(this.timer);
91
+ }
92
+
93
+ if ( value.length < this.options.min_length ) { return; }
94
+
95
+ this.timer = setTimeout( function() {
96
+
97
+ if ( _this.chosenXhr ) {
98
+ _this.chosenXhr.abort();
99
+ }
100
+
101
+ _this.options.data['term'] = value;
102
+
103
+ _this.chosenXhr = window.wp.ajax.post('csf-chosen', _this.options.data).done( function( response ) {
104
+ _this.show_results( response );
105
+ }).fail( function( response ) {
106
+ _this.container.find('.no-results').text(response.error);
107
+ });
108
+
109
+ }, this.options.type_delay );
110
+
111
+ };
112
+
113
+ CSFAjaxChosen.prototype.show_results = function( items ) {
114
+
115
+ var _this = this;
116
+
117
+ if ( this.is_typing || items === null ) { return; }
118
+
119
+ if ( items.length === 0 ) {
120
+ this.element.data().chosen.no_results_clear();
121
+ this.element.data().chosen.no_results(this.search_field.val());
122
+ return;
123
+ }
124
+
125
+ var selected_values = [];
126
+
127
+ this.element.find('option').each(function() {
128
+ if ( $(this).is(':selected') ) {
129
+ selected_values.push( $(this).val() + "-" + $(this).text() );
130
+ } else {
131
+ if( $(this).attr('value').length ) {
132
+ $(this).remove();
133
+ }
134
+ }
135
+ });
136
+
137
+ $.each(items, function(i, item) {
138
+ if ( $.inArray( item.value + "-" + item.text, selected_values ) === -1 ) {
139
+ $('<option />').attr('value', item.value).html(item.text).appendTo(_this.element);
140
+ }
141
+ });
142
+
143
+ var value_before_trigger = this.search_field.val();
144
+ var width_before_trigger = this.search_field.innerWidth();
145
+
146
+ this.element.trigger('chosen:updated');
147
+
148
+ if( this.is_multiple ) {
149
+
150
+ var $hidden_select = this.element.parent().find('.csf-hidden-select');
151
+ var $hidden_value = $hidden_select.val() || [];
152
+
153
+ this.element.CSFChosenOrder($hidden_value, true);
154
+ this.search_field.css('width', width_before_trigger);
155
+
156
+ }
157
+
158
+ this.search_field.val(value_before_trigger);
159
+
160
+ if ( this.chosenXhr.done !== null ) {
161
+ this.chosenXhr.done(items);
162
+ }
163
+
164
+ };
165
+
166
+ $.fn.CSFAjaxChosen = function(chosenOptions) {
167
+ return this.each(function() {
168
+ new CSFAjaxChosen(this, chosenOptions);
169
+ });
170
+ };
171
+
172
+ })(jQuery);
173
+ ;// Chosen Order v1.2.1
174
+ // This plugin allows you to handle the order of the selection for Chosen multiple <select> dropdowns
175
+ // Full source at https://github.com/tristanjahier/chosen-order
176
+ // Copyright (c) 2013 - Tristan Jahier, http://tristan-jahier.fr
177
+ (function() {
178
+ var $, CSFAbstractChosenOrder, _ref,
179
+ __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; },
180
+ __hasProp = {}.hasOwnProperty,
181
+ __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
182
+
183
+ CSFAbstractChosenOrder = (function() {
184
+
185
+ function CSFAbstractChosenOrder() {}
186
+
187
+ CSFAbstractChosenOrder.insertAt = function(node, index, parentNode) {
188
+ return parentNode.insertBefore(node, parentNode.children[index].nextSibling);
189
+ };
190
+
191
+ CSFAbstractChosenOrder.getFlattenedOptionsAndGroups = function(select) {
192
+ var flattened_options, opt, options, sub_opt, sub_options, _i, _j, _len, _len1;
193
+ options = Array.prototype.filter.call(select.childNodes, function(o) {
194
+ var _ref;
195
+ return (_ref = o.nodeName.toUpperCase()) === 'OPTION' || _ref === 'OPTGROUP';
196
+ });
197
+ flattened_options = [];
198
+ for (_i = 0, _len = options.length; _i < _len; _i++) {
199
+ opt = options[_i];
200
+ flattened_options.push(opt);
201
+ if (opt.nodeName.toUpperCase() === 'OPTGROUP') {
202
+ sub_options = Array.prototype.filter.call(opt.childNodes, function(o) {
203
+ return o.nodeName.toUpperCase() === 'OPTION';
204
+ });
205
+ for (_j = 0, _len1 = sub_options.length; _j < _len1; _j++) {
206
+ sub_opt = sub_options[_j];
207
+ flattened_options.push(sub_opt);
208
+ }
209
+ }
210
+ }
211
+ return flattened_options;
212
+ };
213
+
214
+ CSFAbstractChosenOrder.isValidMultipleSelectElement = function(element) {
215
+ return element !== null && typeof element !== "undefined" && element.nodeName === "SELECT" && element.multiple;
216
+ };
217
+
218
+ CSFAbstractChosenOrder.getChosenUIContainer = function(select) {
219
+ if (select.id !== "") {
220
+ return document.getElementById(select.id.replace(/-/g, "_") + "_chosen");
221
+ } else {
222
+ return this.searchChosenUIContainer(select);
223
+ }
224
+ };
225
+
226
+ CSFAbstractChosenOrder.isChosenified = function(select) {
227
+ return this.getChosenUIContainer(select) != null;
228
+ };
229
+
230
+ CSFAbstractChosenOrder.forceSelection = function(select, selection) {
231
+ var i, opt, options, _ref;
232
+ options = this.getFlattenedOptionsAndGroups(select);
233
+ i = 0;
234
+ while (i < options.length) {
235
+ opt = options[i];
236
+ if (_ref = opt.getAttribute("value"), __indexOf.call(selection, _ref) >= 0) {
237
+ opt.selected = true;
238
+ opt.setAttribute("selected", "");
239
+ } else {
240
+ opt.selected = false;
241
+ opt.removeAttribute("selected");
242
+ }
243
+ i++;
244
+ }
245
+ return this.triggerEvent(select, "chosen:updated");
246
+ };
247
+
248
+ CSFAbstractChosenOrder.CSFChosenOrder = function(select, order, force) {
249
+ var chosen_choices, chosen_options, chosen_ui, i, j, opt, opt_val, option, options, rel, relAttributeName, _i, _j, _len, _len1, _results;
250
+ if (this.getDOMElement != null) {
251
+ select = this.getDOMElement(select);
252
+ }
253
+ if (!this.isValidMultipleSelectElement(select)) {
254
+ return;
255
+ }
256
+ chosen_ui = this.getChosenUIContainer(select);
257
+ if (chosen_ui == null) {
258
+ return;
259
+ }
260
+ if (order instanceof Array) {
261
+ order = order.map(Function.prototype.call, String.prototype.trim);
262
+ options = this.getFlattenedOptionsAndGroups(select);
263
+ if ((force != null) && force === true) {
264
+ this.forceSelection(select, order);
265
+ }
266
+ _results = [];
267
+ for (i = _i = 0, _len = order.length; _i < _len; i = ++_i) {
268
+ opt_val = order[i];
269
+ rel = null;
270
+ for (j = _j = 0, _len1 = options.length; _j < _len1; j = ++_j) {
271
+ opt = options[j];
272
+ if (opt.value === opt_val) {
273
+ rel = j;
274
+ }
275
+ }
276
+ chosen_options = chosen_ui.querySelectorAll('.search-choice');
277
+ relAttributeName = this.relAttributeName;
278
+ option = Array.prototype.filter.call(chosen_options, function(o) {
279
+ return o.querySelector("a.search-choice-close[" + relAttributeName + "=\"" + rel + "\"]") != null;
280
+ })[0];
281
+ if (option == null) {
282
+ continue;
283
+ }
284
+ chosen_choices = chosen_ui.querySelector("ul.chosen-choices");
285
+ _results.push(this.insertAt(option, i, chosen_ui.querySelector('ul.chosen-choices')));
286
+ }
287
+ return _results;
288
+ } else {
289
+ return;
290
+ }
291
+ };
292
+
293
+ return CSFAbstractChosenOrder;
294
+
295
+ })();
296
+
297
+ $ = jQuery;
298
+
299
+ $.fn.extend({
300
+ CSFChosenOrder: function(order, force) {
301
+ return _CSFChosenOrder.CSFChosenOrder(this, order, force);
302
+ }
303
+ });
304
+
305
+ this._CSFChosenOrder = (function(_super) {
306
+ __extends(_CSFChosenOrder, _super);
307
+
308
+ function _CSFChosenOrder() {
309
+ _ref = _CSFChosenOrder.__super__.constructor.apply(this, arguments);
310
+ return _ref;
311
+ }
312
+
313
+ _CSFChosenOrder.relAttributeName = 'data-option-array-index';
314
+
315
+ _CSFChosenOrder.isjQueryObject = function(obj) {
316
+ return (typeof jQuery !== "undefined" && jQuery !== null) && obj instanceof jQuery;
317
+ };
318
+
319
+ _CSFChosenOrder.getDOMElement = function(element) {
320
+ if (this.isjQueryObject(element)) {
321
+ return element.get(0);
322
+ } else {
323
+ return element;
324
+ }
325
+ };
326
+
327
+ _CSFChosenOrder.searchChosenUIContainer = function(element) {
328
+ if ($(element).data("chosen") != null) {
329
+ return $(element).data("chosen").container[0];
330
+ } else {
331
+ return $(element).next(".chosen-container.chosen-container-multi").get(0);
332
+ }
333
+ };
334
+
335
+ _CSFChosenOrder.triggerEvent = function(target, event_name) {
336
+ return $(target).trigger(event_name);
337
+ };
338
+
339
+ return _CSFChosenOrder;
340
+
341
+ })(CSFAbstractChosenOrder);
342
+
343
+ }).call(this);
344
+ ;(function() {
345
+ var $, AbstractChosen, Chosen, SelectParser,
346
+ bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
347
+ extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
348
+ hasProp = {}.hasOwnProperty;
349
+
350
+ SelectParser = (function() {
351
+ function SelectParser() {
352
+ this.options_index = 0;
353
+ this.parsed = [];
354
+ }
355
+
356
+ SelectParser.prototype.add_node = function(child) {
357
+ if (child.nodeName.toUpperCase() === "OPTGROUP") {
358
+ return this.add_group(child);
359
+ } else {
360
+ return this.add_option(child);
361
+ }
362
+ };
363
+
364
+ SelectParser.prototype.add_group = function(group) {
365
+ var group_position, i, len, option, ref, results1;
366
+ group_position = this.parsed.length;
367
+ this.parsed.push({
368
+ array_index: group_position,
369
+ group: true,
370
+ label: group.label,
371
+ title: group.title ? group.title : void 0,
372
+ children: 0,
373
+ disabled: group.disabled,
374
+ classes: group.className
375
+ });
376
+ ref = group.childNodes;
377
+ results1 = [];
378
+ for (i = 0, len = ref.length; i < len; i++) {
379
+ option = ref[i];
380
+ results1.push(this.add_option(option, group_position, group.disabled));
381
+ }
382
+ return results1;
383
+ };
384
+
385
+ SelectParser.prototype.add_option = function(option, group_position, group_disabled) {
386
+ if (option.nodeName.toUpperCase() === "OPTION") {
387
+ if (option.text !== "") {
388
+ if (group_position != null) {
389
+ this.parsed[group_position].children += 1;
390
+ }
391
+ this.parsed.push({
392
+ array_index: this.parsed.length,
393
+ options_index: this.options_index,
394
+ value: option.value,
395
+ text: option.text,
396
+ html: option.innerHTML,
397
+ title: option.title ? option.title : void 0,
398
+ selected: option.selected,
399
+ disabled: group_disabled === true ? group_disabled : option.disabled,
400
+ group_array_index: group_position,
401
+ group_label: group_position != null ? this.parsed[group_position].label : null,
402
+ classes: option.className,
403
+ style: option.style.cssText
404
+ });
405
+ } else {
406
+ this.parsed.push({
407
+ array_index: this.parsed.length,
408
+ options_index: this.options_index,
409
+ empty: true
410
+ });
411
+ }
412
+ return this.options_index += 1;
413
+ }
414
+ };
415
+
416
+ return SelectParser;
417
+
418
+ })();
419
+
420
+ SelectParser.select_to_array = function(select) {
421
+ var child, i, len, parser, ref;
422
+ parser = new SelectParser();
423
+ ref = select.childNodes;
424
+ for (i = 0, len = ref.length; i < len; i++) {
425
+ child = ref[i];
426
+ parser.add_node(child);
427
+ }
428
+ return parser.parsed;
429
+ };
430
+
431
+ AbstractChosen = (function() {
432
+ function AbstractChosen(form_field, options1) {
433
+ this.form_field = form_field;
434
+ this.options = options1 != null ? options1 : {};
435
+ this.label_click_handler = bind(this.label_click_handler, this);
436
+ if (!AbstractChosen.browser_is_supported()) {
437
+ return;
438
+ }
439
+ this.is_multiple = this.form_field.multiple;
440
+ this.set_default_text();
441
+ this.set_default_values();
442
+ this.setup();
443
+ this.set_up_html();
444
+ this.register_observers();
445
+ this.on_ready();
446
+ }
447
+
448
+ AbstractChosen.prototype.set_default_values = function() {
449
+ this.click_test_action = (function(_this) {
450
+ return function(evt) {
451
+ return _this.test_active_click(evt);
452
+ };
453
+ })(this);
454
+ this.activate_action = (function(_this) {
455
+ return function(evt) {
456
+ return _this.activate_field(evt);
457
+ };
458
+ })(this);
459
+ this.active_field = false;
460
+ this.mouse_on_container = false;
461
+ this.results_showing = false;
462
+ this.result_highlighted = null;
463
+ this.is_rtl = this.options.rtl || /\bchosen-rtl\b/.test(this.form_field.className);
464
+ this.allow_single_deselect = (this.options.allow_single_deselect != null) && (this.form_field.options[0] != null) && this.form_field.options[0].text === "" ? this.options.allow_single_deselect : false;
465
+ this.disable_search_threshold = this.options.disable_search_threshold || 0;
466
+ this.disable_search = this.options.disable_search || false;
467
+ this.enable_split_word_search = this.options.enable_split_word_search != null ? this.options.enable_split_word_search : true;
468
+ this.group_search = this.options.group_search != null ? this.options.group_search : true;
469
+ this.search_contains = this.options.search_contains || false;
470
+ this.single_backstroke_delete = this.options.single_backstroke_delete != null ? this.options.single_backstroke_delete : true;
471
+ this.max_selected_options = this.options.max_selected_options || Infinity;
472
+ this.inherit_select_classes = this.options.inherit_select_classes || false;
473
+ this.display_selected_options = this.options.display_selected_options != null ? this.options.display_selected_options : true;
474
+ this.display_disabled_options = this.options.display_disabled_options != null ? this.options.display_disabled_options : true;
475
+ this.include_group_label_in_selected = this.options.include_group_label_in_selected || false;
476
+ this.max_shown_results = this.options.max_shown_results || Number.POSITIVE_INFINITY;
477
+ this.case_sensitive_search = this.options.case_sensitive_search || false;
478
+ return this.hide_results_on_select = this.options.hide_results_on_select != null ? this.options.hide_results_on_select : true;
479
+ };
480
+
481
+ AbstractChosen.prototype.set_default_text = function() {
482
+ if (this.form_field.getAttribute("data-placeholder")) {
483
+ this.default_text = this.form_field.getAttribute("data-placeholder");
484
+ } else if (this.is_multiple) {
485
+ this.default_text = this.options.placeholder_text_multiple || this.options.placeholder_text || AbstractChosen.default_multiple_text;
486
+ } else {
487
+ this.default_text = this.options.placeholder_text_single || this.options.placeholder_text || AbstractChosen.default_single_text;
488
+ }
489
+ this.default_text = this.escape_html(this.default_text);
490
+ return this.results_none_found = this.form_field.getAttribute("data-no_results_text") || this.options.no_results_text || AbstractChosen.default_no_result_text;
491
+ };
492
+
493
+ AbstractChosen.prototype.choice_label = function(item) {
494
+ if (this.include_group_label_in_selected && (item.group_label != null)) {
495
+ return "<b class='group-name'>" + (this.escape_html(item.group_label)) + "</b>" + item.html;
496
+ } else {
497
+ return item.html;
498
+ }
499
+ };
500
+
501
+ AbstractChosen.prototype.mouse_enter = function() {
502
+ return this.mouse_on_container = true;
503
+ };
504
+
505
+ AbstractChosen.prototype.mouse_leave = function() {
506
+ return this.mouse_on_container = false;
507
+ };
508
+
509
+ AbstractChosen.prototype.input_focus = function(evt) {
510
+ if (this.is_multiple) {
511
+ if (!this.active_field) {
512
+ return setTimeout(((function(_this) {
513
+ return function() {
514
+ return _this.container_mousedown();
515
+ };
516
+ })(this)), 50);
517
+ }
518
+ } else {
519
+ if (!this.active_field) {
520
+ return this.activate_field();
521
+ }
522
+ }
523
+ };
524
+
525
+ AbstractChosen.prototype.input_blur = function(evt) {
526
+ if (!this.mouse_on_container) {
527
+ this.active_field = false;
528
+ return setTimeout(((function(_this) {
529
+ return function() {
530
+ return _this.blur_test();
531
+ };
532
+ })(this)), 100);
533
+ }
534
+ };
535
+
536
+ AbstractChosen.prototype.label_click_handler = function(evt) {
537
+ if (this.is_multiple) {
538
+ return this.container_mousedown(evt);
539
+ } else {
540
+ return this.activate_field();
541
+ }
542
+ };
543
+
544
+ AbstractChosen.prototype.results_option_build = function(options) {
545
+ var content, data, data_content, i, len, ref, shown_results;
546
+ content = '';
547
+ shown_results = 0;
548
+ ref = this.results_data;
549
+ for (i = 0, len = ref.length; i < len; i++) {
550
+ data = ref[i];
551
+ data_content = '';
552
+ if (data.group) {
553
+ data_content = this.result_add_group(data);
554
+ } else {
555
+ data_content = this.result_add_option(data);
556
+ }
557
+ if (data_content !== '') {
558
+ shown_results++;
559
+ content += data_content;
560
+ }
561
+ if (options != null ? options.first : void 0) {
562
+ if (data.selected && this.is_multiple) {
563
+ this.choice_build(data);
564
+ } else if (data.selected && !this.is_multiple) {
565
+ this.single_set_selected_text(this.choice_label(data));
566
+ }
567
+ }
568
+ if (shown_results >= this.max_shown_results) {
569
+ break;
570
+ }
571
+ }
572
+ return content;
573
+ };
574
+
575
+ AbstractChosen.prototype.result_add_option = function(option) {
576
+ var classes, option_el;
577
+ if (!option.search_match) {
578
+ return '';
579
+ }
580
+ if (!this.include_option_in_results(option)) {
581
+ return '';
582
+ }
583
+ classes = [];
584
+ if (!option.disabled && !(option.selected && this.is_multiple)) {
585
+ classes.push("active-result");
586
+ }
587
+ if (option.disabled && !(option.selected && this.is_multiple)) {
588
+ classes.push("disabled-result");
589
+ }
590
+ if (option.selected) {
591
+ classes.push("result-selected");
592
+ }
593
+ if (option.group_array_index != null) {
594
+ classes.push("group-option");
595
+ }
596
+ if (option.classes !== "") {
597
+ classes.push(option.classes);
598
+ }
599
+ option_el = document.createElement("li");
600
+ option_el.className = classes.join(" ");
601
+ if (option.style) {
602
+ option_el.style.cssText = option.style;
603
+ }
604
+ option_el.setAttribute("data-option-array-index", option.array_index);
605
+ option_el.innerHTML = option.highlighted_html || option.html;
606
+ if (option.title) {
607
+ option_el.title = option.title;
608
+ }
609
+ return this.outerHTML(option_el);
610
+ };
611
+
612
+ AbstractChosen.prototype.result_add_group = function(group) {
613
+ var classes, group_el;
614
+ if (!(group.search_match || group.group_match)) {
615
+ return '';
616
+ }
617
+ if (!(group.active_options > 0)) {
618
+ return '';
619
+ }
620
+ classes = [];
621
+ classes.push("group-result");
622
+ if (group.classes) {
623
+ classes.push(group.classes);
624
+ }
625
+ group_el = document.createElement("li");
626
+ group_el.className = classes.join(" ");
627
+ group_el.innerHTML = group.highlighted_html || this.escape_html(group.label);
628
+ if (group.title) {
629
+ group_el.title = group.title;
630
+ }
631
+ return this.outerHTML(group_el);
632
+ };
633
+
634
+ AbstractChosen.prototype.results_update_field = function() {
635
+ this.set_default_text();
636
+ if (!this.is_multiple) {
637
+ this.results_reset_cleanup();
638
+ }
639
+ this.result_clear_highlight();
640
+ this.results_build();
641
+ if (this.results_showing) {
642
+ return this.winnow_results();
643
+ }
644
+ };
645
+
646
+ AbstractChosen.prototype.reset_single_select_options = function() {
647
+ var i, len, ref, result, results1;
648
+ ref = this.results_data;
649
+ results1 = [];
650
+ for (i = 0, len = ref.length; i < len; i++) {
651
+ result = ref[i];
652
+ if (result.selected) {
653
+ results1.push(result.selected = false);
654
+ } else {
655
+ results1.push(void 0);
656
+ }
657
+ }
658
+ return results1;
659
+ };
660
+
661
+ AbstractChosen.prototype.results_toggle = function() {
662
+ if (this.results_showing) {
663
+ return this.results_hide();
664
+ } else {
665
+ return this.results_show();
666
+ }
667
+ };
668
+
669
+ AbstractChosen.prototype.results_search = function(evt) {
670
+ if (this.results_showing) {
671
+ return this.winnow_results();
672
+ } else {
673
+ return this.results_show();
674
+ }
675
+ };
676
+
677
+ AbstractChosen.prototype.winnow_results = function(options) {
678
+ var escapedQuery, fix, i, len, option, prefix, query, ref, regex, results, results_group, search_match, startpos, suffix, text;
679
+ this.no_results_clear();
680
+ results = 0;
681
+ query = this.get_search_text();
682
+ escapedQuery = query.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
683
+ regex = this.get_search_regex(escapedQuery);
684
+ ref = this.results_data;
685
+ for (i = 0, len = ref.length; i < len; i++) {
686
+ option = ref[i];
687
+ option.search_match = false;
688
+ results_group = null;
689
+ search_match = null;
690
+ option.highlighted_html = '';
691
+ if (this.include_option_in_results(option)) {
692
+ if (option.group) {
693
+ option.group_match = false;
694
+ option.active_options = 0;
695
+ }
696
+ if ((option.group_array_index != null) && this.results_data[option.group_array_index]) {
697
+ results_group = this.results_data[option.group_array_index];
698
+ if (results_group.active_options === 0 && results_group.search_match) {
699
+ results += 1;
700
+ }
701
+ results_group.active_options += 1;
702
+ }
703
+ text = option.group ? option.label : option.text;
704
+ if (!(option.group && !this.group_search)) {
705
+ search_match = this.search_string_match(text, regex);
706
+ option.search_match = search_match != null;
707
+ if (option.search_match && !option.group) {
708
+ results += 1;
709
+ }
710
+ if (option.search_match) {
711
+ if (query.length) {
712
+ startpos = search_match.index;
713
+ prefix = text.slice(0, startpos);
714
+ fix = text.slice(startpos, startpos + query.length);
715
+ suffix = text.slice(startpos + query.length);
716
+ option.highlighted_html = (this.escape_html(prefix)) + "<em>" + (this.escape_html(fix)) + "</em>" + (this.escape_html(suffix));
717
+ }
718
+ if (results_group != null) {
719
+ results_group.group_match = true;
720
+ }
721
+ } else if ((option.group_array_index != null) && this.results_data[option.group_array_index].search_match) {
722
+ option.search_match = true;
723
+ }
724
+ }
725
+ }
726
+ }
727
+ this.result_clear_highlight();
728
+ if (results < 1 && query.length) {
729
+ this.update_results_content("");
730
+ return this.no_results(query);
731
+ } else {
732
+ this.update_results_content(this.results_option_build());
733
+ if (!(options != null ? options.skip_highlight : void 0)) {
734
+ return this.winnow_results_set_highlight();
735
+ }
736
+ }
737
+ };
738
+
739
+ AbstractChosen.prototype.get_search_regex = function(escaped_search_string) {
740
+ var regex_flag, regex_string;
741
+ regex_string = this.search_contains ? escaped_search_string : "(^|\\s|\\b)" + escaped_search_string + "[^\\s]*";
742
+ if (!(this.enable_split_word_search || this.search_contains)) {
743
+ regex_string = "^" + regex_string;
744
+ }
745
+ regex_flag = this.case_sensitive_search ? "" : "i";
746
+ return new RegExp(regex_string, regex_flag);
747
+ };
748
+
749
+ AbstractChosen.prototype.search_string_match = function(search_string, regex) {
750
+ var match;
751
+ match = regex.exec(search_string);
752
+ if (!this.search_contains && (match != null ? match[1] : void 0)) {
753
+ match.index += 1;
754
+ }
755
+ return match;
756
+ };
757
+
758
+ AbstractChosen.prototype.choices_count = function() {
759
+ var i, len, option, ref;
760
+ if (this.selected_option_count != null) {
761
+ return this.selected_option_count;
762
+ }
763
+ this.selected_option_count = 0;
764
+ ref = this.form_field.options;
765
+ for (i = 0, len = ref.length; i < len; i++) {
766
+ option = ref[i];
767
+ if (option.selected) {
768
+ this.selected_option_count += 1;
769
+ }
770
+ }
771
+ return this.selected_option_count;
772
+ };
773
+
774
+ AbstractChosen.prototype.choices_click = function(evt) {
775
+ evt.preventDefault();
776
+ this.activate_field();
777
+ if (!(this.results_showing || this.is_disabled)) {
778
+ return this.results_show();
779
+ }
780
+ };
781
+
782
+ AbstractChosen.prototype.keydown_checker = function(evt) {
783
+ var ref, stroke;
784
+ stroke = (ref = evt.which) != null ? ref : evt.keyCode;
785
+ this.search_field_scale();
786
+ if (stroke !== 8 && this.pending_backstroke) {
787
+ this.clear_backstroke();
788
+ }
789
+ switch (stroke) {
790
+ case 8:
791
+ this.backstroke_length = this.get_search_field_value().length;
792
+ break;
793
+ case 9:
794
+ if (this.results_showing && !this.is_multiple) {
795
+ this.result_select(evt);
796
+ }
797
+ this.mouse_on_container = false;
798
+ break;
799
+ case 13:
800
+ if (this.results_showing) {
801
+ evt.preventDefault();
802
+ }
803
+ break;
804
+ case 27:
805
+ if (this.results_showing) {
806
+ evt.preventDefault();
807
+ }
808
+ break;
809
+ case 32:
810
+ if (this.disable_search) {
811
+ evt.preventDefault();
812
+ }
813
+ break;
814
+ case 38:
815
+ evt.preventDefault();
816
+ this.keyup_arrow();
817
+ break;
818
+ case 40:
819
+ evt.preventDefault();
820
+ this.keydown_arrow();
821
+ break;
822
+ }
823
+ };
824
+
825
+ AbstractChosen.prototype.keyup_checker = function(evt) {
826
+ var ref, stroke;
827
+ stroke = (ref = evt.which) != null ? ref : evt.keyCode;
828
+ this.search_field_scale();
829
+ switch (stroke) {
830
+ case 8:
831
+ if (this.is_multiple && this.backstroke_length < 1 && this.choices_count() > 0) {
832
+ this.keydown_backstroke();
833
+ } else if (!this.pending_backstroke) {
834
+ this.result_clear_highlight();
835
+ this.results_search();
836
+ }
837
+ break;
838
+ case 13:
839
+ evt.preventDefault();
840
+ if (this.results_showing) {
841
+ this.result_select(evt);
842
+ }
843
+ break;
844
+ case 27:
845
+ if (this.results_showing) {
846
+ this.results_hide();
847
+ }
848
+ break;
849
+ case 9:
850
+ case 16:
851
+ case 17:
852
+ case 18:
853
+ case 38:
854
+ case 40:
855
+ case 91:
856
+ break;
857
+ default:
858
+ this.results_search();
859
+ break;
860
+ }
861
+ };
862
+
863
+ AbstractChosen.prototype.clipboard_event_checker = function(evt) {
864
+ if (this.is_disabled) {
865
+ return;
866
+ }
867
+ return setTimeout(((function(_this) {
868
+ return function() {
869
+ return _this.results_search();
870
+ };
871
+ })(this)), 50);
872
+ };
873
+
874
+ AbstractChosen.prototype.container_width = function() {
875
+ if (this.options.width != null) {
876
+ return this.options.width;
877
+ } else {
878
+ return this.form_field.offsetWidth + "px";
879
+ }
880
+ };
881
+
882
+ AbstractChosen.prototype.include_option_in_results = function(option) {
883
+ if (this.is_multiple && (!this.display_selected_options && option.selected)) {
884
+ return false;
885
+ }
886
+ if (!this.display_disabled_options && option.disabled) {
887
+ return false;
888
+ }
889
+ if (option.empty) {
890
+ return false;
891
+ }
892
+ return true;
893
+ };
894
+
895
+ AbstractChosen.prototype.search_results_touchstart = function(evt) {
896
+ this.touch_started = true;
897
+ return this.search_results_mouseover(evt);
898
+ };
899
+
900
+ AbstractChosen.prototype.search_results_touchmove = function(evt) {
901
+ this.touch_started = false;
902
+ return this.search_results_mouseout(evt);
903
+ };
904
+
905
+ AbstractChosen.prototype.search_results_touchend = function(evt) {
906
+ if (this.touch_started) {
907
+ return this.search_results_mouseup(evt);
908
+ }
909
+ };
910
+
911
+ AbstractChosen.prototype.outerHTML = function(element) {
912
+ var tmp;
913
+ if (element.outerHTML) {
914
+ return element.outerHTML;
915
+ }
916
+ tmp = document.createElement("div");
917
+ tmp.appendChild(element);
918
+ return tmp.innerHTML;
919
+ };
920
+
921
+ AbstractChosen.prototype.get_single_html = function() {
922
+ return "<a class=\"chosen-single chosen-default\">\n <span>" + this.default_text + "</span>\n <div><b></b></div>\n</a>\n<div class=\"chosen-drop\">\n <div class=\"chosen-search\">\n <input class=\"chosen-search-input\" type=\"text\" autocomplete=\"off\" />\n </div>\n <ul class=\"chosen-results\"></ul>\n</div>";
923
+ };
924
+
925
+ AbstractChosen.prototype.get_multi_html = function() {
926
+ return "<ul class=\"chosen-choices\">\n <li class=\"search-field\">\n <input class=\"chosen-search-input\" type=\"text\" autocomplete=\"off\" value=\"" + this.default_text + "\" />\n </li>\n</ul>\n<div class=\"chosen-drop\">\n <ul class=\"chosen-results\"></ul>\n</div>";
927
+ };
928
+
929
+ AbstractChosen.prototype.get_no_results_html = function(terms) {
930
+ return "<li class=\"no-results\">\n " + this.results_none_found + " <span>" + (this.escape_html(terms)) + "</span>\n</li>";
931
+ };
932
+
933
+ AbstractChosen.browser_is_supported = function() {
934
+ if ("Microsoft Internet Explorer" === window.navigator.appName) {
935
+ return document.documentMode >= 8;
936
+ }
937
+ if (/iP(od|hone)/i.test(window.navigator.userAgent) || /IEMobile/i.test(window.navigator.userAgent) || /Windows Phone/i.test(window.navigator.userAgent) || /BlackBerry/i.test(window.navigator.userAgent) || /BB10/i.test(window.navigator.userAgent) || /Android.*Mobile/i.test(window.navigator.userAgent)) {
938
+ return false;
939
+ }
940
+ return true;
941
+ };
942
+
943
+ AbstractChosen.default_multiple_text = "Select Some Options";
944
+
945
+ AbstractChosen.default_single_text = "Select an Option";
946
+
947
+ AbstractChosen.default_no_result_text = "No results match";
948
+
949
+ return AbstractChosen;
950
+
951
+ })();
952
+
953
+ $ = jQuery;
954
+
955
+ $.fn.extend({
956
+ chosen: function(options) {
957
+ if (!AbstractChosen.browser_is_supported()) {
958
+ return this;
959
+ }
960
+ return this.each(function(input_field) {
961
+ var $this, chosen;
962
+ $this = $(this);
963
+ chosen = $this.data('chosen');
964
+ if (options === 'destroy') {
965
+ if (chosen instanceof Chosen) {
966
+ chosen.destroy();
967
+ }
968
+ return;
969
+ }
970
+ if (!(chosen instanceof Chosen)) {
971
+ $this.data('chosen', new Chosen(this, options));
972
+ }
973
+ });
974
+ }
975
+ });
976
+
977
+ Chosen = (function(superClass) {
978
+ extend(Chosen, superClass);
979
+
980
+ function Chosen() {
981
+ return Chosen.__super__.constructor.apply(this, arguments);
982
+ }
983
+
984
+ Chosen.prototype.setup = function() {
985
+ this.form_field_jq = $(this.form_field);
986
+ return this.current_selectedIndex = this.form_field.selectedIndex;
987
+ };
988
+
989
+ Chosen.prototype.set_up_html = function() {
990
+ var container_classes, container_props;
991
+ container_classes = ["chosen-container"];
992
+ container_classes.push("chosen-container-" + (this.is_multiple ? "multi" : "single"));
993
+ if (this.inherit_select_classes && this.form_field.className) {
994
+ container_classes.push(this.form_field.className);
995
+ }
996
+ if (this.is_rtl) {
997
+ container_classes.push("chosen-rtl");
998
+ }
999
+ container_props = {
1000
+ 'class': container_classes.join(' '),
1001
+ 'title': this.form_field.title
1002
+ };
1003
+ if (this.form_field.id.length) {
1004
+ container_props.id = this.form_field.id.replace(/[^\w]/g, '_') + "_chosen";
1005
+ }
1006
+ this.container = $("<div />", container_props);
1007
+ this.container.width(this.container_width());
1008
+ if (this.is_multiple) {
1009
+ this.container.html(this.get_multi_html());
1010
+ } else {
1011
+ this.container.html(this.get_single_html());
1012
+ }
1013
+ this.form_field_jq.hide().after(this.container);
1014
+ this.dropdown = this.container.find('div.chosen-drop').first();
1015
+ this.search_field = this.container.find('input').first();
1016
+ this.search_results = this.container.find('ul.chosen-results').first();
1017
+ this.search_field_scale();
1018
+ this.search_no_results = this.container.find('li.no-results').first();
1019
+ if (this.is_multiple) {
1020
+ this.search_choices = this.container.find('ul.chosen-choices').first();
1021
+ this.search_container = this.container.find('li.search-field').first();
1022
+ } else {
1023
+ this.search_container = this.container.find('div.chosen-search').first();
1024
+ this.selected_item = this.container.find('.chosen-single').first();
1025
+ }
1026
+ this.results_build();
1027
+ this.set_tab_index();
1028
+ return this.set_label_behavior();
1029
+ };
1030
+
1031
+ Chosen.prototype.on_ready = function() {
1032
+ return this.form_field_jq.trigger("chosen:ready", {
1033
+ chosen: this
1034
+ });
1035
+ };
1036
+
1037
+ Chosen.prototype.register_observers = function() {
1038
+ this.container.on('touchstart.chosen', (function(_this) {
1039
+ return function(evt) {
1040
+ _this.container_mousedown(evt);
1041
+ };
1042
+ })(this));
1043
+ this.container.on('touchend.chosen', (function(_this) {
1044
+ return function(evt) {
1045
+ _this.container_mouseup(evt);
1046
+ };
1047
+ })(this));
1048
+ this.container.on('mousedown.chosen', (function(_this) {
1049
+ return function(evt) {
1050
+ _this.container_mousedown(evt);
1051
+ };
1052
+ })(this));
1053
+ this.container.on('mouseup.chosen', (function(_this) {
1054
+ return function(evt) {
1055
+ _this.container_mouseup(evt);
1056
+ };
1057
+ })(this));
1058
+ this.container.on('mouseenter.chosen', (function(_this) {
1059
+ return function(evt) {
1060
+ _this.mouse_enter(evt);
1061
+ };
1062
+ })(this));
1063
+ this.container.on('mouseleave.chosen', (function(_this) {
1064
+ return function(evt) {
1065
+ _this.mouse_leave(evt);
1066
+ };
1067
+ })(this));
1068
+ this.search_results.on('mouseup.chosen', (function(_this) {
1069
+ return function(evt) {
1070
+ _this.search_results_mouseup(evt);
1071
+ };
1072
+ })(this));
1073
+ this.search_results.on('mouseover.chosen', (function(_this) {
1074
+ return function(evt) {
1075
+ _this.search_results_mouseover(evt);
1076
+ };
1077
+ })(this));
1078
+ this.search_results.on('mouseout.chosen', (function(_this) {
1079
+ return function(evt) {
1080
+ _this.search_results_mouseout(evt);
1081
+ };
1082
+ })(this));
1083
+ this.search_results.on('mousewheel.chosen DOMMouseScroll.chosen', (function(_this) {
1084
+ return function(evt) {
1085
+ _this.search_results_mousewheel(evt);
1086
+ };
1087
+ })(this));
1088
+ this.search_results.on('touchstart.chosen', (function(_this) {
1089
+ return function(evt) {
1090
+ _this.search_results_touchstart(evt);
1091
+ };
1092
+ })(this));
1093
+ this.search_results.on('touchmove.chosen', (function(_this) {
1094
+ return function(evt) {
1095
+ _this.search_results_touchmove(evt);
1096
+ };
1097
+ })(this));
1098
+ this.search_results.on('touchend.chosen', (function(_this) {
1099
+ return function(evt) {
1100
+ _this.search_results_touchend(evt);
1101
+ };
1102
+ })(this));
1103
+ this.form_field_jq.on("chosen:updated.chosen", (function(_this) {
1104
+ return function(evt) {
1105
+ _this.results_update_field(evt);
1106
+ };
1107
+ })(this));
1108
+ this.form_field_jq.on("chosen:activate.chosen", (function(_this) {
1109
+ return function(evt) {
1110
+ _this.activate_field(evt);
1111
+ };
1112
+ })(this));
1113
+ this.form_field_jq.on("chosen:open.chosen", (function(_this) {
1114
+ return function(evt) {
1115
+ _this.container_mousedown(evt);
1116
+ };
1117
+ })(this));
1118
+ this.form_field_jq.on("chosen:close.chosen", (function(_this) {
1119
+ return function(evt) {
1120
+ _this.close_field(evt);
1121
+ };
1122
+ })(this));
1123
+ this.search_field.on('blur.chosen', (function(_this) {
1124
+ return function(evt) {
1125
+ _this.input_blur(evt);
1126
+ };
1127
+ })(this));
1128
+ this.search_field.on('keyup.chosen', (function(_this) {
1129
+ return function(evt) {
1130
+ _this.keyup_checker(evt);
1131
+ };
1132
+ })(this));
1133
+ this.search_field.on('keydown.chosen', (function(_this) {
1134
+ return function(evt) {
1135
+ _this.keydown_checker(evt);
1136
+ };
1137
+ })(this));
1138
+ this.search_field.on('focus.chosen', (function(_this) {
1139
+ return function(evt) {
1140
+ _this.input_focus(evt);
1141
+ };
1142
+ })(this));
1143
+ this.search_field.on('cut.chosen', (function(_this) {
1144
+ return function(evt) {
1145
+ _this.clipboard_event_checker(evt);
1146
+ };
1147
+ })(this));
1148
+ this.search_field.on('paste.chosen', (function(_this) {
1149
+ return function(evt) {
1150
+ _this.clipboard_event_checker(evt);
1151
+ };
1152
+ })(this));
1153
+ if (this.is_multiple) {
1154
+ return this.search_choices.on('click.chosen', (function(_this) {
1155
+ return function(evt) {
1156
+ _this.choices_click(evt);
1157
+ };
1158
+ })(this));
1159
+ } else {
1160
+ return this.container.on('click.chosen', function(evt) {
1161
+ evt.preventDefault();
1162
+ });
1163
+ }
1164
+ };
1165
+
1166
+ Chosen.prototype.destroy = function() {
1167
+ $(this.container[0].ownerDocument).off('click.chosen', this.click_test_action);
1168
+ if (this.form_field_label.length > 0) {
1169
+ this.form_field_label.off('click.chosen');
1170
+ }
1171
+ if (this.search_field[0].tabIndex) {
1172
+ this.form_field_jq[0].tabIndex = this.search_field[0].tabIndex;
1173
+ }
1174
+ this.container.remove();
1175
+ this.form_field_jq.removeData('chosen');
1176
+ return this.form_field_jq.show();
1177
+ };
1178
+
1179
+ Chosen.prototype.search_field_disabled = function() {
1180
+ this.is_disabled = this.form_field.disabled || this.form_field_jq.parents('fieldset').is(':disabled');
1181
+ this.container.toggleClass('chosen-disabled', this.is_disabled);
1182
+ this.search_field[0].disabled = this.is_disabled;
1183
+ if (!this.is_multiple) {
1184
+ this.selected_item.off('focus.chosen', this.activate_field);
1185
+ }
1186
+ if (this.is_disabled) {
1187
+ return this.close_field();
1188
+ } else if (!this.is_multiple) {
1189
+ return this.selected_item.on('focus.chosen', this.activate_field);
1190
+ }
1191
+ };
1192
+
1193
+ Chosen.prototype.container_mousedown = function(evt) {
1194
+ var ref;
1195
+ if (this.is_disabled) {
1196
+ return;
1197
+ }
1198
+ if (evt && ((ref = evt.type) === 'mousedown' || ref === 'touchstart') && !this.results_showing) {
1199
+ evt.preventDefault();
1200
+ }
1201
+ if (!((evt != null) && ($(evt.target)).hasClass("search-choice-close"))) {
1202
+ if (!this.active_field) {
1203
+ if (this.is_multiple) {
1204
+ this.search_field.val("");
1205
+ }
1206
+ $(this.container[0].ownerDocument).on('click.chosen', this.click_test_action);
1207
+ this.results_show();
1208
+ } else if (!this.is_multiple && evt && (($(evt.target)[0] === this.selected_item[0]) || $(evt.target).parents("a.chosen-single").length)) {
1209
+ evt.preventDefault();
1210
+ this.results_toggle();
1211
+ }
1212
+ return this.activate_field();
1213
+ }
1214
+ };
1215
+
1216
+ Chosen.prototype.container_mouseup = function(evt) {
1217
+ if (evt.target.nodeName === "ABBR" && !this.is_disabled) {
1218
+ return this.results_reset(evt);
1219
+ }
1220
+ };
1221
+
1222
+ Chosen.prototype.search_results_mousewheel = function(evt) {
1223
+ var delta;
1224
+ if (evt.originalEvent) {
1225
+ delta = evt.originalEvent.deltaY || -evt.originalEvent.wheelDelta || evt.originalEvent.detail;
1226
+ }
1227
+ if (delta != null) {
1228
+ evt.preventDefault();
1229
+ if (evt.type === 'DOMMouseScroll') {
1230
+ delta = delta * 40;
1231
+ }
1232
+ return this.search_results.scrollTop(delta + this.search_results.scrollTop());
1233
+ }
1234
+ };
1235
+
1236
+ Chosen.prototype.blur_test = function(evt) {
1237
+ if (!this.active_field && this.container.hasClass("chosen-container-active")) {
1238
+ return this.close_field();
1239
+ }
1240
+ };
1241
+
1242
+ Chosen.prototype.close_field = function() {
1243
+ $(this.container[0].ownerDocument).off("click.chosen", this.click_test_action);
1244
+ this.active_field = false;
1245
+ this.results_hide();
1246
+ this.container.removeClass("chosen-container-active");
1247
+ this.clear_backstroke();
1248
+ this.show_search_field_default();
1249
+ this.search_field_scale();
1250
+ return this.search_field.blur();
1251
+ };
1252
+
1253
+ Chosen.prototype.activate_field = function() {
1254
+ if (this.is_disabled) {
1255
+ return;
1256
+ }
1257
+ this.container.addClass("chosen-container-active");
1258
+ this.active_field = true;
1259
+ this.search_field.val(this.search_field.val());
1260
+ return this.search_field.focus();
1261
+ };
1262
+
1263
+ Chosen.prototype.test_active_click = function(evt) {
1264
+ var active_container;
1265
+ active_container = $(evt.target).closest('.chosen-container');
1266
+ if (active_container.length && this.container[0] === active_container[0]) {
1267
+ return this.active_field = true;
1268
+ } else {
1269
+ return this.close_field();
1270
+ }
1271
+ };
1272
+
1273
+ Chosen.prototype.results_build = function() {
1274
+ this.parsing = true;
1275
+ this.selected_option_count = null;
1276
+ this.results_data = SelectParser.select_to_array(this.form_field);
1277
+ if (this.is_multiple) {
1278
+ this.search_choices.find("li.search-choice").remove();
1279
+ } else {
1280
+ this.single_set_selected_text();
1281
+ if (this.disable_search || this.form_field.options.length <= this.disable_search_threshold) {
1282
+ this.search_field[0].readOnly = true;
1283
+ this.container.addClass("chosen-container-single-nosearch");
1284
+ } else {
1285
+ this.search_field[0].readOnly = false;
1286
+ this.container.removeClass("chosen-container-single-nosearch");
1287
+ }
1288
+ }
1289
+ this.update_results_content(this.results_option_build({
1290
+ first: true
1291
+ }));
1292
+ this.search_field_disabled();
1293
+ this.show_search_field_default();
1294
+ this.search_field_scale();
1295
+ return this.parsing = false;
1296
+ };
1297
+
1298
+ Chosen.prototype.result_do_highlight = function(el) {
1299
+ var high_bottom, high_top, maxHeight, visible_bottom, visible_top;
1300
+ if (el.length) {
1301
+ this.result_clear_highlight();
1302
+ this.result_highlight = el;
1303
+ this.result_highlight.addClass("highlighted");
1304
+ maxHeight = parseInt(this.search_results.css("maxHeight"), 10);
1305
+ visible_top = this.search_results.scrollTop();
1306
+ visible_bottom = maxHeight + visible_top;
1307
+ high_top = this.result_highlight.position().top + this.search_results.scrollTop();
1308
+ high_bottom = high_top + this.result_highlight.outerHeight();
1309
+ if (high_bottom >= visible_bottom) {
1310
+ return this.search_results.scrollTop((high_bottom - maxHeight) > 0 ? high_bottom - maxHeight : 0);
1311
+ } else if (high_top < visible_top) {
1312
+ return this.search_results.scrollTop(high_top);
1313
+ }
1314
+ }
1315
+ };
1316
+
1317
+ Chosen.prototype.result_clear_highlight = function() {
1318
+ if (this.result_highlight) {
1319
+ this.result_highlight.removeClass("highlighted");
1320
+ }
1321
+ return this.result_highlight = null;
1322
+ };
1323
+
1324
+ Chosen.prototype.results_show = function() {
1325
+ if (this.is_multiple && this.max_selected_options <= this.choices_count()) {
1326
+ this.form_field_jq.trigger("chosen:maxselected", {
1327
+ chosen: this
1328
+ });
1329
+ return false;
1330
+ }
1331
+ this.container.addClass("chosen-with-drop");
1332
+ this.results_showing = true;
1333
+ this.search_field.focus();
1334
+ this.search_field.val(this.get_search_field_value());
1335
+ this.winnow_results();
1336
+ return this.form_field_jq.trigger("chosen:showing_dropdown", {
1337
+ chosen: this
1338
+ });
1339
+ };
1340
+
1341
+ Chosen.prototype.update_results_content = function(content) {
1342
+ return this.search_results.html(content);
1343
+ };
1344
+
1345
+ Chosen.prototype.results_hide = function() {
1346
+ if (this.results_showing) {
1347
+ this.result_clear_highlight();
1348
+ this.container.removeClass("chosen-with-drop");
1349
+ this.form_field_jq.trigger("chosen:hiding_dropdown", {
1350
+ chosen: this
1351
+ });
1352
+ }
1353
+ return this.results_showing = false;
1354
+ };
1355
+
1356
+ Chosen.prototype.set_tab_index = function(el) {
1357
+ var ti;
1358
+ if (this.form_field.tabIndex) {
1359
+ ti = this.form_field.tabIndex;
1360
+ this.form_field.tabIndex = -1;
1361
+ return this.search_field[0].tabIndex = ti;
1362
+ }
1363
+ };
1364
+
1365
+ Chosen.prototype.set_label_behavior = function() {
1366
+ this.form_field_label = this.form_field_jq.parents("label");
1367
+ if (!this.form_field_label.length && this.form_field.id.length) {
1368
+ this.form_field_label = $("label[for='" + this.form_field.id + "']");
1369
+ }
1370
+ if (this.form_field_label.length > 0) {
1371
+ return this.form_field_label.on('click.chosen', this.label_click_handler);
1372
+ }
1373
+ };
1374
+
1375
+ Chosen.prototype.show_search_field_default = function() {
1376
+ if (this.is_multiple && this.choices_count() < 1 && !this.active_field) {
1377
+ this.search_field.val(this.default_text);
1378
+ return this.search_field.addClass("default");
1379
+ } else {
1380
+ this.search_field.val("");
1381
+ return this.search_field.removeClass("default");
1382
+ }
1383
+ };
1384
+
1385
+ Chosen.prototype.search_results_mouseup = function(evt) {
1386
+ var target;
1387
+ target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
1388
+ if (target.length) {
1389
+ this.result_highlight = target;
1390
+ this.result_select(evt);
1391
+ return this.search_field.focus();
1392
+ }
1393
+ };
1394
+
1395
+ Chosen.prototype.search_results_mouseover = function(evt) {
1396
+ var target;
1397
+ target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
1398
+ if (target) {
1399
+ return this.result_do_highlight(target);
1400
+ }
1401
+ };
1402
+
1403
+ Chosen.prototype.search_results_mouseout = function(evt) {
1404
+ if ($(evt.target).hasClass("active-result") || $(evt.target).parents('.active-result').first()) {
1405
+ return this.result_clear_highlight();
1406
+ }
1407
+ };
1408
+
1409
+ Chosen.prototype.choice_build = function(item) {
1410
+ var choice, close_link;
1411
+ choice = $('<li />', {
1412
+ "class": "search-choice"
1413
+ }).html("<span>" + (this.choice_label(item)) + "</span>");
1414
+ if (item.disabled) {
1415
+ choice.addClass('search-choice-disabled');
1416
+ } else {
1417
+ close_link = $('<a />', {
1418
+ "class": 'search-choice-close',
1419
+ 'data-option-array-index': item.array_index
1420
+ });
1421
+ close_link.on('click.chosen', (function(_this) {
1422
+ return function(evt) {
1423
+ return _this.choice_destroy_link_click(evt);
1424
+ };
1425
+ })(this));
1426
+ choice.append(close_link);
1427
+ }
1428
+ return this.search_container.before(choice);
1429
+ };
1430
+
1431
+ Chosen.prototype.choice_destroy_link_click = function(evt) {
1432
+ evt.preventDefault();
1433
+ evt.stopPropagation();
1434
+ if (!this.is_disabled) {
1435
+ return this.choice_destroy($(evt.target));
1436
+ }
1437
+ };
1438
+
1439
+ Chosen.prototype.choice_destroy = function(link) {
1440
+ if (this.result_deselect(link[0].getAttribute("data-option-array-index"))) {
1441
+ if (this.active_field) {
1442
+ this.search_field.focus();
1443
+ } else {
1444
+ this.show_search_field_default();
1445
+ }
1446
+ if (this.is_multiple && this.choices_count() > 0 && this.get_search_field_value().length < 1) {
1447
+ this.results_hide();
1448
+ }
1449
+ link.parents('li').first().remove();
1450
+ return this.search_field_scale();
1451
+ }
1452
+ };
1453
+
1454
+ Chosen.prototype.results_reset = function() {
1455
+ this.reset_single_select_options();
1456
+ this.form_field.options[0].selected = true;
1457
+ this.single_set_selected_text();
1458
+ this.show_search_field_default();
1459
+ this.results_reset_cleanup();
1460
+ this.trigger_form_field_change();
1461
+ if (this.active_field) {
1462
+ return this.results_hide();
1463
+ }
1464
+ };
1465
+
1466
+ Chosen.prototype.results_reset_cleanup = function() {
1467
+ this.current_selectedIndex = this.form_field.selectedIndex;
1468
+ return this.selected_item.find("abbr").remove();
1469
+ };
1470
+
1471
+ Chosen.prototype.result_select = function(evt) {
1472
+ var high, item;
1473
+ if (this.result_highlight) {
1474
+ high = this.result_highlight;
1475
+ this.result_clear_highlight();
1476
+ if (this.is_multiple && this.max_selected_options <= this.choices_count()) {
1477
+ this.form_field_jq.trigger("chosen:maxselected", {
1478
+ chosen: this
1479
+ });
1480
+ return false;
1481
+ }
1482
+ if (this.is_multiple) {
1483
+ high.removeClass("active-result");
1484
+ } else {
1485
+ this.reset_single_select_options();
1486
+ }
1487
+ high.addClass("result-selected");
1488
+ item = this.results_data[high[0].getAttribute("data-option-array-index")];
1489
+ item.selected = true;
1490
+ this.form_field.options[item.options_index].selected = true;
1491
+ this.selected_option_count = null;
1492
+ if (this.is_multiple) {
1493
+ this.choice_build(item);
1494
+ } else {
1495
+ this.single_set_selected_text(this.choice_label(item));
1496
+ }
1497
+ if (this.is_multiple && (!this.hide_results_on_select || (evt.metaKey || evt.ctrlKey))) {
1498
+ if (evt.metaKey || evt.ctrlKey) {
1499
+ this.winnow_results({
1500
+ skip_highlight: true
1501
+ });
1502
+ } else {
1503
+ this.search_field.val("");
1504
+ this.winnow_results();
1505
+ }
1506
+ } else {
1507
+ this.results_hide();
1508
+ this.show_search_field_default();
1509
+ }
1510
+ if (this.is_multiple || this.form_field.selectedIndex !== this.current_selectedIndex) {
1511
+ this.trigger_form_field_change({
1512
+ selected: this.form_field.options[item.options_index].value
1513
+ });
1514
+ }
1515
+ this.current_selectedIndex = this.form_field.selectedIndex;
1516
+ evt.preventDefault();
1517
+ return this.search_field_scale();
1518
+ }
1519
+ };
1520
+
1521
+ Chosen.prototype.single_set_selected_text = function(text) {
1522
+ if (text == null) {
1523
+ text = this.default_text;
1524
+ }
1525
+ if (text === this.default_text) {
1526
+ this.selected_item.addClass("chosen-default");
1527
+ } else {
1528
+ this.single_deselect_control_build();
1529
+ this.selected_item.removeClass("chosen-default");
1530
+ }
1531
+ return this.selected_item.find("span").html(text);
1532
+ };
1533
+
1534
+ Chosen.prototype.result_deselect = function(pos) {
1535
+ var result_data;
1536
+ result_data = this.results_data[pos];
1537
+ if (!this.form_field.options[result_data.options_index].disabled) {
1538
+ result_data.selected = false;
1539
+ this.form_field.options[result_data.options_index].selected = false;
1540
+ this.selected_option_count = null;
1541
+ this.result_clear_highlight();
1542
+ if (this.results_showing) {
1543
+ this.winnow_results();
1544
+ }
1545
+ this.trigger_form_field_change({
1546
+ deselected: this.form_field.options[result_data.options_index].value
1547
+ });
1548
+ this.search_field_scale();
1549
+ return true;
1550
+ } else {
1551
+ return false;
1552
+ }
1553
+ };
1554
+
1555
+ Chosen.prototype.single_deselect_control_build = function() {
1556
+ if (!this.allow_single_deselect) {
1557
+ return;
1558
+ }
1559
+ if (!this.selected_item.find("abbr").length) {
1560
+ this.selected_item.find("span").first().after("<abbr class=\"search-choice-close\"></abbr>");
1561
+ }
1562
+ return this.selected_item.addClass("chosen-single-with-deselect");
1563
+ };
1564
+
1565
+ Chosen.prototype.get_search_field_value = function() {
1566
+ return this.search_field.val();
1567
+ };
1568
+
1569
+ Chosen.prototype.get_search_text = function() {
1570
+ return $.trim(this.get_search_field_value());
1571
+ };
1572
+
1573
+ Chosen.prototype.escape_html = function(text) {
1574
+ return $('<div/>').text(text).html();
1575
+ };
1576
+
1577
+ Chosen.prototype.winnow_results_set_highlight = function() {
1578
+ var do_high, selected_results;
1579
+ selected_results = !this.is_multiple ? this.search_results.find(".result-selected.active-result") : [];
1580
+ do_high = selected_results.length ? selected_results.first() : this.search_results.find(".active-result").first();
1581
+ if (do_high != null) {
1582
+ return this.result_do_highlight(do_high);
1583
+ }
1584
+ };
1585
+
1586
+ Chosen.prototype.no_results = function(terms) {
1587
+ var no_results_html;
1588
+ no_results_html = this.get_no_results_html(terms);
1589
+ this.search_results.append(no_results_html);
1590
+ return this.form_field_jq.trigger("chosen:no_results", {
1591
+ chosen: this
1592
+ });
1593
+ };
1594
+
1595
+ Chosen.prototype.no_results_clear = function() {
1596
+ return this.search_results.find(".no-results").remove();
1597
+ };
1598
+
1599
+ Chosen.prototype.keydown_arrow = function() {
1600
+ var next_sib;
1601
+ if (this.results_showing && this.result_highlight) {
1602
+ next_sib = this.result_highlight.nextAll("li.active-result").first();
1603
+ if (next_sib) {
1604
+ return this.result_do_highlight(next_sib);
1605
+ }
1606
+ } else {
1607
+ return this.results_show();
1608
+ }
1609
+ };
1610
+
1611
+ Chosen.prototype.keyup_arrow = function() {
1612
+ var prev_sibs;
1613
+ if (!this.results_showing && !this.is_multiple) {
1614
+ return this.results_show();
1615
+ } else if (this.result_highlight) {
1616
+ prev_sibs = this.result_highlight.prevAll("li.active-result");
1617
+ if (prev_sibs.length) {
1618
+ return this.result_do_highlight(prev_sibs.first());
1619
+ } else {
1620
+ if (this.choices_count() > 0) {
1621
+ this.results_hide();
1622
+ }
1623
+ return this.result_clear_highlight();
1624
+ }
1625
+ }
1626
+ };
1627
+
1628
+ Chosen.prototype.keydown_backstroke = function() {
1629
+ var next_available_destroy;
1630
+ if (this.pending_backstroke) {
1631
+ this.choice_destroy(this.pending_backstroke.find("a").first());
1632
+ return this.clear_backstroke();
1633
+ } else {
1634
+ next_available_destroy = this.search_container.siblings("li.search-choice").last();
1635
+ if (next_available_destroy.length && !next_available_destroy.hasClass("search-choice-disabled")) {
1636
+ this.pending_backstroke = next_available_destroy;
1637
+ if (this.single_backstroke_delete) {
1638
+ return this.keydown_backstroke();
1639
+ } else {
1640
+ return this.pending_backstroke.addClass("search-choice-focus");
1641
+ }
1642
+ }
1643
+ }
1644
+ };
1645
+
1646
+ Chosen.prototype.clear_backstroke = function() {
1647
+ if (this.pending_backstroke) {
1648
+ this.pending_backstroke.removeClass("search-choice-focus");
1649
+ }
1650
+ return this.pending_backstroke = null;
1651
+ };
1652
+
1653
+ Chosen.prototype.search_field_scale = function() {
1654
+ var div, i, len, style, style_block, styles, width;
1655
+ if (!this.is_multiple) {
1656
+ return;
1657
+ }
1658
+ style_block = {
1659
+ position: 'absolute',
1660
+ left: '-1000px',
1661
+ top: '-1000px',
1662
+ display: 'none',
1663
+ whiteSpace: 'pre'
1664
+ };
1665
+ styles = ['fontSize', 'fontStyle', 'fontWeight', 'fontFamily', 'lineHeight', 'textTransform', 'letterSpacing'];
1666
+ for (i = 0, len = styles.length; i < len; i++) {
1667
+ style = styles[i];
1668
+ style_block[style] = this.search_field.css(style);
1669
+ }
1670
+ div = $('<div />').css(style_block);
1671
+ div.text(this.get_search_field_value());
1672
+ $('body').append(div);
1673
+ width = div.width() + 25;
1674
+ div.remove();
1675
+ if (this.container.is(':visible')) {
1676
+ width = Math.min(this.container.outerWidth() - 10, width);
1677
+ }
1678
+ return this.search_field.width(width);
1679
+ };
1680
+
1681
+ Chosen.prototype.trigger_form_field_change = function(extra) {
1682
+ this.form_field_jq.trigger("input", extra);
1683
+ return this.form_field_jq.trigger("change", extra);
1684
+ };
1685
+
1686
+ return Chosen;
1687
+
1688
+ })(AbstractChosen);
1689
+
1690
+ }).call(this);
1691
+ ;/**
1692
+ *
1693
+ * jQuery Interdependencies library
1694
+ * http://miohtama.github.com/jquery-interdependencies/
1695
+ * Copyright 2012-2013 Mikko Ohtamaa, others
1696
+ *
1697
+ * Customized by Codestar
1698
+ *
1699
+ */
1700
+ (function($) {
1701
+
1702
+ 'use strict';
1703
+
1704
+ function Rule(controller, condition, value) {
1705
+ this.init(controller, condition, value);
1706
+ }
1707
+
1708
+ $.extend(Rule.prototype, {
1709
+
1710
+ init: function(controller, condition, value) {
1711
+
1712
+ this.controller = controller;
1713
+ this.condition = condition;
1714
+ this.value = value;
1715
+ this.rules = [];
1716
+ this.controls = [];
1717
+
1718
+ },
1719
+
1720
+ evalCondition: function(context, control, condition, val1, val2) {
1721
+
1722
+ if( condition == '==' ) {
1723
+
1724
+ return this.checkBoolean(val1) == this.checkBoolean(val2);
1725
+
1726
+ } else if( condition == '!=' ) {
1727
+
1728
+ return this.checkBoolean(val1) != this.checkBoolean(val2);
1729
+
1730
+ } else if( condition == '>=' ) {
1731
+
1732
+ return Number(val2) >= Number(val1);
1733
+
1734
+ } else if( condition == '<=' ) {
1735
+
1736
+ return Number(val2) <= Number(val1);
1737
+
1738
+ } else if( condition == '>' ) {
1739
+
1740
+ return Number(val2) > Number(val1);
1741
+
1742
+ } else if( condition == '<' ) {
1743
+
1744
+ return Number(val2) < Number(val1);
1745
+
1746
+ } else if( condition == '()' ) {
1747
+
1748
+ return window[val1](context, control, val2);
1749
+
1750
+ } else if( condition == 'any' ) {
1751
+
1752
+ if( $.isArray( val2 ) ) {
1753
+ for (var i = val2.length - 1; i >= 0; i--) {
1754
+ if( $.inArray( val2[i], val1.split(',') ) !== -1 ) {
1755
+ return true;
1756
+ }
1757
+ }
1758
+ } else {
1759
+ if( $.inArray( val2, val1.split(',') ) !== -1 ) {
1760
+ return true;
1761
+ }
1762
+ }
1763
+
1764
+ } else if( condition == 'not-any' ) {
1765
+
1766
+ if( $.isArray( val2 ) ) {
1767
+ for (var i = val2.length - 1; i >= 0; i--) {
1768
+ if( $.inArray( val2[i], val1.split(',') ) == -1 ) {
1769
+ return true;
1770
+ }
1771
+ }
1772
+ } else {
1773
+ if( $.inArray( val2, val1.split(',') ) == -1 ) {
1774
+ return true;
1775
+ }
1776
+ }
1777
+
1778
+ }
1779
+
1780
+ return false;
1781
+
1782
+ },
1783
+
1784
+ checkBoolean: function(value) {
1785
+
1786
+ switch( value ) {
1787
+
1788
+ case true:
1789
+ case 'true':
1790
+ case 1:
1791
+ case '1':
1792
+ value = true;
1793
+ break;
1794
+
1795
+ case null:
1796
+ case false:
1797
+ case 'false':
1798
+ case 0:
1799
+ case '0':
1800
+ value = false;
1801
+ break;
1802
+
1803
+ }
1804
+
1805
+ return value;
1806
+ },
1807
+
1808
+ checkCondition: function( context ) {
1809
+
1810
+ if( !this.condition ) {
1811
+ return true;
1812
+ }
1813
+
1814
+ var control = context.find(this.controller);
1815
+
1816
+ var control_value = this.getControlValue(context, control);
1817
+
1818
+ if( control_value === undefined ) {
1819
+ return false;
1820
+ }
1821
+
1822
+ control_value = this.normalizeValue(control, this.value, control_value);
1823
+
1824
+ return this.evalCondition(context, control, this.condition, this.value, control_value);
1825
+ },
1826
+
1827
+ normalizeValue: function( control, baseValue, control_value ) {
1828
+
1829
+ if( typeof baseValue == 'number' ) {
1830
+ return parseFloat( control_value );
1831
+ }
1832
+
1833
+ return control_value;
1834
+ },
1835
+
1836
+ getControlValue: function(context, control) {
1837
+
1838
+ if( control.length > 1 && ( control.attr('type') == 'radio' || control.attr('type') == 'checkbox' ) ) {
1839
+
1840
+ return control.filter(':checked').map(function() { return this.value; }).get();
1841
+
1842
+ } else if ( control.attr('type') == 'checkbox' || control.attr('type') == 'radio' ) {
1843
+
1844
+ return control.is(':checked');
1845
+
1846
+ }
1847
+
1848
+ return control.val();
1849
+
1850
+ },
1851
+
1852
+ createRule: function(controller, condition, value) {
1853
+ var rule = new Rule(controller, condition, value);
1854
+ this.rules.push(rule);
1855
+ return rule;
1856
+ },
1857
+
1858
+ include: function(input) {
1859
+ this.controls.push(input);
1860
+ },
1861
+
1862
+ applyRule: function(context, enforced) {
1863
+
1864
+ var result;
1865
+
1866
+ if( typeof( enforced ) == 'undefined' ) {
1867
+ result = this.checkCondition(context);
1868
+ } else {
1869
+ result = enforced;
1870
+ }
1871
+
1872
+ var controls = $.map(this.controls, function(elem, idx) {
1873
+ return context.find(elem);
1874
+ });
1875
+
1876
+ if( result ) {
1877
+
1878
+ $(controls).each(function() {
1879
+ $(this).removeClass('hidden');
1880
+ });
1881
+
1882
+ $(this.rules).each(function() {
1883
+ this.applyRule(context);
1884
+ });
1885
+
1886
+ } else {
1887
+
1888
+ $(controls).each(function() {
1889
+ $(this).addClass('hidden');
1890
+ });
1891
+
1892
+ $(this.rules).each(function() {
1893
+ this.applyRule(context, false);
1894
+ });
1895
+
1896
+ }
1897
+ }
1898
+ });
1899
+
1900
+ function Ruleset() {
1901
+ this.rules = [];
1902
+ };
1903
+
1904
+ $.extend(Ruleset.prototype, {
1905
+
1906
+ createRule: function(controller, condition, value) {
1907
+ var rule = new Rule(controller, condition, value);
1908
+ this.rules.push(rule);
1909
+ return rule;
1910
+ },
1911
+
1912
+ applyRules: function(context) {
1913
+ $(this.rules).each(function() {
1914
+ this.applyRule(context);
1915
+ });
1916
+ }
1917
+ });
1918
+
1919
+ $.csf_deps = {
1920
+
1921
+ createRuleset: function() {
1922
+ return new Ruleset();
1923
+ },
1924
+
1925
+ enable: function(selection, ruleset, depends) {
1926
+
1927
+ selection.on('change keyup', function(elem) {
1928
+
1929
+ var depend_id = elem.target.getAttribute('data-depend-id') || elem.target.getAttribute('data-sub-depend-id');
1930
+
1931
+ if( depends.indexOf( depend_id ) !== -1 ) {
1932
+ ruleset.applyRules(selection);
1933
+ }
1934
+
1935
+ });
1936
+
1937
+ ruleset.applyRules(selection);
1938
+
1939
+ return true;
1940
+ }
1941
+ };
1942
+
1943
+ })(jQuery);
1944
+ ;/**
1945
+ *
1946
+ * jQuery serializeObject
1947
+ *
1948
+ * @copyright 2014, macek <paulmacek@gmail.com>
1949
+ * @link https://github.com/macek/jquery-serialize-object
1950
+ * @license BSD
1951
+ * @version 2.5.0
1952
+ *
1953
+ * Customized by Codestar
1954
+ *
1955
+ */
1956
+ (function(root, factory) {
1957
+
1958
+ // AMD
1959
+ if (typeof define === "function" && define.amd) {
1960
+ define(["exports", "jquery"], function(exports, $) {
1961
+ return factory(exports, $);
1962
+ });
1963
+ }
1964
+
1965
+ // CommonJS
1966
+ else if (typeof exports !== "undefined") {
1967
+ var $ = require("jquery");
1968
+ factory(exports, $);
1969
+ }
1970
+
1971
+ // Browser
1972
+ else {
1973
+ factory(root, (root.jQuery || root.Zepto || root.ender || root.$));
1974
+ }
1975
+
1976
+ }(this, function(exports, $) {
1977
+
1978
+ //
1979
+ // Codestar: Added custom patterns for spesific validate
1980
+ //
1981
+ var patterns = {
1982
+ validate: /^(?!(_nonce|_pseudo))[a-zA-Z0-9_-]*(?:\[(?:\d*|(?!(_nonce|_pseudo))[a-zA-Z0-9_-]+)\])*$/i,
1983
+ key: /[a-zA-Z0-9_-]+|(?=\[\])/g,
1984
+ named: /^[a-zA-Z0-9_-]+$/,
1985
+ push: /^$/,
1986
+ fixed: /^\d+$/
1987
+ };
1988
+
1989
+ function FormSerializer(helper, $form) {
1990
+
1991
+ // private variables
1992
+ var data = {},
1993
+ pushes = {};
1994
+
1995
+ // private API
1996
+ function build(base, key, value) {
1997
+ base[key] = value;
1998
+ return base;
1999
+ }
2000
+
2001
+ function makeObject(root, value) {
2002
+
2003
+ var keys = root.match(patterns.key), k;
2004
+
2005
+ // nest, nest, ..., nest
2006
+ while ((k = keys.pop()) !== undefined) {
2007
+ // foo[]
2008
+ if (patterns.push.test(k)) {
2009
+ var idx = incrementPush(root.replace(/\[\]$/, ''));
2010
+ value = build([], idx, value);
2011
+ }
2012
+
2013
+ // foo[n]
2014
+ else if (patterns.fixed.test(k)) {
2015
+ value = build([], k, value);
2016
+ }
2017
+
2018
+ // foo; foo[bar]
2019
+ else if (patterns.named.test(k)) {
2020
+ value = build({}, k, value);
2021
+ }
2022
+ }
2023
+
2024
+ return value;
2025
+ }
2026
+
2027
+ function incrementPush(key) {
2028
+ if (pushes[key] === undefined) {
2029
+ pushes[key] = 0;
2030
+ }
2031
+ return pushes[key]++;
2032
+ }
2033
+
2034
+ function addPair(pair) {
2035
+ if (!patterns.validate.test(pair.name)) return this;
2036
+ var obj = makeObject(pair.name, pair.value);
2037
+ data = helper.extend(true, data, obj);
2038
+ return this;
2039
+ }
2040
+
2041
+ function addPairs(pairs) {
2042
+ if (!helper.isArray(pairs)) {
2043
+ throw new Error("formSerializer.addPairs expects an Array");
2044
+ }
2045
+ for (var i=0, len=pairs.length; i<len; i++) {
2046
+ this.addPair(pairs[i]);
2047
+ }
2048
+ return this;
2049
+ }
2050
+
2051
+ function serialize() {
2052
+ return data;
2053
+ }
2054
+
2055
+ function serializeJSON() {
2056
+ return JSON.stringify(serialize());
2057
+ }
2058
+
2059
+ // public API
2060
+ this.addPair = addPair;
2061
+ this.addPairs = addPairs;
2062
+ this.serialize = serialize;
2063
+ this.serializeJSON = serializeJSON;
2064
+ }
2065
+
2066
+ FormSerializer.patterns = patterns;
2067
+
2068
+ FormSerializer.serializeObject = function serializeObject() {
2069
+ return new FormSerializer($, this).
2070
+ addPairs(this.serializeArray()).
2071
+ serialize();
2072
+ };
2073
+
2074
+ FormSerializer.serializeJSON = function serializeJSON() {
2075
+ return new FormSerializer($, this).
2076
+ addPairs(this.serializeArray()).
2077
+ serializeJSON();
2078
+ };
2079
+
2080
+ //
2081
+ // Codestar: Renamed function names for avoid conflicts
2082
+ //
2083
+
2084
+ if (typeof $.fn !== "undefined") {
2085
+ $.fn.serializeObjectCSF = FormSerializer.serializeObject;
2086
+ $.fn.serializeJSONCSF = FormSerializer.serializeJSON;
2087
+ }
2088
+
2089
+ exports.FormSerializer = FormSerializer;
2090
+
2091
+ return FormSerializer;
2092
+ }));
admin/settings/assets/js/csf-plugins.min.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /* Codestar Framework | A Simple and Lightweight WordPress Option Framework - v2.1.3.x*/
2
+
3
+ !function(t){function e(e,s){this.element=t(e),this.options=s,this.init()}e.prototype.init=function(){this.element.chosen(this.options),this.container=this.element.next(".chosen-container"),this.search_field=this.container.find(".chosen-search-input"),this.is_multiple=this.container.hasClass("chosen-container-multi"),this.is_typing=!1,this.chosenXhr=null,this.events()},e.prototype.events=function(){var t=this;this.search_field.on("compositionstart",function(){t.is_typing=!0}),this.search_field.on("compositionend",function(){t.is_typing=!1,t.update_list()}),this.search_field.on("keyup",function(){t.update_list()}),this.search_field.on("focus",function(){t.search_field_focused()})},e.prototype.search_field_focused=function(){this.search_welcome_message(),0===this.options.min_length&&0===this.search_field.val().length&&this.update_list()},e.prototype.search_welcome_message=function(){var e=t.trim(this.search_field.val()),s=this.container.find(".chosen-results");0===s.children().length&&0===e.length&&s.html('<li class="no-results">'+this.options.typing_text.replace("%s",this.options.min_length-e.length)+"</li>")},e.prototype.update_list=function(){var e=this;if(this.search_welcome_message(),!this.is_typing){var s=t.trim(this.search_field.val()),i=s.length<this.options.min_length?this.options.typing_text.replace("%s",this.options.min_length-s.length):this.options.searching_text;this.container.find(".no-results").text(i),s!==this.search_field.data("prevVal")&&(this.search_field.data("prevVal",s),this.timer&&clearTimeout(this.timer),s.length<this.options.min_length||(this.timer=setTimeout(function(){e.chosenXhr&&e.chosenXhr.abort(),e.options.data.term=s,e.chosenXhr=window.wp.ajax.post("csf-chosen",e.options.data).done(function(t){e.show_results(t)}).fail(function(t){e.container.find(".no-results").text(t.error)})},this.options.type_delay)))}},e.prototype.show_results=function(e){var s=this;if(!this.is_typing&&null!==e){if(0===e.length)return this.element.data().chosen.no_results_clear(),void this.element.data().chosen.no_results(this.search_field.val());var i=[];this.element.find("option").each(function(){t(this).is(":selected")?i.push(t(this).val()+"-"+t(this).text()):t(this).attr("value").length&&t(this).remove()}),t.each(e,function(e,n){-1===t.inArray(n.value+"-"+n.text,i)&&t("<option />").attr("value",n.value).html(n.text).appendTo(s.element)});var n=this.search_field.val(),r=this.search_field.innerWidth();if(this.element.trigger("chosen:updated"),this.is_multiple){var o=this.element.parent().find(".csf-hidden-select").val()||[];this.element.CSFChosenOrder(o,!0),this.search_field.css("width",r)}this.search_field.val(n),null!==this.chosenXhr.done&&this.chosenXhr.done(e)}},t.fn.CSFAjaxChosen=function(t){return this.each(function(){new e(this,t)})}}(jQuery),function(){var t,e,s=[].indexOf||function(t){for(var e=0,s=this.length;e<s;e++)if(e in this&&this[e]===t)return e;return-1},i={}.hasOwnProperty;e=function(){function t(){}return t.insertAt=function(t,e,s){return s.insertBefore(t,s.children[e].nextSibling)},t.getFlattenedOptionsAndGroups=function(t){var e,s,i,n,r,o,h,l,c;for(e=[],o=0,l=(i=Array.prototype.filter.call(t.childNodes,function(t){var e;return"OPTION"===(e=t.nodeName.toUpperCase())||"OPTGROUP"===e})).length;o<l;o++)if(s=i[o],e.push(s),"OPTGROUP"===s.nodeName.toUpperCase())for(h=0,c=(r=Array.prototype.filter.call(s.childNodes,function(t){return"OPTION"===t.nodeName.toUpperCase()})).length;h<c;h++)n=r[h],e.push(n);return e},t.isValidMultipleSelectElement=function(t){return null!=t&&"SELECT"===t.nodeName&&t.multiple},t.getChosenUIContainer=function(t){return""!==t.id?document.getElementById(t.id.replace(/-/g,"_")+"_chosen"):this.searchChosenUIContainer(t)},t.isChosenified=function(t){return null!=this.getChosenUIContainer(t)},t.forceSelection=function(t,e){var i,n,r,o;for(r=this.getFlattenedOptionsAndGroups(t),i=0;i<r.length;)o=(n=r[i]).getAttribute("value"),s.call(e,o)>=0?(n.selected=!0,n.setAttribute("selected","")):(n.selected=!1,n.removeAttribute("selected")),i++;return this.triggerEvent(t,"chosen:updated")},t.CSFChosenOrder=function(t,e,s){var i,n,r,o,h,l,c,a,u,_,d,p,f,g;if(null!=this.getDOMElement&&(t=this.getDOMElement(t)),this.isValidMultipleSelectElement(t)&&null!=(n=this.getChosenUIContainer(t))&&e instanceof Array){for(e=e.map(Function.prototype.call,String.prototype.trim),c=this.getFlattenedOptionsAndGroups(t),null!=s&&!0===s&&this.forceSelection(t,e),g=[],r=_=0,p=e.length;_<p;r=++_){for(h=e[r],a=null,o=d=0,f=c.length;d<f;o=++d)c[o].value===h&&(a=o);i=n.querySelectorAll(".search-choice"),u=this.relAttributeName,null!=(l=Array.prototype.filter.call(i,function(t){return null!=t.querySelector("a.search-choice-close["+u+'="'+a+'"]')})[0])&&(n.querySelector("ul.chosen-choices"),g.push(this.insertAt(l,r,n.querySelector("ul.chosen-choices"))))}return g}},t}(),(t=jQuery).fn.extend({CSFChosenOrder:function(t,e){return _CSFChosenOrder.CSFChosenOrder(this,t,e)}}),this._CSFChosenOrder=function(s){function n(){return n.__super__.constructor.apply(this,arguments)}return function(t,e){for(var s in e)i.call(e,s)&&(t[s]=e[s]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(n,e),n.relAttributeName="data-option-array-index",n.isjQueryObject=function(t){return"undefined"!=typeof jQuery&&null!==jQuery&&t instanceof jQuery},n.getDOMElement=function(t){return this.isjQueryObject(t)?t.get(0):t},n.searchChosenUIContainer=function(e){return null!=t(e).data("chosen")?t(e).data("chosen").container[0]:t(e).next(".chosen-container.chosen-container-multi").get(0)},n.triggerEvent=function(e,s){return t(e).trigger(s)},n}()}.call(this),function(){var t,e,s,i,n=function(t,e){return function(){return t.apply(e,arguments)}},r={}.hasOwnProperty;(i=function(){function t(){this.options_index=0,this.parsed=[]}return t.prototype.add_node=function(t){return"OPTGROUP"===t.nodeName.toUpperCase()?this.add_group(t):this.add_option(t)},t.prototype.add_group=function(t){var e,s,i,n,r,o;for(e=this.parsed.length,this.parsed.push({array_index:e,group:!0,label:t.label,title:t.title?t.title:void 0,children:0,disabled:t.disabled,classes:t.className}),o=[],s=0,i=(r=t.childNodes).length;s<i;s++)n=r[s],o.push(this.add_option(n,e,t.disabled));return o},t.prototype.add_option=function(t,e,s){if("OPTION"===t.nodeName.toUpperCase())return""!==t.text?(null!=e&&(this.parsed[e].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:t.value,text:t.text,html:t.innerHTML,title:t.title?t.title:void 0,selected:t.selected,disabled:!0===s?s:t.disabled,group_array_index:e,group_label:null!=e?this.parsed[e].label:null,classes:t.className,style:t.style.cssText})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1},t}()).select_to_array=function(t){var e,s,n,r,o;for(r=new i,s=0,n=(o=t.childNodes).length;s<n;s++)e=o[s],r.add_node(e);return r.parsed},e=function(){function t(e,s){this.form_field=e,this.options=null!=s?s:{},this.label_click_handler=n(this.label_click_handler,this),t.browser_is_supported()&&(this.is_multiple=this.form_field.multiple,this.set_default_text(),this.set_default_values(),this.setup(),this.set_up_html(),this.register_observers(),this.on_ready())}return t.prototype.set_default_values=function(){var t,e;return this.click_test_action=(t=this,function(e){return t.test_active_click(e)}),this.activate_action=(e=this,function(t){return e.activate_field(t)}),this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.is_rtl=this.options.rtl||/\bchosen-rtl\b/.test(this.form_field.className),this.allow_single_deselect=null!=this.options.allow_single_deselect&&null!=this.form_field.options[0]&&""===this.form_field.options[0].text&&this.options.allow_single_deselect,this.disable_search_threshold=this.options.disable_search_threshold||0,this.disable_search=this.options.disable_search||!1,this.enable_split_word_search=null==this.options.enable_split_word_search||this.options.enable_split_word_search,this.group_search=null==this.options.group_search||this.options.group_search,this.search_contains=this.options.search_contains||!1,this.single_backstroke_delete=null==this.options.single_backstroke_delete||this.options.single_backstroke_delete,this.max_selected_options=this.options.max_selected_options||1/0,this.inherit_select_classes=this.options.inherit_select_classes||!1,this.display_selected_options=null==this.options.display_selected_options||this.options.display_selected_options,this.display_disabled_options=null==this.options.display_disabled_options||this.options.display_disabled_options,this.include_group_label_in_selected=this.options.include_group_label_in_selected||!1,this.max_shown_results=this.options.max_shown_results||Number.POSITIVE_INFINITY,this.case_sensitive_search=this.options.case_sensitive_search||!1,this.hide_results_on_select=null==this.options.hide_results_on_select||this.options.hide_results_on_select},t.prototype.set_default_text=function(){return this.form_field.getAttribute("data-placeholder")?this.default_text=this.form_field.getAttribute("data-placeholder"):this.is_multiple?this.default_text=this.options.placeholder_text_multiple||this.options.placeholder_text||t.default_multiple_text:this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||t.default_single_text,this.default_text=this.escape_html(this.default_text),this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||t.default_no_result_text},t.prototype.choice_label=function(t){return this.include_group_label_in_selected&&null!=t.group_label?"<b class='group-name'>"+this.escape_html(t.group_label)+"</b>"+t.html:t.html},t.prototype.mouse_enter=function(){return this.mouse_on_container=!0},t.prototype.mouse_leave=function(){return this.mouse_on_container=!1},t.prototype.input_focus=function(t){if(this.is_multiple){if(!this.active_field)return setTimeout((e=this,function(){return e.container_mousedown()}),50)}else if(!this.active_field)return this.activate_field();var e},t.prototype.input_blur=function(t){if(!this.mouse_on_container)return this.active_field=!1,setTimeout((e=this,function(){return e.blur_test()}),100);var e},t.prototype.label_click_handler=function(t){return this.is_multiple?this.container_mousedown(t):this.activate_field()},t.prototype.results_option_build=function(t){var e,s,i,n,r,o,h;for(e="",h=0,n=0,r=(o=this.results_data).length;n<r&&(i="",""!==(i=(s=o[n]).group?this.result_add_group(s):this.result_add_option(s))&&(h++,e+=i),(null!=t?t.first:void 0)&&(s.selected&&this.is_multiple?this.choice_build(s):s.selected&&!this.is_multiple&&this.single_set_selected_text(this.choice_label(s))),!(h>=this.max_shown_results));n++);return e},t.prototype.result_add_option=function(t){var e,s;return t.search_match&&this.include_option_in_results(t)?(e=[],t.disabled||t.selected&&this.is_multiple||e.push("active-result"),!t.disabled||t.selected&&this.is_multiple||e.push("disabled-result"),t.selected&&e.push("result-selected"),null!=t.group_array_index&&e.push("group-option"),""!==t.classes&&e.push(t.classes),(s=document.createElement("li")).className=e.join(" "),t.style&&(s.style.cssText=t.style),s.setAttribute("data-option-array-index",t.array_index),s.innerHTML=t.highlighted_html||t.html,t.title&&(s.title=t.title),this.outerHTML(s)):""},t.prototype.result_add_group=function(t){var e,s;return(t.search_match||t.group_match)&&t.active_options>0?((e=[]).push("group-result"),t.classes&&e.push(t.classes),(s=document.createElement("li")).className=e.join(" "),s.innerHTML=t.highlighted_html||this.escape_html(t.label),t.title&&(s.title=t.title),this.outerHTML(s)):""},t.prototype.results_update_field=function(){if(this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing)return this.winnow_results()},t.prototype.reset_single_select_options=function(){var t,e,s,i,n;for(n=[],t=0,e=(s=this.results_data).length;t<e;t++)(i=s[t]).selected?n.push(i.selected=!1):n.push(void 0);return n},t.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},t.prototype.results_search=function(t){return this.results_showing?this.winnow_results():this.results_show()},t.prototype.winnow_results=function(t){var e,s,i,n,r,o,h,l,c,a,u,_,d,p,f;for(this.no_results_clear(),a=0,e=(h=this.get_search_text()).replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),c=this.get_search_regex(e),i=0,n=(l=this.results_data).length;i<n;i++)(r=l[i]).search_match=!1,u=null,_=null,r.highlighted_html="",this.include_option_in_results(r)&&(r.group&&(r.group_match=!1,r.active_options=0),null!=r.group_array_index&&this.results_data[r.group_array_index]&&(0===(u=this.results_data[r.group_array_index]).active_options&&u.search_match&&(a+=1),u.active_options+=1),f=r.group?r.label:r.text,r.group&&!this.group_search||(_=this.search_string_match(f,c),r.search_match=null!=_,r.search_match&&!r.group&&(a+=1),r.search_match?(h.length&&(d=_.index,o=f.slice(0,d),s=f.slice(d,d+h.length),p=f.slice(d+h.length),r.highlighted_html=this.escape_html(o)+"<em>"+this.escape_html(s)+"</em>"+this.escape_html(p)),null!=u&&(u.group_match=!0)):null!=r.group_array_index&&this.results_data[r.group_array_index].search_match&&(r.search_match=!0)));return this.result_clear_highlight(),a<1&&h.length?(this.update_results_content(""),this.no_results(h)):(this.update_results_content(this.results_option_build()),(null!=t?t.skip_highlight:void 0)?void 0:this.winnow_results_set_highlight())},t.prototype.get_search_regex=function(t){var e,s;return s=this.search_contains?t:"(^|\\s|\\b)"+t+"[^\\s]*",this.enable_split_word_search||this.search_contains||(s="^"+s),e=this.case_sensitive_search?"":"i",new RegExp(s,e)},t.prototype.search_string_match=function(t,e){var s;return s=e.exec(t),!this.search_contains&&(null!=s?s[1]:void 0)&&(s.index+=1),s},t.prototype.choices_count=function(){var t,e,s;if(null!=this.selected_option_count)return this.selected_option_count;for(this.selected_option_count=0,t=0,e=(s=this.form_field.options).length;t<e;t++)s[t].selected&&(this.selected_option_count+=1);return this.selected_option_count},t.prototype.choices_click=function(t){if(t.preventDefault(),this.activate_field(),!this.results_showing&&!this.is_disabled)return this.results_show()},t.prototype.keydown_checker=function(t){var e,s;switch(s=null!=(e=t.which)?e:t.keyCode,this.search_field_scale(),8!==s&&this.pending_backstroke&&this.clear_backstroke(),s){case 8:this.backstroke_length=this.get_search_field_value().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(t),this.mouse_on_container=!1;break;case 13:case 27:this.results_showing&&t.preventDefault();break;case 32:this.disable_search&&t.preventDefault();break;case 38:t.preventDefault(),this.keyup_arrow();break;case 40:t.preventDefault(),this.keydown_arrow()}},t.prototype.keyup_checker=function(t){var e,s;switch(s=null!=(e=t.which)?e:t.keyCode,this.search_field_scale(),s){case 8:this.is_multiple&&this.backstroke_length<1&&this.choices_count()>0?this.keydown_backstroke():this.pending_backstroke||(this.result_clear_highlight(),this.results_search());break;case 13:t.preventDefault(),this.results_showing&&this.result_select(t);break;case 27:this.results_showing&&this.results_hide();break;case 9:case 16:case 17:case 18:case 38:case 40:case 91:break;default:this.results_search()}},t.prototype.clipboard_event_checker=function(t){var e;if(!this.is_disabled)return setTimeout((e=this,function(){return e.results_search()}),50)},t.prototype.container_width=function(){return null!=this.options.width?this.options.width:this.form_field.offsetWidth+"px"},t.prototype.include_option_in_results=function(t){return!(this.is_multiple&&!this.display_selected_options&&t.selected)&&(!(!this.display_disabled_options&&t.disabled)&&!t.empty)},t.prototype.search_results_touchstart=function(t){return this.touch_started=!0,this.search_results_mouseover(t)},t.prototype.search_results_touchmove=function(t){return this.touch_started=!1,this.search_results_mouseout(t)},t.prototype.search_results_touchend=function(t){if(this.touch_started)return this.search_results_mouseup(t)},t.prototype.outerHTML=function(t){var e;return t.outerHTML?t.outerHTML:((e=document.createElement("div")).appendChild(t),e.innerHTML)},t.prototype.get_single_html=function(){return'<a class="chosen-single chosen-default">\n <span>'+this.default_text+'</span>\n <div><b></b></div>\n</a>\n<div class="chosen-drop">\n <div class="chosen-search">\n <input class="chosen-search-input" type="text" autocomplete="off" />\n </div>\n <ul class="chosen-results"></ul>\n</div>'},t.prototype.get_multi_html=function(){return'<ul class="chosen-choices">\n <li class="search-field">\n <input class="chosen-search-input" type="text" autocomplete="off" value="'+this.default_text+'" />\n </li>\n</ul>\n<div class="chosen-drop">\n <ul class="chosen-results"></ul>\n</div>'},t.prototype.get_no_results_html=function(t){return'<li class="no-results">\n '+this.results_none_found+" <span>"+this.escape_html(t)+"</span>\n</li>"},t.browser_is_supported=function(){return"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:!(/iP(od|hone)/i.test(window.navigator.userAgent)||/IEMobile/i.test(window.navigator.userAgent)||/Windows Phone/i.test(window.navigator.userAgent)||/BlackBerry/i.test(window.navigator.userAgent)||/BB10/i.test(window.navigator.userAgent)||/Android.*Mobile/i.test(window.navigator.userAgent))},t.default_multiple_text="Select Some Options",t.default_single_text="Select an Option",t.default_no_result_text="No results match",t}(),(t=jQuery).fn.extend({chosen:function(i){return e.browser_is_supported()?this.each(function(e){var n,r;r=(n=t(this)).data("chosen"),"destroy"!==i?r instanceof s||n.data("chosen",new s(this,i)):r instanceof s&&r.destroy()}):this}}),s=function(s){function n(){return n.__super__.constructor.apply(this,arguments)}return function(t,e){for(var s in e)r.call(e,s)&&(t[s]=e[s]);function i(){this.constructor=t}i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype}(n,e),n.prototype.setup=function(){return this.form_field_jq=t(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex},n.prototype.set_up_html=function(){var e,s;return(e=["chosen-container"]).push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&e.push(this.form_field.className),this.is_rtl&&e.push("chosen-rtl"),s={class:e.join(" "),title:this.form_field.title},this.form_field.id.length&&(s.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=t("<div />",s),this.container.width(this.container_width()),this.is_multiple?this.container.html(this.get_multi_html()):this.container.html(this.get_single_html()),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.results_build(),this.set_tab_index(),this.set_label_behavior()},n.prototype.on_ready=function(){return this.form_field_jq.trigger("chosen:ready",{chosen:this})},n.prototype.register_observers=function(){var t,e,s,i,n,r,o,h,l,c,a,u,_,d,p,f,g,m,v,y,b,w,x,k;return this.container.on("touchstart.chosen",(t=this,function(e){t.container_mousedown(e)})),this.container.on("touchend.chosen",(e=this,function(t){e.container_mouseup(t)})),this.container.on("mousedown.chosen",(s=this,function(t){s.container_mousedown(t)})),this.container.on("mouseup.chosen",(i=this,function(t){i.container_mouseup(t)})),this.container.on("mouseenter.chosen",(n=this,function(t){n.mouse_enter(t)})),this.container.on("mouseleave.chosen",(r=this,function(t){r.mouse_leave(t)})),this.search_results.on("mouseup.chosen",(o=this,function(t){o.search_results_mouseup(t)})),this.search_results.on("mouseover.chosen",(h=this,function(t){h.search_results_mouseover(t)})),this.search_results.on("mouseout.chosen",(l=this,function(t){l.search_results_mouseout(t)})),this.search_results.on("mousewheel.chosen DOMMouseScroll.chosen",(c=this,function(t){c.search_results_mousewheel(t)})),this.search_results.on("touchstart.chosen",(a=this,function(t){a.search_results_touchstart(t)})),this.search_results.on("touchmove.chosen",(u=this,function(t){u.search_results_touchmove(t)})),this.search_results.on("touchend.chosen",(_=this,function(t){_.search_results_touchend(t)})),this.form_field_jq.on("chosen:updated.chosen",(d=this,function(t){d.results_update_field(t)})),this.form_field_jq.on("chosen:activate.chosen",(p=this,function(t){p.activate_field(t)})),this.form_field_jq.on("chosen:open.chosen",(f=this,function(t){f.container_mousedown(t)})),this.form_field_jq.on("chosen:close.chosen",(g=this,function(t){g.close_field(t)})),this.search_field.on("blur.chosen",(m=this,function(t){m.input_blur(t)})),this.search_field.on("keyup.chosen",(v=this,function(t){v.keyup_checker(t)})),this.search_field.on("keydown.chosen",(y=this,function(t){y.keydown_checker(t)})),this.search_field.on("focus.chosen",(b=this,function(t){b.input_focus(t)})),this.search_field.on("cut.chosen",(w=this,function(t){w.clipboard_event_checker(t)})),this.search_field.on("paste.chosen",(x=this,function(t){x.clipboard_event_checker(t)})),this.is_multiple?this.search_choices.on("click.chosen",(k=this,function(t){k.choices_click(t)})):this.container.on("click.chosen",function(t){t.preventDefault()})},n.prototype.destroy=function(){return t(this.container[0].ownerDocument).off("click.chosen",this.click_test_action),this.form_field_label.length>0&&this.form_field_label.off("click.chosen"),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},n.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field.disabled||this.form_field_jq.parents("fieldset").is(":disabled"),this.container.toggleClass("chosen-disabled",this.is_disabled),this.search_field[0].disabled=this.is_disabled,this.is_multiple||this.selected_item.off("focus.chosen",this.activate_field),this.is_disabled?this.close_field():this.is_multiple?void 0:this.selected_item.on("focus.chosen",this.activate_field)},n.prototype.container_mousedown=function(e){var s;if(!this.is_disabled)return!e||"mousedown"!==(s=e.type)&&"touchstart"!==s||this.results_showing||e.preventDefault(),null!=e&&t(e.target).hasClass("search-choice-close")?void 0:(this.active_field?this.is_multiple||!e||t(e.target)[0]!==this.selected_item[0]&&!t(e.target).parents("a.chosen-single").length||(e.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),t(this.container[0].ownerDocument).on("click.chosen",this.click_test_action),this.results_show()),this.activate_field())},n.prototype.container_mouseup=function(t){if("ABBR"===t.target.nodeName&&!this.is_disabled)return this.results_reset(t)},n.prototype.search_results_mousewheel=function(t){var e;if(t.originalEvent&&(e=t.originalEvent.deltaY||-t.originalEvent.wheelDelta||t.originalEvent.detail),null!=e)return t.preventDefault(),"DOMMouseScroll"===t.type&&(e*=40),this.search_results.scrollTop(e+this.search_results.scrollTop())},n.prototype.blur_test=function(t){if(!this.active_field&&this.container.hasClass("chosen-container-active"))return this.close_field()},n.prototype.close_field=function(){return t(this.container[0].ownerDocument).off("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale(),this.search_field.blur()},n.prototype.activate_field=function(){if(!this.is_disabled)return this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},n.prototype.test_active_click=function(e){var s;return(s=t(e.target).closest(".chosen-container")).length&&this.container[0]===s[0]?this.active_field=!0:this.close_field()},n.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=i.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},n.prototype.result_do_highlight=function(t){var e,s,i,n,r;if(t.length){if(this.result_clear_highlight(),this.result_highlight=t,this.result_highlight.addClass("highlighted"),n=(i=parseInt(this.search_results.css("maxHeight"),10))+(r=this.search_results.scrollTop()),(e=(s=this.result_highlight.position().top+this.search_results.scrollTop())+this.result_highlight.outerHeight())>=n)return this.search_results.scrollTop(e-i>0?e-i:0);if(s<r)return this.search_results.scrollTop(s)}},n.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},n.prototype.results_show=function(){return this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.container.addClass("chosen-with-drop"),this.results_showing=!0,this.search_field.focus(),this.search_field.val(this.get_search_field_value()),this.winnow_results(),this.form_field_jq.trigger("chosen:showing_dropdown",{chosen:this}))},n.prototype.update_results_content=function(t){return this.search_results.html(t)},n.prototype.results_hide=function(){return this.results_showing&&(this.result_clear_highlight(),this.container.removeClass("chosen-with-drop"),this.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:this})),this.results_showing=!1},n.prototype.set_tab_index=function(t){var e;if(this.form_field.tabIndex)return e=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field[0].tabIndex=e},n.prototype.set_label_behavior=function(){if(this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=t("label[for='"+this.form_field.id+"']")),this.form_field_label.length>0)return this.form_field_label.on("click.chosen",this.label_click_handler)},n.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},n.prototype.search_results_mouseup=function(e){var s;if((s=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first()).length)return this.result_highlight=s,this.result_select(e),this.search_field.focus()},n.prototype.search_results_mouseover=function(e){var s;if(s=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first())return this.result_do_highlight(s)},n.prototype.search_results_mouseout=function(e){if(t(e.target).hasClass("active-result")||t(e.target).parents(".active-result").first())return this.result_clear_highlight()},n.prototype.choice_build=function(e){var s,i,n;return s=t("<li />",{class:"search-choice"}).html("<span>"+this.choice_label(e)+"</span>"),e.disabled?s.addClass("search-choice-disabled"):((i=t("<a />",{class:"search-choice-close","data-option-array-index":e.array_index})).on("click.chosen",(n=this,function(t){return n.choice_destroy_link_click(t)})),s.append(i)),this.search_container.before(s)},n.prototype.choice_destroy_link_click=function(e){if(e.preventDefault(),e.stopPropagation(),!this.is_disabled)return this.choice_destroy(t(e.target))},n.prototype.choice_destroy=function(t){if(this.result_deselect(t[0].getAttribute("data-option-array-index")))return this.active_field?this.search_field.focus():this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.get_search_field_value().length<1&&this.results_hide(),t.parents("li").first().remove(),this.search_field_scale()},n.prototype.results_reset=function(){if(this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup(),this.trigger_form_field_change(),this.active_field)return this.results_hide()},n.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},n.prototype.result_select=function(t){var e,s;if(this.result_highlight)return e=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?e.removeClass("active-result"):this.reset_single_select_options(),e.addClass("result-selected"),(s=this.results_data[e[0].getAttribute("data-option-array-index")]).selected=!0,this.form_field.options[s.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(s):this.single_set_selected_text(this.choice_label(s)),this.is_multiple&&(!this.hide_results_on_select||t.metaKey||t.ctrlKey)?t.metaKey||t.ctrlKey?this.winnow_results({skip_highlight:!0}):(this.search_field.val(""),this.winnow_results()):(this.results_hide(),this.show_search_field_default()),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&this.trigger_form_field_change({selected:this.form_field.options[s.options_index].value}),this.current_selectedIndex=this.form_field.selectedIndex,t.preventDefault(),this.search_field_scale())},n.prototype.single_set_selected_text=function(t){return null==t&&(t=this.default_text),t===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.selected_item.find("span").html(t)},n.prototype.result_deselect=function(t){var e;return e=this.results_data[t],!this.form_field.options[e.options_index].disabled&&(e.selected=!1,this.form_field.options[e.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.trigger_form_field_change({deselected:this.form_field.options[e.options_index].value}),this.search_field_scale(),!0)},n.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect)return this.selected_item.find("abbr").length||this.selected_item.find("span").first().after('<abbr class="search-choice-close"></abbr>'),this.selected_item.addClass("chosen-single-with-deselect")},n.prototype.get_search_field_value=function(){return this.search_field.val()},n.prototype.get_search_text=function(){return t.trim(this.get_search_field_value())},n.prototype.escape_html=function(e){return t("<div/>").text(e).html()},n.prototype.winnow_results_set_highlight=function(){var t,e;if(null!=(t=(e=this.is_multiple?[]:this.search_results.find(".result-selected.active-result")).length?e.first():this.search_results.find(".active-result").first()))return this.result_do_highlight(t)},n.prototype.no_results=function(t){var e;return e=this.get_no_results_html(t),this.search_results.append(e),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},n.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},n.prototype.keydown_arrow=function(){var t;return this.results_showing&&this.result_highlight?(t=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(t):void 0:this.results_show()},n.prototype.keyup_arrow=function(){var t;return this.results_showing||this.is_multiple?this.result_highlight?(t=this.result_highlight.prevAll("li.active-result")).length?this.result_do_highlight(t.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight()):void 0:this.results_show()},n.prototype.keydown_backstroke=function(){var t;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(t=this.search_container.siblings("li.search-choice").last()).length&&!t.hasClass("search-choice-disabled")?(this.pending_backstroke=t,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0},n.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},n.prototype.search_field_scale=function(){var e,s,i,n,r,o,h;if(this.is_multiple){for(r={position:"absolute",left:"-1000px",top:"-1000px",display:"none",whiteSpace:"pre"},s=0,i=(o=["fontSize","fontStyle","fontWeight","fontFamily","lineHeight","textTransform","letterSpacing"]).length;s<i;s++)r[n=o[s]]=this.search_field.css(n);return(e=t("<div />").css(r)).text(this.get_search_field_value()),t("body").append(e),h=e.width()+25,e.remove(),this.container.is(":visible")&&(h=Math.min(this.container.outerWidth()-10,h)),this.search_field.width(h)}},n.prototype.trigger_form_field_change=function(t){return this.form_field_jq.trigger("input",t),this.form_field_jq.trigger("change",t)},n}()}.call(this),function(t){"use strict";function e(t,e,s){this.init(t,e,s)}function s(){this.rules=[]}t.extend(e.prototype,{init:function(t,e,s){this.controller=t,this.condition=e,this.value=s,this.rules=[],this.controls=[]},evalCondition:function(e,s,i,n,r){if("=="==i)return this.checkBoolean(n)==this.checkBoolean(r);if("!="==i)return this.checkBoolean(n)!=this.checkBoolean(r);if(">="==i)return Number(r)>=Number(n);if("<="==i)return Number(r)<=Number(n);if(">"==i)return Number(r)>Number(n);if("<"==i)return Number(r)<Number(n);if("()"==i)return window[n](e,s,r);if("any"==i){if(t.isArray(r)){for(var o=r.length-1;o>=0;o--)if(-1!==t.inArray(r[o],n.split(",")))return!0}else if(-1!==t.inArray(r,n.split(",")))return!0}else if("not-any"==i)if(t.isArray(r)){for(o=r.length-1;o>=0;o--)if(-1==t.inArray(r[o],n.split(",")))return!0}else if(-1==t.inArray(r,n.split(",")))return!0;return!1},checkBoolean:function(t){switch(t){case!0:case"true":case 1:case"1":t=!0;break;case null:case!1:case"false":case 0:case"0":t=!1}return t},checkCondition:function(t){if(!this.condition)return!0;var e=t.find(this.controller),s=this.getControlValue(t,e);return void 0!==s&&(s=this.normalizeValue(e,this.value,s),this.evalCondition(t,e,this.condition,this.value,s))},normalizeValue:function(t,e,s){return"number"==typeof e?parseFloat(s):s},getControlValue:function(t,e){return e.length>1&&("radio"==e.attr("type")||"checkbox"==e.attr("type"))?e.filter(":checked").map(function(){return this.value}).get():"checkbox"==e.attr("type")||"radio"==e.attr("type")?e.is(":checked"):e.val()},createRule:function(t,s,i){var n=new e(t,s,i);return this.rules.push(n),n},include:function(t){this.controls.push(t)},applyRule:function(e,s){var i;i=void 0===s?this.checkCondition(e):s;var n=t.map(this.controls,function(t,s){return e.find(t)});i?(t(n).each(function(){t(this).removeClass("hidden")}),t(this.rules).each(function(){this.applyRule(e)})):(t(n).each(function(){t(this).addClass("hidden")}),t(this.rules).each(function(){this.applyRule(e,!1)}))}}),t.extend(s.prototype,{createRule:function(t,s,i){var n=new e(t,s,i);return this.rules.push(n),n},applyRules:function(e){t(this.rules).each(function(){this.applyRule(e)})}}),t.csf_deps={createRuleset:function(){return new s},enable:function(t,e,s){return t.on("change keyup",function(i){var n=i.target.getAttribute("data-depend-id")||i.target.getAttribute("data-sub-depend-id");-1!==s.indexOf(n)&&e.applyRules(t)}),e.applyRules(t),!0}}}(jQuery),function(t,e){if("function"==typeof define&&define.amd)define(["exports","jquery"],function(t,s){return e(t,s)});else if("undefined"!=typeof exports){var s=require("jquery");e(exports,s)}else e(t,t.jQuery||t.Zepto||t.ender||t.$)}(this,function(t,e){var s={validate:/^(?!(_nonce|_pseudo))[a-zA-Z0-9_-]*(?:\[(?:\d*|(?!(_nonce|_pseudo))[a-zA-Z0-9_-]+)\])*$/i,key:/[a-zA-Z0-9_-]+|(?=\[\])/g,named:/^[a-zA-Z0-9_-]+$/,push:/^$/,fixed:/^\d+$/};function i(t,e){var i={},n={};function r(t,e,s){return t[e]=s,t}function o(){return i}this.addPair=function(e){if(!s.validate.test(e.name))return this;var o=function(t,e){for(var i,o=t.match(s.key);void 0!==(i=o.pop());)s.push.test(i)?e=r([],(h=t.replace(/\[\]$/,""),void 0===n[h]&&(n[h]=0),n[h]++),e):s.fixed.test(i)?e=r([],i,e):s.named.test(i)&&(e=r({},i,e));var h;return e}(e.name,e.value);return i=t.extend(!0,i,o),this},this.addPairs=function(e){if(!t.isArray(e))throw new Error("formSerializer.addPairs expects an Array");for(var s=0,i=e.length;s<i;s++)this.addPair(e[s]);return this},this.serialize=o,this.serializeJSON=function(){return JSON.stringify(o())}}return i.patterns=s,i.serializeObject=function(){return new i(e,this).addPairs(this.serializeArray()).serialize()},i.serializeJSON=function(){return new i(e,this).addPairs(this.serializeArray()).serializeJSON()},void 0!==e.fn&&(e.fn.serializeObjectCSF=i.serializeObject,e.fn.serializeJSONCSF=i.serializeJSON),t.FormSerializer=i,i});
admin/settings/assets/js/csf.js ADDED
@@ -0,0 +1,3336 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ *
3
+ * -----------------------------------------------------------
4
+ *
5
+ * Codestar Framework
6
+ * A Simple and Lightweight WordPress Option Framework
7
+ *
8
+ * -----------------------------------------------------------
9
+ *
10
+ */
11
+ ;(function( $, window, document, undefined ) {
12
+ 'use strict';
13
+
14
+ //
15
+ // Constants
16
+ //
17
+ var CSF = CSF || {};
18
+
19
+ CSF.funcs = {};
20
+
21
+ CSF.vars = {
22
+ onloaded: false,
23
+ $body: $('body'),
24
+ $window: $(window),
25
+ $document: $(document),
26
+ $form_warning: null,
27
+ form_modified: false,
28
+ code_themes: [],
29
+ is_rtl: $('body').hasClass('rtl'),
30
+ };
31
+
32
+ //
33
+ // Helper Functions
34
+ //
35
+ CSF.helper = {
36
+
37
+ //
38
+ // Generate UID
39
+ //
40
+ uid: function( prefix ) {
41
+ return ( prefix || '' ) + Math.random().toString(36).substr(2, 9);
42
+ },
43
+
44
+ // Quote regular expression characters
45
+ //
46
+ preg_quote: function( str ) {
47
+ return (str+'').replace(/(\[|\-|\])/g, "\\$1");
48
+ },
49
+
50
+ //
51
+ // Reneme input names
52
+ //
53
+ name_nested_replace: function( $selector, field_id ) {
54
+
55
+ var checks = [];
56
+ var regex = new RegExp('('+ CSF.helper.preg_quote(field_id) +')\\[(\\d+)\\]', 'g');
57
+
58
+ $selector.find(':radio').each(function() {
59
+ if( this.checked || this.orginal_checked ) {
60
+ this.orginal_checked = true;
61
+ }
62
+ });
63
+
64
+ $selector.each( function( index ) {
65
+ $(this).find(':input').each(function() {
66
+ this.name = this.name.replace(regex, field_id +'['+ index +']');
67
+ if( this.orginal_checked ) {
68
+ this.checked = true;
69
+ }
70
+ });
71
+ });
72
+
73
+ },
74
+
75
+ //
76
+ // Debounce
77
+ //
78
+ debounce: function( callback, threshold, immediate ) {
79
+ var timeout;
80
+ return function() {
81
+ var context = this, args = arguments;
82
+ var later = function() {
83
+ timeout = null;
84
+ if( !immediate ) {
85
+ callback.apply(context, args);
86
+ }
87
+ };
88
+ var callNow = ( immediate && !timeout );
89
+ clearTimeout( timeout );
90
+ timeout = setTimeout( later, threshold );
91
+ if( callNow ) {
92
+ callback.apply(context, args);
93
+ }
94
+ };
95
+ },
96
+
97
+ //
98
+ // Get a cookie
99
+ //
100
+ get_cookie: function( name ) {
101
+
102
+ var e, b, cookie = document.cookie, p = name + '=';
103
+
104
+ if( ! cookie ) {
105
+ return;
106
+ }
107
+
108
+ b = cookie.indexOf( '; ' + p );
109
+
110
+ if( b === -1 ) {
111
+ b = cookie.indexOf(p);
112
+
113
+ if( b !== 0 ) {
114
+ return null;
115
+ }
116
+ } else {
117
+ b += 2;
118
+ }
119
+
120
+ e = cookie.indexOf( ';', b );
121
+
122
+ if( e === -1 ) {
123
+ e = cookie.length;
124
+ }
125
+
126
+ return decodeURIComponent( cookie.substring( b + p.length, e ) );
127
+
128
+ },
129
+
130
+ //
131
+ // Set a cookie
132
+ //
133
+ set_cookie: function( name, value, expires, path, domain, secure ) {
134
+
135
+ var d = new Date();
136
+
137
+ if( typeof( expires ) === 'object' && expires.toGMTString ) {
138
+ expires = expires.toGMTString();
139
+ } else if( parseInt( expires, 10 ) ) {
140
+ d.setTime( d.getTime() + ( parseInt( expires, 10 ) * 1000 ) );
141
+ expires = d.toGMTString();
142
+ } else {
143
+ expires = '';
144
+ }
145
+
146
+ document.cookie = name + '=' + encodeURIComponent( value ) +
147
+ ( expires ? '; expires=' + expires : '' ) +
148
+ ( path ? '; path=' + path : '' ) +
149
+ ( domain ? '; domain=' + domain : '' ) +
150
+ ( secure ? '; secure' : '' );
151
+
152
+ },
153
+
154
+ //
155
+ // Remove a cookie
156
+ //
157
+ remove_cookie: function( name, path, domain, secure ) {
158
+ CSF.helper.set_cookie( name, '', -1000, path, domain, secure );
159
+ },
160
+
161
+ };
162
+
163
+ //
164
+ // Custom clone for textarea and select clone() bug
165
+ //
166
+ $.fn.csf_clone = function() {
167
+
168
+ var base = $.fn.clone.apply(this, arguments),
169
+ clone = this.find('select').add(this.filter('select')),
170
+ cloned = base.find('select').add(base.filter('select'));
171
+
172
+ for( var i = 0; i < clone.length; ++i ) {
173
+ for( var j = 0; j < clone[i].options.length; ++j ) {
174
+
175
+ if( clone[i].options[j].selected === true ) {
176
+ cloned[i].options[j].selected = true;
177
+ }
178
+
179
+ }
180
+ }
181
+
182
+ this.find(':radio').each( function() {
183
+ this.orginal_checked = this.checked;
184
+ });
185
+
186
+ return base;
187
+
188
+ };
189
+
190
+ //
191
+ // Expand All Options
192
+ //
193
+ $.fn.csf_expand_all = function() {
194
+ return this.each( function() {
195
+ $(this).on('click', function( e ) {
196
+
197
+ e.preventDefault();
198
+ $('.csf-wrapper').toggleClass('csf-show-all');
199
+ $('.csf-section').csf_reload_script();
200
+ $(this).find('.fa').toggleClass('fa-indent').toggleClass('fa-outdent');
201
+
202
+ });
203
+ });
204
+ };
205
+
206
+ //
207
+ // Options Navigation
208
+ //
209
+ $.fn.csf_nav_options = function() {
210
+ return this.each( function() {
211
+
212
+ var $nav = $(this),
213
+ $links = $nav.find('a'),
214
+ $hidden = $nav.closest('.csf').find('.csf-section-id'),
215
+ $last_section;
216
+
217
+ $(window).on('hashchange', function() {
218
+
219
+ var hash = window.location.hash.match(new RegExp('tab=([^&]*)'));
220
+ var slug = hash ? hash[1] : $links.first().attr('href').replace('#tab=', '');
221
+ var $link = $('#csf-tab-link-'+ slug);
222
+
223
+ if( $link.length > 0 ) {
224
+
225
+ $link.closest('.csf-tab-depth-0').addClass('csf-tab-active').siblings().removeClass('csf-tab-active');
226
+ $links.removeClass('csf-section-active');
227
+ $link.addClass('csf-section-active');
228
+
229
+ if( $last_section !== undefined ) {
230
+ $last_section.hide();
231
+ }
232
+
233
+ var $section = $('#csf-section-'+slug);
234
+ $section.css({display: 'block'});
235
+ $section.csf_reload_script();
236
+
237
+ $hidden.val(slug);
238
+
239
+ $last_section = $section;
240
+
241
+ }
242
+
243
+ }).trigger('hashchange');
244
+
245
+ });
246
+ };
247
+
248
+ //
249
+ // Metabox Tabs
250
+ //
251
+ $.fn.csf_nav_metabox = function() {
252
+ return this.each( function() {
253
+
254
+ var $nav = $(this),
255
+ $links = $nav.find('a'),
256
+ unique_id = $nav.data('unique'),
257
+ post_id = $('#post_ID').val() || 'global',
258
+ $last_section,
259
+ $last_link;
260
+
261
+ $links.on('click', function( e ) {
262
+
263
+ e.preventDefault();
264
+
265
+ var $link = $(this),
266
+ section_id = $link.data('section');
267
+
268
+ if( $last_link !== undefined ) {
269
+ $last_link.removeClass('csf-section-active');
270
+ }
271
+
272
+ if( $last_section !== undefined ) {
273
+ $last_section.hide();
274
+ }
275
+
276
+ $link.addClass('csf-section-active');
277
+
278
+ var $section = $('#csf-section-'+section_id);
279
+ $section.css({display: 'block'});
280
+ $section.csf_reload_script();
281
+
282
+ CSF.helper.set_cookie('csf-last-metabox-tab-'+ post_id +'-'+ unique_id, section_id);
283
+
284
+ $last_section = $section;
285
+ $last_link = $link;
286
+
287
+ });
288
+
289
+ var get_cookie = CSF.helper.get_cookie('csf-last-metabox-tab-'+ post_id +'-'+ unique_id);
290
+
291
+ if( get_cookie ) {
292
+ $nav.find('a[data-section="'+ get_cookie +'"]').trigger('click');
293
+ } else {
294
+ $links.first('a').trigger('click');
295
+ }
296
+
297
+ });
298
+ };
299
+
300
+ //
301
+ // Metabox Page Templates Listener
302
+ //
303
+ $.fn.csf_page_templates = function() {
304
+ if( this.length ) {
305
+
306
+ $(document).on('change', '.editor-page-attributes__template select, #page_template', function() {
307
+
308
+ var maybe_value = $(this).val() || 'default';
309
+
310
+ $('.csf-page-templates').removeClass('csf-show').addClass('csf-hide');
311
+ $('.csf-page-'+maybe_value.toLowerCase().replace(/[^a-zA-Z0-9]+/g,'-')).removeClass('csf-hide').addClass('csf-show');
312
+
313
+ });
314
+
315
+ }
316
+ };
317
+
318
+ //
319
+ // Metabox Post Formats Listener
320
+ //
321
+ $.fn.csf_post_formats = function() {
322
+ if( this.length ) {
323
+
324
+ $(document).on('change', '.editor-post-format select, #formatdiv input[name="post_format"]', function() {
325
+
326
+ var maybe_value = $(this).val() || 'default';
327
+
328
+ // Fallback for classic editor version
329
+ maybe_value = ( maybe_value === '0' ) ? 'default' : maybe_value;
330
+
331
+ $('.csf-post-formats').removeClass('csf-show').addClass('csf-hide');
332
+ $('.csf-post-format-'+maybe_value).removeClass('csf-hide').addClass('csf-show');
333
+
334
+ });
335
+
336
+ }
337
+ };
338
+
339
+ //
340
+ // Search
341
+ //
342
+ $.fn.csf_search = function() {
343
+ return this.each( function() {
344
+
345
+ var $this = $(this),
346
+ $input = $this.find('input');
347
+
348
+ $input.on('change keyup', function() {
349
+
350
+ var value = $(this).val(),
351
+ $wrapper = $('.csf-wrapper'),
352
+ $section = $wrapper.find('.csf-section'),
353
+ $fields = $section.find('> .csf-field:not(.hidden)'),
354
+ $titles = $fields.find('> .csf-title, .csf-search-tags');
355
+
356
+ if( value.length > 3 ) {
357
+
358
+ $fields.addClass('csf-hidden');
359
+ $wrapper.addClass('csf-search-all');
360
+
361
+ $titles.each( function() {
362
+
363
+ var $title = $(this);
364
+
365
+ if( $title.text().match( new RegExp('.*?' + value + '.*?', 'i') ) ) {
366
+
367
+ var $field = $title.closest('.csf-field');
368
+
369
+ $field.removeClass('csf-hidden');
370
+ $field.parent().csf_reload_script();
371
+
372
+ }
373
+
374
+ });
375
+
376
+ } else {
377
+
378
+ $fields.removeClass('csf-hidden');
379
+ $wrapper.removeClass('csf-search-all');
380
+
381
+ }
382
+
383
+ });
384
+
385
+ });
386
+ };
387
+
388
+ //
389
+ // Sticky Header
390
+ //
391
+ $.fn.csf_sticky = function() {
392
+ return this.each( function() {
393
+
394
+ var $this = $(this),
395
+ $window = $(window),
396
+ $inner = $this.find('.csf-header-inner'),
397
+ padding = parseInt( $inner.css('padding-left') ) + parseInt( $inner.css('padding-right') ),
398
+ offset = 32,
399
+ scrollTop = 0,
400
+ lastTop = 0,
401
+ ticking = false,
402
+ stickyUpdate = function() {
403
+
404
+ var offsetTop = $this.offset().top,
405
+ stickyTop = Math.max(offset, offsetTop - scrollTop ),
406
+ winWidth = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
407
+
408
+ if( stickyTop <= offset && winWidth > 782 ) {
409
+ $inner.css({width: $this.outerWidth()-padding});
410
+ $this.css({height: $this.outerHeight()}).addClass( 'csf-sticky' );
411
+ } else {
412
+ $inner.removeAttr('style');
413
+ $this.removeAttr('style').removeClass( 'csf-sticky' );
414
+ }
415
+
416
+ },
417
+ requestTick = function() {
418
+
419
+ if( !ticking ) {
420
+ requestAnimationFrame( function() {
421
+ stickyUpdate();
422
+ ticking = false;
423
+ });
424
+ }
425
+
426
+ ticking = true;
427
+
428
+ },
429
+ onSticky = function() {
430
+
431
+ scrollTop = $window.scrollTop();
432
+ requestTick();
433
+
434
+ };
435
+
436
+ $window.on( 'scroll resize', onSticky);
437
+
438
+ onSticky();
439
+
440
+ });
441
+ };
442
+
443
+ //
444
+ // Dependency System
445
+ //
446
+ $.fn.csf_dependency = function() {
447
+ return this.each( function() {
448
+
449
+ var $this = $(this),
450
+ ruleset = $.csf_deps.createRuleset(),
451
+ depends = [],
452
+ is_global = false;
453
+
454
+ $this.children('[data-controller]').each( function() {
455
+
456
+ var $field = $(this),
457
+ controllers = $field.data('controller').split('|'),
458
+ conditions = $field.data('condition').split('|'),
459
+ values = $field.data('value').toString().split('|'),
460
+ rules = ruleset;
461
+
462
+ if( $field.data('depend-global') ) {
463
+ is_global = true;
464
+ }
465
+
466
+ $.each(controllers, function( index, depend_id ) {
467
+
468
+ var value = values[index] || '',
469
+ condition = conditions[index] || conditions[0];
470
+
471
+ rules = rules.createRule('[data-depend-id="'+ depend_id +'"]', condition, value);
472
+
473
+ rules.include($field);
474
+
475
+ depends.push(depend_id);
476
+
477
+ });
478
+
479
+ });
480
+
481
+ if( depends.length ) {
482
+
483
+ if( is_global ) {
484
+ $.csf_deps.enable(CSF.vars.$body, ruleset, depends);
485
+ } else {
486
+ $.csf_deps.enable($this, ruleset, depends);
487
+ }
488
+
489
+ }
490
+
491
+ });
492
+ };
493
+
494
+ //
495
+ // Field: accordion
496
+ //
497
+ $.fn.csf_field_accordion = function() {
498
+ return this.each( function() {
499
+
500
+ var $titles = $(this).find('.csf-accordion-title');
501
+
502
+ $titles.on('click', function() {
503
+
504
+ var $title = $(this),
505
+ $icon = $title.find('.csf-accordion-icon'),
506
+ $content = $title.next();
507
+
508
+ if( $icon.hasClass('fa-angle-right') ) {
509
+ $icon.removeClass('fa-angle-right').addClass('fa-angle-down');
510
+ } else {
511
+ $icon.removeClass('fa-angle-down').addClass('fa-angle-right');
512
+ }
513
+
514
+ if( !$content.data( 'opened' ) ) {
515
+
516
+ $content.csf_reload_script();
517
+ $content.data( 'opened', true );
518
+
519
+ }
520
+
521
+ $content.toggleClass('csf-accordion-open');
522
+
523
+ });
524
+
525
+ });
526
+ };
527
+
528
+ //
529
+ // Field: backup
530
+ //
531
+ $.fn.csf_field_backup = function() {
532
+ return this.each( function() {
533
+
534
+ if( window.wp.customize === undefined ) { return; }
535
+
536
+ var base = this,
537
+ $this = $(this),
538
+ $body = $('body'),
539
+ $import = $this.find('.csf-import'),
540
+ $reset = $this.find('.csf-reset');
541
+
542
+ base.notification = function( message_text ) {
543
+
544
+ if( wp.customize.notifications && wp.customize.OverlayNotification ) {
545
+
546
+ // clear if there is any saved data.
547
+ if( !wp.customize.state('saved').get() ) {
548
+ wp.customize.state('changesetStatus').set('trash');
549
+ wp.customize.each( function( setting ) { setting._dirty = false; });
550
+ wp.customize.state('saved').set(true);
551
+ }
552
+
553
+ // then show a notification overlay
554
+ wp.customize.notifications.add( new wp.customize.OverlayNotification('csf_field_backup_notification', {
555
+ type: 'info',
556
+ message: message_text,
557
+ loading: true
558
+ }));
559
+
560
+ }
561
+
562
+ };
563
+
564
+ $reset.on('click', function( e ) {
565
+
566
+ e.preventDefault();
567
+
568
+ if( CSF.vars.is_confirm ) {
569
+
570
+ base.notification( window.csf_vars.i18n.reset_notification );
571
+
572
+ window.wp.ajax.post('csf-reset', {
573
+ unique: $reset.data('unique'),
574
+ nonce: $reset.data('nonce')
575
+ })
576
+ .done( function( response ) {
577
+ window.location.reload(true);
578
+ })
579
+ .fail( function( response ) {
580
+ alert( response.error );
581
+ wp.customize.notifications.remove('csf_field_backup_notification');
582
+ });
583
+
584
+ }
585
+
586
+ });
587
+
588
+ $import.on('click', function( e ) {
589
+
590
+ e.preventDefault();
591
+
592
+ if( CSF.vars.is_confirm ) {
593
+
594
+ base.notification( window.csf_vars.i18n.import_notification );
595
+
596
+ window.wp.ajax.post( 'csf-import', {
597
+ unique: $import.data('unique'),
598
+ nonce: $import.data('nonce'),
599
+ import_data: $this.find('.csf-import-data').val()
600
+ }).done( function( response ) {
601
+ window.location.reload(true);
602
+ }).fail( function( response ) {
603
+ alert( response.error );
604
+ wp.customize.notifications.remove('csf_field_backup_notification');
605
+ });
606
+
607
+ }
608
+
609
+ });
610
+
611
+ });
612
+ };
613
+
614
+ //
615
+ // Field: background
616
+ //
617
+ $.fn.csf_field_background = function() {
618
+ return this.each( function() {
619
+ $(this).find('.csf--background-image').csf_reload_script();
620
+ });
621
+ };
622
+
623
+ //
624
+ // Field: code_editor
625
+ //
626
+ $.fn.csf_field_code_editor = function() {
627
+ return this.each( function() {
628
+
629
+ if( typeof CodeMirror !== 'function' ) { return; }
630
+
631
+ var $this = $(this),
632
+ $textarea = $this.find('textarea'),
633
+ $inited = $this.find('.CodeMirror'),
634
+ data_editor = $textarea.data('editor');
635
+
636
+ if( $inited.length ) {
637
+ $inited.remove();
638
+ }
639
+
640
+ var interval = setInterval(function () {
641
+ if( $this.is(':visible') ) {
642
+
643
+ var code_editor = CodeMirror.fromTextArea( $textarea[0], data_editor );
644
+
645
+ // load code-mirror theme css.
646
+ if( data_editor.theme !== 'default' && CSF.vars.code_themes.indexOf(data_editor.theme) === -1 ) {
647
+
648
+ var $cssLink = $('<link>');
649
+
650
+ $('#csf-codemirror-css').after( $cssLink );
651
+
652
+ $cssLink.attr({
653
+ rel: 'stylesheet',
654
+ id: 'csf-codemirror-'+ data_editor.theme +'-css',
655
+ href: data_editor.cdnURL +'/theme/'+ data_editor.theme +'.min.css',
656
+ type: 'text/css',
657
+ media: 'all'
658
+ });
659
+
660
+ CSF.vars.code_themes.push(data_editor.theme);
661
+
662
+ }
663
+
664
+ CodeMirror.modeURL = data_editor.cdnURL +'/mode/%N/%N.min.js';
665
+ CodeMirror.autoLoadMode(code_editor, data_editor.mode);
666
+
667
+ code_editor.on( 'change', function( editor, event ) {
668
+ $textarea.val( code_editor.getValue() ).trigger('change');
669
+ });
670
+
671
+ clearInterval(interval);
672
+
673
+ }
674
+ });
675
+
676
+ });
677
+ };
678
+
679
+ //
680
+ // Field: date
681
+ //
682
+ $.fn.csf_field_date = function() {
683
+ return this.each( function() {
684
+
685
+ var $this = $(this),
686
+ $inputs = $this.find('input'),
687
+ settings = $this.find('.csf-date-settings').data('settings'),
688
+ wrapper = '<div class="csf-datepicker-wrapper"></div>',
689
+ $datepicker;
690
+
691
+ var defaults = {
692
+ showAnim: '',
693
+ beforeShow: function(input, inst) {
694
+ $(inst.dpDiv).addClass('csf-datepicker-wrapper');
695
+ },
696
+ onClose: function( input, inst ) {
697
+ $(inst.dpDiv).removeClass('csf-datepicker-wrapper');
698
+ },
699
+ };
700
+
701
+ settings = $.extend({}, settings, defaults);
702
+
703
+ if( $inputs.length === 2 ) {
704
+
705
+ settings = $.extend({}, settings, {
706
+ onSelect: function( selectedDate ) {
707
+
708
+ var $this = $(this),
709
+ $from = $inputs.first(),
710
+ option = ( $inputs.first().attr('id') === $(this).attr('id') ) ? 'minDate' : 'maxDate',
711
+ date = $.datepicker.parseDate( settings.dateFormat, selectedDate );
712
+
713
+ $inputs.not(this).datepicker('option', option, date );
714
+
715
+ }
716
+ });
717
+
718
+ }
719
+
720
+ $inputs.each( function(){
721
+
722
+ var $input = $(this);
723
+
724
+ if( $input.hasClass('hasDatepicker') ) {
725
+ $input.removeAttr('id').removeClass('hasDatepicker');
726
+ }
727
+
728
+ $input.datepicker(settings);
729
+
730
+ });
731
+
732
+ });
733
+ };
734
+
735
+ //
736
+ // Field: fieldset
737
+ //
738
+ $.fn.csf_field_fieldset = function() {
739
+ return this.each( function() {
740
+ $(this).find('.csf-fieldset-content').csf_reload_script();
741
+ });
742
+ };
743
+
744
+ //
745
+ // Field: gallery
746
+ //
747
+ $.fn.csf_field_gallery = function() {
748
+ return this.each( function() {
749
+
750
+ var $this = $(this),
751
+ $edit = $this.find('.csf-edit-gallery'),
752
+ $clear = $this.find('.csf-clear-gallery'),
753
+ $list = $this.find('ul'),
754
+ $input = $this.find('input'),
755
+ $img = $this.find('img'),
756
+ wp_media_frame;
757
+
758
+ $this.on('click', '.csf-button, .csf-edit-gallery', function( e ) {
759
+
760
+ var $el = $(this),
761
+ ids = $input.val(),
762
+ what = ( $el.hasClass('csf-edit-gallery') ) ? 'edit' : 'add',
763
+ state = ( what === 'add' && !ids.length ) ? 'gallery' : 'gallery-edit';
764
+
765
+ e.preventDefault();
766
+
767
+ if( typeof window.wp === 'undefined' || ! window.wp.media || ! window.wp.media.gallery ) { return; }
768
+
769
+ // Open media with state
770
+ if( state === 'gallery' ) {
771
+
772
+ wp_media_frame = window.wp.media({
773
+ library: {
774
+ type: 'image'
775
+ },
776
+ frame: 'post',
777
+ state: 'gallery',
778
+ multiple: true
779
+ });
780
+
781
+ wp_media_frame.open();
782
+
783
+ } else {
784
+
785
+ wp_media_frame = window.wp.media.gallery.edit( '[gallery ids="'+ ids +'"]' );
786
+
787
+ if( what === 'add' ) {
788
+ wp_media_frame.setState('gallery-library');
789
+ }
790
+
791
+ }
792
+
793
+ // Media Update
794
+ wp_media_frame.on( 'update', function( selection ) {
795
+
796
+ $list.empty();
797
+
798
+ var selectedIds = selection.models.map( function( attachment ) {
799
+
800
+ var item = attachment.toJSON();
801
+ var thumb = ( item.sizes && item.sizes.thumbnail && item.sizes.thumbnail.url ) ? item.sizes.thumbnail.url : item.url;
802
+
803
+ $list.append('<li><img src="'+ thumb +'"></li>');
804
+
805
+ return item.id;
806
+
807
+ });
808
+
809
+ $input.val( selectedIds.join( ',' ) ).trigger('change');
810
+ $clear.removeClass('hidden');
811
+ $edit.removeClass('hidden');
812
+
813
+ });
814
+
815
+ });
816
+
817
+ $clear.on('click', function( e ) {
818
+ e.preventDefault();
819
+ $list.empty();
820
+ $input.val('').trigger('change');
821
+ $clear.addClass('hidden');
822
+ $edit.addClass('hidden');
823
+ });
824
+
825
+ });
826
+
827
+ };
828
+
829
+ //
830
+ // Field: group
831
+ //
832
+ $.fn.csf_field_group = function() {
833
+ return this.each( function() {
834
+
835
+ var $this = $(this),
836
+ $fieldset = $this.children('.csf-fieldset'),
837
+ $group = $fieldset.length ? $fieldset : $this,
838
+ $wrapper = $group.children('.csf-cloneable-wrapper'),
839
+ $hidden = $group.children('.csf-cloneable-hidden'),
840
+ $max = $group.children('.csf-cloneable-max'),
841
+ $min = $group.children('.csf-cloneable-min'),
842
+ field_id = $wrapper.data('field-id'),
843
+ unique_id = $wrapper.data('unique-id'),
844
+ is_number = Boolean( Number( $wrapper.data('title-number') ) ),
845
+ max = parseInt( $wrapper.data('max') ),
846
+ min = parseInt( $wrapper.data('min') );
847
+
848
+ // clear accordion arrows if multi-instance
849
+ if( $wrapper.hasClass('ui-accordion') ) {
850
+ $wrapper.find('.ui-accordion-header-icon').remove();
851
+ }
852
+
853
+ var update_title_numbers = function( $selector ) {
854
+ $selector.find('.csf-cloneable-title-number').each( function( index ) {
855
+ $(this).html( ( $(this).closest('.csf-cloneable-item').index()+1 ) + '.' );
856
+ });
857
+ };
858
+
859
+ $wrapper.accordion({
860
+ header: '> .csf-cloneable-item > .csf-cloneable-title',
861
+ collapsible : true,
862
+ active: false,
863
+ animate: false,
864
+ heightStyle: 'content',
865
+ icons: {
866
+ 'header': 'csf-cloneable-header-icon fa fa-angle-right',
867
+ 'activeHeader': 'csf-cloneable-header-icon fa fa-angle-down'
868
+ },
869
+ activate: function( event, ui ) {
870
+
871
+ var $panel = ui.newPanel;
872
+ var $header = ui.newHeader;
873
+
874
+ if( $panel.length && !$panel.data( 'opened' ) ) {
875
+
876
+ var $fields = $panel.children();
877
+ var $first = $fields.first().find(':input').first();
878
+ var $title = $header.find('.csf-cloneable-value');
879
+
880
+ $first.on('keyup', function( event ) {
881
+ $title.text($first.val());
882
+ });
883
+
884
+ $panel.csf_reload_script();
885
+ $panel.data( 'opened', true );
886
+ $panel.data( 'retry', false );
887
+
888
+ } else if( $panel.data( 'retry' ) ) {
889
+
890
+ $panel.csf_reload_script_retry();
891
+ $panel.data( 'retry', false );
892
+
893
+ }
894
+
895
+ }
896
+ });
897
+
898
+ $wrapper.sortable({
899
+ axis: 'y',
900
+ handle: '.csf-cloneable-title,.csf-cloneable-sort',
901
+ helper: 'original',
902
+ cursor: 'move',
903
+ placeholder: 'widget-placeholder',
904
+ start: function( event, ui ) {
905
+
906
+ $wrapper.accordion({ active:false });
907
+ $wrapper.sortable('refreshPositions');
908
+ ui.item.children('.csf-cloneable-content').data('retry', true);
909
+
910
+ },
911
+ update: function( event, ui ) {
912
+
913
+ CSF.helper.name_nested_replace( $wrapper.children('.csf-cloneable-item'), field_id );
914
+ $wrapper.csf_customizer_refresh();
915
+
916
+ if( is_number ) {
917
+ update_title_numbers($wrapper);
918
+ }
919
+
920
+ },
921
+ });
922
+
923
+ $group.children('.csf-cloneable-add').on('click', function( e ) {
924
+
925
+ e.preventDefault();
926
+
927
+ var count = $wrapper.children('.csf-cloneable-item').length;
928
+
929
+ $min.hide();
930
+
931
+ if( max && (count+1) > max ) {
932
+ $max.show();
933
+ return;
934
+ }
935
+
936
+ var new_field_id = unique_id + field_id + '['+ count +']';
937
+
938
+ var $cloned_item = $hidden.csf_clone(true);
939
+
940
+ $cloned_item.removeClass('csf-cloneable-hidden');
941
+
942
+ $cloned_item.find(':input[name!="_pseudo"]').each( function() {
943
+ this.name = new_field_id + this.name.replace( ( this.name.startsWith('_nonce') ? '_nonce' : unique_id ), '');
944
+ });
945
+
946
+ $cloned_item.find('.csf-data-wrapper').each( function(){
947
+ $(this).attr('data-unique-id', new_field_id );
948
+ });
949
+
950
+ $wrapper.append($cloned_item);
951
+ $wrapper.accordion('refresh');
952
+ $wrapper.accordion({active: count});
953
+ $wrapper.csf_customizer_refresh();
954
+ $wrapper.csf_customizer_listen({closest: true});
955
+
956
+ if( is_number ) {
957
+ update_title_numbers($wrapper);
958
+ }
959
+
960
+ });
961
+
962
+ var event_clone = function( e ) {
963
+
964
+ e.preventDefault();
965
+
966
+ var count = $wrapper.children('.csf-cloneable-item').length;
967
+
968
+ $min.hide();
969
+
970
+ if( max && (count+1) > max ) {
971
+ $max.show();
972
+ return;
973
+ }
974
+
975
+ var $this = $(this),
976
+ $parent = $this.parent().parent(),
977
+ $cloned_helper = $parent.children('.csf-cloneable-helper').csf_clone(true),
978
+ $cloned_title = $parent.children('.csf-cloneable-title').csf_clone(),
979
+ $cloned_content = $parent.children('.csf-cloneable-content').csf_clone(),
980
+ cloned_regex = new RegExp('('+ CSF.helper.preg_quote(field_id) +')\\[(\\d+)\\]', 'g');
981
+
982
+ $cloned_content.find('.csf-data-wrapper').each( function(){
983
+ var $this = $(this);
984
+ $this.attr('data-unique-id', $this.attr('data-unique-id').replace(cloned_regex, field_id +'['+ ($parent.index()+1) +']') );
985
+ });
986
+
987
+ var $cloned = $('<div class="csf-cloneable-item" />');
988
+
989
+ $cloned.append($cloned_helper);
990
+ $cloned.append($cloned_title);
991
+ $cloned.append($cloned_content);
992
+
993
+ $wrapper.children().eq($parent.index()).after($cloned);
994
+
995
+ CSF.helper.name_nested_replace( $wrapper.children('.csf-cloneable-item'), field_id );
996
+
997
+ $wrapper.accordion('refresh');
998
+ $wrapper.csf_customizer_refresh();
999
+ $wrapper.csf_customizer_listen({closest: true});
1000
+
1001
+ if( is_number ) {
1002
+ update_title_numbers($wrapper);
1003
+ }
1004
+
1005
+ };
1006
+
1007
+ $wrapper.children('.csf-cloneable-item').children('.csf-cloneable-helper').on('click', '.csf-cloneable-clone', event_clone);
1008
+ $group.children('.csf-cloneable-hidden').children('.csf-cloneable-helper').on('click', '.csf-cloneable-clone', event_clone);
1009
+
1010
+ var event_remove = function( e ) {
1011
+
1012
+ e.preventDefault();
1013
+
1014
+ var count = $wrapper.children('.csf-cloneable-item').length;
1015
+
1016
+ $max.hide();
1017
+ $min.hide();
1018
+
1019
+ if( min && (count-1) < min ) {
1020
+ $min.show();
1021
+ return;
1022
+ }
1023
+
1024
+ $(this).closest('.csf-cloneable-item').remove();
1025
+
1026
+ CSF.helper.name_nested_replace( $wrapper.children('.csf-cloneable-item'), field_id );
1027
+
1028
+ $wrapper.csf_customizer_refresh();
1029
+
1030
+ if( is_number ) {
1031
+ update_title_numbers($wrapper);
1032
+ }
1033
+
1034
+ };
1035
+
1036
+ $wrapper.children('.csf-cloneable-item').children('.csf-cloneable-helper').on('click', '.csf-cloneable-remove', event_remove);
1037
+ $group.children('.csf-cloneable-hidden').children('.csf-cloneable-helper').on('click', '.csf-cloneable-remove', event_remove);
1038
+
1039
+ });
1040
+ };
1041
+
1042
+ //
1043
+ // Field: icon
1044
+ //
1045
+ $.fn.csf_field_icon = function() {
1046
+ return this.each( function() {
1047
+
1048
+ var $this = $(this);
1049
+
1050
+ $this.on('click', '.csf-icon-add', function( e ) {
1051
+
1052
+ e.preventDefault();
1053
+
1054
+ var $button = $(this);
1055
+ var $modal = $('#csf-modal-icon');
1056
+
1057
+ $modal.show();
1058
+
1059
+ CSF.vars.$icon_target = $this;
1060
+
1061
+ if( !CSF.vars.icon_modal_loaded ) {
1062
+
1063
+ $modal.find('.csf-modal-loading').show();
1064
+
1065
+ window.wp.ajax.post( 'csf-get-icons', {
1066
+ nonce: $button.data('nonce')
1067
+ }).done( function( response ) {
1068
+
1069
+ $modal.find('.csf-modal-loading').hide();
1070
+
1071
+ CSF.vars.icon_modal_loaded = true;
1072
+
1073
+ var $load = $modal.find('.csf-modal-load').html( response.content );
1074
+
1075
+ $load.on('click', 'a', function( e ) {
1076
+
1077
+ e.preventDefault();
1078
+
1079
+ var icon = $(this).data('csf-icon');
1080
+
1081
+ CSF.vars.$icon_target.find('i').removeAttr('class').addClass(icon);
1082
+ CSF.vars.$icon_target.find('input').val(icon).trigger('change');
1083
+ CSF.vars.$icon_target.find('.csf-icon-preview').removeClass('hidden');
1084
+ CSF.vars.$icon_target.find('.csf-icon-remove').removeClass('hidden');
1085
+
1086
+ $modal.hide();
1087
+
1088
+ });
1089
+
1090
+ $modal.on('change keyup', '.csf-icon-search', function() {
1091
+
1092
+ var value = $(this).val(),
1093
+ $icons = $load.find('a');
1094
+
1095
+ $icons.each( function() {
1096
+
1097
+ var $elem = $(this);
1098
+
1099
+ if( $elem.data('csf-icon').search( new RegExp( value, 'i' ) ) < 0 ) {
1100
+ $elem.hide();
1101
+ } else {
1102
+ $elem.show();
1103
+ }
1104
+
1105
+ });
1106
+
1107
+ });
1108
+
1109
+ $modal.on('click', '.csf-modal-close, .csf-modal-overlay', function() {
1110
+ $modal.hide();
1111
+ });
1112
+
1113
+ }).fail( function( response ) {
1114
+ $modal.find('.csf-modal-loading').hide();
1115
+ $modal.find('.csf-modal-load').html( response.error );
1116
+ $modal.on('click', function() { $modal.hide(); });
1117
+ });
1118
+ }
1119
+
1120
+ });
1121
+
1122
+ $this.on('click', '.csf-icon-remove', function( e ) {
1123
+ e.preventDefault();
1124
+ $this.find('.csf-icon-preview').addClass('hidden');
1125
+ $this.find('input').val('').trigger('change');
1126
+ $(this).addClass('hidden');
1127
+ });
1128
+
1129
+ });
1130
+ };
1131
+
1132
+ //
1133
+ // Field: map
1134
+ //
1135
+ $.fn.csf_field_map = function() {
1136
+ return this.each( function() {
1137
+
1138
+ if( typeof L === 'undefined' ) { return; }
1139
+
1140
+ var $this = $(this),
1141
+ $map = $this.find('.csf--map-osm'),
1142
+ $search_input = $this.find('.csf--map-search input'),
1143
+ $latitude = $this.find('.csf--latitude'),
1144
+ $longitude = $this.find('.csf--longitude'),
1145
+ $zoom = $this.find('.csf--zoom'),
1146
+ map_data = $map.data( 'map' );
1147
+
1148
+ var mapInit = L.map( $map.get(0), map_data);
1149
+
1150
+ L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
1151
+ attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
1152
+ }).addTo(mapInit);
1153
+
1154
+ var mapMarker = L.marker(map_data.center,{draggable: true}).addTo(mapInit);
1155
+
1156
+ var update_latlng = function( data ) {
1157
+ $latitude.val( data.lat );
1158
+ $longitude.val( data.lng );
1159
+ $zoom.val( mapInit.getZoom() );
1160
+ };
1161
+
1162
+ mapInit.on( 'click', function ( data ) {
1163
+ mapMarker.setLatLng( data.latlng );
1164
+ update_latlng( data.latlng );
1165
+ });
1166
+
1167
+ mapInit.on( 'zoom', function () {
1168
+ update_latlng( mapMarker.getLatLng() );
1169
+ });
1170
+
1171
+ mapMarker.on( 'drag', function () {
1172
+ update_latlng( mapMarker.getLatLng() );
1173
+ });
1174
+
1175
+ if( ! $search_input.length ) {
1176
+ $search_input = $( '[data-depend-id="'+ $this.find('.csf--address-field').data( 'address-field' ) +'"]' );
1177
+ }
1178
+
1179
+ $search_input.autocomplete({
1180
+ source: function ( request, response ) {
1181
+ $.get( 'https://nominatim.openstreetmap.org/search', {
1182
+ format: 'json',
1183
+ q: request.term,
1184
+ }, function( results ) {
1185
+ if( results.length ) {
1186
+ response( results.map( function( item ) {
1187
+ return {
1188
+ value: item.display_name,
1189
+ label: item.display_name,
1190
+ lat: item.lat,
1191
+ lon: item.lon
1192
+ };
1193
+ }, 'json' ) );
1194
+ } else {
1195
+ response([{
1196
+ value: 'no-data',
1197
+ label: 'No Results.'
1198
+ }]);
1199
+ }
1200
+ });
1201
+ },
1202
+ select: function ( event, ui ) {
1203
+
1204
+ if( ui.item.value === 'no-data' ) { return false; }
1205
+
1206
+ var latLng = L.latLng( ui.item.lat, ui.item.lon );
1207
+
1208
+ mapInit.panTo( latLng );
1209
+ mapMarker.setLatLng( latLng );
1210
+ update_latlng( latLng );
1211
+
1212
+ },
1213
+ create: function (event, ui) {
1214
+ $(this).autocomplete('widget').addClass('csf-map-ui-autocomplate');
1215
+ }
1216
+ });
1217
+
1218
+ var input_update_latlng = function() {
1219
+
1220
+ var latLng = L.latLng( $latitude.val(), $longitude.val() );
1221
+
1222
+ mapInit.panTo( latLng );
1223
+ mapMarker.setLatLng( latLng );
1224
+
1225
+ };
1226
+
1227
+ $latitude.on('change', input_update_latlng );
1228
+ $longitude.on('change', input_update_latlng );
1229
+
1230
+ });
1231
+ };
1232
+
1233
+ //
1234
+ // Field: media
1235
+ //
1236
+ $.fn.csf_field_media = function() {
1237
+ return this.each( function() {
1238
+
1239
+ var $this = $(this),
1240
+ $upload_button = $this.find('.csf--button'),
1241
+ $remove_button = $this.find('.csf--remove'),
1242
+ $library = $upload_button.data('library') && $upload_button.data('library').split(',') || '',
1243
+ $auto_attributes = ( $this.hasClass('csf-assign-field-background') ) ? $this.closest('.csf-field-background').find('.csf--auto-attributes') : false,
1244
+ wp_media_frame;
1245
+
1246
+ $upload_button.on('click', function( e ) {
1247
+
1248
+ e.preventDefault();
1249
+
1250
+ if( typeof window.wp === 'undefined' || ! window.wp.media || ! window.wp.media.gallery ) {
1251
+ return;
1252
+ }
1253
+
1254
+ if( wp_media_frame ) {
1255
+ wp_media_frame.open();
1256
+ return;
1257
+ }
1258
+
1259
+ wp_media_frame = window.wp.media({
1260
+ library: {
1261
+ type: $library
1262
+ }
1263
+ });
1264
+
1265
+ wp_media_frame.on( 'select', function() {
1266
+
1267
+ var thumbnail;
1268
+ var attributes = wp_media_frame.state().get('selection').first().attributes;
1269
+ var preview_size = $upload_button.data('preview-size') || 'thumbnail';
1270
+
1271
+ if( $library.length && $library.indexOf(attributes.subtype) === -1 && $library.indexOf(attributes.type) === -1 ) {
1272
+ return;
1273
+ }
1274
+
1275
+ $this.find('.csf--id').val( attributes.id );
1276
+ $this.find('.csf--width').val( attributes.width );
1277
+ $this.find('.csf--height').val( attributes.height );
1278
+ $this.find('.csf--alt').val( attributes.alt );
1279
+ $this.find('.csf--title').val( attributes.title );
1280
+ $this.find('.csf--description').val( attributes.description );
1281
+
1282
+ if( typeof attributes.sizes !== 'undefined' && typeof attributes.sizes.thumbnail !== 'undefined' && preview_size === 'thumbnail' ) {
1283
+ thumbnail = attributes.sizes.thumbnail.url;
1284
+ } else if( typeof attributes.sizes !== 'undefined' && typeof attributes.sizes.full !== 'undefined' ) {
1285
+ thumbnail = attributes.sizes.full.url;
1286
+ } else {
1287
+ thumbnail = attributes.icon;
1288
+ }
1289
+
1290
+ if( $auto_attributes ) {
1291
+ $auto_attributes.removeClass('csf--attributes-hidden');
1292
+ }
1293
+
1294
+ $remove_button.removeClass('hidden');
1295
+
1296
+ $this.find('.csf--preview').removeClass('hidden');
1297
+ $this.find('.csf--src').attr('src', thumbnail);
1298
+ $this.find('.csf--thumbnail').val( thumbnail );
1299
+ $this.find('.csf--url').val( attributes.url ).trigger('change');
1300
+
1301
+ });
1302
+
1303
+ wp_media_frame.open();
1304
+
1305
+ });
1306
+
1307
+ $remove_button.on('click', function( e ) {
1308
+
1309
+ e.preventDefault();
1310
+
1311
+ if( $auto_attributes ) {
1312
+ $auto_attributes.addClass('csf--attributes-hidden');
1313
+ }
1314
+
1315
+ $remove_button.addClass('hidden');
1316
+ $this.find('input').val('');
1317
+ $this.find('.csf--preview').addClass('hidden');
1318
+ $this.find('.csf--url').trigger('change');
1319
+
1320
+ });
1321
+
1322
+ });
1323
+
1324
+ };
1325
+
1326
+ //
1327
+ // Field: repeater
1328
+ //
1329
+ $.fn.csf_field_repeater = function() {
1330
+ return this.each( function() {
1331
+
1332
+ var $this = $(this),
1333
+ $fieldset = $this.children('.csf-fieldset'),
1334
+ $repeater = $fieldset.length ? $fieldset : $this,
1335
+ $wrapper = $repeater.children('.csf-repeater-wrapper'),
1336
+ $hidden = $repeater.children('.csf-repeater-hidden'),
1337
+ $max = $repeater.children('.csf-repeater-max'),
1338
+ $min = $repeater.children('.csf-repeater-min'),
1339
+ field_id = $wrapper.data('field-id'),
1340
+ unique_id = $wrapper.data('unique-id'),
1341
+ max = parseInt( $wrapper.data('max') ),
1342
+ min = parseInt( $wrapper.data('min') );
1343
+
1344
+
1345
+ $wrapper.children('.csf-repeater-item').children('.csf-repeater-content').csf_reload_script();
1346
+
1347
+ $wrapper.sortable({
1348
+ axis: 'y',
1349
+ handle: '.csf-repeater-sort',
1350
+ helper: 'original',
1351
+ cursor: 'move',
1352
+ placeholder: 'widget-placeholder',
1353
+ update: function( event, ui ) {
1354
+
1355
+ CSF.helper.name_nested_replace( $wrapper.children('.csf-repeater-item'), field_id );
1356
+ $wrapper.csf_customizer_refresh();
1357
+ ui.item.csf_reload_script_retry();
1358
+
1359
+ }
1360
+ });
1361
+
1362
+ $repeater.children('.csf-repeater-add').on('click', function( e ) {
1363
+
1364
+ e.preventDefault();
1365
+
1366
+ var count = $wrapper.children('.csf-repeater-item').length;
1367
+
1368
+ $min.hide();
1369
+
1370
+ if( max && (count+1) > max ) {
1371
+ $max.show();
1372
+ return;
1373
+ }
1374
+
1375
+ var new_field_id = unique_id + field_id + '['+ count +']';
1376
+
1377
+ var $cloned_item = $hidden.csf_clone(true);
1378
+
1379
+ $cloned_item.removeClass('csf-repeater-hidden');
1380
+
1381
+ $cloned_item.find(':input[name!="_pseudo"]').each( function() {
1382
+ this.name = new_field_id + this.name.replace( ( this.name.startsWith('_nonce') ? '_nonce' : unique_id ), '');
1383
+ });
1384
+
1385
+ $cloned_item.find('.csf-data-wrapper').each( function(){
1386
+ $(this).attr('data-unique-id', new_field_id );
1387
+ });
1388
+
1389
+ $wrapper.append($cloned_item);
1390
+ $cloned_item.children('.csf-repeater-content').csf_reload_script();
1391
+ $wrapper.csf_customizer_refresh();
1392
+ $wrapper.csf_customizer_listen({closest: true});
1393
+
1394
+ });
1395
+
1396
+ var event_clone = function( e ) {
1397
+
1398
+ e.preventDefault();
1399
+
1400
+ var count = $wrapper.children('.csf-repeater-item').length;
1401
+
1402
+ $min.hide();
1403
+
1404
+ if( max && (count+1) > max ) {
1405
+ $max.show();
1406
+ return;
1407
+ }
1408
+
1409
+ var $this = $(this),
1410
+ $parent = $this.parent().parent().parent(),
1411
+ $cloned_content = $parent.children('.csf-repeater-content').csf_clone(),
1412
+ $cloned_helper = $parent.children('.csf-repeater-helper').csf_clone(true),
1413
+ cloned_regex = new RegExp('('+ CSF.helper.preg_quote(field_id) +')\\[(\\d+)\\]', 'g');
1414
+
1415
+ $cloned_content.find('.csf-data-wrapper').each( function(){
1416
+ var $this = $(this);
1417
+ $this.attr('data-unique-id', $this.attr('data-unique-id').replace(cloned_regex, field_id +'['+ ($parent.index()+1) +']') );
1418
+ });
1419
+
1420
+ var $cloned = $('<div class="csf-repeater-item" />');
1421
+
1422
+ $cloned.append($cloned_content);
1423
+ $cloned.append($cloned_helper);
1424
+
1425
+ $wrapper.children().eq($parent.index()).after($cloned);
1426
+
1427
+ $cloned.children('.csf-repeater-content').csf_reload_script();
1428
+
1429
+ CSF.helper.name_nested_replace( $wrapper.children('.csf-repeater-item'), field_id );
1430
+
1431
+ $wrapper.csf_customizer_refresh();
1432
+ $wrapper.csf_customizer_listen({closest: true});
1433
+
1434
+ };
1435
+
1436
+ $wrapper.children('.csf-repeater-item').children('.csf-repeater-helper').on('click', '.csf-repeater-clone', event_clone);
1437
+ $repeater.children('.csf-repeater-hidden').children('.csf-repeater-helper').on('click', '.csf-repeater-clone', event_clone);
1438
+
1439
+ var event_remove = function( e ) {
1440
+
1441
+ e.preventDefault();
1442
+
1443
+ var count = $wrapper.children('.csf-repeater-item').length;
1444
+
1445
+ $max.hide();
1446
+ $min.hide();
1447
+
1448
+ if( min && (count-1) < min ) {
1449
+ $min.show();
1450
+ return;
1451
+ }
1452
+
1453
+ $(this).closest('.csf-repeater-item').remove();
1454
+
1455
+ CSF.helper.name_nested_replace( $wrapper.children('.csf-repeater-item'), field_id );
1456
+
1457
+ $wrapper.csf_customizer_refresh();
1458
+
1459
+ };
1460
+
1461
+ $wrapper.children('.csf-repeater-item').children('.csf-repeater-helper').on('click', '.csf-repeater-remove', event_remove);
1462
+ $repeater.children('.csf-repeater-hidden').children('.csf-repeater-helper').on('click', '.csf-repeater-remove', event_remove);
1463
+
1464
+ });
1465
+ };
1466
+
1467
+ //
1468
+ // Field: slider
1469
+ //
1470
+ $.fn.csf_field_slider = function() {
1471
+ return this.each( function() {
1472
+
1473
+ var $this = $(this),
1474
+ $input = $this.find('input'),
1475
+ $slider = $this.find('.csf-slider-ui'),
1476
+ data = $input.data(),
1477
+ value = $input.val() || 0;
1478
+
1479
+ if( $slider.hasClass('ui-slider') ) {
1480
+ $slider.empty();
1481
+ }
1482
+
1483
+ $slider.slider({
1484
+ range: 'min',
1485
+ value: value,
1486
+ min: data.min,
1487
+ max: data.max,
1488
+ step: data.step,
1489
+ slide: function( e, o ) {
1490
+ $input.val( o.value ).trigger('change');
1491
+ }
1492
+ });
1493
+
1494
+ $input.keyup( function() {
1495
+ $slider.slider('value', $input.val());
1496
+ });
1497
+
1498
+ });
1499
+ };
1500
+
1501
+ //
1502
+ // Field: sortable
1503
+ //
1504
+ $.fn.csf_field_sortable = function() {
1505
+ return this.each( function() {
1506
+
1507
+ var $sortable = $(this).find('.csf--sortable');
1508
+
1509
+ $sortable.sortable({
1510
+ axis: 'y',
1511
+ helper: 'original',
1512
+ cursor: 'move',
1513
+ placeholder: 'widget-placeholder',
1514
+ update: function( event, ui ) {
1515
+ $sortable.csf_customizer_refresh();
1516
+ }
1517
+ });
1518
+
1519
+ $sortable.find('.csf--sortable-content').csf_reload_script();
1520
+
1521
+ });
1522
+ };
1523
+
1524
+ //
1525
+ // Field: sorter
1526
+ //
1527
+ $.fn.csf_field_sorter = function() {
1528
+ return this.each( function() {
1529
+
1530
+ var $this = $(this),
1531
+ $enabled = $this.find('.csf-enabled'),
1532
+ $has_disabled = $this.find('.csf-disabled'),
1533
+ $disabled = ( $has_disabled.length ) ? $has_disabled : false;
1534
+
1535
+ $enabled.sortable({
1536
+ connectWith: $disabled,
1537
+ placeholder: 'ui-sortable-placeholder',
1538
+ update: function( event, ui ) {
1539
+
1540
+ var $el = ui.item.find('input');
1541
+
1542
+ if( ui.item.parent().hasClass('csf-enabled') ) {
1543
+ $el.attr('name', $el.attr('name').replace('disabled', 'enabled'));
1544
+ } else {
1545
+ $el.attr('name', $el.attr('name').replace('enabled', 'disabled'));
1546
+ }
1547
+
1548
+ $this.csf_customizer_refresh();
1549
+
1550
+ }
1551
+ });
1552
+
1553
+ if( $disabled ) {
1554
+
1555
+ $disabled.sortable({
1556
+ connectWith: $enabled,
1557
+ placeholder: 'ui-sortable-placeholder',
1558
+ update: function( event, ui ) {
1559
+ $this.csf_customizer_refresh();
1560
+ }
1561
+ });
1562
+
1563
+ }
1564
+
1565
+ });
1566
+ };
1567
+
1568
+ //
1569
+ // Field: spinner
1570
+ //
1571
+ $.fn.csf_field_spinner = function() {
1572
+ return this.each( function() {
1573
+
1574
+ var $this = $(this),
1575
+ $input = $this.find('input'),
1576
+ $inited = $this.find('.ui-spinner-button'),
1577
+ $unit = $input.data('unit');
1578
+
1579
+ if( $inited.length ) {
1580
+ $inited.remove();
1581
+ }
1582
+
1583
+ $input.spinner({
1584
+ max: $input.data('max') || 100,
1585
+ min: $input.data('min') || 0,
1586
+ step: $input.data('step') || 1,
1587
+ create: function( event, ui ) {
1588
+ if( $unit.length ) {
1589
+ $this.find('.ui-spinner-up').after('<span class="ui-button-text-only csf--unit">'+ $unit +'</span>');
1590
+ }
1591
+ },
1592
+ spin: function (event, ui ) {
1593
+ $input.val(ui.value).trigger('change');
1594
+ }
1595
+ });
1596
+
1597
+ });
1598
+ };
1599
+
1600
+ //
1601
+ // Field: switcher
1602
+ //
1603
+ $.fn.csf_field_switcher = function() {
1604
+ return this.each( function() {
1605
+
1606
+ var $switcher = $(this).find('.csf--switcher');
1607
+
1608
+ $switcher.on('click', function() {
1609
+
1610
+ var value = 0;
1611
+ var $input = $switcher.find('input');
1612
+
1613
+ if( $switcher.hasClass('csf--active') ) {
1614
+ $switcher.removeClass('csf--active');
1615
+ } else {
1616
+ value = 1;
1617
+ $switcher.addClass('csf--active');
1618
+ }
1619
+
1620
+ $input.val(value).trigger('change');
1621
+
1622
+ });
1623
+
1624
+ });
1625
+ };
1626
+
1627
+ //
1628
+ // Field: tabbed
1629
+ //
1630
+ $.fn.csf_field_tabbed = function() {
1631
+ return this.each( function() {
1632
+
1633
+ var $this = $(this),
1634
+ $links = $this.find('.csf-tabbed-nav a'),
1635
+ $sections = $this.find('.csf-tabbed-section');
1636
+
1637
+ $sections.eq(0).csf_reload_script();
1638
+
1639
+ $links.on( 'click', function( e ) {
1640
+
1641
+ e.preventDefault();
1642
+
1643
+ var $link = $(this),
1644
+ index = $link.index(),
1645
+ $section = $sections.eq(index);
1646
+
1647
+ $link.addClass('csf-tabbed-active').siblings().removeClass('csf-tabbed-active');
1648
+ $section.csf_reload_script();
1649
+ $section.removeClass('hidden').siblings().addClass('hidden');
1650
+
1651
+ });
1652
+
1653
+ });
1654
+ };
1655
+
1656
+ //
1657
+ // Field: typography
1658
+ //
1659
+ $.fn.csf_field_typography = function() {
1660
+ return this.each(function () {
1661
+
1662
+ var base = this;
1663
+ var $this = $(this);
1664
+ var loaded_fonts = [];
1665
+ var webfonts = csf_typography_json.webfonts;
1666
+ var googlestyles = csf_typography_json.googlestyles;
1667
+ var defaultstyles = csf_typography_json.defaultstyles;
1668
+
1669
+ //
1670
+ //
1671
+ // Sanitize google font subset
1672
+ base.sanitize_subset = function( subset ) {
1673
+ subset = subset.replace('-ext', ' Extended');
1674
+ subset = subset.charAt(0).toUpperCase() + subset.slice(1);
1675
+ return subset;
1676
+ };
1677
+
1678
+ //
1679
+ //
1680
+ // Sanitize google font styles (weight and style)
1681
+ base.sanitize_style = function( style ) {
1682
+ return googlestyles[style] ? googlestyles[style] : style;
1683
+ };
1684
+
1685
+ //
1686
+ //
1687
+ // Load google font
1688
+ base.load_google_font = function( font_family, weight, style ) {
1689
+
1690
+ if( font_family && typeof WebFont === 'object' ) {
1691
+
1692
+ weight = weight ? weight.replace('normal', '') : '';
1693
+ style = style ? style.replace('normal', '') : '';
1694
+
1695
+ if( weight || style ) {
1696
+ font_family = font_family +':'+ weight + style;
1697
+ }
1698
+
1699
+ if( loaded_fonts.indexOf( font_family ) === -1 ) {
1700
+ WebFont.load({ google: { families: [font_family] } });
1701
+ }
1702
+
1703
+ loaded_fonts.push( font_family );
1704
+
1705
+ }
1706
+
1707
+ };
1708
+
1709
+ //
1710
+ //
1711
+ // Append select options
1712
+ base.append_select_options = function( $select, options, condition, type, is_multi ) {
1713
+
1714
+ $select.find('option').not(':first').remove();
1715
+
1716
+ var opts = '';
1717
+
1718
+ $.each( options, function( key, value ) {
1719
+
1720
+ var selected;
1721
+ var name = value;
1722
+
1723
+ // is_multi
1724
+ if( is_multi ) {
1725
+ selected = ( condition && condition.indexOf(value) !== -1 ) ? ' selected' : '';
1726
+ } else {
1727
+ selected = ( condition && condition === value ) ? ' selected' : '';
1728
+ }
1729
+
1730
+ if( type === 'subset' ) {
1731
+ name = base.sanitize_subset( value );
1732
+ } else if( type === 'style' ){
1733
+ name = base.sanitize_style( value );
1734
+ }
1735
+
1736
+ opts += '<option value="'+ value +'"'+ selected +'>'+ name +'</option>';
1737
+
1738
+ });
1739
+
1740
+ $select.append(opts).trigger('csf.change').trigger('chosen:updated');
1741
+
1742
+ };
1743
+
1744
+ base.init = function () {
1745
+
1746
+ //
1747
+ //
1748
+ // Constants
1749
+ var selected_styles = [];
1750
+ var $typography = $this.find('.csf--typography');
1751
+ var $type = $this.find('.csf--type');
1752
+ var $styles = $this.find('.csf--block-font-style');
1753
+ var unit = $typography.data('unit');
1754
+ var exclude_fonts = $typography.data('exclude') ? $typography.data('exclude').split(',') : [];
1755
+
1756
+ //
1757
+ //
1758
+ // Chosen init
1759
+ if( $this.find('.csf--chosen').length ) {
1760
+
1761
+ var $chosen_selects = $this.find('select');
1762
+
1763
+ $chosen_selects.each( function(){
1764
+
1765
+ var $chosen_select = $(this),
1766
+ $chosen_inited = $chosen_select.parent().find('.chosen-container');
1767
+
1768
+ if( $chosen_inited.length ) {
1769
+ $chosen_inited.remove();
1770
+ }
1771
+
1772
+ $chosen_select.chosen({
1773
+ allow_single_deselect: true,
1774
+ disable_search_threshold: 15,
1775
+ width: '100%'
1776
+ });
1777
+
1778
+ });
1779
+
1780
+ }
1781
+
1782
+ //
1783
+ //
1784
+ // Font family select
1785
+ var $font_family_select = $this.find('.csf--font-family');
1786
+ var first_font_family = $font_family_select.val();
1787
+
1788
+ // Clear default font family select options
1789
+ $font_family_select.find('option').not(':first-child').remove();
1790
+
1791
+ var opts = '';
1792
+
1793
+ $.each(webfonts, function( type, group ) {
1794
+
1795
+ // Check for exclude fonts
1796
+ if( exclude_fonts && exclude_fonts.indexOf(type) !== -1 ) { return; }
1797
+
1798
+ opts += '<optgroup label="' + group.label + '">';
1799
+
1800
+ $.each(group.fonts, function( key, value ) {
1801
+
1802
+ // use key if value is object
1803
+ value = ( typeof value === 'object' ) ? key : value;
1804
+ var selected = ( value === first_font_family ) ? ' selected' : '';
1805
+ opts += '<option value="'+ value +'" data-type="'+ type +'"'+ selected +'>'+ value +'</option>';
1806
+
1807
+ });
1808
+
1809
+ opts += '</optgroup>';
1810
+
1811
+ });
1812
+
1813
+ // Append google font select options
1814
+ $font_family_select.append(opts).trigger('chosen:updated');
1815
+
1816
+ //
1817
+ //
1818
+ // Font style select
1819
+ var $font_style_block = $this.find('.csf--block-font-style');
1820
+
1821
+ if( $font_style_block.length ) {
1822
+
1823
+ var $font_style_select = $this.find('.csf--font-style-select');
1824
+ var first_style_value = $font_style_select.val() ? $font_style_select.val().replace(/normal/g, '' ) : '';
1825
+
1826
+ //
1827
+ // Font Style on on change listener
1828
+ $font_style_select.on('change csf.change', function( event ) {
1829
+
1830
+ var style_value = $font_style_select.val();
1831
+
1832
+ // set a default value
1833
+ if( !style_value && selected_styles && selected_styles.indexOf('normal') === -1 ) {
1834
+ style_value = selected_styles[0];
1835
+ }
1836
+
1837
+ // set font weight, for eg. replacing 800italic to 800
1838
+ var font_normal = ( style_value && style_value !== 'italic' && style_value === 'normal' ) ? 'normal' : '';
1839
+ var font_weight = ( style_value && style_value !== 'italic' && style_value !== 'normal' ) ? style_value.replace('italic', '') : font_normal;
1840
+ var font_style = ( style_value && style_value.substr(-6) === 'italic' ) ? 'italic' : '';
1841
+
1842
+ $this.find('.csf--font-weight').val( font_weight );
1843
+ $this.find('.csf--font-style').val( font_style );
1844
+
1845
+ });
1846
+
1847
+ //
1848
+ //
1849
+ // Extra font style select
1850
+ var $extra_font_style_block = $this.find('.csf--block-extra-styles');
1851
+
1852
+ if( $extra_font_style_block.length ) {
1853
+ var $extra_font_style_select = $this.find('.csf--extra-styles');
1854
+ var first_extra_style_value = $extra_font_style_select.val();
1855
+ }
1856
+
1857
+ }
1858
+
1859
+ //
1860
+ //
1861
+ // Subsets select
1862
+ var $subset_block = $this.find('.csf--block-subset');
1863
+ if( $subset_block.length ) {
1864
+ var $subset_select = $this.find('.csf--subset');
1865
+ var first_subset_select_value = $subset_select.val();
1866
+ var subset_multi_select = $subset_select.data('multiple') || false;
1867
+ }
1868
+
1869
+ //
1870
+ //
1871
+ // Backup font family
1872
+ var $backup_font_family_block = $this.find('.csf--block-backup-font-family');
1873
+
1874
+ //
1875
+ //
1876
+ // Font Family on Change Listener
1877
+ $font_family_select.on('change csf.change', function( event ) {
1878
+
1879
+ // Hide subsets on change
1880
+ if( $subset_block.length ) {
1881
+ $subset_block.addClass('hidden');
1882
+ }
1883
+
1884
+ // Hide extra font style on change
1885
+ if( $extra_font_style_block.length ) {
1886
+ $extra_font_style_block.addClass('hidden');
1887
+ }
1888
+
1889
+ // Hide backup font family on change
1890
+ if( $backup_font_family_block.length ) {
1891
+ $backup_font_family_block.addClass('hidden');
1892
+ }
1893
+
1894
+ var $selected = $font_family_select.find(':selected');
1895
+ var value = $selected.val();
1896
+ var type = $selected.data('type');
1897
+
1898
+ if( type && value ) {
1899
+
1900
+ // Show backup fonts if font type google or custom
1901
+ if( ( type === 'google' || type === 'custom' ) && $backup_font_family_block.length ) {
1902
+ $backup_font_family_block.removeClass('hidden');
1903
+ }
1904
+
1905
+ // Appending font style select options
1906
+ if( $font_style_block.length ) {
1907
+
1908
+ // set styles for multi and normal style selectors
1909
+ var styles = defaultstyles;
1910
+
1911
+ // Custom or gogle font styles
1912
+ if( type === 'google' && webfonts[type].fonts[value][0] ) {
1913
+ styles = webfonts[type].fonts[value][0];
1914
+ } else if( type === 'custom' && webfonts[type].fonts[value] ) {
1915
+ styles = webfonts[type].fonts[value];
1916
+ }
1917
+
1918
+ selected_styles = styles;
1919
+
1920
+ // Set selected style value for avoid load errors
1921
+ var set_auto_style = ( styles.indexOf('normal') !== -1 ) ? 'normal' : styles[0];
1922
+ var set_style_value = ( first_style_value && styles.indexOf(first_style_value) !== -1 ) ? first_style_value : set_auto_style;
1923
+
1924
+ // Append style select options
1925
+ base.append_select_options( $font_style_select, styles, set_style_value, 'style' );
1926
+
1927
+ // Clear first value
1928
+ first_style_value = false;
1929
+
1930
+ // Show style select after appended
1931
+ $font_style_block.removeClass('hidden');
1932
+
1933
+ // Appending extra font style select options
1934
+ if( type === 'google' && $extra_font_style_block.length && styles.length > 1 ) {
1935
+
1936
+ // Append extra-style select options
1937
+ base.append_select_options( $extra_font_style_select, styles, first_extra_style_value, 'style', true );
1938
+
1939
+ // Clear first value
1940
+ first_extra_style_value = false;
1941
+
1942
+ // Show style select after appended
1943
+ $extra_font_style_block.removeClass('hidden');
1944
+
1945
+ }
1946
+
1947
+ }
1948
+
1949
+ // Appending google fonts subsets select options
1950
+ if( type === 'google' && $subset_block.length && webfonts[type].fonts[value][1] ) {
1951
+
1952
+ var subsets = webfonts[type].fonts[value][1];
1953
+ var set_auto_subset = ( subsets.length < 2 && subsets[0] !== 'latin' ) ? subsets[0] : '';
1954
+ var set_subset_value = ( first_subset_select_value && subsets.indexOf(first_subset_select_value) !== -1 ) ? first_subset_select_value : set_auto_subset;
1955
+
1956
+ // check for multiple subset select
1957
+ set_subset_value = ( subset_multi_select && first_subset_select_value ) ? first_subset_select_value : set_subset_value;
1958
+
1959
+ base.append_select_options( $subset_select, subsets, set_subset_value, 'subset', subset_multi_select );
1960
+
1961
+ first_subset_select_value = false;
1962
+
1963
+ $subset_block.removeClass('hidden');
1964
+
1965
+ }
1966
+
1967
+ } else {
1968
+
1969
+ // Clear Styles
1970
+ $styles.find(':input').val('');
1971
+
1972
+ // Clear subsets options if type and value empty
1973
+ if( $subset_block.length ) {
1974
+ $subset_select.find('option').not(':first-child').remove();
1975
+ $subset_select.trigger('chosen:updated');
1976
+ }
1977
+
1978
+ // Clear font styles options if type and value empty
1979
+ if( $font_style_block.length ) {
1980
+ $font_style_select.find('option').not(':first-child').remove();
1981
+ $font_style_select.trigger('chosen:updated');
1982
+ }
1983
+
1984
+ }
1985
+
1986
+ // Update font type input value
1987
+ $type.val(type);
1988
+
1989
+ }).trigger('csf.change');
1990
+
1991
+ //
1992
+ //
1993
+ // Preview
1994
+ var $preview_block = $this.find('.csf--block-preview');
1995
+
1996
+ if( $preview_block.length ) {
1997
+
1998
+ var $preview = $this.find('.csf--preview');
1999
+
2000
+ // Set preview styles on change
2001
+ $this.on('change', CSF.helper.debounce( function( event ) {
2002
+
2003
+ $preview_block.removeClass('hidden');
2004
+
2005
+ var font_family = $font_family_select.val(),
2006
+ font_weight = $this.find('.csf--font-weight').val(),
2007
+ font_style = $this.find('.csf--font-style').val(),
2008
+ font_size = $this.find('.csf--font-size').val(),
2009
+ font_variant = $this.find('.csf--font-variant').val(),
2010
+ line_height = $this.find('.csf--line-height').val(),
2011
+ text_align = $this.find('.csf--text-align').val(),
2012
+ text_transform = $this.find('.csf--text-transform').val(),
2013
+ text_decoration = $this.find('.csf--text-decoration').val(),
2014
+ text_color = $this.find('.csf--color').val(),
2015
+ word_spacing = $this.find('.csf--word-spacing').val(),
2016
+ letter_spacing = $this.find('.csf--letter-spacing').val(),
2017
+ custom_style = $this.find('.csf--custom-style').val(),
2018
+ type = $this.find('.csf--type').val();
2019
+
2020
+ if( type === 'google' ) {
2021
+ base.load_google_font(font_family, font_weight, font_style);
2022
+ }
2023
+
2024
+ var properties = {};
2025
+
2026
+ if( font_family ) { properties.fontFamily = font_family; }
2027
+ if( font_weight ) { properties.fontWeight = font_weight; }
2028
+ if( font_style ) { properties.fontStyle = font_style; }
2029
+ if( font_variant ) { properties.fontVariant = font_variant; }
2030
+ if( font_size ) { properties.fontSize = font_size + unit; }
2031
+ if( line_height ) { properties.lineHeight = line_height + unit; }
2032
+ if( letter_spacing ) { properties.letterSpacing = letter_spacing + unit; }
2033
+ if( word_spacing ) { properties.wordSpacing = word_spacing + unit; }
2034
+ if( text_align ) { properties.textAlign = text_align; }
2035
+ if( text_transform ) { properties.textTransform = text_transform; }
2036
+ if( text_decoration ) { properties.textDecoration = text_decoration; }
2037
+ if( text_color ) { properties.color = text_color; }
2038
+
2039
+ $preview.removeAttr('style');
2040
+
2041
+ // Customs style attribute
2042
+ if( custom_style ) { $preview.attr('style', custom_style); }
2043
+
2044
+ $preview.css(properties);
2045
+
2046
+ }, 100 ) );
2047
+
2048
+ // Preview black and white backgrounds trigger
2049
+ $preview_block.on('click', function() {
2050
+
2051
+ $preview.toggleClass('csf--black-background');
2052
+
2053
+ var $toggle = $preview_block.find('.csf--toggle');
2054
+
2055
+ if( $toggle.hasClass('fa-toggle-off') ) {
2056
+ $toggle.removeClass('fa-toggle-off').addClass('fa-toggle-on');
2057
+ } else {
2058
+ $toggle.removeClass('fa-toggle-on').addClass('fa-toggle-off');
2059
+ }
2060
+
2061
+ });
2062
+
2063
+ if( !$preview_block.hasClass('hidden') ) {
2064
+ $this.trigger('change');
2065
+ }
2066
+
2067
+ }
2068
+
2069
+ };
2070
+
2071
+ base.init();
2072
+
2073
+ });
2074
+ };
2075
+
2076
+ //
2077
+ // Field: upload
2078
+ //
2079
+ $.fn.csf_field_upload = function() {
2080
+ return this.each( function() {
2081
+
2082
+ var $this = $(this),
2083
+ $input = $this.find('input'),
2084
+ $upload_button = $this.find('.csf--button'),
2085
+ $remove_button = $this.find('.csf--remove'),
2086
+ $library = $upload_button.data('library') && $upload_button.data('library').split(',') || '',
2087
+ wp_media_frame;
2088
+
2089
+ $input.on('change', function( e ) {
2090
+ if( $input.val() ) {
2091
+ $remove_button.removeClass('hidden');
2092
+ } else {
2093
+ $remove_button.addClass('hidden');
2094
+ }
2095
+ });
2096
+
2097
+ $upload_button.on('click', function( e ) {
2098
+
2099
+ e.preventDefault();
2100
+
2101
+ if( typeof window.wp === 'undefined' || ! window.wp.media || ! window.wp.media.gallery ) {
2102
+ return;
2103
+ }
2104
+
2105
+ if( wp_media_frame ) {
2106
+ wp_media_frame.open();
2107
+ return;
2108
+ }
2109
+
2110
+ wp_media_frame = window.wp.media({
2111
+ library: {
2112
+ type: $library
2113
+ },
2114
+ });
2115
+
2116
+ wp_media_frame.on( 'select', function() {
2117
+
2118
+ var attributes = wp_media_frame.state().get('selection').first().attributes;
2119
+
2120
+ if( $library.length && $library.indexOf(attributes.subtype) === -1 && $library.indexOf(attributes.type) === -1 ) {
2121
+ return;
2122
+ }
2123
+
2124
+ $input.val(attributes.url).trigger('change');
2125
+
2126
+ });
2127
+
2128
+ wp_media_frame.open();
2129
+
2130
+ });
2131
+
2132
+ $remove_button.on('click', function( e ) {
2133
+ e.preventDefault();
2134
+ $input.val('').trigger('change');
2135
+ });
2136
+
2137
+ });
2138
+
2139
+ };
2140
+
2141
+ //
2142
+ // Field: wp_editor
2143
+ //
2144
+ $.fn.csf_field_wp_editor = function() {
2145
+ return this.each( function() {
2146
+
2147
+ if( typeof window.wp.editor === 'undefined' || typeof window.tinyMCEPreInit === 'undefined' || typeof window.tinyMCEPreInit.mceInit.csf_wp_editor === 'undefined' ) {
2148
+ return;
2149
+ }
2150
+
2151
+ var $this = $(this),
2152
+ $editor = $this.find('.csf-wp-editor'),
2153
+ $textarea = $this.find('textarea');
2154
+
2155
+ // If there is wp-editor remove it for avoid dupliated wp-editor conflicts.
2156
+ var $has_wp_editor = $this.find('.wp-editor-wrap').length || $this.find('.mce-container').length;
2157
+
2158
+ if( $has_wp_editor ) {
2159
+ $editor.empty();
2160
+ $editor.append($textarea);
2161
+ $textarea.css('display', '');
2162
+ }
2163
+
2164
+ // Generate a unique id
2165
+ var uid = CSF.helper.uid('csf-editor-');
2166
+
2167
+ $textarea.attr('id', uid);
2168
+
2169
+ // Get default editor settings
2170
+ var default_editor_settings = {
2171
+ tinymce: window.tinyMCEPreInit.mceInit.csf_wp_editor,
2172
+ quicktags: window.tinyMCEPreInit.qtInit.csf_wp_editor
2173
+ };
2174
+
2175
+ // Get default editor settings
2176
+ var field_editor_settings = $editor.data('editor-settings');
2177
+
2178
+ // Add on change event handle
2179
+ var editor_on_change = function( editor ) {
2180
+ editor.on('change', CSF.helper.debounce( function() {
2181
+ editor.save();
2182
+ $textarea.trigger('change');
2183
+ }, 250 ) );
2184
+ };
2185
+
2186
+ // Callback for old wp editor
2187
+ var wpEditor = wp.oldEditor ? wp.oldEditor : wp.editor;
2188
+
2189
+ if( wpEditor && wpEditor.hasOwnProperty('autop') ) {
2190
+ wp.editor.autop = wpEditor.autop;
2191
+ wp.editor.removep = wpEditor.removep;
2192
+ wp.editor.initialize = wpEditor.initialize;
2193
+ }
2194
+
2195
+ // Extend editor selector and on change event handler
2196
+ default_editor_settings.tinymce = $.extend( {}, default_editor_settings.tinymce, { selector: '#'+ uid, setup: editor_on_change } );
2197
+
2198
+ // Override editor tinymce settings
2199
+ if( field_editor_settings.tinymce === false ) {
2200
+ default_editor_settings.tinymce = false;
2201
+ $editor.addClass('csf-no-tinymce');
2202
+ }
2203
+
2204
+ // Override editor quicktags settings
2205
+ if( field_editor_settings.quicktags === false ) {
2206
+ default_editor_settings.quicktags = false;
2207
+ $editor.addClass('csf-no-quicktags');
2208
+ }
2209
+
2210
+ // Wait until :visible
2211
+ var interval = setInterval(function () {
2212
+ if( $this.is(':visible') ) {
2213
+ window.wp.editor.initialize(uid, default_editor_settings);
2214
+ clearInterval(interval);
2215
+ }
2216
+ });
2217
+
2218
+ // Add Media buttons
2219
+ if( field_editor_settings.media_buttons && window.csf_media_buttons ) {
2220
+
2221
+ var $editor_buttons = $editor.find('.wp-media-buttons');
2222
+
2223
+ if( $editor_buttons.length ) {
2224
+
2225
+ $editor_buttons.find('.csf-shortcode-button').data('editor-id', uid);
2226
+
2227
+ } else {
2228
+
2229
+ var $media_buttons = $(window.csf_media_buttons);
2230
+
2231
+ $media_buttons.find('.csf-shortcode-button').data('editor-id', uid);
2232
+
2233
+ $editor.prepend( $media_buttons );
2234
+
2235
+ }
2236
+
2237
+ }
2238
+
2239
+ });
2240
+
2241
+ };
2242
+
2243
+ //
2244
+ // Confirm
2245
+ //
2246
+ $.fn.csf_confirm = function() {
2247
+ return this.each( function() {
2248
+ $(this).on('click', function( e ) {
2249
+
2250
+ var confirm_text = $(this).data('confirm') || window.csf_vars.i18n.confirm;
2251
+ var confirm_answer = confirm( confirm_text );
2252
+ CSF.vars.is_confirm = true;
2253
+
2254
+ if( !confirm_answer ) {
2255
+ e.preventDefault();
2256
+ CSF.vars.is_confirm = false;
2257
+ return false;
2258
+ }
2259
+
2260
+ });
2261
+ });
2262
+ };
2263
+
2264
+ $.fn.serializeObject = function(){
2265
+
2266
+ var obj = {};
2267
+
2268
+ $.each( this.serializeArray(), function(i,o){
2269
+ var n = o.name,
2270
+ v = o.value;
2271
+
2272
+ obj[n] = obj[n] === undefined ? v
2273
+ : $.isArray( obj[n] ) ? obj[n].concat( v )
2274
+ : [ obj[n], v ];
2275
+ });
2276
+
2277
+ return obj;
2278
+
2279
+ };
2280
+
2281
+ //
2282
+ // Options Save
2283
+ //
2284
+ $.fn.csf_save = function() {
2285
+ return this.each( function() {
2286
+
2287
+ var $this = $(this),
2288
+ $buttons = $('.csf-save'),
2289
+ $panel = $('.csf-options'),
2290
+ flooding = false,
2291
+ timeout;
2292
+
2293
+ $this.on('click', function( e ) {
2294
+
2295
+ if( !flooding ) {
2296
+
2297
+ var $text = $this.data('save'),
2298
+ $value = $this.val();
2299
+
2300
+ $buttons.attr('value', $text);
2301
+
2302
+ if( $this.hasClass('csf-save-ajax') ) {
2303
+
2304
+ e.preventDefault();
2305
+
2306
+ $panel.addClass('csf-saving');
2307
+ $buttons.prop('disabled', true);
2308
+
2309
+ window.wp.ajax.post( 'csf_'+ $panel.data('unique') +'_ajax_save', {
2310
+ data: $('#csf-form').serializeJSONCSF()
2311
+ })
2312
+ .done( function( response ) {
2313
+
2314
+ // clear errors
2315
+ $('.csf-error').remove();
2316
+
2317
+ if( Object.keys( response.errors ).length ) {
2318
+
2319
+ var error_icon = '<i class="csf-label-error csf-error">!</i>';
2320
+
2321
+ $.each(response.errors, function( key, error_message ) {
2322
+
2323
+ var $field = $('[data-depend-id="'+ key +'"]'),
2324
+ $link = $('#csf-tab-link-'+ ($field.closest('.csf-section').index()+1)),
2325
+ $tab = $link.closest('.csf-tab-depth-0');
2326
+
2327
+ $field.closest('.csf-fieldset').append( '<p class="csf-text-error csf-error">'+ error_message +'</p>' );
2328
+
2329
+ if( !$link.find('.csf-error').length ) {
2330
+ $link.append( error_icon );
2331
+ }
2332
+
2333
+ if( !$tab.find('.csf-arrow .csf-error').length ) {
2334
+ $tab.find('.csf-arrow').append( error_icon );
2335
+ }
2336
+
2337
+ console.log(error_message);
2338
+
2339
+ });
2340
+
2341
+ }
2342
+
2343
+ $panel.removeClass('csf-saving');
2344
+ $buttons.prop('disabled', false).attr('value', $value);
2345
+ flooding = false;
2346
+
2347
+ CSF.vars.form_modified = false;
2348
+ CSF.vars.$form_warning.hide();
2349
+
2350
+ clearTimeout(timeout);
2351
+
2352
+ var $result_success = $('.csf-form-success');
2353
+ $result_success.empty().append(response.notice).fadeIn('fast', function() {
2354
+ timeout = setTimeout( function() {
2355
+ $result_success.fadeOut('fast');
2356
+ }, 1000);
2357
+ });
2358
+
2359
+ })
2360
+ .fail( function( response ) {
2361
+ alert( response.error );
2362
+ });
2363
+
2364
+ }
2365
+
2366
+ }
2367
+
2368
+ flooding = true;
2369
+
2370
+ });
2371
+
2372
+ });
2373
+ };
2374
+
2375
+ //
2376
+ // Option Framework
2377
+ //
2378
+ $.fn.csf_options = function() {
2379
+ return this.each( function() {
2380
+
2381
+ var $this = $(this),
2382
+ $content = $this.find('.csf-content'),
2383
+ $form_success = $this.find('.csf-form-success'),
2384
+ $form_warning = $this.find('.csf-form-warning'),
2385
+ $save_button = $this.find('.csf-header .csf-save');
2386
+
2387
+ CSF.vars.$form_warning = $form_warning;
2388
+
2389
+ // Shows a message white leaving theme options without saving
2390
+ if( $form_warning.length ) {
2391
+
2392
+ window.onbeforeunload = function() {
2393
+ return ( CSF.vars.form_modified ) ? true : undefined;
2394
+ };
2395
+
2396
+ $content.on('change keypress', ':input', function() {
2397
+ if( !CSF.vars.form_modified ) {
2398
+ $form_success.hide();
2399
+ $form_warning.fadeIn('fast');
2400
+ CSF.vars.form_modified = true;
2401
+ }
2402
+ });
2403
+
2404
+ }
2405
+
2406
+ if( $form_success.hasClass('csf-form-show') ) {
2407
+ setTimeout( function() {
2408
+ $form_success.fadeOut('fast');
2409
+ }, 1000);
2410
+ }
2411
+
2412
+ $(document).keydown(function (event) {
2413
+ if( ( event.ctrlKey || event.metaKey ) && event.which === 83 ) {
2414
+ $save_button.trigger('click');
2415
+ event.preventDefault();
2416
+ return false;
2417
+ }
2418
+ });
2419
+
2420
+ });
2421
+ };
2422
+
2423
+ //
2424
+ // Taxonomy Framework
2425
+ //
2426
+ $.fn.csf_taxonomy = function() {
2427
+ return this.each( function() {
2428
+
2429
+ var $this = $(this),
2430
+ $form = $this.parents('form');
2431
+
2432
+ if( $form.attr('id') === 'addtag' ) {
2433
+
2434
+ var $submit = $form.find('#submit'),
2435
+ $cloned = $this.find('.csf-field').csf_clone();
2436
+
2437
+ $submit.on( 'click', function() {
2438
+
2439
+ if( !$form.find('.form-required').hasClass('form-invalid') ) {
2440
+
2441
+ $this.data('inited', false);
2442
+
2443
+ $this.empty();
2444
+
2445
+ $this.html( $cloned );
2446
+
2447
+ $cloned = $cloned.csf_clone();
2448
+
2449
+ $this.csf_reload_script();
2450
+
2451
+ }
2452
+
2453
+ });
2454
+
2455
+ }
2456
+
2457
+ });
2458
+ };
2459
+
2460
+ //
2461
+ // Shortcode Framework
2462
+ //
2463
+ $.fn.csf_shortcode = function() {
2464
+
2465
+ var base = this;
2466
+
2467
+ base.shortcode_parse = function( serialize, key ) {
2468
+
2469
+ var shortcode = '';
2470
+
2471
+ $.each(serialize, function( shortcode_key, shortcode_values ) {
2472
+
2473
+ key = ( key ) ? key : shortcode_key;
2474
+
2475
+ shortcode += '[' + key;
2476
+
2477
+ $.each(shortcode_values, function( shortcode_tag, shortcode_value ) {
2478
+
2479
+ if( shortcode_tag === 'content' ) {
2480
+
2481
+ shortcode += ']';
2482
+ shortcode += shortcode_value;
2483
+ shortcode += '[/'+ key +'';
2484
+
2485
+ } else {
2486
+
2487
+ shortcode += base.shortcode_tags( shortcode_tag, shortcode_value );
2488
+
2489
+ }
2490
+
2491
+ });
2492
+
2493
+ shortcode += ']';
2494
+
2495
+ });
2496
+
2497
+ return shortcode;
2498
+
2499
+ };
2500
+
2501
+ base.shortcode_tags = function( shortcode_tag, shortcode_value ) {
2502
+
2503
+ var shortcode = '';
2504
+
2505
+ if( shortcode_value !== '' ) {
2506
+
2507
+ if( typeof shortcode_value === 'object' && !$.isArray( shortcode_value ) ) {
2508
+
2509
+ $.each(shortcode_value, function( sub_shortcode_tag, sub_shortcode_value ) {
2510
+
2511
+ // sanitize spesific key/value
2512
+ switch( sub_shortcode_tag ) {
2513
+
2514
+ case 'background-image':
2515
+ sub_shortcode_value = ( sub_shortcode_value.url ) ? sub_shortcode_value.url : '';
2516
+ break;
2517
+
2518
+ }
2519
+
2520
+ if( sub_shortcode_value !== '' ) {
2521
+ shortcode += ' ' + sub_shortcode_tag.replace('-', '_') + '="' + sub_shortcode_value.toString() + '"';
2522
+ }
2523
+
2524
+ });
2525
+
2526
+ } else {
2527
+
2528
+ shortcode += ' ' + shortcode_tag.replace('-', '_') + '="' + shortcode_value.toString() + '"';
2529
+
2530
+ }
2531
+
2532
+ }
2533
+
2534
+ return shortcode;
2535
+
2536
+ };
2537
+
2538
+ base.insertAtChars = function( _this, currentValue ) {
2539
+
2540
+ var obj = ( typeof _this[0].name !== 'undefined' ) ? _this[0] : _this;
2541
+
2542
+ if( obj.value.length && typeof obj.selectionStart !== 'undefined' ) {
2543
+ obj.focus();
2544
+ return obj.value.substring( 0, obj.selectionStart ) + currentValue + obj.value.substring( obj.selectionEnd, obj.value.length );
2545
+ } else {
2546
+ obj.focus();
2547
+ return currentValue;
2548
+ }
2549
+
2550
+ };
2551
+
2552
+ base.send_to_editor = function( html, editor_id ) {
2553
+
2554
+ var tinymce_editor;
2555
+
2556
+ if( typeof tinymce !== 'undefined' ) {
2557
+ tinymce_editor = tinymce.get( editor_id );
2558
+ }
2559
+
2560
+ if( tinymce_editor && !tinymce_editor.isHidden() ) {
2561
+ tinymce_editor.execCommand( 'mceInsertContent', false, html );
2562
+ } else {
2563
+ var $editor = $('#'+editor_id);
2564
+ $editor.val( base.insertAtChars( $editor, html ) ).trigger('change');
2565
+ }
2566
+
2567
+ };
2568
+
2569
+ return this.each( function() {
2570
+
2571
+ var $modal = $(this),
2572
+ $load = $modal.find('.csf-modal-load'),
2573
+ $content = $modal.find('.csf-modal-content'),
2574
+ $insert = $modal.find('.csf-modal-insert'),
2575
+ $loading = $modal.find('.csf-modal-loading'),
2576
+ $select = $modal.find('select'),
2577
+ modal_id = $modal.data('modal-id'),
2578
+ nonce = $modal.data('nonce'),
2579
+ editor_id,
2580
+ target_id,
2581
+ gutenberg_id,
2582
+ sc_key,
2583
+ sc_name,
2584
+ sc_view,
2585
+ sc_group,
2586
+ $cloned,
2587
+ $button;
2588
+
2589
+ $(document).on('click', '.csf-shortcode-button[data-modal-id="'+ modal_id +'"]', function( e ) {
2590
+
2591
+ e.preventDefault();
2592
+
2593
+ $button = $(this);
2594
+ editor_id = $button.data('editor-id') || false;
2595
+ target_id = $button.data('target-id') || false;
2596
+ gutenberg_id = $button.data('gutenberg-id') || false;
2597
+
2598
+ $modal.show();
2599
+
2600
+ // single usage trigger first shortcode
2601
+ if( $modal.hasClass('csf-shortcode-single') && sc_name === undefined ) {
2602
+ $select.trigger('change');
2603
+ }
2604
+
2605
+ });
2606
+
2607
+ $select.on( 'change', function() {
2608
+
2609
+ var $option = $(this);
2610
+ var $selected = $option.find(':selected');
2611
+
2612
+ sc_key = $option.val();
2613
+ sc_name = $selected.data('shortcode');
2614
+ sc_view = $selected.data('view') || 'normal';
2615
+ sc_group = $selected.data('group') || sc_name;
2616
+
2617
+ $load.empty();
2618
+
2619
+ if( sc_key ) {
2620
+
2621
+ $loading.show();
2622
+
2623
+ window.wp.ajax.post( 'csf-get-shortcode-'+ modal_id, {
2624
+ shortcode_key: sc_key,
2625
+ nonce: nonce
2626
+ })
2627
+ .done( function( response ) {
2628
+
2629
+ $loading.hide();
2630
+
2631
+ var $appended = $(response.content).appendTo($load);
2632
+
2633
+ $insert.parent().removeClass('hidden');
2634
+
2635
+ $cloned = $appended.find('.csf--repeat-shortcode').csf_clone();
2636
+
2637
+ $appended.csf_reload_script();
2638
+ $appended.find('.csf-fields').csf_reload_script();
2639
+
2640
+ });
2641
+
2642
+ } else {
2643
+
2644
+ $insert.parent().addClass('hidden');
2645
+
2646
+ }
2647
+
2648
+ });
2649
+
2650
+ $insert.on('click', function( e ) {
2651
+
2652
+ e.preventDefault();
2653
+
2654
+ if( $insert.prop('disabled') || $insert.attr('disabled') ) { return; }
2655
+
2656
+ var shortcode = '';
2657
+ var serialize = $modal.find('.csf-field:not(.hidden)').find(':input:not(.ignore)').serializeObjectCSF();
2658
+
2659
+ switch ( sc_view ) {
2660
+
2661
+ case 'contents':
2662
+ var contentsObj = ( sc_name ) ? serialize[sc_name] : serialize;
2663
+ $.each(contentsObj, function( sc_key, sc_value ) {
2664
+ var sc_tag = ( sc_name ) ? sc_name : sc_key;
2665
+ shortcode += '['+ sc_tag +']'+ sc_value +'[/'+ sc_tag +']';
2666
+ });
2667
+ break;
2668
+
2669
+ case 'group':
2670
+
2671
+ shortcode += '[' + sc_name;
2672
+ $.each(serialize[sc_name], function( sc_key, sc_value ) {
2673
+ shortcode += base.shortcode_tags( sc_key, sc_value );
2674
+ });
2675
+ shortcode += ']';
2676
+ shortcode += base.shortcode_parse( serialize[sc_group], sc_group );
2677
+ shortcode += '[/' + sc_name + ']';
2678
+
2679
+ break;
2680
+
2681
+ case 'repeater':
2682
+ shortcode += base.shortcode_parse( serialize[sc_group], sc_group );
2683
+ break;
2684
+
2685
+ default:
2686
+ shortcode += base.shortcode_parse( serialize );
2687
+ break;
2688
+
2689
+ }
2690
+
2691
+ shortcode = ( shortcode === '' ) ? '['+ sc_name +']' : shortcode;
2692
+
2693
+ if( gutenberg_id ) {
2694
+
2695
+ var content = window.csf_gutenberg_props.attributes.hasOwnProperty('shortcode') ? window.csf_gutenberg_props.attributes.shortcode : '';
2696
+ window.csf_gutenberg_props.setAttributes({shortcode: content + shortcode});
2697
+
2698
+ } else if( editor_id ) {
2699
+
2700
+ base.send_to_editor( shortcode, editor_id );
2701
+
2702
+ } else {
2703
+
2704
+ var $textarea = (target_id) ? $(target_id) : $button.parent().find('textarea');
2705
+ $textarea.val( base.insertAtChars( $textarea, shortcode ) ).trigger('change');
2706
+
2707
+ }
2708
+
2709
+ $modal.hide();
2710
+
2711
+ });
2712
+
2713
+ $modal.on('click', '.csf--repeat-button', function( e ) {
2714
+
2715
+ e.preventDefault();
2716
+
2717
+ var $repeatable = $modal.find('.csf--repeatable');
2718
+ var $new_clone = $cloned.csf_clone();
2719
+ var $remove_btn = $new_clone.find('.csf-repeat-remove');
2720
+
2721
+ var $appended = $new_clone.appendTo( $repeatable );
2722
+
2723
+ $new_clone.find('.csf-fields').csf_reload_script();
2724
+
2725
+ CSF.helper.name_nested_replace( $modal.find('.csf--repeat-shortcode'), sc_group );
2726
+
2727
+ $remove_btn.on('click', function() {
2728
+
2729
+ $new_clone.remove();
2730
+
2731
+ CSF.helper.name_nested_replace( $modal.find('.csf--repeat-shortcode'), sc_group );
2732
+
2733
+ });
2734
+
2735
+ });
2736
+
2737
+ $modal.on('click', '.csf-modal-close, .csf-modal-overlay', function() {
2738
+ $modal.hide();
2739
+ });
2740
+
2741
+ });
2742
+ };
2743
+
2744
+ //
2745
+ // WP Color Picker
2746
+ //
2747
+ if( typeof Color === 'function' ) {
2748
+
2749
+ Color.fn.toString = function() {
2750
+
2751
+ if( this._alpha < 1 ) {
2752
+ return this.toCSS('rgba', this._alpha).replace(/\s+/g, '');
2753
+ }
2754
+
2755
+ var hex = parseInt( this._color, 10 ).toString( 16 );
2756
+
2757
+ if( this.error ) { return ''; }
2758
+
2759
+ if( hex.length < 6 ) {
2760
+ for (var i = 6 - hex.length - 1; i >= 0; i--) {
2761
+ hex = '0' + hex;
2762
+ }
2763
+ }
2764
+
2765
+ return '#' + hex;
2766
+
2767
+ };
2768
+
2769
+ }
2770
+
2771
+ CSF.funcs.parse_color = function( color ) {
2772
+
2773
+ var value = color.replace(/\s+/g, ''),
2774
+ trans = ( value.indexOf('rgba') !== -1 ) ? parseFloat( value.replace(/^.*,(.+)\)/, '$1') * 100 ) : 100,
2775
+ rgba = ( trans < 100 ) ? true : false;
2776
+
2777
+ return { value: value, transparent: trans, rgba: rgba };
2778
+
2779
+ };
2780
+
2781
+ $.fn.csf_color = function() {
2782
+ return this.each( function() {
2783
+
2784
+ var $input = $(this),
2785
+ picker_color = CSF.funcs.parse_color( $input.val() ),
2786
+ palette_color = window.csf_vars.color_palette.length ? window.csf_vars.color_palette : true,
2787
+ $container;
2788
+
2789
+ // Destroy and Reinit
2790
+ if( $input.hasClass('wp-color-picker') ) {
2791
+ $input.closest('.wp-picker-container').after($input).remove();
2792
+ }
2793
+
2794
+ $input.wpColorPicker({
2795
+ palettes: palette_color,
2796
+ change: function( event, ui ) {
2797
+
2798
+ var ui_color_value = ui.color.toString();
2799
+
2800
+ $container.removeClass('csf--transparent-active');
2801
+ $container.find('.csf--transparent-offset').css('background-color', ui_color_value);
2802
+ $input.val(ui_color_value).trigger('change');
2803
+
2804
+ },
2805
+ create: function() {
2806
+
2807
+ $container = $input.closest('.wp-picker-container');
2808
+
2809
+ var a8cIris = $input.data('a8cIris'),
2810
+ $transparent_wrap = $('<div class="csf--transparent-wrap">' +
2811
+ '<div class="csf--transparent-slider"></div>' +
2812
+ '<div class="csf--transparent-offset"></div>' +
2813
+ '<div class="csf--transparent-text"></div>' +
2814
+ '<div class="csf--transparent-button">transparent <i class="fa fa-toggle-off"></i></div>' +
2815
+ '</div>').appendTo( $container.find('.wp-picker-holder') ),
2816
+ $transparent_slider = $transparent_wrap.find('.csf--transparent-slider'),
2817
+ $transparent_text = $transparent_wrap.find('.csf--transparent-text'),
2818
+ $transparent_offset = $transparent_wrap.find('.csf--transparent-offset'),
2819
+ $transparent_button = $transparent_wrap.find('.csf--transparent-button');
2820
+
2821
+ if( $input.val() === 'transparent' ) {
2822
+ $container.addClass('csf--transparent-active');
2823
+ }
2824
+
2825
+ $transparent_button.on('click', function() {
2826
+ if( $input.val() !== 'transparent' ) {
2827
+ $input.val('transparent').trigger('change').removeClass('iris-error');
2828
+ $container.addClass('csf--transparent-active');
2829
+ } else {
2830
+ $input.val( a8cIris._color.toString() ).trigger('change');
2831
+ $container.removeClass('csf--transparent-active');
2832
+ }
2833
+ });
2834
+
2835
+ $transparent_slider.slider({
2836
+ value: picker_color.transparent,
2837
+ step: 1,
2838
+ min: 0,
2839
+ max: 100,
2840
+ slide: function( event, ui ) {
2841
+
2842
+ var slide_value = parseFloat( ui.value / 100 );
2843
+ a8cIris._color._alpha = slide_value;
2844
+ $input.wpColorPicker( 'color', a8cIris._color.toString() );
2845
+ $transparent_text.text( ( slide_value === 1 || slide_value === 0 ? '' : slide_value ) );
2846
+
2847
+ },
2848
+ create: function() {
2849
+
2850
+ var slide_value = parseFloat( picker_color.transparent / 100 ),
2851
+ text_value = slide_value < 1 ? slide_value : '';
2852
+
2853
+ $transparent_text.text(text_value);
2854
+ $transparent_offset.css('background-color', picker_color.value);
2855
+
2856
+ $container.on('click', '.wp-picker-clear', function() {
2857
+
2858
+ a8cIris._color._alpha = 1;
2859
+ $transparent_text.text('');
2860
+ $transparent_slider.slider('option', 'value', 100);
2861
+ $container.removeClass('csf--transparent-active');
2862
+ $input.trigger('change');
2863
+
2864
+ });
2865
+
2866
+ $container.on('click', '.wp-picker-default', function() {
2867
+
2868
+ var default_color = CSF.funcs.parse_color( $input.data('default-color') ),
2869
+ default_value = parseFloat( default_color.transparent / 100 ),
2870
+ default_text = default_value < 1 ? default_value : '';
2871
+
2872
+ a8cIris._color._alpha = default_value;
2873
+ $transparent_text.text(default_text);
2874
+ $transparent_slider.slider('option', 'value', default_color.transparent);
2875
+
2876
+ });
2877
+
2878
+ }
2879
+ });
2880
+ }
2881
+ });
2882
+
2883
+ });
2884
+ };
2885
+
2886
+ //
2887
+ // ChosenJS
2888
+ //
2889
+ $.fn.csf_chosen = function() {
2890
+ return this.each( function() {
2891
+
2892
+ var $this = $(this),
2893
+ $inited = $this.parent().find('.chosen-container'),
2894
+ is_sortable = $this.hasClass('csf-chosen-sortable') || false,
2895
+ is_ajax = $this.hasClass('csf-chosen-ajax') || false,
2896
+ is_multiple = $this.attr('multiple') || false,
2897
+ set_width = is_multiple ? '100%' : 'auto',
2898
+ set_options = $.extend({
2899
+ allow_single_deselect: true,
2900
+ disable_search_threshold: 10,
2901
+ width: set_width,
2902
+ no_results_text: window.csf_vars.i18n.no_results_text,
2903
+ }, $this.data('chosen-settings'));
2904
+
2905
+ if( $inited.length ) {
2906
+ $inited.remove();
2907
+ }
2908
+
2909
+ // Chosen ajax
2910
+ if( is_ajax ) {
2911
+
2912
+ var set_ajax_options = $.extend({
2913
+ data: {
2914
+ type: 'post',
2915
+ nonce: '',
2916
+ },
2917
+ allow_single_deselect: true,
2918
+ disable_search_threshold: -1,
2919
+ width: '100%',
2920
+ min_length: 3,
2921
+ type_delay: 500,
2922
+ typing_text: window.csf_vars.i18n.typing_text,
2923
+ searching_text: window.csf_vars.i18n.searching_text,
2924
+ no_results_text: window.csf_vars.i18n.no_results_text,
2925
+ }, $this.data('chosen-settings'));
2926
+
2927
+ $this.CSFAjaxChosen(set_ajax_options);
2928
+
2929
+ } else {
2930
+
2931
+ $this.chosen(set_options);
2932
+
2933
+ }
2934
+
2935
+ // Chosen keep options order
2936
+ if( is_multiple ) {
2937
+
2938
+ var $hidden_select = $this.parent().find('.csf-hidden-select');
2939
+ var $hidden_value = $hidden_select.val() || [];
2940
+
2941
+ $this.on('change', function(obj, result) {
2942
+
2943
+ if( result && result.selected ) {
2944
+ $hidden_select.append( '<option value="'+ result.selected +'" selected="selected">'+ result.selected +'</option>' );
2945
+ } else if( result && result.deselected ) {
2946
+ $hidden_select.find('option[value="'+ result.deselected +'"]').remove();
2947
+ }
2948
+
2949
+ // Force customize refresh
2950
+ if( $hidden_select.children().length === 0 && window.wp.customize !== undefined ) {
2951
+ window.wp.customize.control( $hidden_select.data('customize-setting-link') ).setting.set('');
2952
+ }
2953
+
2954
+ $hidden_select.trigger('change');
2955
+
2956
+ });
2957
+
2958
+ // Chosen order abstract
2959
+ $this.CSFChosenOrder($hidden_value, true);
2960
+
2961
+ }
2962
+
2963
+ // Chosen sortable
2964
+ if( is_sortable ) {
2965
+
2966
+ var $chosen_container = $this.parent().find('.chosen-container');
2967
+ var $chosen_choices = $chosen_container.find('.chosen-choices');
2968
+
2969
+ $chosen_choices.bind('mousedown', function( event ) {
2970
+ if( $(event.target).is('span') ) {
2971
+ event.stopPropagation();
2972
+ }
2973
+ });
2974
+
2975
+ $chosen_choices.sortable({
2976
+ items: 'li:not(.search-field)',
2977
+ helper: 'orginal',
2978
+ cursor: 'move',
2979
+ placeholder: 'search-choice-placeholder',
2980
+ start: function(e,ui) {
2981
+ ui.placeholder.width( ui.item.innerWidth() );
2982
+ ui.placeholder.height( ui.item.innerHeight() );
2983
+ },
2984
+ update: function( e, ui ) {
2985
+
2986
+ var select_options = '';
2987
+ var chosen_object = $this.data('chosen');
2988
+ var $prev_select = $this.parent().find('.csf-hidden-select');
2989
+
2990
+ $chosen_choices.find('.search-choice-close').each( function() {
2991
+ var option_array_index = $(this).data('option-array-index');
2992
+ $.each(chosen_object.results_data, function(index, data) {
2993
+ if( data.array_index === option_array_index ){
2994
+ select_options += '<option value="'+ data.value +'" selected>'+ data.value +'</option>';
2995
+ }
2996
+ });
2997
+ });
2998
+
2999
+ $prev_select.children().remove();
3000
+ $prev_select.append(select_options);
3001
+ $prev_select.trigger('change');
3002
+
3003
+ }
3004
+ });
3005
+
3006
+ }
3007
+
3008
+ });
3009
+ };
3010
+
3011
+ //
3012
+ // Helper Checkbox Checker
3013
+ //
3014
+ $.fn.csf_checkbox = function() {
3015
+ return this.each( function() {
3016
+
3017
+ var $this = $(this),
3018
+ $input = $this.find('.csf--input'),
3019
+ $checkbox = $this.find('.csf--checkbox');
3020
+
3021
+ $checkbox.on('click', function() {
3022
+ $input.val( Number( $checkbox.prop('checked') ) ).trigger('change');
3023
+ });
3024
+
3025
+ });
3026
+ };
3027
+
3028
+ //
3029
+ // Siblings
3030
+ //
3031
+ $.fn.csf_siblings = function() {
3032
+ return this.each( function() {
3033
+
3034
+ var $this = $(this),
3035
+ $siblings = $this.find('.csf--sibling'),
3036
+ multiple = $this.data('multiple') || false;
3037
+
3038
+ $siblings.on('click', function() {
3039
+
3040
+ var $sibling = $(this);
3041
+
3042
+ if( multiple ) {
3043
+
3044
+ if( $sibling.hasClass('csf--active') ) {
3045
+ $sibling.removeClass('csf--active');
3046
+ $sibling.find('input').prop('checked', false).trigger('change');
3047
+ } else {
3048
+ $sibling.addClass('csf--active');
3049
+ $sibling.find('input').prop('checked', true).trigger('change');
3050
+ }
3051
+
3052
+ } else {
3053
+
3054
+ $this.find('input').prop('checked', false);
3055
+ $sibling.find('input').prop('checked', true).trigger('change');
3056
+ $sibling.addClass('csf--active').siblings().removeClass('csf--active');
3057
+
3058
+ }
3059
+
3060
+ });
3061
+
3062
+ });
3063
+ };
3064
+
3065
+ //
3066
+ // Help Tooltip
3067
+ //
3068
+ $.fn.csf_help = function() {
3069
+ return this.each( function() {
3070
+
3071
+ var $this = $(this),
3072
+ $tooltip,
3073
+ offset_left;
3074
+
3075
+ $this.on({
3076
+ mouseenter: function() {
3077
+
3078
+ $tooltip = $( '<div class="csf-tooltip"></div>' ).html( $this.find('.csf-help-text').html() ).appendTo('body');
3079
+ offset_left = ( CSF.vars.is_rtl ) ? ( $this.offset().left + 24 ) : ( $this.offset().left - $tooltip.outerWidth() );
3080
+
3081
+ $tooltip.css({
3082
+ top: $this.offset().top - ( ( $tooltip.outerHeight() / 2 ) - 14 ),
3083
+ left: offset_left,
3084
+ });
3085
+
3086
+ },
3087
+ mouseleave: function() {
3088
+
3089
+ if( $tooltip !== undefined ) {
3090
+ $tooltip.remove();
3091
+ }
3092
+
3093
+ }
3094
+
3095
+ });
3096
+
3097
+ });
3098
+ };
3099
+
3100
+ //
3101
+ // Customize Refresh
3102
+ //
3103
+ $.fn.csf_customizer_refresh = function() {
3104
+ return this.each( function() {
3105
+
3106
+ var $this = $(this),
3107
+ $complex = $this.closest('.csf-customize-complex');
3108
+
3109
+ if( $complex.length ) {
3110
+
3111
+ var $input = $complex.find(':input'),
3112
+ $unique = $complex.data('unique-id'),
3113
+ $option = $complex.data('option-id'),
3114
+ obj = $input.serializeObjectCSF(),
3115
+ data = ( !$.isEmptyObject(obj) ) ? obj[$unique][$option] : '',
3116
+ control = window.wp.customize.control($unique +'['+ $option +']');
3117
+
3118
+ // clear the value to force refresh.
3119
+ control.setting._value = null;
3120
+
3121
+ control.setting.set( data );
3122
+
3123
+ } else {
3124
+
3125
+ $this.find(':input').first().trigger('change');
3126
+
3127
+ }
3128
+
3129
+ $(document).trigger('csf-customizer-refresh', $this);
3130
+
3131
+ });
3132
+ };
3133
+
3134
+ //
3135
+ // Customize Listen Form Elements
3136
+ //
3137
+ $.fn.csf_customizer_listen = function( options ) {
3138
+
3139
+ var settings = $.extend({
3140
+ closest: false,
3141
+ }, options );
3142
+
3143
+ return this.each( function() {
3144
+
3145
+ if( window.wp.customize === undefined ) { return; }
3146
+
3147
+ var $this = ( settings.closest ) ? $(this).closest('.csf-customize-complex') : $(this),
3148
+ $input = $this.find(':input'),
3149
+ unique_id = $this.data('unique-id'),
3150
+ option_id = $this.data('option-id');
3151
+
3152
+ if( unique_id === undefined ) { return; }
3153
+
3154
+ $input.on('change keyup', CSF.helper.debounce( function() {
3155
+
3156
+ var obj = $this.find(':input').serializeObjectCSF();
3157
+ var val = ( !$.isEmptyObject(obj) && obj[unique_id] && obj[unique_id][option_id] ) ? obj[unique_id][option_id] : '';
3158
+
3159
+ window.wp.customize.control( unique_id +'['+ option_id +']' ).setting.set( val );
3160
+
3161
+ }, 250 ) );
3162
+
3163
+ });
3164
+ };
3165
+
3166
+ //
3167
+ // Customizer Listener for Reload JS
3168
+ //
3169
+ $(document).on('expanded', '.control-section', function() {
3170
+
3171
+ var $this = $(this);
3172
+
3173
+ if( $this.hasClass('open') && !$this.data('inited') ) {
3174
+
3175
+ var $fields = $this.find('.csf-customize-field');
3176
+ var $complex = $this.find('.csf-customize-complex');
3177
+
3178
+ if( $fields.length ) {
3179
+ $this.csf_dependency();
3180
+ $fields.csf_reload_script({dependency: false});
3181
+ $complex.csf_customizer_listen();
3182
+ }
3183
+
3184
+ $this.data('inited', true);
3185
+
3186
+ }
3187
+
3188
+ });
3189
+
3190
+ //
3191
+ // Window on resize
3192
+ //
3193
+ CSF.vars.$window.on('resize csf.resize', CSF.helper.debounce( function( event ) {
3194
+
3195
+ var window_width = navigator.userAgent.indexOf('AppleWebKit/') > -1 ? CSF.vars.$window.width() : window.innerWidth;
3196
+
3197
+ if( window_width <= 782 && !CSF.vars.onloaded ) {
3198
+ $('.csf-section').csf_reload_script();
3199
+ CSF.vars.onloaded = true;
3200
+ }
3201
+
3202
+ }, 200)).trigger('csf.resize');
3203
+
3204
+ //
3205
+ // Widgets Framework
3206
+ //
3207
+ $.fn.csf_widgets = function() {
3208
+ if( this.length ) {
3209
+
3210
+ $(document).on('widget-added widget-updated', function( event, $widget ) {
3211
+ $widget.find('.csf-fields').csf_reload_script();
3212
+ });
3213
+
3214
+ $('.widgets-sortables, .control-section-sidebar').on('sortstop', function( event, ui ) {
3215
+ ui.item.find('.csf-fields').csf_reload_script_retry();
3216
+ });
3217
+
3218
+ $(document).on('click', '.widget-top', function( event ) {
3219
+ $(this).parent().find('.csf-fields').csf_reload_script();
3220
+ });
3221
+
3222
+ }
3223
+ };
3224
+
3225
+ //
3226
+ // Retry Plugins
3227
+ //
3228
+ $.fn.csf_reload_script_retry = function() {
3229
+ return this.each( function() {
3230
+
3231
+ var $this = $(this);
3232
+
3233
+ if( $this.data('inited') ) {
3234
+ $this.children('.csf-field-wp_editor').csf_field_wp_editor();
3235
+ }
3236
+
3237
+ });
3238
+ };
3239
+
3240
+ //
3241
+ // Reload Plugins
3242
+ //
3243
+ $.fn.csf_reload_script = function( options ) {
3244
+
3245
+ var settings = $.extend({
3246
+ dependency: true,
3247
+ }, options );
3248
+
3249
+ return this.each( function() {
3250
+
3251
+ var $this = $(this);
3252
+
3253
+ // Avoid for conflicts
3254
+ if( !$this.data('inited') ) {
3255
+
3256
+ // Field plugins
3257
+ $this.children('.csf-field-accordion').csf_field_accordion();
3258
+ $this.children('.csf-field-backup').csf_field_backup();
3259
+ $this.children('.csf-field-background').csf_field_background();
3260
+ $this.children('.csf-field-code_editor').csf_field_code_editor();
3261
+ $this.children('.csf-field-date').csf_field_date();
3262
+ $this.children('.csf-field-fieldset').csf_field_fieldset();
3263
+ $this.children('.csf-field-gallery').csf_field_gallery();
3264
+ $this.children('.csf-field-group').csf_field_group();
3265
+ $this.children('.csf-field-icon').csf_field_icon();
3266
+ $this.children('.csf-field-media').csf_field_media();
3267
+ $this.children('.csf-field-map').csf_field_map();
3268
+ $this.children('.csf-field-repeater').csf_field_repeater();
3269
+ $this.children('.csf-field-slider').csf_field_slider();
3270
+ $this.children('.csf-field-sortable').csf_field_sortable();
3271
+ $this.children('.csf-field-sorter').csf_field_sorter();
3272
+ $this.children('.csf-field-spinner').csf_field_spinner();
3273
+ $this.children('.csf-field-switcher').csf_field_switcher();
3274
+ $this.children('.csf-field-tabbed').csf_field_tabbed();
3275
+ $this.children('.csf-field-typography').csf_field_typography();
3276
+ $this.children('.csf-field-upload').csf_field_upload();
3277
+ $this.children('.csf-field-wp_editor').csf_field_wp_editor();
3278
+
3279
+ // Field colors
3280
+ $this.children('.csf-field-border').find('.csf-color').csf_color();
3281
+ $this.children('.csf-field-background').find('.csf-color').csf_color();
3282
+ $this.children('.csf-field-color').find('.csf-color').csf_color();
3283
+ $this.children('.csf-field-color_group').find('.csf-color').csf_color();
3284
+ $this.children('.csf-field-link_color').find('.csf-color').csf_color();
3285
+ $this.children('.csf-field-typography').find('.csf-color').csf_color();
3286
+
3287
+ // Field chosenjs
3288
+ $this.children('.csf-field-select').find('.csf-chosen').csf_chosen();
3289
+
3290
+ // Field Checkbox
3291
+ $this.children('.csf-field-checkbox').find('.csf-checkbox').csf_checkbox();
3292
+
3293
+ // Field Siblings
3294
+ $this.children('.csf-field-button_set').find('.csf-siblings').csf_siblings();
3295
+ $this.children('.csf-field-image_select').find('.csf-siblings').csf_siblings();
3296
+ $this.children('.csf-field-palette').find('.csf-siblings').csf_siblings();
3297
+
3298
+ // Help Tooptip
3299
+ $this.children('.csf-field').find('.csf-help').csf_help();
3300
+
3301
+ if( settings.dependency ) {
3302
+ $this.csf_dependency();
3303
+ }
3304
+
3305
+ $this.data('inited', true);
3306
+
3307
+ $(document).trigger('csf-reload-script', $this);
3308
+
3309
+ }
3310
+
3311
+ });
3312
+ };
3313
+
3314
+ //
3315
+ // Document ready and run scripts
3316
+ //
3317
+ $(document).ready( function() {
3318
+
3319
+ $('.csf-save').csf_save();
3320
+ $('.csf-options').csf_options();
3321
+ $('.csf-sticky-header').csf_sticky();
3322
+ $('.csf-nav-options').csf_nav_options();
3323
+ $('.csf-nav-metabox').csf_nav_metabox();
3324
+ $('.csf-taxonomy').csf_taxonomy();
3325
+ $('.csf-page-templates').csf_page_templates();
3326
+ $('.csf-post-formats').csf_post_formats();
3327
+ $('.csf-shortcode').csf_shortcode();
3328
+ $('.csf-search').csf_search();
3329
+ $('.csf-confirm').csf_confirm();
3330
+ $('.csf-expand-all').csf_expand_all();
3331
+ $('.csf-onload').csf_reload_script();
3332
+ $('.widget').csf_widgets();
3333
+
3334
+ });
3335
+
3336
+ })( jQuery, window, document );
admin/settings/assets/js/csf.min.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /* Codestar Framework | A Simple and Lightweight WordPress Option Framework - v2.1.3.x*/
2
+
3
+ !function(e,t,n,i){"use strict";var a=a||{};a.funcs={},a.vars={onloaded:!1,$body:e("body"),$window:e(t),$document:e(n),$form_warning:null,form_modified:!1,code_themes:[],is_rtl:e("body").hasClass("rtl")},a.helper={uid:function(e){return(e||"")+Math.random().toString(36).substr(2,9)},preg_quote:function(e){return(e+"").replace(/(\[|\-|\])/g,"\\$1")},name_nested_replace:function(t,n){var i=new RegExp("("+a.helper.preg_quote(n)+")\\[(\\d+)\\]","g");t.find(":radio").each(function(){(this.checked||this.orginal_checked)&&(this.orginal_checked=!0)}),t.each(function(t){e(this).find(":input").each(function(){this.name=this.name.replace(i,n+"["+t+"]"),this.orginal_checked&&(this.checked=!0)})})},debounce:function(e,t,n){var i;return function(){var a=this,s=arguments,c=n&&!i;clearTimeout(i),i=setTimeout(function(){i=null,n||e.apply(a,s)},t),c&&e.apply(a,s)}},get_cookie:function(e){var t,i,a=n.cookie,s=e+"=";if(a){if(-1===(i=a.indexOf("; "+s))){if(0!==(i=a.indexOf(s)))return null}else i+=2;return-1===(t=a.indexOf(";",i))&&(t=a.length),decodeURIComponent(a.substring(i+s.length,t))}},set_cookie:function(e,t,i,a,s,c){var r=new Date;"object"==typeof i&&i.toGMTString?i=i.toGMTString():parseInt(i,10)?(r.setTime(r.getTime()+1e3*parseInt(i,10)),i=r.toGMTString()):i="",n.cookie=e+"="+encodeURIComponent(t)+(i?"; expires="+i:"")+(a?"; path="+a:"")+(s?"; domain="+s:"")+(c?"; secure":"")},remove_cookie:function(e,t,n,i){a.helper.set_cookie(e,"",-1e3,t,n,i)}},e.fn.csf_clone=function(){for(var t=e.fn.clone.apply(this,arguments),n=this.find("select").add(this.filter("select")),i=t.find("select").add(t.filter("select")),a=0;a<n.length;++a)for(var s=0;s<n[a].options.length;++s)!0===n[a].options[s].selected&&(i[a].options[s].selected=!0);return this.find(":radio").each(function(){this.orginal_checked=this.checked}),t},e.fn.csf_expand_all=function(){return this.each(function(){e(this).on("click",function(t){t.preventDefault(),e(".csf-wrapper").toggleClass("csf-show-all"),e(".csf-section").csf_reload_script(),e(this).find(".fa").toggleClass("fa-indent").toggleClass("fa-outdent")})})},e.fn.csf_nav_options=function(){return this.each(function(){var n,a=e(this),s=a.find("a"),c=a.closest(".csf").find(".csf-section-id");e(t).on("hashchange",function(){var a=t.location.hash.match(new RegExp("tab=([^&]*)")),r=a?a[1]:s.first().attr("href").replace("#tab=",""),o=e("#csf-tab-link-"+r);if(o.length>0){o.closest(".csf-tab-depth-0").addClass("csf-tab-active").siblings().removeClass("csf-tab-active"),s.removeClass("csf-section-active"),o.addClass("csf-section-active"),n!==i&&n.hide();var f=e("#csf-section-"+r);f.css({display:"block"}),f.csf_reload_script(),c.val(r),n=f}}).trigger("hashchange")})},e.fn.csf_nav_metabox=function(){return this.each(function(){var t,n,s=e(this),c=s.find("a"),r=s.data("unique"),o=e("#post_ID").val()||"global";c.on("click",function(s){s.preventDefault();var c=e(this),f=c.data("section");n!==i&&n.removeClass("csf-section-active"),t!==i&&t.hide(),c.addClass("csf-section-active");var l=e("#csf-section-"+f);l.css({display:"block"}),l.csf_reload_script(),a.helper.set_cookie("csf-last-metabox-tab-"+o+"-"+r,f),t=l,n=c});var f=a.helper.get_cookie("csf-last-metabox-tab-"+o+"-"+r);f?s.find('a[data-section="'+f+'"]').trigger("click"):c.first("a").trigger("click")})},e.fn.csf_page_templates=function(){this.length&&e(n).on("change",".editor-page-attributes__template select, #page_template",function(){var t=e(this).val()||"default";e(".csf-page-templates").removeClass("csf-show").addClass("csf-hide"),e(".csf-page-"+t.toLowerCase().replace(/[^a-zA-Z0-9]+/g,"-")).removeClass("csf-hide").addClass("csf-show")})},e.fn.csf_post_formats=function(){this.length&&e(n).on("change",'.editor-post-format select, #formatdiv input[name="post_format"]',function(){var t=e(this).val()||"default";t="0"===t?"default":t,e(".csf-post-formats").removeClass("csf-show").addClass("csf-hide"),e(".csf-post-format-"+t).removeClass("csf-hide").addClass("csf-show")})},e.fn.csf_search=function(){return this.each(function(){e(this).find("input").on("change keyup",function(){var t=e(this).val(),n=e(".csf-wrapper"),i=n.find(".csf-section").find("> .csf-field:not(.hidden)"),a=i.find("> .csf-title, .csf-search-tags");t.length>3?(i.addClass("csf-hidden"),n.addClass("csf-search-all"),a.each(function(){var n=e(this);if(n.text().match(new RegExp(".*?"+t+".*?","i"))){var i=n.closest(".csf-field");i.removeClass("csf-hidden"),i.parent().csf_reload_script()}})):(i.removeClass("csf-hidden"),n.removeClass("csf-search-all"))})})},e.fn.csf_sticky=function(){return this.each(function(){var i=e(this),a=e(t),s=i.find(".csf-header-inner"),c=parseInt(s.css("padding-left"))+parseInt(s.css("padding-right")),r=0,o=!1,f=function(){o||requestAnimationFrame(function(){var e,a,f;e=i.offset().top,a=Math.max(32,e-r),f=Math.max(n.documentElement.clientWidth,t.innerWidth||0),a<=32&&f>782?(s.css({width:i.outerWidth()-c}),i.css({height:i.outerHeight()}).addClass("csf-sticky")):(s.removeAttr("style"),i.removeAttr("style").removeClass("csf-sticky")),o=!1}),o=!0},l=function(){r=a.scrollTop(),f()};a.on("scroll resize",l),l()})},e.fn.csf_dependency=function(){return this.each(function(){var t=e(this),n=e.csf_deps.createRuleset(),i=[],s=!1;t.children("[data-controller]").each(function(){var t=e(this),a=t.data("controller").split("|"),c=t.data("condition").split("|"),r=t.data("value").toString().split("|"),o=n;t.data("depend-global")&&(s=!0),e.each(a,function(e,n){var a=r[e]||"",s=c[e]||c[0];(o=o.createRule('[data-depend-id="'+n+'"]',s,a)).include(t),i.push(n)})}),i.length&&(s?e.csf_deps.enable(a.vars.$body,n,i):e.csf_deps.enable(t,n,i))})},e.fn.csf_field_accordion=function(){return this.each(function(){e(this).find(".csf-accordion-title").on("click",function(){var t=e(this),n=t.find(".csf-accordion-icon"),i=t.next();n.hasClass("fa-angle-right")?n.removeClass("fa-angle-right").addClass("fa-angle-down"):n.removeClass("fa-angle-down").addClass("fa-angle-right"),i.data("opened")||(i.csf_reload_script(),i.data("opened",!0)),i.toggleClass("csf-accordion-open")})})},e.fn.csf_field_backup=function(){return this.each(function(){if(t.wp.customize!==i){var n=this,s=e(this),c=(e("body"),s.find(".csf-import")),r=s.find(".csf-reset");n.notification=function(e){wp.customize.notifications&&wp.customize.OverlayNotification&&(wp.customize.state("saved").get()||(wp.customize.state("changesetStatus").set("trash"),wp.customize.each(function(e){e._dirty=!1}),wp.customize.state("saved").set(!0)),wp.customize.notifications.add(new wp.customize.OverlayNotification("csf_field_backup_notification",{type:"info",message:e,loading:!0})))},r.on("click",function(e){e.preventDefault(),a.vars.is_confirm&&(n.notification(t.csf_vars.i18n.reset_notification),t.wp.ajax.post("csf-reset",{unique:r.data("unique"),nonce:r.data("nonce")}).done(function(e){t.location.reload(!0)}).fail(function(e){alert(e.error),wp.customize.notifications.remove("csf_field_backup_notification")}))}),c.on("click",function(e){e.preventDefault(),a.vars.is_confirm&&(n.notification(t.csf_vars.i18n.import_notification),t.wp.ajax.post("csf-import",{unique:c.data("unique"),nonce:c.data("nonce"),import_data:s.find(".csf-import-data").val()}).done(function(e){t.location.reload(!0)}).fail(function(e){alert(e.error),wp.customize.notifications.remove("csf_field_backup_notification")}))})}})},e.fn.csf_field_background=function(){return this.each(function(){e(this).find(".csf--background-image").csf_reload_script()})},e.fn.csf_field_code_editor=function(){return this.each(function(){if("function"==typeof CodeMirror){var t=e(this),n=t.find("textarea"),i=t.find(".CodeMirror"),s=n.data("editor");i.length&&i.remove();var c=setInterval(function(){if(t.is(":visible")){var i=CodeMirror.fromTextArea(n[0],s);if("default"!==s.theme&&-1===a.vars.code_themes.indexOf(s.theme)){var r=e("<link>");e("#csf-codemirror-css").after(r),r.attr({rel:"stylesheet",id:"csf-codemirror-"+s.theme+"-css",href:s.cdnURL+"/theme/"+s.theme+".min.css",type:"text/css",media:"all"}),a.vars.code_themes.push(s.theme)}CodeMirror.modeURL=s.cdnURL+"/mode/%N/%N.min.js",CodeMirror.autoLoadMode(i,s.mode),i.on("change",function(e,t){n.val(i.getValue()).trigger("change")}),clearInterval(c)}})}})},e.fn.csf_field_date=function(){return this.each(function(){var t=e(this),n=t.find("input"),i=t.find(".csf-date-settings").data("settings"),a={showAnim:"",beforeShow:function(t,n){e(n.dpDiv).addClass("csf-datepicker-wrapper")},onClose:function(t,n){e(n.dpDiv).removeClass("csf-datepicker-wrapper")}};i=e.extend({},i,a),2===n.length&&(i=e.extend({},i,{onSelect:function(t){e(this),n.first();var a=n.first().attr("id")===e(this).attr("id")?"minDate":"maxDate",s=e.datepicker.parseDate(i.dateFormat,t);n.not(this).datepicker("option",a,s)}})),n.each(function(){var t=e(this);t.hasClass("hasDatepicker")&&t.removeAttr("id").removeClass("hasDatepicker"),t.datepicker(i)})})},e.fn.csf_field_fieldset=function(){return this.each(function(){e(this).find(".csf-fieldset-content").csf_reload_script()})},e.fn.csf_field_gallery=function(){return this.each(function(){var n,i=e(this),a=i.find(".csf-edit-gallery"),s=i.find(".csf-clear-gallery"),c=i.find("ul"),r=i.find("input");i.find("img");i.on("click",".csf-button, .csf-edit-gallery",function(i){var o=e(this),f=r.val(),l=o.hasClass("csf-edit-gallery")?"edit":"add",d="add"!==l||f.length?"gallery-edit":"gallery";i.preventDefault(),void 0!==t.wp&&t.wp.media&&t.wp.media.gallery&&("gallery"===d?(n=t.wp.media({library:{type:"image"},frame:"post",state:"gallery",multiple:!0})).open():(n=t.wp.media.gallery.edit('[gallery ids="'+f+'"]'),"add"===l&&n.setState("gallery-library")),n.on("update",function(e){c.empty();var t=e.models.map(function(e){var t=e.toJSON(),n=t.sizes&&t.sizes.thumbnail&&t.sizes.thumbnail.url?t.sizes.thumbnail.url:t.url;return c.append('<li><img src="'+n+'"></li>'),t.id});r.val(t.join(",")).trigger("change"),s.removeClass("hidden"),a.removeClass("hidden")}))}),s.on("click",function(e){e.preventDefault(),c.empty(),r.val("").trigger("change"),s.addClass("hidden"),a.addClass("hidden")})})},e.fn.csf_field_group=function(){return this.each(function(){var t=e(this),n=t.children(".csf-fieldset"),i=n.length?n:t,s=i.children(".csf-cloneable-wrapper"),c=i.children(".csf-cloneable-hidden"),r=i.children(".csf-cloneable-max"),o=i.children(".csf-cloneable-min"),f=s.data("field-id"),l=s.data("unique-id"),d=Boolean(Number(s.data("title-number"))),h=parseInt(s.data("max")),p=parseInt(s.data("min"));s.hasClass("ui-accordion")&&s.find(".ui-accordion-header-icon").remove();var u=function(t){t.find(".csf-cloneable-title-number").each(function(t){e(this).html(e(this).closest(".csf-cloneable-item").index()+1+".")})};s.accordion({header:"> .csf-cloneable-item > .csf-cloneable-title",collapsible:!0,active:!1,animate:!1,heightStyle:"content",icons:{header:"csf-cloneable-header-icon fa fa-angle-right",activeHeader:"csf-cloneable-header-icon fa fa-angle-down"},activate:function(e,t){var n=t.newPanel,i=t.newHeader;if(n.length&&!n.data("opened")){var a=n.children().first().find(":input").first(),s=i.find(".csf-cloneable-value");a.on("keyup",function(e){s.text(a.val())}),n.csf_reload_script(),n.data("opened",!0),n.data("retry",!1)}else n.data("retry")&&(n.csf_reload_script_retry(),n.data("retry",!1))}}),s.sortable({axis:"y",handle:".csf-cloneable-title,.csf-cloneable-sort",helper:"original",cursor:"move",placeholder:"widget-placeholder",start:function(e,t){s.accordion({active:!1}),s.sortable("refreshPositions"),t.item.children(".csf-cloneable-content").data("retry",!0)},update:function(e,t){a.helper.name_nested_replace(s.children(".csf-cloneable-item"),f),s.csf_customizer_refresh(),d&&u(s)}}),i.children(".csf-cloneable-add").on("click",function(t){t.preventDefault();var n=s.children(".csf-cloneable-item").length;if(o.hide(),h&&n+1>h)r.show();else{var i=l+f+"["+n+"]",a=c.csf_clone(!0);a.removeClass("csf-cloneable-hidden"),a.find(':input[name!="_pseudo"]').each(function(){this.name=i+this.name.replace(this.name.startsWith("_nonce")?"_nonce":l,"")}),a.find(".csf-data-wrapper").each(function(){e(this).attr("data-unique-id",i)}),s.append(a),s.accordion("refresh"),s.accordion({active:n}),s.csf_customizer_refresh(),s.csf_customizer_listen({closest:!0}),d&&u(s)}});var v=function(t){t.preventDefault();var n=s.children(".csf-cloneable-item").length;if(o.hide(),h&&n+1>h)r.show();else{var i=e(this).parent().parent(),c=i.children(".csf-cloneable-helper").csf_clone(!0),l=i.children(".csf-cloneable-title").csf_clone(),p=i.children(".csf-cloneable-content").csf_clone(),v=new RegExp("("+a.helper.preg_quote(f)+")\\[(\\d+)\\]","g");p.find(".csf-data-wrapper").each(function(){var t=e(this);t.attr("data-unique-id",t.attr("data-unique-id").replace(v,f+"["+(i.index()+1)+"]"))});var g=e('<div class="csf-cloneable-item" />');g.append(c),g.append(l),g.append(p),s.children().eq(i.index()).after(g),a.helper.name_nested_replace(s.children(".csf-cloneable-item"),f),s.accordion("refresh"),s.csf_customizer_refresh(),s.csf_customizer_listen({closest:!0}),d&&u(s)}};s.children(".csf-cloneable-item").children(".csf-cloneable-helper").on("click",".csf-cloneable-clone",v),i.children(".csf-cloneable-hidden").children(".csf-cloneable-helper").on("click",".csf-cloneable-clone",v);var g=function(t){t.preventDefault();var n=s.children(".csf-cloneable-item").length;r.hide(),o.hide(),p&&n-1<p?o.show():(e(this).closest(".csf-cloneable-item").remove(),a.helper.name_nested_replace(s.children(".csf-cloneable-item"),f),s.csf_customizer_refresh(),d&&u(s))};s.children(".csf-cloneable-item").children(".csf-cloneable-helper").on("click",".csf-cloneable-remove",g),i.children(".csf-cloneable-hidden").children(".csf-cloneable-helper").on("click",".csf-cloneable-remove",g)})},e.fn.csf_field_icon=function(){return this.each(function(){var n=e(this);n.on("click",".csf-icon-add",function(i){i.preventDefault();var s=e(this),c=e("#csf-modal-icon");c.show(),a.vars.$icon_target=n,a.vars.icon_modal_loaded||(c.find(".csf-modal-loading").show(),t.wp.ajax.post("csf-get-icons",{nonce:s.data("nonce")}).done(function(t){c.find(".csf-modal-loading").hide(),a.vars.icon_modal_loaded=!0;var n=c.find(".csf-modal-load").html(t.content);n.on("click","a",function(t){t.preventDefault();var n=e(this).data("csf-icon");a.vars.$icon_target.find("i").removeAttr("class").addClass(n),a.vars.$icon_target.find("input").val(n).trigger("change"),a.vars.$icon_target.find(".csf-icon-preview").removeClass("hidden"),a.vars.$icon_target.find(".csf-icon-remove").removeClass("hidden"),c.hide()}),c.on("change keyup",".csf-icon-search",function(){var t=e(this).val();n.find("a").each(function(){var n=e(this);n.data("csf-icon").search(new RegExp(t,"i"))<0?n.hide():n.show()})}),c.on("click",".csf-modal-close, .csf-modal-overlay",function(){c.hide()})}).fail(function(e){c.find(".csf-modal-loading").hide(),c.find(".csf-modal-load").html(e.error),c.on("click",function(){c.hide()})}))}),n.on("click",".csf-icon-remove",function(t){t.preventDefault(),n.find(".csf-icon-preview").addClass("hidden"),n.find("input").val("").trigger("change"),e(this).addClass("hidden")})})},e.fn.csf_field_map=function(){return this.each(function(){if("undefined"!=typeof L){var t=e(this),n=t.find(".csf--map-osm"),i=t.find(".csf--map-search input"),a=t.find(".csf--latitude"),s=t.find(".csf--longitude"),c=t.find(".csf--zoom"),r=n.data("map"),o=L.map(n.get(0),r);L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'}).addTo(o);var f=L.marker(r.center,{draggable:!0}).addTo(o),l=function(e){a.val(e.lat),s.val(e.lng),c.val(o.getZoom())};o.on("click",function(e){f.setLatLng(e.latlng),l(e.latlng)}),o.on("zoom",function(){l(f.getLatLng())}),f.on("drag",function(){l(f.getLatLng())}),i.length||(i=e('[data-depend-id="'+t.find(".csf--address-field").data("address-field")+'"]')),i.autocomplete({source:function(t,n){e.get("https://nominatim.openstreetmap.org/search",{format:"json",q:t.term},function(e){e.length?n(e.map(function(e){return{value:e.display_name,label:e.display_name,lat:e.lat,lon:e.lon}},"json")):n([{value:"no-data",label:"No Results."}])})},select:function(e,t){if("no-data"===t.item.value)return!1;var n=L.latLng(t.item.lat,t.item.lon);o.panTo(n),f.setLatLng(n),l(n)},create:function(t,n){e(this).autocomplete("widget").addClass("csf-map-ui-autocomplate")}});var d=function(){var e=L.latLng(a.val(),s.val());o.panTo(e),f.setLatLng(e)};a.on("change",d),s.on("change",d)}})},e.fn.csf_field_media=function(){return this.each(function(){var n,i=e(this),a=i.find(".csf--button"),s=i.find(".csf--remove"),c=a.data("library")&&a.data("library").split(",")||"",r=!!i.hasClass("csf-assign-field-background")&&i.closest(".csf-field-background").find(".csf--auto-attributes");a.on("click",function(e){e.preventDefault(),void 0!==t.wp&&t.wp.media&&t.wp.media.gallery&&(n?n.open():((n=t.wp.media({library:{type:c}})).on("select",function(){var e,t=n.state().get("selection").first().attributes,o=a.data("preview-size")||"thumbnail";c.length&&-1===c.indexOf(t.subtype)&&-1===c.indexOf(t.type)||(i.find(".csf--id").val(t.id),i.find(".csf--width").val(t.width),i.find(".csf--height").val(t.height),i.find(".csf--alt").val(t.alt),i.find(".csf--title").val(t.title),i.find(".csf--description").val(t.description),e=void 0!==t.sizes&&void 0!==t.sizes.thumbnail&&"thumbnail"===o?t.sizes.thumbnail.url:void 0!==t.sizes&&void 0!==t.sizes.full?t.sizes.full.url:t.icon,r&&r.removeClass("csf--attributes-hidden"),s.removeClass("hidden"),i.find(".csf--preview").removeClass("hidden"),i.find(".csf--src").attr("src",e),i.find(".csf--thumbnail").val(e),i.find(".csf--url").val(t.url).trigger("change"))}),n.open()))}),s.on("click",function(e){e.preventDefault(),r&&r.addClass("csf--attributes-hidden"),s.addClass("hidden"),i.find("input").val(""),i.find(".csf--preview").addClass("hidden"),i.find(".csf--url").trigger("change")})})},e.fn.csf_field_repeater=function(){return this.each(function(){var t=e(this),n=t.children(".csf-fieldset"),i=n.length?n:t,s=i.children(".csf-repeater-wrapper"),c=i.children(".csf-repeater-hidden"),r=i.children(".csf-repeater-max"),o=i.children(".csf-repeater-min"),f=s.data("field-id"),l=s.data("unique-id"),d=parseInt(s.data("max")),h=parseInt(s.data("min"));s.children(".csf-repeater-item").children(".csf-repeater-content").csf_reload_script(),s.sortable({axis:"y",handle:".csf-repeater-sort",helper:"original",cursor:"move",placeholder:"widget-placeholder",update:function(e,t){a.helper.name_nested_replace(s.children(".csf-repeater-item"),f),s.csf_customizer_refresh(),t.item.csf_reload_script_retry()}}),i.children(".csf-repeater-add").on("click",function(t){t.preventDefault();var n=s.children(".csf-repeater-item").length;if(o.hide(),d&&n+1>d)r.show();else{var i=l+f+"["+n+"]",a=c.csf_clone(!0);a.removeClass("csf-repeater-hidden"),a.find(':input[name!="_pseudo"]').each(function(){this.name=i+this.name.replace(this.name.startsWith("_nonce")?"_nonce":l,"")}),a.find(".csf-data-wrapper").each(function(){e(this).attr("data-unique-id",i)}),s.append(a),a.children(".csf-repeater-content").csf_reload_script(),s.csf_customizer_refresh(),s.csf_customizer_listen({closest:!0})}});var p=function(t){t.preventDefault();var n=s.children(".csf-repeater-item").length;if(o.hide(),d&&n+1>d)r.show();else{var i=e(this).parent().parent().parent(),c=i.children(".csf-repeater-content").csf_clone(),l=i.children(".csf-repeater-helper").csf_clone(!0),h=new RegExp("("+a.helper.preg_quote(f)+")\\[(\\d+)\\]","g");c.find(".csf-data-wrapper").each(function(){var t=e(this);t.attr("data-unique-id",t.attr("data-unique-id").replace(h,f+"["+(i.index()+1)+"]"))});var p=e('<div class="csf-repeater-item" />');p.append(c),p.append(l),s.children().eq(i.index()).after(p),p.children(".csf-repeater-content").csf_reload_script(),a.helper.name_nested_replace(s.children(".csf-repeater-item"),f),s.csf_customizer_refresh(),s.csf_customizer_listen({closest:!0})}};s.children(".csf-repeater-item").children(".csf-repeater-helper").on("click",".csf-repeater-clone",p),i.children(".csf-repeater-hidden").children(".csf-repeater-helper").on("click",".csf-repeater-clone",p);var u=function(t){t.preventDefault();var n=s.children(".csf-repeater-item").length;r.hide(),o.hide(),h&&n-1<h?o.show():(e(this).closest(".csf-repeater-item").remove(),a.helper.name_nested_replace(s.children(".csf-repeater-item"),f),s.csf_customizer_refresh())};s.children(".csf-repeater-item").children(".csf-repeater-helper").on("click",".csf-repeater-remove",u),i.children(".csf-repeater-hidden").children(".csf-repeater-helper").on("click",".csf-repeater-remove",u)})},e.fn.csf_field_slider=function(){return this.each(function(){var t=e(this),n=t.find("input"),i=t.find(".csf-slider-ui"),a=n.data(),s=n.val()||0;i.hasClass("ui-slider")&&i.empty(),i.slider({range:"min",value:s,min:a.min,max:a.max,step:a.step,slide:function(e,t){n.val(t.value).trigger("change")}}),n.keyup(function(){i.slider("value",n.val())})})},e.fn.csf_field_sortable=function(){return this.each(function(){var t=e(this).find(".csf--sortable");t.sortable({axis:"y",helper:"original",cursor:"move",placeholder:"widget-placeholder",update:function(e,n){t.csf_customizer_refresh()}}),t.find(".csf--sortable-content").csf_reload_script()})},e.fn.csf_field_sorter=function(){return this.each(function(){var t=e(this),n=t.find(".csf-enabled"),i=t.find(".csf-disabled"),a=!!i.length&&i;n.sortable({connectWith:a,placeholder:"ui-sortable-placeholder",update:function(e,n){var i=n.item.find("input");n.item.parent().hasClass("csf-enabled")?i.attr("name",i.attr("name").replace("disabled","enabled")):i.attr("name",i.attr("name").replace("enabled","disabled")),t.csf_customizer_refresh()}}),a&&a.sortable({connectWith:n,placeholder:"ui-sortable-placeholder",update:function(e,n){t.csf_customizer_refresh()}})})},e.fn.csf_field_spinner=function(){return this.each(function(){var t=e(this),n=t.find("input"),i=t.find(".ui-spinner-button"),a=n.data("unit");i.length&&i.remove(),n.spinner({max:n.data("max")||100,min:n.data("min")||0,step:n.data("step")||1,create:function(e,n){a.length&&t.find(".ui-spinner-up").after('<span class="ui-button-text-only csf--unit">'+a+"</span>")},spin:function(e,t){n.val(t.value).trigger("change")}})})},e.fn.csf_field_switcher=function(){return this.each(function(){var t=e(this).find(".csf--switcher");t.on("click",function(){var e=0,n=t.find("input");t.hasClass("csf--active")?t.removeClass("csf--active"):(e=1,t.addClass("csf--active")),n.val(e).trigger("change")})})},e.fn.csf_field_tabbed=function(){return this.each(function(){var t=e(this),n=t.find(".csf-tabbed-nav a"),i=t.find(".csf-tabbed-section");i.eq(0).csf_reload_script(),n.on("click",function(t){t.preventDefault();var n=e(this),a=n.index(),s=i.eq(a);n.addClass("csf-tabbed-active").siblings().removeClass("csf-tabbed-active"),s.csf_reload_script(),s.removeClass("hidden").siblings().addClass("hidden")})})},e.fn.csf_field_typography=function(){return this.each(function(){var t=this,n=e(this),i=[],s=csf_typography_json.webfonts,c=csf_typography_json.googlestyles,r=csf_typography_json.defaultstyles;t.sanitize_subset=function(e){return e=(e=e.replace("-ext"," Extended")).charAt(0).toUpperCase()+e.slice(1)},t.sanitize_style=function(e){return c[e]?c[e]:e},t.load_google_font=function(e,t,n){e&&"object"==typeof WebFont&&(t=t?t.replace("normal",""):"",n=n?n.replace("normal",""):"",(t||n)&&(e=e+":"+t+n),-1===i.indexOf(e)&&WebFont.load({google:{families:[e]}}),i.push(e))},t.append_select_options=function(n,i,a,s,c){n.find("option").not(":first").remove();var r="";e.each(i,function(e,n){var i,o=n;i=c?a&&-1!==a.indexOf(n)?" selected":"":a&&a===n?" selected":"","subset"===s?o=t.sanitize_subset(n):"style"===s&&(o=t.sanitize_style(n)),r+='<option value="'+n+'"'+i+">"+o+"</option>"}),n.append(r).trigger("csf.change").trigger("chosen:updated")},t.init=function(){var i=[],c=n.find(".csf--typography"),o=n.find(".csf--type"),f=n.find(".csf--block-font-style"),l=c.data("unit"),d=c.data("exclude")?c.data("exclude").split(","):[];n.find(".csf--chosen").length&&n.find("select").each(function(){var t=e(this),n=t.parent().find(".chosen-container");n.length&&n.remove(),t.chosen({allow_single_deselect:!0,disable_search_threshold:15,width:"100%"})});var h=n.find(".csf--font-family"),p=h.val();h.find("option").not(":first-child").remove();var u="";e.each(s,function(t,n){d&&-1!==d.indexOf(t)||(u+='<optgroup label="'+n.label+'">',e.each(n.fonts,function(e,n){u+='<option value="'+(n="object"==typeof n?e:n)+'" data-type="'+t+'"'+(n===p?" selected":"")+">"+n+"</option>"}),u+="</optgroup>")}),h.append(u).trigger("chosen:updated");var v=n.find(".csf--block-font-style");if(v.length){var g=n.find(".csf--font-style-select"),_=g.val()?g.val().replace(/normal/g,""):"";g.on("change csf.change",function(e){var t=g.val();!t&&i&&-1===i.indexOf("normal")&&(t=i[0]);var a=t&&"italic"!==t&&"normal"===t?"normal":"",s=t&&"italic"!==t&&"normal"!==t?t.replace("italic",""):a,c=t&&"italic"===t.substr(-6)?"italic":"";n.find(".csf--font-weight").val(s),n.find(".csf--font-style").val(c)});var m=n.find(".csf--block-extra-styles");if(m.length)var b=n.find(".csf--extra-styles"),y=b.val()}var w=n.find(".csf--block-subset");if(w.length)var k=n.find(".csf--subset"),C=k.val(),x=k.data("multiple")||!1;var z=n.find(".csf--block-backup-font-family");h.on("change csf.change",function(e){w.length&&w.addClass("hidden"),m.length&&m.addClass("hidden"),z.length&&z.addClass("hidden");var n=h.find(":selected"),a=n.val(),c=n.data("type");if(c&&a){if("google"!==c&&"custom"!==c||!z.length||z.removeClass("hidden"),v.length){var l=r;"google"===c&&s[c].fonts[a][0]?l=s[c].fonts[a][0]:"custom"===c&&s[c].fonts[a]&&(l=s[c].fonts[a]),i=l;var d=-1!==l.indexOf("normal")?"normal":l[0],p=_&&-1!==l.indexOf(_)?_:d;t.append_select_options(g,l,p,"style"),_=!1,v.removeClass("hidden"),"google"===c&&m.length&&l.length>1&&(t.append_select_options(b,l,y,"style",!0),y=!1,m.removeClass("hidden"))}if("google"===c&&w.length&&s[c].fonts[a][1]){var u=s[c].fonts[a][1],D=u.length<2&&"latin"!==u[0]?u[0]:"",O=C&&-1!==u.indexOf(C)?C:D;O=x&&C?C:O,t.append_select_options(k,u,O,"subset",x),C=!1,w.removeClass("hidden")}}else f.find(":input").val(""),w.length&&(k.find("option").not(":first-child").remove(),k.trigger("chosen:updated")),v.length&&(g.find("option").not(":first-child").remove(),g.trigger("chosen:updated"));o.val(c)}).trigger("csf.change");var D=n.find(".csf--block-preview");if(D.length){var O=n.find(".csf--preview");n.on("change",a.helper.debounce(function(e){D.removeClass("hidden");var i=h.val(),a=n.find(".csf--font-weight").val(),s=n.find(".csf--font-style").val(),c=n.find(".csf--font-size").val(),r=n.find(".csf--font-variant").val(),o=n.find(".csf--line-height").val(),f=n.find(".csf--text-align").val(),d=n.find(".csf--text-transform").val(),p=n.find(".csf--text-decoration").val(),u=n.find(".csf--color").val(),v=n.find(".csf--word-spacing").val(),g=n.find(".csf--letter-spacing").val(),_=n.find(".csf--custom-style").val();"google"===n.find(".csf--type").val()&&t.load_google_font(i,a,s);var m={};i&&(m.fontFamily=i),a&&(m.fontWeight=a),s&&(m.fontStyle=s),r&&(m.fontVariant=r),c&&(m.fontSize=c+l),o&&(m.lineHeight=o+l),g&&(m.letterSpacing=g+l),v&&(m.wordSpacing=v+l),f&&(m.textAlign=f),d&&(m.textTransform=d),p&&(m.textDecoration=p),u&&(m.color=u),O.removeAttr("style"),_&&O.attr("style",_),O.css(m)},100)),D.on("click",function(){O.toggleClass("csf--black-background");var e=D.find(".csf--toggle");e.hasClass("fa-toggle-off")?e.removeClass("fa-toggle-off").addClass("fa-toggle-on"):e.removeClass("fa-toggle-on").addClass("fa-toggle-off")}),D.hasClass("hidden")||n.trigger("change")}},t.init()})},e.fn.csf_field_upload=function(){return this.each(function(){var n,i=e(this),a=i.find("input"),s=i.find(".csf--button"),c=i.find(".csf--remove"),r=s.data("library")&&s.data("library").split(",")||"";a.on("change",function(e){a.val()?c.removeClass("hidden"):c.addClass("hidden")}),s.on("click",function(e){e.preventDefault(),void 0!==t.wp&&t.wp.media&&t.wp.media.gallery&&(n?n.open():((n=t.wp.media({library:{type:r}})).on("select",function(){var e=n.state().get("selection").first().attributes;r.length&&-1===r.indexOf(e.subtype)&&-1===r.indexOf(e.type)||a.val(e.url).trigger("change")}),n.open()))}),c.on("click",function(e){e.preventDefault(),a.val("").trigger("change")})})},e.fn.csf_field_wp_editor=function(){return this.each(function(){if(void 0!==t.wp.editor&&void 0!==t.tinyMCEPreInit&&void 0!==t.tinyMCEPreInit.mceInit.csf_wp_editor){var n=e(this),i=n.find(".csf-wp-editor"),s=n.find("textarea");(n.find(".wp-editor-wrap").length||n.find(".mce-container").length)&&(i.empty(),i.append(s),s.css("display",""));var c=a.helper.uid("csf-editor-");s.attr("id",c);var r={tinymce:t.tinyMCEPreInit.mceInit.csf_wp_editor,quicktags:t.tinyMCEPreInit.qtInit.csf_wp_editor},o=i.data("editor-settings"),f=wp.oldEditor?wp.oldEditor:wp.editor;f&&f.hasOwnProperty("autop")&&(wp.editor.autop=f.autop,wp.editor.removep=f.removep,wp.editor.initialize=f.initialize),r.tinymce=e.extend({},r.tinymce,{selector:"#"+c,setup:function(e){e.on("change",a.helper.debounce(function(){e.save(),s.trigger("change")},250))}}),!1===o.tinymce&&(r.tinymce=!1,i.addClass("csf-no-tinymce")),!1===o.quicktags&&(r.quicktags=!1,i.addClass("csf-no-quicktags"));var l=setInterval(function(){n.is(":visible")&&(t.wp.editor.initialize(c,r),clearInterval(l))});if(o.media_buttons&&t.csf_media_buttons){var d=i.find(".wp-media-buttons");if(d.length)d.find(".csf-shortcode-button").data("editor-id",c);else{var h=e(t.csf_media_buttons);h.find(".csf-shortcode-button").data("editor-id",c),i.prepend(h)}}}})},e.fn.csf_confirm=function(){return this.each(function(){e(this).on("click",function(n){var i=e(this).data("confirm")||t.csf_vars.i18n.confirm,s=confirm(i);if(a.vars.is_confirm=!0,!s)return n.preventDefault(),a.vars.is_confirm=!1,!1})})},e.fn.serializeObject=function(){var t={};return e.each(this.serializeArray(),function(n,a){var s=a.name,c=a.value;t[s]=t[s]===i?c:e.isArray(t[s])?t[s].concat(c):[t[s],c]}),t},e.fn.csf_save=function(){return this.each(function(){var n,i=e(this),s=e(".csf-save"),c=e(".csf-options"),r=!1;i.on("click",function(o){if(!r){var f=i.data("save"),l=i.val();s.attr("value",f),i.hasClass("csf-save-ajax")&&(o.preventDefault(),c.addClass("csf-saving"),s.prop("disabled",!0),t.wp.ajax.post("csf_"+c.data("unique")+"_ajax_save",{data:e("#csf-form").serializeJSONCSF()}).done(function(t){if(e(".csf-error").remove(),Object.keys(t.errors).length){var i='<i class="csf-label-error csf-error">!</i>';e.each(t.errors,function(t,n){var a=e('[data-depend-id="'+t+'"]'),s=e("#csf-tab-link-"+(a.closest(".csf-section").index()+1)),c=s.closest(".csf-tab-depth-0");a.closest(".csf-fieldset").append('<p class="csf-text-error csf-error">'+n+"</p>"),s.find(".csf-error").length||s.append(i),c.find(".csf-arrow .csf-error").length||c.find(".csf-arrow").append(i),console.log(n)})}c.removeClass("csf-saving"),s.prop("disabled",!1).attr("value",l),r=!1,a.vars.form_modified=!1,a.vars.$form_warning.hide(),clearTimeout(n);var o=e(".csf-form-success");o.empty().append(t.notice).fadeIn("fast",function(){n=setTimeout(function(){o.fadeOut("fast")},1e3)})}).fail(function(e){alert(e.error)}))}r=!0})})},e.fn.csf_options=function(){return this.each(function(){var s=e(this),c=s.find(".csf-content"),r=s.find(".csf-form-success"),o=s.find(".csf-form-warning"),f=s.find(".csf-header .csf-save");a.vars.$form_warning=o,o.length&&(t.onbeforeunload=function(){return!!a.vars.form_modified||i},c.on("change keypress",":input",function(){a.vars.form_modified||(r.hide(),o.fadeIn("fast"),a.vars.form_modified=!0)})),r.hasClass("csf-form-show")&&setTimeout(function(){r.fadeOut("fast")},1e3),e(n).keydown(function(e){if((e.ctrlKey||e.metaKey)&&83===e.which)return f.trigger("click"),e.preventDefault(),!1})})},e.fn.csf_taxonomy=function(){return this.each(function(){var t=e(this),n=t.parents("form");if("addtag"===n.attr("id")){var i=n.find("#submit"),a=t.find(".csf-field").csf_clone();i.on("click",function(){n.find(".form-required").hasClass("form-invalid")||(t.data("inited",!1),t.empty(),t.html(a),a=a.csf_clone(),t.csf_reload_script())})}})},e.fn.csf_shortcode=function(){var s=this;return s.shortcode_parse=function(t,n){var i="";return e.each(t,function(t,a){i+="["+(n=n||t),e.each(a,function(e,t){"content"===e?(i+="]",i+=t,i+="[/"+n):i+=s.shortcode_tags(e,t)}),i+="]"}),i},s.shortcode_tags=function(t,n){var i="";return""!==n&&("object"!=typeof n||e.isArray(n)?i+=" "+t.replace("-","_")+'="'+n.toString()+'"':e.each(n,function(e,t){switch(e){case"background-image":t=t.url?t.url:""}""!==t&&(i+=" "+e.replace("-","_")+'="'+t.toString()+'"')})),i},s.insertAtChars=function(e,t){var n=void 0!==e[0].name?e[0]:e;return n.value.length&&void 0!==n.selectionStart?(n.focus(),n.value.substring(0,n.selectionStart)+t+n.value.substring(n.selectionEnd,n.value.length)):(n.focus(),t)},s.send_to_editor=function(t,n){var i;if("undefined"!=typeof tinymce&&(i=tinymce.get(n)),i&&!i.isHidden())i.execCommand("mceInsertContent",!1,t);else{var a=e("#"+n);a.val(s.insertAtChars(a,t)).trigger("change")}},this.each(function(){var c,r,o,f,l,d,h,p,u,v=e(this),g=v.find(".csf-modal-load"),_=(v.find(".csf-modal-content"),v.find(".csf-modal-insert")),m=v.find(".csf-modal-loading"),b=v.find("select"),y=v.data("modal-id"),w=v.data("nonce");e(n).on("click",'.csf-shortcode-button[data-modal-id="'+y+'"]',function(t){t.preventDefault(),u=e(this),c=u.data("editor-id")||!1,r=u.data("target-id")||!1,o=u.data("gutenberg-id")||!1,v.show(),v.hasClass("csf-shortcode-single")&&l===i&&b.trigger("change")}),b.on("change",function(){var n=e(this),i=n.find(":selected");f=n.val(),l=i.data("shortcode"),d=i.data("view")||"normal",h=i.data("group")||l,g.empty(),f?(m.show(),t.wp.ajax.post("csf-get-shortcode-"+y,{shortcode_key:f,nonce:w}).done(function(t){m.hide();var n=e(t.content).appendTo(g);_.parent().removeClass("hidden"),p=n.find(".csf--repeat-shortcode").csf_clone(),n.csf_reload_script(),n.find(".csf-fields").csf_reload_script()})):_.parent().addClass("hidden")}),_.on("click",function(n){if(n.preventDefault(),!_.prop("disabled")&&!_.attr("disabled")){var i="",a=v.find(".csf-field:not(.hidden)").find(":input:not(.ignore)").serializeObjectCSF();switch(d){case"contents":var f=l?a[l]:a;e.each(f,function(e,t){var n=l||e;i+="["+n+"]"+t+"[/"+n+"]"});break;case"group":i+="["+l,e.each(a[l],function(e,t){i+=s.shortcode_tags(e,t)}),i+="]",i+=s.shortcode_parse(a[h],h),i+="[/"+l+"]";break;case"repeater":i+=s.shortcode_parse(a[h],h);break;default:i+=s.shortcode_parse(a)}if(i=""===i?"["+l+"]":i,o){var p=t.csf_gutenberg_props.attributes.hasOwnProperty("shortcode")?t.csf_gutenberg_props.attributes.shortcode:"";t.csf_gutenberg_props.setAttributes({shortcode:p+i})}else if(c)s.send_to_editor(i,c);else{var g=r?e(r):u.parent().find("textarea");g.val(s.insertAtChars(g,i)).trigger("change")}v.hide()}}),v.on("click",".csf--repeat-button",function(e){e.preventDefault();var t=v.find(".csf--repeatable"),n=p.csf_clone(),i=n.find(".csf-repeat-remove");n.appendTo(t);n.find(".csf-fields").csf_reload_script(),a.helper.name_nested_replace(v.find(".csf--repeat-shortcode"),h),i.on("click",function(){n.remove(),a.helper.name_nested_replace(v.find(".csf--repeat-shortcode"),h)})}),v.on("click",".csf-modal-close, .csf-modal-overlay",function(){v.hide()})})},"function"==typeof Color&&(Color.fn.toString=function(){if(this._alpha<1)return this.toCSS("rgba",this._alpha).replace(/\s+/g,"");var e=parseInt(this._color,10).toString(16);if(this.error)return"";if(e.length<6)for(var t=6-e.length-1;t>=0;t--)e="0"+e;return"#"+e}),a.funcs.parse_color=function(e){var t=e.replace(/\s+/g,""),n=-1!==t.indexOf("rgba")?parseFloat(100*t.replace(/^.*,(.+)\)/,"$1")):100;return{value:t,transparent:n,rgba:n<100}},e.fn.csf_color=function(){return this.each(function(){var n,i=e(this),s=a.funcs.parse_color(i.val()),c=!t.csf_vars.color_palette.length||t.csf_vars.color_palette;i.hasClass("wp-color-picker")&&i.closest(".wp-picker-container").after(i).remove(),i.wpColorPicker({palettes:c,change:function(e,t){var a=t.color.toString();n.removeClass("csf--transparent-active"),n.find(".csf--transparent-offset").css("background-color",a),i.val(a).trigger("change")},create:function(){n=i.closest(".wp-picker-container");var t=i.data("a8cIris"),c=e('<div class="csf--transparent-wrap"><div class="csf--transparent-slider"></div><div class="csf--transparent-offset"></div><div class="csf--transparent-text"></div><div class="csf--transparent-button">transparent <i class="fa fa-toggle-off"></i></div></div>').appendTo(n.find(".wp-picker-holder")),r=c.find(".csf--transparent-slider"),o=c.find(".csf--transparent-text"),f=c.find(".csf--transparent-offset"),l=c.find(".csf--transparent-button");"transparent"===i.val()&&n.addClass("csf--transparent-active"),l.on("click",function(){"transparent"!==i.val()?(i.val("transparent").trigger("change").removeClass("iris-error"),n.addClass("csf--transparent-active")):(i.val(t._color.toString()).trigger("change"),n.removeClass("csf--transparent-active"))}),r.slider({value:s.transparent,step:1,min:0,max:100,slide:function(e,n){var a=parseFloat(n.value/100);t._color._alpha=a,i.wpColorPicker("color",t._color.toString()),o.text(1===a||0===a?"":a)},create:function(){var e=parseFloat(s.transparent/100),c=e<1?e:"";o.text(c),f.css("background-color",s.value),n.on("click",".wp-picker-clear",function(){t._color._alpha=1,o.text(""),r.slider("option","value",100),n.removeClass("csf--transparent-active"),i.trigger("change")}),n.on("click",".wp-picker-default",function(){var e=a.funcs.parse_color(i.data("default-color")),n=parseFloat(e.transparent/100),s=n<1?n:"";t._color._alpha=n,o.text(s),r.slider("option","value",e.transparent)})}})}})})},e.fn.csf_chosen=function(){return this.each(function(){var n=e(this),a=n.parent().find(".chosen-container"),s=n.hasClass("csf-chosen-sortable")||!1,c=n.hasClass("csf-chosen-ajax")||!1,r=n.attr("multiple")||!1,o=r?"100%":"auto",f=e.extend({allow_single_deselect:!0,disable_search_threshold:10,width:o,no_results_text:t.csf_vars.i18n.no_results_text},n.data("chosen-settings"));if(a.length&&a.remove(),c){var l=e.extend({data:{type:"post",nonce:""},allow_single_deselect:!0,disable_search_threshold:-1,width:"100%",min_length:3,type_delay:500,typing_text:t.csf_vars.i18n.typing_text,searching_text:t.csf_vars.i18n.searching_text,no_results_text:t.csf_vars.i18n.no_results_text},n.data("chosen-settings"));n.CSFAjaxChosen(l)}else n.chosen(f);if(r){var d=n.parent().find(".csf-hidden-select"),h=d.val()||[];n.on("change",function(e,n){n&&n.selected?d.append('<option value="'+n.selected+'" selected="selected">'+n.selected+"</option>"):n&&n.deselected&&d.find('option[value="'+n.deselected+'"]').remove(),0===d.children().length&&t.wp.customize!==i&&t.wp.customize.control(d.data("customize-setting-link")).setting.set(""),d.trigger("change")}),n.CSFChosenOrder(h,!0)}if(s){var p=n.parent().find(".chosen-container").find(".chosen-choices");p.bind("mousedown",function(t){e(t.target).is("span")&&t.stopPropagation()}),p.sortable({items:"li:not(.search-field)",helper:"orginal",cursor:"move",placeholder:"search-choice-placeholder",start:function(e,t){t.placeholder.width(t.item.innerWidth()),t.placeholder.height(t.item.innerHeight())},update:function(t,i){var a="",s=n.data("chosen"),c=n.parent().find(".csf-hidden-select");p.find(".search-choice-close").each(function(){var t=e(this).data("option-array-index");e.each(s.results_data,function(e,n){n.array_index===t&&(a+='<option value="'+n.value+'" selected>'+n.value+"</option>")})}),c.children().remove(),c.append(a),c.trigger("change")}})}})},e.fn.csf_checkbox=function(){return this.each(function(){var t=e(this),n=t.find(".csf--input"),i=t.find(".csf--checkbox");i.on("click",function(){n.val(Number(i.prop("checked"))).trigger("change")})})},e.fn.csf_siblings=function(){return this.each(function(){var t=e(this),n=t.find(".csf--sibling"),i=t.data("multiple")||!1;n.on("click",function(){var n=e(this);i?n.hasClass("csf--active")?(n.removeClass("csf--active"),n.find("input").prop("checked",!1).trigger("change")):(n.addClass("csf--active"),n.find("input").prop("checked",!0).trigger("change")):(t.find("input").prop("checked",!1),n.find("input").prop("checked",!0).trigger("change"),n.addClass("csf--active").siblings().removeClass("csf--active"))})})},e.fn.csf_help=function(){return this.each(function(){var t,n,s=e(this);s.on({mouseenter:function(){t=e('<div class="csf-tooltip"></div>').html(s.find(".csf-help-text").html()).appendTo("body"),n=a.vars.is_rtl?s.offset().left+24:s.offset().left-t.outerWidth(),t.css({top:s.offset().top-(t.outerHeight()/2-14),left:n})},mouseleave:function(){t!==i&&t.remove()}})})},e.fn.csf_customizer_refresh=function(){return this.each(function(){var i=e(this),a=i.closest(".csf-customize-complex");if(a.length){var s=a.find(":input"),c=a.data("unique-id"),r=a.data("option-id"),o=s.serializeObjectCSF(),f=e.isEmptyObject(o)?"":o[c][r],l=t.wp.customize.control(c+"["+r+"]");l.setting._value=null,l.setting.set(f)}else i.find(":input").first().trigger("change");e(n).trigger("csf-customizer-refresh",i)})},e.fn.csf_customizer_listen=function(n){var s=e.extend({closest:!1},n);return this.each(function(){if(t.wp.customize!==i){var n=s.closest?e(this).closest(".csf-customize-complex"):e(this),c=n.find(":input"),r=n.data("unique-id"),o=n.data("option-id");r!==i&&c.on("change keyup",a.helper.debounce(function(){var i=n.find(":input").serializeObjectCSF(),a=!e.isEmptyObject(i)&&i[r]&&i[r][o]?i[r][o]:"";t.wp.customize.control(r+"["+o+"]").setting.set(a)},250))}})},e(n).on("expanded",".control-section",function(){var t=e(this);if(t.hasClass("open")&&!t.data("inited")){var n=t.find(".csf-customize-field"),i=t.find(".csf-customize-complex");n.length&&(t.csf_dependency(),n.csf_reload_script({dependency:!1}),i.csf_customizer_listen()),t.data("inited",!0)}}),a.vars.$window.on("resize csf.resize",a.helper.debounce(function(n){(navigator.userAgent.indexOf("AppleWebKit/")>-1?a.vars.$window.width():t.innerWidth)<=782&&!a.vars.onloaded&&(e(".csf-section").csf_reload_script(),a.vars.onloaded=!0)},200)).trigger("csf.resize"),e.fn.csf_widgets=function(){this.length&&(e(n).on("widget-added widget-updated",function(e,t){t.find(".csf-fields").csf_reload_script()}),e(".widgets-sortables, .control-section-sidebar").on("sortstop",function(e,t){t.item.find(".csf-fields").csf_reload_script_retry()}),e(n).on("click",".widget-top",function(t){e(this).parent().find(".csf-fields").csf_reload_script()}))},e.fn.csf_reload_script_retry=function(){return this.each(function(){var t=e(this);t.data("inited")&&t.children(".csf-field-wp_editor").csf_field_wp_editor()})},e.fn.csf_reload_script=function(t){var i=e.extend({dependency:!0},t);return this.each(function(){var t=e(this);t.data("inited")||(t.children(".csf-field-accordion").csf_field_accordion(),t.children(".csf-field-backup").csf_field_backup(),t.children(".csf-field-background").csf_field_background(),t.children(".csf-field-code_editor").csf_field_code_editor(),t.children(".csf-field-date").csf_field_date(),t.children(".csf-field-fieldset").csf_field_fieldset(),t.children(".csf-field-gallery").csf_field_gallery(),t.children(".csf-field-group").csf_field_group(),t.children(".csf-field-icon").csf_field_icon(),t.children(".csf-field-media").csf_field_media(),t.children(".csf-field-map").csf_field_map(),t.children(".csf-field-repeater").csf_field_repeater(),t.children(".csf-field-slider").csf_field_slider(),t.children(".csf-field-sortable").csf_field_sortable(),t.children(".csf-field-sorter").csf_field_sorter(),t.children(".csf-field-spinner").csf_field_spinner(),t.children(".csf-field-switcher").csf_field_switcher(),t.children(".csf-field-tabbed").csf_field_tabbed(),t.children(".csf-field-typography").csf_field_typography(),t.children(".csf-field-upload").csf_field_upload(),t.children(".csf-field-wp_editor").csf_field_wp_editor(),t.children(".csf-field-border").find(".csf-color").csf_color(),t.children(".csf-field-background").find(".csf-color").csf_color(),t.children(".csf-field-color").find(".csf-color").csf_color(),t.children(".csf-field-color_group").find(".csf-color").csf_color(),t.children(".csf-field-link_color").find(".csf-color").csf_color(),t.children(".csf-field-typography").find(".csf-color").csf_color(),t.children(".csf-field-select").find(".csf-chosen").csf_chosen(),t.children(".csf-field-checkbox").find(".csf-checkbox").csf_checkbox(),t.children(".csf-field-button_set").find(".csf-siblings").csf_siblings(),t.children(".csf-field-image_select").find(".csf-siblings").csf_siblings(),t.children(".csf-field-palette").find(".csf-siblings").csf_siblings(),t.children(".csf-field").find(".csf-help").csf_help(),i.dependency&&t.csf_dependency(),t.data("inited",!0),e(n).trigger("csf-reload-script",t))})},e(n).ready(function(){e(".csf-save").csf_save(),e(".csf-options").csf_options(),e(".csf-sticky-header").csf_sticky(),e(".csf-nav-options").csf_nav_options(),e(".csf-nav-metabox").csf_nav_metabox(),e(".csf-taxonomy").csf_taxonomy(),e(".csf-page-templates").csf_page_templates(),e(".csf-post-formats").csf_post_formats(),e(".csf-shortcode").csf_shortcode(),e(".csf-search").csf_search(),e(".csf-confirm").csf_confirm(),e(".csf-expand-all").csf_expand_all(),e(".csf-onload").csf_reload_script(),e(".widget").csf_widgets()})}(jQuery,window,document);
admin/settings/assets/scss/csf-rtl.scss ADDED
@@ -0,0 +1,646 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ *
3
+ * ---------------------------------------------------------
4
+ * CODESTAR FRAMEWORK RTL CSS MAP
5
+ * ---------------------------------------------------------
6
+ *
7
+ * 01. Base
8
+ * 01. 01. Header
9
+ * 01. 02. Header Buttons
10
+ * 01. 03. Navigation
11
+ * 01. 04. Content
12
+ * 01. 05. Section
13
+ * 01. 06. Show All Options
14
+ * 01. 07. Search Input
15
+ * 01. 08. Copyright
16
+ * 01. 09. Metabox
17
+ * 02. Fields
18
+ * 02. 01. Field: typography
19
+ * 02. 02. Field: checkbox, radio
20
+ * 02. 03. Field: switcher
21
+ * 02. 04. Field: upload
22
+ * 02. 05. Field: group
23
+ * 02. 06. Field: repeater
24
+ * 02. 07. Field: help
25
+ * 02. 08. Field: icon
26
+ * 02. 09. Field: gallery
27
+ * 02. 10. Field: sorter
28
+ * 02. 11. Field: tabbed
29
+ * 02. 12. Field: media
30
+ * 02. 13. Field: notice
31
+ * 02. 14. Field: border, spacing, dimensions
32
+ * 02. 15. Field: background
33
+ * 02. 16. Field: spinner
34
+ * 02. 17. Field: slider
35
+ * 02. 18. Field: button_set
36
+ * 02. 19. Field: link_color
37
+ * 02. 20. Field: color_group
38
+ * 02. 21. Field: palette
39
+ * 03. Taxonomy
40
+ * 04. Profile
41
+ * 05. Modal
42
+ * 06. Customizer
43
+ * 07. Responsive
44
+ * 08. Others
45
+ *
46
+ * ---------------------------------------------------------
47
+ *
48
+ */
49
+ @import "compass";
50
+ @import "vendor/mixins";
51
+
52
+ /**
53
+ * 01. Base
54
+ */
55
+ .csf{
56
+ margin-left: 20px;
57
+ margin-right: 0;
58
+ }
59
+
60
+ /**
61
+ * 01. 01. Header
62
+ */
63
+ .csf-header{
64
+ h1{
65
+ float: right;
66
+ }
67
+
68
+ fieldset{
69
+ float: left;
70
+ }
71
+ }
72
+
73
+ /**
74
+ * 01. 02. Header Buttons
75
+ */
76
+ .csf-buttons{
77
+ float: left;
78
+ direction: ltr;
79
+ }
80
+
81
+ .csf-header-left{
82
+ float: right;
83
+ }
84
+
85
+ .csf-header-right{
86
+ float: left;
87
+ }
88
+
89
+ /**
90
+ * 01. 03. Navigation
91
+ */
92
+ .csf-nav{
93
+ float: right;
94
+
95
+ ul{
96
+ clear: right;
97
+
98
+ li{
99
+ .csf-section-active:after{
100
+ right: auto;
101
+ left: 0;
102
+ border-left-color: #fff;
103
+ border-right-color: transparent;
104
+ }
105
+
106
+ .csf-arrow:after{
107
+ content: "\f053";
108
+ right: auto;
109
+ left: 10px;
110
+ }
111
+
112
+ &.csf-tab-active .csf-arrow:after{
113
+ @include transform( rotate(-90deg) );
114
+ }
115
+ }
116
+
117
+ ul{
118
+ li{
119
+ a{
120
+ padding-right: 25px;
121
+ padding-left: 15px;
122
+ }
123
+ }
124
+
125
+ &:before{
126
+ left: auto;
127
+ right: 15px;
128
+ }
129
+ }
130
+ }
131
+
132
+ .fa{
133
+ margin-left: 5px;
134
+ margin-right: 0;
135
+ }
136
+ }
137
+
138
+ .csf-nav-background{
139
+ left: auto;
140
+ right: 0;
141
+ }
142
+
143
+ /**
144
+ * 01. 04. Content
145
+ */
146
+ .csf-content{
147
+ margin-left: 0;
148
+ margin-right: 225px;
149
+ }
150
+
151
+ /**
152
+ * 01. 05. Section
153
+ */
154
+ .csf-sections{
155
+ float: right;
156
+ }
157
+
158
+ /**
159
+ * 01. 06. Show all options
160
+ */
161
+ .csf-show-all .csf-content{
162
+ margin-right: 0;
163
+ overflow: hidden;
164
+ }
165
+
166
+ .csf-expand-all{
167
+ float: right;
168
+ right: auto;
169
+ left: 40px;
170
+ margin-right: 0;
171
+ margin-left: 4px;
172
+ }
173
+
174
+ /**
175
+ * 01. 07. Search Input
176
+ */
177
+ .csf-search{
178
+ float: right;
179
+
180
+ input{
181
+ margin: 0 0 0 5px;
182
+ }
183
+ }
184
+
185
+ /**
186
+ * 01. 08. Copyright
187
+ */
188
+ .csf-copyright{
189
+ float: right;
190
+ }
191
+
192
+ /**
193
+ * 01. 09. Metabox
194
+ */
195
+ .csf-metabox{
196
+ margin: -6px -12px -12px -12px;
197
+
198
+ .csf-section-title{
199
+ padding: 20px;
200
+
201
+ .fa{
202
+ margin-left: 5px;
203
+ margin-right: 0;
204
+ }
205
+ }
206
+ }
207
+
208
+ .csf-section-title .fa{
209
+ margin-left: 5px;
210
+ margin-right: 0;
211
+ }
212
+
213
+ /**
214
+ * 02. Fields
215
+ */
216
+ .csf-field{
217
+
218
+ .csf-title{
219
+ float: right;
220
+ }
221
+
222
+ .csf-fieldset{
223
+ margin-left: 0;
224
+ margin-right: 30%;
225
+ }
226
+ }
227
+
228
+ .csf-pseudo-field{
229
+ padding: 0 0 0 5px !important;
230
+ }
231
+
232
+ /**
233
+ * 02. 01. Field: typography
234
+ */
235
+ .csf-field-typography{
236
+
237
+ select{
238
+ margin: 0;
239
+ width: 100%;
240
+ }
241
+
242
+ .csf--blocks-inputs{
243
+ .csf--blocks{
244
+ flex-direction: row-reverse;
245
+ }
246
+ }
247
+ }
248
+
249
+ /**
250
+ * 02. 02. Field: checkbox, radio
251
+ */
252
+ .csf-field-checkbox,
253
+ .csf-field-radio{
254
+
255
+ .csf--inline-list li{
256
+ margin-right: 0;
257
+ margin-left: 15px;
258
+ }
259
+ }
260
+
261
+ /**
262
+ * 02. 03. Field: switcher
263
+ */
264
+ .csf-field-switcher{
265
+
266
+ .csf--switcher{
267
+ float: right;
268
+ }
269
+
270
+ .csf--label{
271
+ float: right;
272
+ margin-left: 0;
273
+ margin-right: 5px;
274
+ }
275
+ }
276
+
277
+ /**
278
+ * 02. 04. Field: upload
279
+ */
280
+ .csf-field-upload{
281
+
282
+ .csf--remove,
283
+ .csf--buttons{
284
+ margin-left: 0;
285
+ margin-right: 5px;
286
+ }
287
+ }
288
+
289
+ /**
290
+ * 02. 05. Field: group
291
+ */
292
+ .csf-field-group{
293
+
294
+ .csf-cloneable-title{
295
+ padding: 15px 10px 15px 65px;
296
+ }
297
+
298
+ .csf-cloneable-helper{
299
+ right: auto;
300
+ left: 10px;
301
+ }
302
+ }
303
+
304
+ /**
305
+ * 02. 06. Field: repeater
306
+ */
307
+ .csf-field-repeater{
308
+
309
+ .csf-repeater-helper{
310
+ border-left: 0;
311
+ border-right: 1px solid #eee;
312
+ }
313
+ }
314
+
315
+ /**
316
+ * 02. 07. Field: help
317
+ */
318
+ .csf-help{
319
+ right: auto;
320
+ left: 5px;
321
+ }
322
+
323
+ /**
324
+ * 02. 08. Field: icon
325
+ */
326
+ .csf-field-icon{
327
+
328
+ .button{
329
+ margin-right: 0;
330
+ margin-left: 5px;
331
+ }
332
+
333
+ .csf-icon-preview i{
334
+ margin-right: 0;
335
+ margin-left: 5px;
336
+ }
337
+ }
338
+
339
+ /**
340
+ * 02. 09. Field: gallery
341
+ */
342
+ .csf-field-gallery{
343
+
344
+ ul li{
345
+ margin-right: 0;
346
+ margin-left: 5px;
347
+ }
348
+
349
+ .button{
350
+ margin-right: 0;
351
+ margin-left: 5px;
352
+ }
353
+ }
354
+
355
+ /**
356
+ * 02. 11. Field: tabbed
357
+ */
358
+ .csf-field-tabbed{
359
+
360
+ .csf-tabbed-nav{
361
+
362
+ .fa{
363
+ padding-right: 0;
364
+ padding-left: 5px;
365
+ }
366
+
367
+ a{
368
+ margin-right: 0;
369
+ margin-left: 5px;
370
+ }
371
+ }
372
+ }
373
+
374
+ /**
375
+ * 02. 12. Field: media
376
+ */
377
+ .csf-field-media{
378
+
379
+ .button{
380
+ margin-left: 0;
381
+ margin-right: 7px;
382
+ }
383
+
384
+ .hidden + .button{
385
+ margin-right: 0;
386
+ }
387
+ }
388
+
389
+ /**
390
+ * 02. 13. Field: notice
391
+ */
392
+ .csf-notice{
393
+ border-left: none;
394
+ border-right-style: solid;
395
+ border-right-width: 4px;
396
+ }
397
+
398
+ /**
399
+ * 02. 14. Field: border, spacing, dimensions
400
+ */
401
+ .csf-field-dimensions,
402
+ .csf-field-spacing,
403
+ .csf-field-border{
404
+
405
+ .csf--input{
406
+ float: right;
407
+ margin-right: 0;
408
+ margin-left: 15px;
409
+ }
410
+
411
+ .csf--left{
412
+ float: right;
413
+ }
414
+ }
415
+
416
+ /**
417
+ * 02. 15. Field: background
418
+ */
419
+ .csf-field-background{
420
+
421
+ .csf--block{
422
+ float: right;
423
+ }
424
+
425
+ .csf--select,
426
+ .csf--media{
427
+ padding-right: 0;
428
+ }
429
+
430
+ .csf--title{
431
+ margin-right: 0;
432
+ margin-left: 5px;
433
+ }
434
+ }
435
+
436
+ /**
437
+ * 02. 16. Field: spinner
438
+ */
439
+ .csf-field-spinner{
440
+
441
+ .csf--spin{
442
+ float: right;
443
+ }
444
+ }
445
+
446
+ /**
447
+ * 02. 17. Field: slider
448
+ */
449
+ .csf-field-slider{
450
+
451
+ .ui-slider{
452
+ direction: ltr;
453
+ }
454
+
455
+ input[type="text"]{
456
+ margin-left: 0;
457
+ margin-right: 15px;
458
+ }
459
+
460
+ em{
461
+ padding-left: 0;
462
+ padding-right: 5px;
463
+ }
464
+ }
465
+
466
+ /**
467
+ * 02. 18. Field: button_set
468
+ */
469
+ .csf-field-button_set{
470
+
471
+ .csf--button-group{
472
+ float: right;
473
+ }
474
+ }
475
+
476
+ /**
477
+ * 02. 19. Field: link_color
478
+ */
479
+ .csf-field-link_color{
480
+
481
+ .csf--left{
482
+ float: right;
483
+ margin-right: 0;
484
+ margin-left: 10px;
485
+ }
486
+ }
487
+
488
+ /**
489
+ * 02. 20. Field: color_group
490
+ */
491
+ .csf-field-color_group{
492
+
493
+ .csf--left{
494
+ float: right;
495
+ margin-right: 0;
496
+ margin-left: 10px;
497
+ }
498
+ }
499
+
500
+ /**
501
+ * 02. 21. Field: palette
502
+ */
503
+ .csf-field-palette{
504
+
505
+ .csf--palette{
506
+ margin-right: 0;
507
+ margin-left: 10px;
508
+ }
509
+ }
510
+
511
+ /**
512
+ * 03. Taxonomy
513
+ */
514
+ .csf-taxonomy-add-fields{
515
+
516
+ .csf-fieldset{
517
+ margin-right: 0;
518
+ }
519
+
520
+ .csf-field > .csf-fieldset > .csf-help{
521
+ left: -5px;
522
+ right: auto;
523
+ }
524
+ }
525
+
526
+ .csf-taxonomy-edit-fields{
527
+
528
+ .csf-fieldset{
529
+ margin-left: 0;
530
+ margin-right: 225px;
531
+ }
532
+
533
+ .csf-field > .csf-fieldset > .csf-help{
534
+ right: auto;
535
+ left: -5px;
536
+ }
537
+ }
538
+
539
+ /**
540
+ * 04. Profile
541
+ */
542
+ .csf-profile{
543
+
544
+ > h2 > .fa{
545
+ padding-right: 0;
546
+ padding-left: 7px;
547
+ }
548
+
549
+ > .csf-field{
550
+
551
+ > .csf-fieldset{
552
+ margin-left: 0;
553
+ margin-right: 220px;
554
+ }
555
+
556
+ > .csf-help{
557
+ left: 0;
558
+ right: auto;
559
+ }
560
+ }
561
+ }
562
+
563
+ .csf-taxonomy-edit-fields{
564
+
565
+ .csf-fieldset{
566
+ margin-left: 0;
567
+ margin-right: 225px;
568
+ }
569
+
570
+ .csf-field > .csf-fieldset > .csf-help{
571
+ right: auto;
572
+ left: -5px;
573
+ }
574
+ }
575
+
576
+ /**
577
+ * 05. Modal
578
+ */
579
+ .csf-modal-content{
580
+
581
+ .csf-field{
582
+ padding: 15px 15px 15px 30px;
583
+ }
584
+ }
585
+
586
+ .csf-modal-title{
587
+ padding: 0 16px 0 36px;
588
+ }
589
+
590
+ .csf-modal-close{
591
+ right: auto;
592
+ left: 0;
593
+ }
594
+
595
+ /**
596
+ * 06. Customizer
597
+ */
598
+ .control-section{
599
+
600
+ .csf-field{
601
+
602
+ .csf-fieldset{
603
+ margin-right: 0;
604
+ }
605
+ }
606
+ }
607
+
608
+ /**
609
+ * 07. Responsive
610
+ */
611
+ @media only screen and (max-width:1200px){
612
+ .csf-metabox .csf-field .csf-fieldset{
613
+ margin-left: 0;
614
+ }
615
+ }
616
+
617
+ @media only screen and (max-width:782px){
618
+ .csf .csf-fieldset,
619
+ .csf .csf-content{
620
+ margin-right: 0;
621
+ }
622
+ }
623
+
624
+ /**
625
+ * 08. Others
626
+ */
627
+ .csf-field{
628
+
629
+ .csf--transparent-slider{
630
+ margin-left: 0;
631
+ margin-right: 2px;
632
+
633
+ .ui-slider-handle{
634
+ margin: 0 -11px;
635
+ }
636
+ }
637
+
638
+ .csf--transparent-offset{
639
+ background-position: center right;
640
+ }
641
+
642
+ .csf--transparent-text{
643
+ right: auto;
644
+ left: 10px;
645
+ }
646
+ }
admin/settings/assets/scss/csf.scss ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ *
3
+ * ---------------------------------------------------------
4
+ * CODESTAR FRAMEWORK CSS MAP
5
+ * ---------------------------------------------------------
6
+ *
7
+ * 01. Base
8
+ * 01. 01. Header
9
+ * 01. 02. Sticky
10
+ * 01. 03. Header Buttons
11
+ * 01. 04. Navigation
12
+ * 01. 05. Wrapper
13
+ * 01. 06. Content
14
+ * 01. 07. Section
15
+ * 01. 08. Footer
16
+ * 01. 09. Copyright
17
+ * 01. 10. Show All Options
18
+ * 01. 11. Search Input
19
+ * 01. 12. Metabox
20
+ * 01. 13. Comment Metabox
21
+ * 01. 14. Help Tooltip
22
+ * 02. Themes
23
+ * 02. 01. Theme Dark
24
+ * 02. 02. Theme Light
25
+ * 03. Fields
26
+ * 03. 01. Field
27
+ * 03. 02. Field: accordion
28
+ * 03. 03. Field: background
29
+ * 03. 04. Field: backup
30
+ * 03. 05. Field: border, spacing, dimensions
31
+ * 03. 06. Field: button_set
32
+ * 03. 07. Field: checkbox, radio
33
+ * 03. 08. Field: code_editor
34
+ * 03. 09. Field: color
35
+ * 03. 10. Field: color_group
36
+ * 03. 11. Field: fieldset
37
+ * 03. 12. Field: date
38
+ * 03. 13. Field: gallery
39
+ * 03. 14. Field: group
40
+ * 03. 15. Field: icon
41
+ * 03. 16. Field: image_select
42
+ * 03. 17. Field: link_color
43
+ * 03. 18. Field: map
44
+ * 03. 19. Field: media
45
+ * 03. 20. Field: palette
46
+ * 03. 21. Field: repeater
47
+ * 03. 22. Field: select
48
+ * 03. 23. Field: slider
49
+ * 03. 24. Field: sortable
50
+ * 03. 25. Field: sorter
51
+ * 03. 26. Field: spinner
52
+ * 03. 27. Field: switcher
53
+ * 03. 28. Field: tabbed
54
+ * 03. 29. Field: text
55
+ * 03. 30. Field: textarea
56
+ * 03. 31. Field: typography
57
+ * 03. 32. Field: upload
58
+ * 03. 33. Field: wp_editor
59
+ * 03. 34. Field: heading
60
+ * 03. 35. Field: subheading
61
+ * 03. 36. Field: submessage
62
+ * 03. 37. Field: notice
63
+ * 03. 38. Field: number
64
+ * 03. 39. Field: others
65
+ * 04. Widget
66
+ * 05. Customizer
67
+ * 06. Taxonomy
68
+ * 07. Profile
69
+ * 08. Modal
70
+ * 08. 01. Shortcode Modal
71
+ * 08. 02. Gutenberg Modal
72
+ * 08. 03. Icon Modal
73
+ * 09. Helper
74
+ * 10. Welcome Page
75
+ * 11. Responsive
76
+ * 12. Others
77
+ *
78
+ * ---------------------------------------------------------
79
+ *
80
+ */
81
+ @import "compass";
82
+ @import "vendor/mixins";
83
+ @import "vendor/base";
84
+ @import "vendor/themes";
85
+ @import "vendor/fields";
86
+ @import "vendor/widget";
87
+ @import "vendor/customizer";
88
+ @import "vendor/taxonomy";
89
+ @import "vendor/profile";
90
+ @import "vendor/modal";
91
+ @import "vendor/helper";
92
+ @import "vendor/welcome";
93
+ @import "vendor/responsive";
94
+ @import "vendor/chosen";
admin/settings/assets/scss/vendor/_base.scss ADDED
@@ -0,0 +1,446 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * 01. Base
3
+ */
4
+ .csf{
5
+ position: relative;
6
+
7
+ label{
8
+ padding: 0;
9
+ margin: 0;
10
+ display: inline-block;
11
+ }
12
+ }
13
+
14
+ .csf-ab-icon{
15
+ top: 2px;
16
+ }
17
+
18
+ #screen-meta-links + .csf-options{
19
+ margin-top: 40px;
20
+ }
21
+
22
+ .csf-options{
23
+ margin-top: 20px;
24
+ margin-right: 20px;
25
+ }
26
+
27
+ /**
28
+ * 01. 01. Header
29
+ */
30
+ .csf-header{
31
+ position: relative;
32
+ }
33
+
34
+ .csf-header-inner{
35
+ padding: 25px;
36
+
37
+ h1{
38
+ float: left;
39
+ font-size: 1.5em;
40
+ line-height: 26px;
41
+ font-weight: 400;
42
+ margin: 0;
43
+
44
+ small{
45
+ font-size: 11px;
46
+ font-weight: 500;
47
+ }
48
+ }
49
+ }
50
+
51
+ /**
52
+ * 01. 02. Sticky
53
+ */
54
+ .csf-sticky{
55
+
56
+ .csf-header-inner{
57
+ position: fixed;
58
+ z-index: 99999;
59
+ top: 32px;
60
+ @include box-shadow(0 5px 25px rgba(black, 0.125));
61
+ }
62
+ }
63
+
64
+ /**
65
+ * 01. 03. Header Buttons
66
+ */
67
+ .csf-buttons{
68
+ float: right;
69
+ @include transition(opacity 0.2s);
70
+
71
+ .button{
72
+ margin: 0 2px;
73
+ line-height: 26px;
74
+
75
+ &:focus{
76
+ outline: none !important;
77
+ box-shadow: none !important;
78
+ }
79
+ }
80
+
81
+ .csf-save{
82
+ min-width: 72px;
83
+ }
84
+ }
85
+
86
+ .csf-header-left{
87
+ float: left;
88
+ }
89
+
90
+ .csf-header-right{
91
+ float: right;
92
+ }
93
+
94
+ /**
95
+ * 01. 04. Navigation
96
+ */
97
+ .csf-nav{
98
+ display: block;
99
+ position: relative;
100
+ z-index: 10;
101
+ float: left;
102
+ width: 225px;
103
+
104
+ ul{
105
+ clear: left;
106
+ margin: 0;
107
+ list-style-type: none;
108
+
109
+ li{
110
+ margin-bottom: 0;
111
+
112
+ a{
113
+ font-size: 13px;
114
+ position: relative;
115
+ display: block;
116
+ padding: 14px 12px;
117
+ text-decoration: none;
118
+ @include transition(all 0.3s ease);
119
+
120
+ &:focus{
121
+ outline: none;
122
+ @include box-shadow(none);
123
+ }
124
+ }
125
+
126
+ .csf-section-active{
127
+
128
+ &:after{
129
+ content: " ";
130
+ position: absolute;
131
+ right: 0;
132
+ top: 50%;
133
+ height: 0;
134
+ width: 0;
135
+ pointer-events: none;
136
+ border: solid transparent;
137
+ border-right-color: #fff;
138
+ border-width: 4px;
139
+ margin-top: -4px;
140
+ }
141
+ }
142
+
143
+ .csf-arrow:after{
144
+ content: "\f054";
145
+ display: inline-block;
146
+ font-family: "FontAwesome";
147
+ font-size: 9px;
148
+ line-height: 1;
149
+ position: absolute;
150
+ right: 10px;
151
+ top: 50%;
152
+ margin-top: -4px;
153
+ @include transform(rotate(0));
154
+ }
155
+
156
+ &.csf-tab-active{
157
+
158
+ .csf-arrow:after{
159
+ @include transform( rotate(90deg) );
160
+ }
161
+
162
+ ul{
163
+ display: block;
164
+ }
165
+ }
166
+ }
167
+
168
+ ul{
169
+ display: none;
170
+ position: relative;
171
+
172
+ li{
173
+
174
+ a{
175
+ font-size: 12px;
176
+ padding: 12px 14px 12px 24px;
177
+ }
178
+ }
179
+ }
180
+ }
181
+
182
+ .fa{
183
+ width: 20px;
184
+ margin-right: 5px;
185
+ font-size: 14px;
186
+ text-align: center;
187
+ }
188
+
189
+ .csf-label-error{
190
+ margin-left: 4px;
191
+ vertical-align: top;
192
+ }
193
+ }
194
+
195
+ .csf-nav-background{
196
+ position: absolute;
197
+ top: 0;
198
+ left: 0;
199
+ bottom: 0;
200
+ z-index: 9;
201
+ width: 225px;
202
+ }
203
+
204
+ /**
205
+ * 01. 05. Wrapper
206
+ */
207
+ .csf-wrapper{
208
+ position: relative;
209
+ }
210
+
211
+ /**
212
+ * 01. 06. Content
213
+ */
214
+ .csf-content{
215
+ position: relative;
216
+ margin-left: 225px;
217
+ background-color: #fff;
218
+ @include transition(opacity 0.2s);
219
+ }
220
+
221
+ /**
222
+ * 01. 07. Section
223
+ */
224
+ .csf-sections{
225
+ float: left;
226
+ width: 100%;
227
+ }
228
+
229
+ .csf-section{
230
+ display: none;
231
+ }
232
+
233
+ .csf-section-title{
234
+ display: none;
235
+ padding: 20px 30px;
236
+ background-color: #f5f5f5;
237
+ border-top: 1px solid #eee;
238
+ border-bottom: 1px solid #eee;
239
+
240
+ h3{
241
+ margin: 0;
242
+ padding: 0 ;
243
+ font-size: 13px;
244
+ font-weight: bold;
245
+ text-transform: uppercase;
246
+ }
247
+
248
+ .fa{
249
+ margin-right: 5px;
250
+ }
251
+ }
252
+
253
+ /**
254
+ * 01. 08. Footer
255
+ */
256
+ .csf-footer{
257
+ padding: 20px;
258
+ font-size: 11px;
259
+ }
260
+
261
+ /**
262
+ * 01. 09. Copyright
263
+ */
264
+ .csf-copyright{
265
+ float: left;
266
+ margin-top: 5px;
267
+ }
268
+
269
+ /**
270
+ * 01. 10. Show All Options
271
+ */
272
+ .csf-search-all,
273
+ .csf-show-all{
274
+ .csf-nav-background,
275
+ .csf-nav{
276
+ display: none;
277
+ }
278
+
279
+ .csf-content{
280
+ margin-left: 0;
281
+ }
282
+
283
+ .csf-section-title,
284
+ .csf-section{
285
+ display: block !important;
286
+ }
287
+ }
288
+
289
+ .csf-search-all{
290
+ .csf-section-title{
291
+ display: none !important;
292
+ }
293
+ }
294
+
295
+ //
296
+ // Expand
297
+ //
298
+ .csf-expand-all{
299
+ float: left;
300
+ padding: 0 8px;
301
+ margin-right: 4px;
302
+ z-index: 1;
303
+ font-size: 14px;
304
+ line-height: 28px;
305
+ cursor: pointer;
306
+ user-select: none;
307
+ @include border-radius(2px);
308
+ @include transition(all 0.2s);
309
+
310
+ span{
311
+ font-size: 11px;
312
+ vertical-align: middle;
313
+ }
314
+ }
315
+
316
+ /**
317
+ * 01. 11. Search Input
318
+ */
319
+ .csf-search{
320
+ float: left;
321
+
322
+ input{
323
+ margin: 0 2px 0 0;
324
+ border: none;
325
+ font-size: 12px;
326
+ line-height: 28px;
327
+ min-height: 28px;
328
+ text-align: inherit;
329
+ padding: 0 10px;
330
+ @include border-radius(2px);
331
+ @include box-shadow(none);
332
+
333
+ &:focus{
334
+ @include box-shadow(none);
335
+ }
336
+ }
337
+ }
338
+
339
+ .csf-saving{
340
+
341
+ .csf-buttons,
342
+ .csf-content{
343
+ cursor: default;
344
+ pointer-events: none;
345
+ @include opacity(0.5);
346
+ }
347
+ }
348
+
349
+ /**
350
+ * 01. 12. Metabox
351
+ */
352
+ .csf-metabox{
353
+ margin: -6px -12px -12px -12px;
354
+
355
+ .csf-section-title{
356
+ padding: 20px;
357
+ }
358
+ }
359
+
360
+ .block-editor-page{
361
+
362
+ .csf-metabox{
363
+ margin: -6px -14px -12px -14px;
364
+ }
365
+ }
366
+
367
+ .csf-restore-wrapper{
368
+ text-align: right;
369
+ padding: 10px;
370
+ border-top: 1px solid #eee;
371
+
372
+ .csf-button-cancel,
373
+ input{
374
+ display: none;
375
+ }
376
+
377
+ span{
378
+ -webkit-user-select: none;
379
+ user-select: none;
380
+ }
381
+
382
+
383
+ input:checked ~ .csf-button-restore{
384
+ display: none;
385
+ }
386
+
387
+ input:checked ~ .csf-button-cancel{
388
+ display: inline-block;
389
+ }
390
+
391
+ }
392
+
393
+ #side-sortables{
394
+
395
+ .csf-section-title{
396
+ padding: 12px;
397
+ }
398
+
399
+ .csf-field{
400
+ padding: 12px;
401
+
402
+ .csf-title{
403
+ float: none;
404
+ width: 100%;
405
+ margin-bottom: 10px;
406
+ }
407
+
408
+ .csf-fieldset{
409
+ margin-left: 0;
410
+ }
411
+ }
412
+
413
+ .csf-notice{
414
+ padding: 12px;
415
+ }
416
+ }
417
+
418
+ /**
419
+ * 01. 13. Comment Metabox
420
+ */
421
+ .csf-comment-metabox{
422
+ margin: -6px -12px -12px -12px;
423
+
424
+ .csf-section-title{
425
+ padding: 20px;
426
+ }
427
+ }
428
+
429
+
430
+ /**
431
+ * 01. 14. Help Tooltip
432
+ */
433
+ .csf-tooltip{
434
+ position: absolute;
435
+ z-index: 5000001;
436
+ font-size: 12px;
437
+ line-height: 1.4;
438
+ text-align: center;
439
+ text-decoration: none;
440
+ padding: 6px 12px;
441
+ max-width: 200px;
442
+ color: #fff;
443
+ background-color: #000;
444
+ background-color: rgba(black, 0.85);
445
+ @include border-radius(4px);
446
+ }
admin/settings/assets/scss/vendor/_chosen.scss ADDED
@@ -0,0 +1,405 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Chosen JS Styles
3
+ */
4
+ .chosen-container {
5
+ position: relative;
6
+ display: inline-block;
7
+ vertical-align: middle;
8
+ font-size: 13px;
9
+ user-select: none;
10
+ }
11
+
12
+ .chosen-container * {
13
+ box-sizing: border-box;
14
+ }
15
+
16
+ .chosen-container .chosen-drop {
17
+ position: absolute;
18
+ top: 100%;
19
+ z-index: 1010;
20
+ width: 100%;
21
+ border: 1px solid #aaa;
22
+ border-top: 0;
23
+ background: #fff;
24
+ box-shadow: 0 4px 5px rgba(0, 0, 0, 0.15);
25
+ clip: rect(0, 0, 0, 0);
26
+ clip-path: inset(100% 100%);
27
+ }
28
+
29
+ .chosen-container.chosen-with-drop .chosen-drop {
30
+ clip: auto;
31
+ clip-path: none;
32
+ }
33
+
34
+ .chosen-container a {
35
+ cursor: pointer;
36
+ }
37
+
38
+ .chosen-container .search-choice .group-name, .chosen-container .chosen-single .group-name {
39
+ margin-right: 4px;
40
+ overflow: hidden;
41
+ white-space: nowrap;
42
+ text-overflow: ellipsis;
43
+ font-weight: normal;
44
+ color: #999999;
45
+ }
46
+
47
+ .chosen-container .search-choice .group-name:after, .chosen-container .chosen-single .group-name:after {
48
+ content: ":";
49
+ padding-left: 2px;
50
+ vertical-align: top;
51
+ }
52
+
53
+ .chosen-container-single .chosen-single {
54
+ position: relative;
55
+ display: block;
56
+ overflow: hidden;
57
+ padding: 0 0 0 8px;
58
+ height: 25px;
59
+ border: 1px solid #aaa;
60
+ border-radius: 5px;
61
+ background-color: #fff;
62
+ background: linear-gradient(#fff 20%, #f6f6f6 50%, #eee 52%, #f4f4f4 100%);
63
+ background-clip: padding-box;
64
+ box-shadow: 0 0 3px #fff inset, 0 1px 1px rgba(0, 0, 0, 0.1);
65
+ color: #444;
66
+ text-decoration: none;
67
+ white-space: nowrap;
68
+ line-height: 24px;
69
+ }
70
+
71
+ .chosen-container-single .chosen-default {
72
+ color: #999;
73
+ }
74
+
75
+ .chosen-container-single .chosen-single span {
76
+ display: block;
77
+ overflow: hidden;
78
+ margin-right: 26px;
79
+ text-overflow: ellipsis;
80
+ white-space: nowrap;
81
+ }
82
+
83
+ .chosen-container-single .chosen-single-with-deselect span {
84
+ margin-right: 38px;
85
+ }
86
+
87
+ .chosen-container-single .chosen-single abbr {
88
+ position: absolute;
89
+ top: 6px;
90
+ right: 26px;
91
+ display: block;
92
+ width: 12px;
93
+ height: 12px;
94
+ font-size: 1px;
95
+ }
96
+
97
+ .chosen-container-single .chosen-single div {
98
+ position: absolute;
99
+ top: 0;
100
+ right: 0;
101
+ display: block;
102
+ width: 18px;
103
+ height: 100%;
104
+ }
105
+
106
+ .chosen-container-single .chosen-single div b {
107
+ display: block;
108
+ width: 100%;
109
+ height: 100%;
110
+ }
111
+
112
+ .chosen-container-single .chosen-search {
113
+ position: relative;
114
+ z-index: 1010;
115
+ margin: 0;
116
+ padding: 3px 4px;
117
+ white-space: nowrap;
118
+ }
119
+
120
+ .chosen-container-single .chosen-search input[type="text"] {
121
+ margin: 1px 0;
122
+ padding: 4px 20px 4px 5px;
123
+ width: 100%;
124
+ height: auto;
125
+ outline: 0;
126
+ border: 1px solid #aaa;
127
+ font-size: 1em;
128
+ font-family: sans-serif;
129
+ line-height: normal;
130
+ border-radius: 0;
131
+ }
132
+
133
+ .chosen-container-single .chosen-drop {
134
+ margin-top: -1px;
135
+ border-radius: 0 0 4px 4px;
136
+ background-clip: padding-box;
137
+ }
138
+
139
+ .chosen-container-single.chosen-container-single-nosearch .chosen-search {
140
+ position: absolute;
141
+ clip: rect(0, 0, 0, 0);
142
+ clip-path: inset(100% 100%);
143
+ }
144
+
145
+ .chosen-container .chosen-results {
146
+ color: #444;
147
+ position: relative;
148
+ overflow-x: hidden;
149
+ overflow-y: auto;
150
+ margin: 0 4px 4px 0;
151
+ padding: 0 0 0 4px;
152
+ max-height: 240px;
153
+ -webkit-overflow-scrolling: touch;
154
+ }
155
+
156
+ .chosen-container .chosen-results li {
157
+ display: none;
158
+ margin: 0;
159
+ padding: 5px 6px;
160
+ list-style: none;
161
+ line-height: 15px;
162
+ word-wrap: break-word;
163
+ -webkit-touch-callout: none;
164
+ }
165
+
166
+ .chosen-container .chosen-results li.active-result {
167
+ display: list-item;
168
+ cursor: pointer;
169
+ }
170
+
171
+ .chosen-container .chosen-results li.disabled-result {
172
+ display: list-item;
173
+ color: #ccc;
174
+ cursor: default;
175
+ }
176
+
177
+ .chosen-container .chosen-results li.highlighted {
178
+ background-color: #3875d7;
179
+ background-image: linear-gradient(#3875d7 20%, #2a62bc 90%);
180
+ color: #fff;
181
+ }
182
+
183
+ .chosen-container .chosen-results li.no-results {
184
+ color: #777;
185
+ display: list-item;
186
+ background: #f4f4f4;
187
+ }
188
+
189
+ .chosen-container .chosen-results li.group-result {
190
+ display: list-item;
191
+ font-weight: bold;
192
+ cursor: default;
193
+ }
194
+
195
+ .chosen-container .chosen-results li.group-option {
196
+ padding-left: 15px;
197
+ }
198
+
199
+ .chosen-container .chosen-results li em {
200
+ font-style: normal;
201
+ text-decoration: underline;
202
+ }
203
+
204
+ .chosen-container-multi .chosen-choices {
205
+ position: relative;
206
+ overflow: hidden;
207
+ margin: 0;
208
+ padding: 0 5px;
209
+ width: 100%;
210
+ height: auto;
211
+ border: 1px solid #aaa;
212
+ background-color: #fff;
213
+ background-image: linear-gradient(#eee 1%, #fff 15%);
214
+ cursor: text;
215
+ }
216
+
217
+ .chosen-container-multi .chosen-choices li {
218
+ float: left;
219
+ list-style: none;
220
+ }
221
+
222
+ .chosen-container-multi .chosen-choices li.search-field {
223
+ margin: 0;
224
+ padding: 0;
225
+ white-space: nowrap;
226
+ }
227
+
228
+ .chosen-container-multi .chosen-choices li.search-field input[type="text"] {
229
+ margin: 1px 0;
230
+ padding: 0;
231
+ outline: 0;
232
+ border: 0 !important;
233
+ background: transparent !important;
234
+ box-shadow: none;
235
+ color: #999;
236
+ font-size: 100%;
237
+ font-family: sans-serif;
238
+ line-height: normal;
239
+ border-radius: 0;
240
+ width: 25px;
241
+ height: 25px;
242
+ min-height: 25px;
243
+ }
244
+
245
+ .chosen-container-multi .chosen-choices li.search-choice {
246
+ position: relative;
247
+ margin: 3px 5px 3px 0;
248
+ padding: 3px 20px 3px 6px;
249
+ border: 1px solid #aaa;
250
+ max-width: 100%;
251
+ border-radius: 3px;
252
+ background-color: #eeeeee;
253
+ background-image: linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
254
+ background-size: 100% 19px;
255
+ background-repeat: repeat-x;
256
+ background-clip: padding-box;
257
+ box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05);
258
+ color: #333;
259
+ line-height: 13px;
260
+ cursor: default;
261
+ }
262
+
263
+ .chosen-container-multi .chosen-choices li.search-choice span {
264
+ word-wrap: break-word;
265
+ white-space: nowrap;
266
+ }
267
+
268
+ .chosen-container-multi .chosen-choices li.search-choice .search-choice-close {
269
+ position: absolute;
270
+ top: 0;
271
+ right: 0;
272
+ display: block;
273
+ width: 12px;
274
+ height: 12px;
275
+ font-size: 1px;
276
+ }
277
+
278
+ .chosen-container-multi .chosen-choices li.search-choice-disabled {
279
+ padding-right: 5px;
280
+ border: 1px solid #ccc;
281
+ background-color: #e4e4e4;
282
+ background-image: linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
283
+ color: #666;
284
+ }
285
+
286
+ .chosen-container-multi .chosen-choices li.search-choice-focus {
287
+ background: #d4d4d4;
288
+ }
289
+
290
+ .chosen-container-multi .chosen-results {
291
+ margin: 0;
292
+ padding: 0;
293
+ }
294
+
295
+ .chosen-container-multi .chosen-drop .result-selected {
296
+ display: list-item;
297
+ color: #ccc;
298
+ cursor: default;
299
+ }
300
+
301
+ .chosen-container-active .chosen-single {
302
+ border: 1px solid #5897fb;
303
+ box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
304
+ }
305
+
306
+ .chosen-container-active.chosen-with-drop .chosen-single {
307
+ border: 1px solid #aaa;
308
+ border-bottom-right-radius: 0;
309
+ border-bottom-left-radius: 0;
310
+ background-image: linear-gradient(#eee 20%, #fff 80%);
311
+ box-shadow: 0 1px 0 #fff inset;
312
+ }
313
+
314
+ .chosen-container-active.chosen-with-drop .chosen-single div {
315
+ border-left: none;
316
+ background: transparent;
317
+ }
318
+
319
+ .chosen-container-active .chosen-choices {
320
+ border: 1px solid #5897fb;
321
+ box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
322
+ }
323
+
324
+ .chosen-container-active .chosen-choices li.search-field input[type="text"] {
325
+ color: #222 !important;
326
+ }
327
+
328
+ .chosen-disabled {
329
+ opacity: 0.5 !important;
330
+ cursor: default;
331
+ }
332
+
333
+ .chosen-disabled .chosen-single {
334
+ cursor: default;
335
+ }
336
+
337
+ .chosen-disabled .chosen-choices .search-choice .search-choice-close {
338
+ cursor: default;
339
+ }
340
+
341
+ .chosen-rtl {
342
+ text-align: right;
343
+ }
344
+
345
+ .chosen-rtl .chosen-single {
346
+ overflow: visible;
347
+ padding: 0 8px 0 0;
348
+ }
349
+
350
+ .chosen-rtl .chosen-single span {
351
+ margin-right: 0;
352
+ margin-left: 26px;
353
+ direction: rtl;
354
+ }
355
+
356
+ .chosen-rtl .chosen-single-with-deselect span {
357
+ margin-left: 38px;
358
+ }
359
+
360
+ .chosen-rtl .chosen-single div {
361
+ right: auto;
362
+ left: 3px;
363
+ }
364
+
365
+ .chosen-rtl .chosen-single abbr {
366
+ right: auto;
367
+ left: 26px;
368
+ }
369
+
370
+ .chosen-rtl .chosen-choices li {
371
+ float: right;
372
+ }
373
+
374
+ .chosen-rtl .chosen-choices li.search-field input[type="text"] {
375
+ direction: rtl;
376
+ }
377
+
378
+ .chosen-rtl .chosen-choices li.search-choice {
379
+ margin: 3px 5px 3px 0;
380
+ padding: 3px 5px 3px 19px;
381
+ }
382
+
383
+ .chosen-rtl .chosen-choices li.search-choice .search-choice-close {
384
+ right: auto;
385
+ left: 4px;
386
+ }
387
+
388
+ .chosen-rtl.chosen-container-single .chosen-results {
389
+ margin: 0 0 4px 4px;
390
+ padding: 0 4px 0 0;
391
+ }
392
+
393
+ .chosen-rtl .chosen-results li.group-option {
394
+ padding-right: 15px;
395
+ padding-left: 0;
396
+ }
397
+
398
+ .chosen-rtl.chosen-container-active.chosen-with-drop .chosen-single div {
399
+ border-right: none;
400
+ }
401
+
402
+ .chosen-rtl .chosen-search input[type="text"] {
403
+ padding: 4px 5px 4px 20px;
404
+ direction: rtl;
405
+ }
admin/settings/assets/scss/vendor/_customizer.scss ADDED
@@ -0,0 +1,185 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * 05. Widget
3
+ */
4
+ .control-section{
5
+
6
+ .csf-field{
7
+ padding: 0;
8
+
9
+ .csf-title{
10
+ float: none;
11
+ width: 100%;
12
+ margin-bottom: 6px;
13
+
14
+ h4{
15
+ display: block;
16
+ font-size: 13px;
17
+ line-height: 1;
18
+ font-weight: 600;
19
+ color: inherit;
20
+ }
21
+ }
22
+
23
+ .csf-fieldset{
24
+ margin-left: 0;
25
+ }
26
+ }
27
+
28
+ .csf-help{
29
+ top: -5px;
30
+ right: -5px;
31
+ }
32
+
33
+ .csf-field-select select{
34
+ width: 100%;
35
+ }
36
+
37
+ .csf-field-heading{
38
+ color: inherit;
39
+ font-size: 14px;
40
+ line-height: 1em;
41
+ margin-right: -15px;
42
+ margin-left: -15px;
43
+ padding: 15px;
44
+ }
45
+
46
+ .csf-field-subheading{
47
+ color: inherit;
48
+ font-size: 11px;
49
+ margin-right: -15px;
50
+ margin-left: -15px;
51
+ padding: 10px 15px;
52
+ }
53
+
54
+ .csf-text-subtitle{
55
+ margin-top: 4px;
56
+ font-size: 12px;
57
+ }
58
+
59
+ .csf-field-submessage .csf-submessage{
60
+ margin-right: -15px;
61
+ margin-left: -15px;
62
+ padding: 15px;
63
+ }
64
+
65
+ .csf-fieldset{
66
+
67
+ .csf-field-submessage .csf-submessage,
68
+ .csf-field-heading,
69
+ .csf-field-subheading{
70
+ margin-left: 0;
71
+ margin-right: 0;
72
+ }
73
+ }
74
+
75
+ .csf-field-date{
76
+
77
+ .csf--to{
78
+ margin-left: 0;
79
+ }
80
+ }
81
+
82
+ .csf-field-sorter{
83
+
84
+ ul li{
85
+ padding: 5px;
86
+ }
87
+
88
+ .csf-modules{
89
+ float: none;
90
+ width: 100%;
91
+ }
92
+
93
+ .csf-modules:first-child{
94
+ padding-right: 0;
95
+ padding-bottom: 15px;
96
+ }
97
+ }
98
+
99
+ .csf-field-background{
100
+
101
+ .csf--background-attributes{
102
+ flex-direction: column;
103
+ }
104
+ }
105
+
106
+ .csf-field-spacing{
107
+ input{
108
+ width: 90px;
109
+ }
110
+ }
111
+
112
+ .csf-field-border{
113
+
114
+ .csf--input{
115
+ flex: 1 50%;
116
+ }
117
+
118
+ input,
119
+ select{
120
+ width: 100%;
121
+ }
122
+ }
123
+
124
+ .csf-field-spinner{
125
+ input{
126
+ width: 50px;
127
+ }
128
+ }
129
+
130
+ .csf-field-number{
131
+
132
+ .csf--wrap{
133
+ width: 100%;
134
+ }
135
+ }
136
+
137
+ .csf-field-backup{
138
+
139
+ .csf-export-data{
140
+ display: none;
141
+ }
142
+ }
143
+
144
+ .csf-field-fieldset{
145
+
146
+ .csf-fieldset-content{
147
+ border-color: #e5e5e5;
148
+ }
149
+
150
+ .csf-field{
151
+ padding: 10px;
152
+
153
+ .csf-title{
154
+ margin-bottom: 5px;
155
+ }
156
+
157
+ h4{
158
+ font-size: 12px;
159
+ }
160
+ }
161
+ }
162
+
163
+ .csf-field-group,
164
+ .csf-field-tabbed,
165
+ .csf-field-sortable,
166
+ .csf-field-repeater,
167
+ .csf-field-accordion{
168
+
169
+ .csf-field{
170
+ padding: 10px;
171
+
172
+ .csf-title{
173
+ margin-bottom: 5px;
174
+ }
175
+
176
+ h4{
177
+ font-size: 12px;
178
+ }
179
+ }
180
+ }
181
+
182
+ .csf-dependency-control.hidden{
183
+ display: none !important;
184
+ }
185
+ }
admin/settings/assets/scss/vendor/_fields.scss ADDED
@@ -0,0 +1,2193 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * 03. Fields
3
+ */
4
+ .csf-field{
5
+ position: relative;
6
+ padding: 30px;
7
+
8
+ + .csf-field:not(.hidden){
9
+ border-top: 1px solid #eee;
10
+ }
11
+
12
+ p:first-child{
13
+ margin-top: 0;
14
+ }
15
+
16
+ p:last-child{
17
+ margin-bottom: 0;
18
+ }
19
+
20
+ &:after,
21
+ &:before{
22
+ content: " ";
23
+ display: table;
24
+ }
25
+
26
+ &:after{
27
+ clear: both;
28
+ }
29
+
30
+ h4{
31
+ margin-top: 0;
32
+ }
33
+
34
+ .csf-title{
35
+ position: relative;
36
+ width: 20%;
37
+ float: left;
38
+
39
+ h4{
40
+ margin: 0;
41
+ color: #23282d;
42
+ }
43
+ }
44
+
45
+ .csf-fieldset{
46
+ margin-left: 25%;
47
+ }
48
+ }
49
+
50
+ .csf-pseudo-field{
51
+ padding: 0 5px 0 0 !important;
52
+ display: inline-block;
53
+
54
+ + .csf-pseudo-field{
55
+ border: 0;
56
+ }
57
+
58
+ pre{
59
+ display: none;
60
+ }
61
+ }
62
+
63
+ /**
64
+ * 03. 02. Field: accordion
65
+ */
66
+ .csf-field-accordion{
67
+
68
+ .csf-accordion-item{
69
+ position: relative;
70
+ margin-bottom: 5px;
71
+
72
+ h4{
73
+ font-size: 1em;
74
+ }
75
+ }
76
+
77
+ .csf-accordion-title{
78
+ display: block;
79
+ cursor: pointer;
80
+ position: relative;
81
+ margin: 0;
82
+ padding: 15px;
83
+ min-height: 0;
84
+ font-size: 100%;
85
+ user-select: none;
86
+ border: 1px solid #ccd0d4;
87
+ background-color: #fafafa;
88
+ box-shadow: 0 1px 1px rgba(0,0,0,.04);
89
+ transition: border-color .15s;
90
+
91
+ &:active,
92
+ &:hover,
93
+ &:focus{
94
+ outline: none;
95
+ border-color: #999;
96
+ }
97
+ }
98
+
99
+ .csf-accordion-icon{
100
+ width: 14px;
101
+ text-align: center;
102
+ }
103
+
104
+ .csf--icon{
105
+ width: 20px;
106
+ text-align: center;
107
+ }
108
+
109
+ .csf-accordion-content{
110
+ display: none;
111
+ padding: 0;
112
+ border: 1px solid #ccd0d4;
113
+ border-top: none;
114
+ background-color: #fff;
115
+ box-shadow: 0 1px 1px rgba(0,0,0,.04);
116
+
117
+ > .csf-field{
118
+ padding: 15px;
119
+ }
120
+ }
121
+
122
+ .csf-accordion-open{
123
+ display: block;
124
+ }
125
+ }
126
+
127
+ /**
128
+ * 03. 03. Field: background
129
+ */
130
+ .csf-field-background{
131
+
132
+ .csf-field{
133
+ border: 0 !important;
134
+ padding: 0;
135
+ margin-bottom: 6px;
136
+ margin-right: 6px;
137
+ }
138
+
139
+ .csf--title{
140
+ color: #777;
141
+ font-size: 12px;
142
+ }
143
+
144
+ .csf--background-colors{
145
+ display: flex;
146
+ }
147
+
148
+ .csf--background-attributes{
149
+ display: flex;
150
+ flex-wrap: wrap;
151
+
152
+ select{
153
+ min-width: 100%;
154
+ margin: 0;
155
+ }
156
+
157
+ .csf-field{
158
+ flex: 1;
159
+ }
160
+ }
161
+
162
+ .csf--attributes-hidden{
163
+ display: none;
164
+ }
165
+
166
+ .wp-color-result.button{
167
+ margin-bottom: 0;
168
+ }
169
+ }
170
+
171
+ /**
172
+ * 03. 04. Field: backup
173
+ */
174
+ .csf-field-backup{
175
+
176
+ textarea{
177
+ width: 100%;
178
+ min-height: 200px;
179
+ margin-bottom: 5px;
180
+ }
181
+
182
+ small{
183
+ display: inline-block;
184
+ margin: 5px;
185
+ }
186
+
187
+ hr{
188
+ margin: 20px 0;
189
+ border: none;
190
+ border-bottom: 1px solid #e5e5e5;
191
+ }
192
+ }
193
+
194
+ /**
195
+ * 03. 05. Field: border, spacing, dimensions
196
+ */
197
+ .csf-field-border,
198
+ .csf-field-spacing,
199
+ .csf-field-dimensions{
200
+
201
+ .csf--inputs{
202
+ float: left;
203
+ display: flex;
204
+ flex-wrap: wrap;
205
+ }
206
+
207
+ .csf--input{
208
+ display: flex;
209
+ padding-right: 6px;
210
+ padding-bottom: 4px;
211
+ box-sizing: border-box;
212
+
213
+ select{
214
+ margin: 0;
215
+ }
216
+
217
+ input{
218
+ position: relative;
219
+ z-index: 1;
220
+ margin: 0;
221
+ width: 65px;
222
+ max-width: 100%;
223
+ text-align: center;
224
+ }
225
+ }
226
+
227
+ .csf--color{
228
+ float: left;
229
+ }
230
+
231
+ .csf--label{
232
+ display: flex;
233
+ flex-direction: column;
234
+ justify-content: center;
235
+ user-select: none;
236
+ min-width: 20px;
237
+ max-width: 100%;
238
+ padding: 0 4px;
239
+ font-size: 12px;
240
+ text-align: center;
241
+ color: #555;
242
+ border: 1px solid #7B776C;
243
+ background-color: #f5f5f5;
244
+ }
245
+
246
+ .csf--icon{
247
+ border-right: 0;
248
+ border-radius: 4px 0 0 4px;
249
+ }
250
+
251
+ .csf--icon + input{
252
+ border-top-left-radius: 0;
253
+ border-bottom-left-radius: 0;
254
+ }
255
+
256
+ .csf--unit{
257
+ border-left: 0;
258
+ border-radius: 0 4px 4px 0;
259
+ }
260
+
261
+ .csf--is-unit{
262
+ border-top-right-radius: 0;
263
+ border-bottom-right-radius: 0;
264
+ }
265
+ }
266
+
267
+ /**
268
+ * 03. 06. Field: button_set
269
+ */
270
+ .csf-field-button_set{
271
+
272
+ .csf--buttons{
273
+ display: inline-block;
274
+ }
275
+
276
+ .csf--button{
277
+ position: relative;
278
+ z-index: 1;
279
+ float: left;
280
+ cursor: pointer;
281
+ padding: 7px 14px;
282
+ min-width: 40px;
283
+ text-align: center;
284
+ color: #555;
285
+ border: 1px solid #cccccc;
286
+ background-color: #f7f7f7;
287
+ user-select: none;
288
+ -webkit-user-select: none;
289
+ box-shadow: 0 1px 0 rgba(0,0,0,0.1);
290
+
291
+ &:first-child{
292
+ border-radius: 4px 0 0 4px;
293
+ }
294
+
295
+ &:last-child{
296
+ border-radius: 0 4px 4px 0;
297
+ }
298
+
299
+ &:not(:first-child){
300
+ margin-left: -1px;
301
+ }
302
+
303
+ &:hover{
304
+ background-color: #eee;
305
+ }
306
+ }
307
+
308
+ .csf--active:hover,
309
+ .csf--active{
310
+ z-index: 2;
311
+ color: #fff;
312
+ border-color: #006799;
313
+ background-color: #0085ba;
314
+ }
315
+
316
+ input{
317
+ display: none;
318
+ }
319
+ }
320
+
321
+ /**
322
+ * 03. 07. Field: checkbox, radio
323
+ */
324
+ .csf-field-checkbox,
325
+ .csf-field-radio{
326
+
327
+ ul{
328
+ margin: 0;
329
+ padding: 0 1px;
330
+ list-style-type: none;
331
+ overflow-y: auto;
332
+ max-height: 305px;
333
+
334
+ ul{
335
+ max-height: none;
336
+ }
337
+ }
338
+
339
+ .csf--inline-list li{
340
+ display: inline-block;
341
+ margin-right: 15px;
342
+ }
343
+
344
+ input[type="radio"]:checked:before{
345
+ line-height: 10px;
346
+ }
347
+
348
+ .csf-checker{
349
+ cursor: pointer;
350
+ }
351
+ }
352
+
353
+ /**
354
+ * 03. 08. Field: code_editor
355
+ */
356
+ .csf-field-code_editor{
357
+
358
+ .CodeMirror{
359
+ width: 100%;
360
+ height: 400px;
361
+ }
362
+
363
+ .cm-s-default{
364
+ border: 1px solid #ccd0d4;
365
+ }
366
+
367
+ textarea{
368
+ width: 100%;
369
+ height: 400px;
370
+ }
371
+ }
372
+
373
+ /**
374
+ * 03. 09. Field: color
375
+ */
376
+ .csf-field-color{
377
+
378
+ > input{
379
+ opacity: 0.75;
380
+ width: 115px;
381
+ max-width: 100%;
382
+ }
383
+
384
+ .button.wp-picker-clear{
385
+ margin-left: 6px;
386
+ padding: 2px 8px;
387
+ }
388
+ }
389
+
390
+ /**
391
+ * 03. 10. Field: color_group
392
+ */
393
+ .csf-field-color_group{
394
+
395
+ .csf--left{
396
+ float: left;
397
+ margin-right: 10px;
398
+ margin-bottom: 5px;
399
+ }
400
+
401
+ .csf--title{
402
+ color: #999;
403
+ margin-bottom: 5px;
404
+ }
405
+ }
406
+
407
+ /**
408
+ * 03. 11. Field: fieldset
409
+ */
410
+ .csf-field-fieldset{
411
+
412
+ .csf-fieldset-content{
413
+ border: 1px solid #ccd0d4;
414
+ background-color: #fff;
415
+ box-shadow: 0 1px 1px rgba(0,0,0,.04);
416
+
417
+ > .csf-field{
418
+ padding: 15px;
419
+ }
420
+ }
421
+
422
+ .csf-field-subheading{
423
+ font-size: 13px;
424
+ }
425
+ }
426
+
427
+ /**
428
+ * 03. 12. Field: date
429
+ */
430
+ .csf-field-date{
431
+
432
+ input{
433
+ margin: 0;
434
+ }
435
+
436
+ .csf--to{
437
+ margin-left: 7px;
438
+ }
439
+ }
440
+
441
+ .csf-datepicker-wrapper{
442
+ margin-top: 5px;
443
+ width: auto;
444
+ background-color: #fff;
445
+ z-index: 9999999 !important;
446
+ @include box-shadow(0 0 30px rgba(black, 0.15));
447
+
448
+ *{
449
+ float: none;
450
+ margin: 0;
451
+ padding: 0;
452
+ font-family: inherit;
453
+ font-weight: normal;
454
+ font-style: normal;
455
+ text-decoration: none;
456
+ border: 0;
457
+ border-radius: 0;
458
+ box-shadow: none;
459
+ }
460
+
461
+ .ui-widget-header,
462
+ .ui-datepicker-header{
463
+ color: #fff;
464
+ background: #00a0d2;
465
+ }
466
+
467
+ .ui-datepicker-header .ui-state-hover{
468
+ cursor: pointer;
469
+ }
470
+
471
+ .ui-datepicker-title{
472
+ font-size: 14px;
473
+ line-height: 40px;
474
+ text-align: center;
475
+ }
476
+
477
+ .ui-datepicker-prev,
478
+ .ui-datepicker-next{
479
+ position: static;
480
+ top: auto;
481
+ left: auto;
482
+ right: auto;
483
+ font-family: "FontAwesome";
484
+ font-size: 12px;
485
+ text-align: center;
486
+ width: 41px;
487
+ height: 40px;
488
+ line-height: 40px;
489
+ color: #fff;
490
+ background-color: rgba(white, 0.1);
491
+ text-rendering: auto;
492
+ -webkit-font-smoothing: antialiased;
493
+ -moz-osx-font-smoothing: grayscale;
494
+ }
495
+
496
+ .ui-datepicker-next span,
497
+ .ui-datepicker-prev span{
498
+ display: none;
499
+ }
500
+
501
+ .ui-datepicker-prev{
502
+ float: left;
503
+ }
504
+
505
+ .ui-datepicker-next{
506
+ float: right;
507
+ }
508
+
509
+ .ui-datepicker-prev:before{
510
+ content: '\f053';
511
+ }
512
+
513
+ .ui-datepicker-next:before{
514
+ content: '\f054';
515
+ }
516
+
517
+ .ui-datepicker-prev-hover,
518
+ .ui-datepicker-next-hover{
519
+ opacity: 0.75;
520
+ }
521
+
522
+ tbody .ui-datepicker-week-col{
523
+ background-color: #f7f7f7;
524
+ }
525
+
526
+ .ui-datepicker-buttonpane{
527
+ padding: 10px;
528
+ text-align: center;
529
+ background-color: #f7f7f7;
530
+ }
531
+
532
+ .ui-datepicker-buttonpane button{
533
+ cursor: pointer;
534
+ margin: 0 5px;
535
+ padding: 7px 14px;
536
+ border: 1px solid #eee;
537
+ background-color: #fff;
538
+ }
539
+
540
+ select{
541
+ margin: 0 4px;
542
+ }
543
+
544
+ select option{
545
+ color: #555;
546
+ }
547
+
548
+ table{
549
+ font-size: 13px;
550
+ border-collapse: collapse;
551
+ width: 100%;
552
+ }
553
+
554
+ thead{
555
+ color: #fff;
556
+ background: #32373c;
557
+ }
558
+
559
+ th{
560
+ text-align: center;
561
+ padding: 7px;
562
+ border: 1px solid #444;
563
+ }
564
+
565
+ td{
566
+ text-align: center;
567
+ border: 1px solid #f4f4f4;
568
+ }
569
+
570
+ td.ui-datepicker-other-month{
571
+ border: transparent;
572
+ }
573
+
574
+ td .ui-state-default{
575
+ color: #555;
576
+ width: auto;
577
+ display: block;
578
+ padding: 6px 12px;
579
+ }
580
+
581
+ td .ui-state-active,
582
+ td .ui-state-hover{
583
+ color: #fff;
584
+ background-color: #0073aa;
585
+ }
586
+
587
+ td.ui-state-disabled .ui-state-default{
588
+ opacity: 0.5;
589
+ }
590
+ }
591
+
592
+ /**
593
+ * 03. 13. Field: gallery
594
+ */
595
+ .csf-field-gallery{
596
+
597
+ input{
598
+ display: none;
599
+ }
600
+
601
+ ul{
602
+ margin: 0;
603
+ padding: 0;
604
+ list-style-type: none;
605
+
606
+ li{
607
+ display: inline-block;
608
+ position: relative;
609
+ padding: 4px;
610
+ margin: 0 5px 10px 0;
611
+ border: 1px solid #ccc;
612
+ background-color: #f9f9f9;
613
+ @include border-radius(2px);
614
+ @include box-shadow(0 1px 0 rgba(black, 0.08));
615
+
616
+ img{
617
+ max-height: 60px;
618
+ display: inline-block;
619
+ vertical-align: middle;
620
+ }
621
+ }
622
+ }
623
+
624
+ .button{
625
+ margin-right: 5px;
626
+ margin-bottom: 5px;
627
+ }
628
+ }
629
+
630
+ /**
631
+ * 03. 14. Field: group
632
+ */
633
+ .csf-field-group{
634
+
635
+ .csf-cloneable-hidden{
636
+ display: none !important;
637
+ }
638
+
639
+ .csf-cloneable-wrapper{
640
+ position: relative;
641
+ }
642
+
643
+ .csf-cloneable-item{
644
+ display: none;
645
+ position: relative;
646
+ margin-bottom: 5px;
647
+
648
+ h4{
649
+ font-size: 1em;
650
+ }
651
+ }
652
+
653
+ .ui-accordion .csf-cloneable-item{
654
+ display: block;
655
+ }
656
+
657
+ .csf-cloneable-content{
658
+ border: 1px solid #ccd0d4;
659
+ background-color: #fff;
660
+ box-shadow: 0 1px 1px rgba(0,0,0,.04);
661
+
662
+ > .csf-field{
663
+ padding: 15px;
664
+ }
665
+ }
666
+
667
+ .csf-cloneable-title{
668
+ display: block;
669
+ cursor: pointer;
670
+ position: relative;
671
+ user-select: none;
672
+ margin: 0;
673
+ padding: 15px 65px 15px 10px;
674
+ min-height: 0;
675
+ font-size: 100%;
676
+ border: 1px solid #ccd0d4;
677
+ background-color: #fafafa;
678
+ box-shadow: 0 1px 1px rgba(0,0,0,.04);
679
+ transition: border-color .15s;
680
+
681
+ &:active,
682
+ &:hover,
683
+ &:focus{
684
+ border-color: #999;
685
+ outline: none;
686
+ }
687
+ }
688
+
689
+ .csf-cloneable-helper{
690
+ position: absolute;
691
+ top: 12px;
692
+ right: 10px;
693
+ z-index: 1;
694
+ font-size: 14px;
695
+ line-height: 1em;
696
+
697
+ i{
698
+ display: inline-block;
699
+ cursor: pointer;
700
+ padding: 5px;
701
+ color: #999;
702
+
703
+ &:hover{
704
+ color: #555;
705
+ }
706
+ }
707
+ }
708
+
709
+ .csf-cloneable-content{
710
+ padding: 0;
711
+ border-top: 0;
712
+ }
713
+
714
+ .csf-cloneable-title-prefix,
715
+ .csf-cloneable-title-number{
716
+ margin-right: 5px;
717
+ }
718
+
719
+ .csf-cloneable-alert{
720
+ display: none;
721
+ margin-bottom: 5px;
722
+ padding: 10px 20px;
723
+ color: #a94442;
724
+ border: 1px solid #ebccd1;
725
+ background-color: #f2dede;
726
+ }
727
+
728
+ .widget-placeholder{
729
+ margin-bottom: 10px;
730
+ border: 1px dashed #f1c40f;
731
+ background-color: #fffae4;
732
+ }
733
+
734
+ .csf-cloneable-header-icon{
735
+ display: inline-block;
736
+ text-align: center;
737
+ font-size: 14px;
738
+ width: 17px;
739
+ text-indent: 0;
740
+ vertical-align: text-top;
741
+ }
742
+
743
+ .csf-cloneable-placeholder{
744
+ background-color: #ddd;
745
+ margin-top: 4px;
746
+ width: 100px;
747
+ height: 10px;
748
+ font-size: 10px;
749
+ line-height: 10px;
750
+ display: inline-block;
751
+ vertical-align: top;
752
+ border-radius: 2px;
753
+ }
754
+ }
755
+
756
+ /**
757
+ * 03. 15. Field: icon
758
+ */
759
+ .csf-field-icon{
760
+
761
+ input{
762
+ display: none;
763
+ }
764
+
765
+ .button{
766
+ margin-right: 5px;
767
+ }
768
+
769
+ .csf-icon-preview i{
770
+ display: inline-block;
771
+ font-size: 14px;
772
+ width: 30px;
773
+ height: 26px;
774
+ line-height: 26px;
775
+ margin-right: 5px;
776
+ text-align: center;
777
+ vertical-align: top;
778
+ color: #555;
779
+ border: 1px solid #ccc;
780
+ background-color: #f7f7f7;
781
+ @include border-radius(3px);
782
+ @include box-shadow(0 1px 0 rgba(black, 0.08));
783
+ @include box-sizing(content-box);
784
+ }
785
+ }
786
+
787
+ /**
788
+ * 03. 16. Field: image_select
789
+ */
790
+ .csf-field-image_select{
791
+
792
+ .csf--image{
793
+ cursor: pointer;
794
+ position: relative;
795
+ display: inline-block;
796
+ max-width: 100%;
797
+ margin: 0 5px 5px 0;
798
+ vertical-align: bottom;
799
+ border: 2px solid transparent;
800
+ background-color: #fff;
801
+ user-select: none;
802
+ -webkit-user-select: none;
803
+ @include transition(all 0.2s);
804
+
805
+ &:before{
806
+ position: absolute;
807
+ top: 0;
808
+ left: 0;
809
+ text-align: center;
810
+ font-size: 11px;
811
+ font-family: FontAwesome;
812
+ content: "\f00c";
813
+ width: 15px;
814
+ height: 15px;
815
+ line-height: 15px;
816
+ opacity: 0;
817
+ color: #fff;
818
+ background-color: #222;
819
+ transition: opacity .2s;
820
+ }
821
+ }
822
+
823
+ .csf--active{
824
+ border-color: #222;
825
+ box-shadow: 0 0 20px rgba(0,0,0,0.2);
826
+
827
+ &:before{
828
+ opacity: 1;
829
+ }
830
+ }
831
+
832
+ img{
833
+ vertical-align: top;
834
+ }
835
+
836
+ input{
837
+ display: none;
838
+ }
839
+ }
840
+
841
+ /**
842
+ * 03. 17. Field: link_color
843
+ */
844
+ .csf-field-link_color{
845
+
846
+ .csf--left{
847
+ float: left;
848
+ margin-right: 10px;
849
+ margin-bottom: 5px;
850
+ }
851
+
852
+ .csf--title{
853
+ color: #777;
854
+ margin-bottom: 5px;
855
+ }
856
+ }
857
+
858
+ /**
859
+ * 03. 18. Field: map
860
+ */
861
+ .csf-field-map{
862
+
863
+ input{
864
+ width: 100%;
865
+ }
866
+
867
+ input[type="text"].ui-autocomplete-loading{
868
+ background-position-x: calc(100% - 5px);
869
+ }
870
+
871
+ .csf--map-search + .csf--map-osm-wrap{
872
+ margin-top: 10px;
873
+ }
874
+
875
+ .csf--map-osm-wrap{
876
+ position: relative;
877
+ padding: 5px;
878
+ border: 1px solid #eee;
879
+ background-color: #fff;
880
+ box-shadow: 0 1px 1px rgba(0,0,0,.04);
881
+ }
882
+
883
+ .csf--map-osm{
884
+ position: relative;
885
+ z-index: 1;
886
+ min-height: 250px;
887
+ }
888
+
889
+ .csf--map-inputs{
890
+ margin-top: 10px;
891
+ display: flex;
892
+ justify-content: space-between;
893
+ }
894
+
895
+ .csf--map-input{
896
+ flex: 1;
897
+
898
+ &:last-child{
899
+ padding-left: 10px;
900
+ }
901
+ }
902
+
903
+ label{
904
+ display: block;
905
+ color: #777;
906
+ font-size: 12px;
907
+ margin: 0 0 2px 0;
908
+ }
909
+ }
910
+
911
+ .csf-map-ui-autocomplate{
912
+ z-index: 999999;
913
+ border-radius: 4px;
914
+ overflow: hidden;
915
+ }
916
+
917
+
918
+ /**
919
+ * 03. 19. Field: media
920
+ */
921
+ .csf-field-media{
922
+
923
+ .csf--placeholder{
924
+ display: flex;
925
+
926
+ input{
927
+ width: 100%;
928
+ margin: 0;
929
+ }
930
+ }
931
+
932
+ .button{
933
+ margin-left: 5px;
934
+ }
935
+
936
+ .hidden + .button{
937
+ margin-left: 0;
938
+ }
939
+
940
+ .csf--preview{
941
+ position: relative;
942
+
943
+ .fa-times{
944
+ position: absolute;
945
+ z-index: 1;
946
+ right: 4px;
947
+ top: 4px;
948
+ font-size: 14px;
949
+ width: 22px;
950
+ height: 22px;
951
+ line-height: 22px;
952
+ text-align: center;
953
+ text-decoration: none;
954
+ color: #fff;
955
+ background-color: #dd3333;
956
+ opacity: 0.8;
957
+ transition: all .2s;
958
+
959
+ &:hover{
960
+ opacity: 1;
961
+ }
962
+
963
+ &:focus{
964
+ box-shadow: none;
965
+ }
966
+ }
967
+ }
968
+ }
969
+
970
+ /**
971
+ * 03. 20. Field: palette
972
+ */
973
+ .csf-field-palette{
974
+
975
+ .csf--palette{
976
+ position: relative;
977
+ display: inline-block;
978
+ cursor: pointer;
979
+ border: 2px solid #ddd;
980
+ margin-right: 10px;
981
+ margin-bottom: 10px;
982
+ user-select: none;
983
+ -webkit-user-select: none;
984
+ transition: all .2s;
985
+
986
+ span{
987
+ vertical-align: middle;
988
+ display: inline-block;
989
+ width: 22px;
990
+ height: 60px;
991
+ line-height: 60px;
992
+ overflow: hidden;
993
+ text-indent: -999px;
994
+ }
995
+
996
+ &:before{
997
+ position: absolute;
998
+ top: 0;
999
+ left: 0;
1000
+ text-align: center;
1001
+ font-size: 11px;
1002
+ font-family: FontAwesome;
1003
+ content: "\f00c";
1004
+ width: 15px;
1005
+ height: 15px;
1006
+ line-height: 15px;
1007
+ opacity: 0;
1008
+ color: #fff;
1009
+ background-color: #222;
1010
+ transition: opacity .2s;
1011
+ }
1012
+ }
1013
+
1014
+ .csf--active{
1015
+ border-color: #222;
1016
+ box-shadow: 0 0 20px rgba(0,0,0,0.2);
1017
+
1018
+ &:before{
1019
+ opacity: 1;
1020
+ }
1021
+ }
1022
+
1023
+ input{
1024
+ display: none;
1025
+ }
1026
+ }
1027
+
1028
+ /**
1029
+ * 03. 21. Field: repeater
1030
+ */
1031
+ .csf-field-repeater{
1032
+
1033
+ .csf-field-text input{
1034
+ width: 100%;
1035
+ }
1036
+
1037
+ .csf-repeater-hidden{
1038
+ display: none !important;
1039
+ }
1040
+
1041
+ .csf-repeater-wrapper{
1042
+
1043
+ .csf-repeater-item{
1044
+ display: table;
1045
+ width: 100%;
1046
+ margin-bottom: 5px;
1047
+ border: 1px solid #eee;
1048
+
1049
+ h4{
1050
+ font-size: 1em;
1051
+ }
1052
+ }
1053
+ }
1054
+
1055
+ .csf-repeater-content{
1056
+ width: 100%;
1057
+ display: table-cell;
1058
+ vertical-align: middle;
1059
+ background-color: #fff;
1060
+
1061
+ > .csf-field{
1062
+ padding: 15px;
1063
+ }
1064
+ }
1065
+
1066
+ .csf-repeater-helper{
1067
+ width: 100%;
1068
+ display: table-cell;
1069
+ vertical-align: middle;
1070
+ text-align: center;
1071
+ font-size: 14px;
1072
+ line-height: 1em;
1073
+ border-left: 1px solid #eee;
1074
+ background-color: #f7f7f7;
1075
+
1076
+ i{
1077
+ display: inline-block;
1078
+ cursor: pointer;
1079
+ color: #999;
1080
+ padding: 5px;
1081
+
1082
+ &:hover{
1083
+ color: #555;
1084
+ }
1085
+ }
1086
+ }
1087
+
1088
+ .csf-repeater-helper-inner{
1089
+ width: 75px;
1090
+ }
1091
+
1092
+ .csf-repeater-alert{
1093
+ display: none;
1094
+ margin-bottom: 5px;
1095
+ padding: 10px 20px;
1096
+ color: #a94442;
1097
+ border: 1px solid #ebccd1;
1098
+ background-color: #f2dede;
1099
+ }
1100
+
1101
+ .widget-placeholder{
1102
+ height: 50px;
1103
+ margin-bottom: 3px;
1104
+ border: 1px dashed #f1c40f;
1105
+ background-color: #fffae4;
1106
+ }
1107
+
1108
+ .ui-sortable-helper{
1109
+ height: 50px !important;
1110
+ overflow: hidden !important;
1111
+ border-color: #ccc !important;
1112
+ background-color: #eee !important;
1113
+ @include opacity(0.5);
1114
+
1115
+ .csf-repeater-helper,
1116
+ .csf-repeater-content{
1117
+ display: none;
1118
+ }
1119
+ }
1120
+ }
1121
+
1122
+ /**
1123
+ * 03. 22. Field: select
1124
+ */
1125
+ .csf-field-select{
1126
+
1127
+ .csf-fieldset{
1128
+ min-height: 30px;
1129
+ }
1130
+
1131
+ .csf-chosen{
1132
+ display: none;
1133
+ }
1134
+
1135
+ select{
1136
+ max-width: 100%;
1137
+ margin: 0;
1138
+ }
1139
+ }
1140
+
1141
+ /**
1142
+ * 03. 23. Field: slider
1143
+ */
1144
+ .csf-field-slider{
1145
+
1146
+ .csf--wrap{
1147
+ display: flex;
1148
+ align-items: center;
1149
+ }
1150
+
1151
+ .csf--input{
1152
+ display: flex;
1153
+ }
1154
+
1155
+ .csf--unit{
1156
+ display: flex;
1157
+ justify-content: center;
1158
+ flex-direction: column;
1159
+ user-select: none;
1160
+ padding: 0 6px;
1161
+ font-size: 11px;
1162
+ line-height: 1;
1163
+ border-radius: 0 4px 4px 0;
1164
+ color: #555;
1165
+ border: 1px solid #7e8993;
1166
+ border-left: 0;
1167
+ background-color: #f5f5f5;
1168
+ }
1169
+
1170
+ input[type=number]{
1171
+ position: relative;
1172
+ z-index: 1;
1173
+ width: 50px;
1174
+ margin: 0 0 0 15px;
1175
+ text-align: center;
1176
+ }
1177
+
1178
+ .csf--is-unit{
1179
+ border-top-right-radius: 0;
1180
+ border-bottom-right-radius: 0;
1181
+ }
1182
+
1183
+ .ui-slider{
1184
+ position: relative;
1185
+ width: 100%;
1186
+ height: 3px;
1187
+ border: none;
1188
+ background: #ddd;
1189
+ border-radius: 2px;
1190
+ }
1191
+
1192
+ .ui-slider-range{
1193
+ height: 3px;
1194
+ border: none;
1195
+ background: #333;
1196
+ border-radius: 2px;
1197
+ }
1198
+
1199
+ .ui-slider-handle{
1200
+ position: absolute;
1201
+ width: 16px;
1202
+ height: 16px;
1203
+ top: -7px;
1204
+ margin-left: -8px;
1205
+ border: none;
1206
+ background: #333;
1207
+ border-radius: 2px;
1208
+ }
1209
+
1210
+ .ui-state-active,
1211
+ .ui-slider-handle:hover{
1212
+ cursor: pointer;
1213
+ background: #111;
1214
+ }
1215
+ }
1216
+
1217
+ /**
1218
+ * 03. 24. Field: sortable
1219
+ */
1220
+ .csf-field-sortable{
1221
+
1222
+ .csf-field-text{
1223
+
1224
+ input{
1225
+ width: 100%;
1226
+ max-width: 100%;
1227
+ }
1228
+ }
1229
+
1230
+ .csf--sortable{
1231
+
1232
+ .csf--sortable-item{
1233
+ display: table;
1234
+ width: 100%;
1235
+ margin-bottom: 5px;
1236
+ border: 1px solid #eee;
1237
+
1238
+ h4{
1239
+ font-size: 1em;
1240
+ }
1241
+ }
1242
+ }
1243
+
1244
+ .csf--sortable-content{
1245
+ width: 100%;
1246
+ display: table-cell;
1247
+ vertical-align: middle;
1248
+ background-color: #fff;
1249
+
1250
+ > .csf-field{
1251
+ padding: 15px;
1252
+ }
1253
+ }
1254
+
1255
+ .csf--sortable-helper{
1256
+ width: 100%;
1257
+ display: table-cell;
1258
+ vertical-align: middle;
1259
+ text-align: center;
1260
+ font-size: 14px;
1261
+ line-height: 1em;
1262
+ border-left: 1px solid #eee;
1263
+ background-color: #f7f7f7;
1264
+
1265
+ .fa{
1266
+ display: inline-block;
1267
+ cursor: pointer;
1268
+ width: 50px;
1269
+ color: #555;
1270
+
1271
+ &:hover{
1272
+ @include opacity(0.5);
1273
+ }
1274
+ }
1275
+ }
1276
+
1277
+ .widget-placeholder{
1278
+ height: 50px;
1279
+ margin-bottom: 3px;
1280
+ border: 1px dashed #f1c40f;
1281
+ background-color: #fffae4;
1282
+ }
1283
+
1284
+ .ui-sortable-helper{
1285
+ height: 50px !important;
1286
+ overflow: hidden !important;
1287
+ border-color: #ccc !important;
1288
+ background-color: #eee !important;
1289
+ @include opacity(0.5);
1290
+
1291
+ .csf--sortable-helper,
1292
+ .csf--sortable-content{
1293
+ display: none;
1294
+ }
1295
+ }
1296
+ }
1297
+
1298
+ /**
1299
+ * 03. 25. Field: sorter
1300
+ */
1301
+ .csf-field-sorter{
1302
+
1303
+ .ui-sortable-placeholder{
1304
+ height: 20px;
1305
+ border: 1px dashed #f1c40f;
1306
+ background-color: #fffae4;
1307
+ }
1308
+
1309
+ .csf-modules{
1310
+ float: left;
1311
+ width: 50%;
1312
+ box-sizing: border-box;
1313
+
1314
+ &:first-child{
1315
+ padding-right: 15px;
1316
+ }
1317
+
1318
+ &:last-child{
1319
+ padding-left: 15px;
1320
+ }
1321
+ }
1322
+
1323
+ .csf-disabled,
1324
+ .csf-enabled{
1325
+ padding: 5px 15px;
1326
+ border: 1px dashed #ddd;
1327
+ background-color: #fff;
1328
+ }
1329
+
1330
+ .csf-disabled{
1331
+ li{
1332
+ @include transition(opacity 0.15s);
1333
+ @include opacity(0.5);
1334
+ }
1335
+
1336
+ .ui-sortable-helper{
1337
+ @include opacity(1);
1338
+ }
1339
+ }
1340
+
1341
+ .csf-sorter-title{
1342
+ font-size: 13px;
1343
+ font-weight: 600;
1344
+ padding: 10px;
1345
+ text-align: center;
1346
+ border: 1px dashed #ddd;
1347
+ border-bottom: none;
1348
+ background-color: #f8f8f8;
1349
+ text-transform: uppercase;
1350
+ }
1351
+
1352
+ ul{
1353
+ list-style-type: none;
1354
+ margin: 0;
1355
+ padding: 0;
1356
+ min-height: 62px;
1357
+
1358
+ li{
1359
+ margin: 10px 0;
1360
+ padding: 10px 15px;
1361
+ cursor: move;
1362
+ font-weight: bold;
1363
+ text-align: center;
1364
+ border: 1px solid #e5e5e5;
1365
+ background-color: #fafafa;
1366
+ @include transition(border-color 0.15s);
1367
+
1368
+ &:hover{
1369
+ border-color: #bbb;
1370
+ }
1371
+ }
1372
+ }
1373
+ }
1374
+
1375
+ /**
1376
+ * 03. 26. Field: spinner
1377
+ */
1378
+ .csf-field-spinner{
1379
+
1380
+ .csf--spin{
1381
+ display: flex;
1382
+ }
1383
+
1384
+ .ui-spinner{
1385
+ display: flex;
1386
+ }
1387
+
1388
+ .ui-button-text-only{
1389
+ display: flex;
1390
+ flex-direction: column;
1391
+ justify-content: center;
1392
+ text-align: center;
1393
+ min-width: 20px;
1394
+ padding: 0 4px;
1395
+ color: #555;
1396
+ border: 1px solid #7e8993;
1397
+ background-color: #f5f5f5;
1398
+ }
1399
+
1400
+ .ui-button{
1401
+ cursor: pointer;
1402
+
1403
+ &:hover{
1404
+ background-color: #e7e7e7;
1405
+ }
1406
+
1407
+ &:active{
1408
+ background-color: #ddd;
1409
+ }
1410
+
1411
+ &:before{
1412
+ font-family: FontAwesome;
1413
+ font-size: 14px;
1414
+ }
1415
+ }
1416
+
1417
+ .ui-spinner-down{
1418
+ order: 1;
1419
+ border-right: 0;
1420
+ border-radius: 4px 0 0 4px;
1421
+
1422
+ &:before{
1423
+ content: "\f0d9";
1424
+ }
1425
+ }
1426
+
1427
+ .ui-spinner-input{
1428
+ order: 2;
1429
+ }
1430
+
1431
+ .csf--unit{
1432
+ order: 3;
1433
+ border-left: 0;
1434
+ user-select: none;
1435
+ }
1436
+
1437
+ .ui-spinner-up{
1438
+ order: 4;
1439
+ border-left: 0;
1440
+ border-radius: 0 4px 4px 0;
1441
+
1442
+ &:before{
1443
+ content: "\f0da";
1444
+ }
1445
+ }
1446
+
1447
+ input{
1448
+ position: relative;
1449
+ z-index: 1;
1450
+ width: 50px;
1451
+ text-align: center;
1452
+ margin: 0;
1453
+ padding: 0 8px;
1454
+ border-radius: 0;
1455
+ }
1456
+
1457
+ .ui-button-text{
1458
+ display: none;
1459
+ }
1460
+ }
1461
+
1462
+ /**
1463
+ * 03. 27. Field: switcher
1464
+ */
1465
+ .csf-field-switcher{
1466
+
1467
+ .csf--switcher{
1468
+ float: left;
1469
+ cursor: pointer;
1470
+ position: relative;
1471
+ width: 60px;
1472
+ height: 26px;
1473
+ padding: 0;
1474
+ margin: 0;
1475
+ overflow: hidden;
1476
+ border-radius: 4px;
1477
+ background-color: #ed6f6f;
1478
+ user-select: none;
1479
+ -webkit-user-select: none;
1480
+ }
1481
+
1482
+ .csf--ball{
1483
+ position: absolute;
1484
+ top: 4px;
1485
+ left: 4px;
1486
+ width: 24px;
1487
+ height: 18px;
1488
+ background-color: #fff;
1489
+ border-radius: 4px;
1490
+ transition: all .1s;
1491
+ box-shadow: 1px 1px 1px rgba(0,0,0,0.15);
1492
+ }
1493
+
1494
+ .csf--on,
1495
+ .csf--off{
1496
+ position: absolute;
1497
+ top: 0;
1498
+ left: 0;
1499
+ right: 0;
1500
+ font-size: 11px;
1501
+ line-height: 26px;
1502
+ font-weight: 500;
1503
+ font-style: normal;
1504
+ text-align: center;
1505
+ text-transform: uppercase;
1506
+ color: #fff;
1507
+ padding-right: 28px;
1508
+ opacity: 0;
1509
+ transition: all .1s;
1510
+ }
1511
+
1512
+ .csf--off{
1513
+ padding-right: 0;
1514
+ padding-left: 28px;
1515
+ opacity: 1;
1516
+ }
1517
+
1518
+ .csf--active{
1519
+ background: #4fb845;
1520
+
1521
+ .csf--on{
1522
+ opacity: 1;
1523
+ }
1524
+
1525
+ .csf--off{
1526
+ opacity: 0;
1527
+ }
1528
+
1529
+ .csf--ball{
1530
+ left: 100%;
1531
+ margin-left: -28px;
1532
+ }
1533
+ }
1534
+
1535
+ .csf--label{
1536
+ float: left;
1537
+ margin-top: 4px;
1538
+ margin-left: 8px;
1539
+ font-weight: 400;
1540
+ color: #999;
1541
+ }
1542
+
1543
+ input{
1544
+ display: none;
1545
+ }
1546
+ }
1547
+
1548
+ /**
1549
+ * 03. 28. Field: tabbed
1550
+ */
1551
+ .csf-field-tabbed{
1552
+
1553
+ .csf-tabbed-section{
1554
+ border: 1px solid #ccd0d4;
1555
+ background-color: #fff;
1556
+ box-shadow: 0 1px 1px rgba(0,0,0,.04);
1557
+
1558
+ > .csf-field{
1559
+ padding: 15px;
1560
+ }
1561
+ }
1562
+
1563
+ .csf-tabbed-nav{
1564
+
1565
+ .csf--icon{
1566
+ padding-right: 5px;
1567
+ }
1568
+
1569
+ a{
1570
+ display: inline-block;
1571
+ padding: 12px 15px;
1572
+ margin-top: 1px;
1573
+ margin-right: 5px;
1574
+ margin-bottom: -1px;
1575
+ position: relative;
1576
+ text-decoration: none;
1577
+ color: #444;
1578
+ font-weight: 600;
1579
+ border: 1px solid #ccd0d4;
1580
+ background-color: #f3f3f3;
1581
+ transition: all .2s;
1582
+
1583
+ &:hover{
1584
+ background-color: #f9f9f9;
1585
+ }
1586
+
1587
+ &.csf-tabbed-active{
1588
+ background-color: #fff;
1589
+ border-bottom-color: #fff;
1590
+ }
1591
+
1592
+ &:focus{
1593
+ outline: none;
1594
+ @include box-shadow(none);
1595
+ }
1596
+ }
1597
+ }
1598
+ }
1599
+
1600
+ /**
1601
+ * 03. 29. Field: text
1602
+ */
1603
+ .csf-field-text{
1604
+
1605
+ input{
1606
+ width: 50%;
1607
+ max-width: 100%;
1608
+ margin: 0;
1609
+ }
1610
+ }
1611
+
1612
+ /**
1613
+ * 03. 30. Field: textarea
1614
+ */
1615
+ .csf-field-textarea{
1616
+
1617
+ textarea{
1618
+ width: 100%;
1619
+ max-width: 100%;
1620
+ min-height: 125px;
1621
+ }
1622
+
1623
+ .csf-shortcode-button{
1624
+ margin-bottom: 10px;
1625
+ margin-right: 5px;
1626
+ }
1627
+ }
1628
+
1629
+ /**
1630
+ * 03. 31. Field: typography
1631
+ */
1632
+ .csf-field-typography{
1633
+
1634
+ textarea,
1635
+ select{
1636
+ min-width: 100%;
1637
+ margin: 0;
1638
+ }
1639
+
1640
+ .csf--title{
1641
+ color: #777;
1642
+ margin: 0 0 2px 0;
1643
+ font-size: 12px;
1644
+
1645
+ small{
1646
+ vertical-align: top;
1647
+ }
1648
+ }
1649
+
1650
+ .csf--blocks{
1651
+ display: flex;
1652
+ flex-wrap: wrap;
1653
+ }
1654
+
1655
+ .csf--block{
1656
+ flex: 1;
1657
+ padding-right: 6px;
1658
+ padding-bottom: 6px;
1659
+ }
1660
+
1661
+ .csf--input{
1662
+ margin: 0;
1663
+ min-width: 100%;
1664
+ }
1665
+
1666
+ .csf--input-wrap{
1667
+ position: relative;
1668
+ }
1669
+
1670
+ .csf--unit{
1671
+ position: absolute;
1672
+ z-index: 1;
1673
+ right: 4px;
1674
+ top: 4px;
1675
+ bottom: 4px;
1676
+ padding: 2px 6px;
1677
+ color: #666;
1678
+ font-size: 11px;
1679
+ line-height: 1;
1680
+ border-radius: 2px;
1681
+ background: #eee;
1682
+ user-select: none;
1683
+ display: flex;
1684
+ justify-content: center;
1685
+ flex-direction: column;
1686
+ }
1687
+
1688
+ .csf--preview{
1689
+ font-size: 16px;
1690
+ line-height: 20px;
1691
+ padding: 20px;
1692
+ color: #222;
1693
+ border: 1px solid #eee;
1694
+ background-color: #fff;
1695
+ border-radius: 2.5px;
1696
+ user-select: none;
1697
+ -webkit-user-select: none;
1698
+ transition: background-color .2s, border-color .2s;
1699
+ }
1700
+
1701
+ .csf--block-preview{
1702
+ cursor: pointer;
1703
+ position: relative;
1704
+ overflow: hidden;
1705
+ margin-top: 10px;
1706
+ max-width: 100%;
1707
+ }
1708
+
1709
+ .csf--black-background{
1710
+ border-color: #000;
1711
+ background-color: #000;
1712
+ }
1713
+
1714
+ .csf--toggle{
1715
+ position: absolute;
1716
+ top: 5px;
1717
+ right: 10px;
1718
+ color: #999;
1719
+ }
1720
+
1721
+ .csf--block-extra-styles{
1722
+ margin-top: 5px;
1723
+ }
1724
+ }
1725
+
1726
+ /**
1727
+ * 03. 32. Field: upload
1728
+ */
1729
+ .csf-field-upload{
1730
+
1731
+ input{
1732
+ width: 100%;
1733
+ margin: 0;
1734
+ }
1735
+
1736
+ .csf--wrap{
1737
+ display: flex;
1738
+ }
1739
+
1740
+ .button{
1741
+ margin-left: 5px;
1742
+ }
1743
+ }
1744
+
1745
+ /**
1746
+ * 03. 33. Field: wp_editor
1747
+ */
1748
+ .csf-field-wp_editor{
1749
+
1750
+ .csf-wp-editor{
1751
+ float: left;
1752
+ width: 100%;
1753
+ }
1754
+
1755
+ .mce-toolbar-grp{
1756
+ border: none;
1757
+ }
1758
+
1759
+ .mce-btn.mce-active button,
1760
+ .mce-btn.mce-active:hover button,
1761
+ .mce-btn.mce-active i,
1762
+ .mce-btn.mce-active:hover i{
1763
+ color: #23282d;
1764
+ }
1765
+
1766
+ .wp-media-buttons{
1767
+ position: relative;
1768
+ z-index: 2;
1769
+ }
1770
+
1771
+
1772
+ .wp-editor-tabs{
1773
+ position: relative;
1774
+ z-index: 1;
1775
+ }
1776
+
1777
+ .csf-no-tinymce{
1778
+ border: 1px solid #e5e5e5;
1779
+ }
1780
+
1781
+ .csf-no-quicktags{
1782
+
1783
+ .wp-media-buttons{
1784
+ float: none;
1785
+ display: block;
1786
+ }
1787
+
1788
+ .mce-tinymce{
1789
+ box-shadow: none;
1790
+ border: 1px solid #e5e5e5;
1791
+ }
1792
+ }
1793
+
1794
+ textarea{
1795
+ width: 100%;
1796
+ max-width: 100%;
1797
+ margin: 0;
1798
+ box-shadow: none;
1799
+ }
1800
+ }
1801
+
1802
+ /**
1803
+ * 03. 34. Field: heading
1804
+ */
1805
+ .csf-field-heading{
1806
+ font-size: 1.5em;
1807
+ font-weight: bold;
1808
+ color: #23282d;
1809
+ background-color: #f5f5f5;
1810
+ }
1811
+
1812
+ /**
1813
+ * 03. 35. Field: subheading
1814
+ */
1815
+ .csf-field-subheading{
1816
+ font-size: 14px;
1817
+ font-weight: bold;
1818
+ padding-top: 17px;
1819
+ padding-bottom: 17px;
1820
+ color: #23282d;
1821
+ background-color: #f7f7f7;
1822
+ }
1823
+
1824
+ /**
1825
+ * 03. 36. Field: submessage
1826
+ */
1827
+ .csf-field-submessage{
1828
+ padding: 0 !important;
1829
+ border: 0 !important;
1830
+
1831
+ + .csf-field{
1832
+ border-top: 0 !important;
1833
+ }
1834
+ }
1835
+
1836
+ .csf-submessage{
1837
+ font-size: 12px;
1838
+ padding: 17px 30px;
1839
+ border-top: 1px solid transparent;
1840
+ border-bottom: 1px solid transparent;
1841
+ }
1842
+
1843
+ .csf-submessage-success{
1844
+ color: #3c763d;
1845
+ border-color: #d6e9c6;
1846
+ background-color: #dff0d8;
1847
+ }
1848
+
1849
+ .csf-submessage-info{
1850
+ color: #31708f;
1851
+ border-color: #bce8f1;
1852
+ background-color: #d9edf7;
1853
+ }
1854
+
1855
+ .csf-submessage-warning{
1856
+ color: #8a6d3b;
1857
+ border-color: #faebcc;
1858
+ background-color: #fcf8e3;
1859
+ }
1860
+
1861
+ .csf-submessage-danger{
1862
+ color: #a94442;
1863
+ border-color: #ebccd1;
1864
+ background-color: #f2dede;
1865
+ }
1866
+
1867
+ .csf-submessage-normal{
1868
+ color: #23282d;
1869
+ border-color: #eee;
1870
+ background-color: #f7f7f7;
1871
+ }
1872
+
1873
+ /**
1874
+ * 03. 37. Field: notice
1875
+ */
1876
+ .csf-field-notice{
1877
+ background-color: #f7f7f7;
1878
+ }
1879
+
1880
+ .csf-notice{
1881
+ padding: 12px;
1882
+ background-color: #fff;
1883
+ border-left-style: solid;
1884
+ border-left-width: 4px;
1885
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
1886
+ }
1887
+
1888
+ .csf-notice-success{
1889
+ border-color: #46b450;
1890
+ }
1891
+
1892
+ .csf-notice-info{
1893
+ border-color: #339fd4;
1894
+ }
1895
+
1896
+ .csf-notice-warning{
1897
+ border-color: #ffbc00;
1898
+ }
1899
+
1900
+ .csf-notice-danger{
1901
+ border-color: #dc3232;
1902
+ }
1903
+
1904
+ .csf-notice-normal{
1905
+ border-color: #222;
1906
+ }
1907
+
1908
+ /**
1909
+ * 03. 38. Field: number
1910
+ */
1911
+ .csf-field-number{
1912
+
1913
+ input{
1914
+ width: 100%;
1915
+ margin: 0;
1916
+ }
1917
+
1918
+ .csf--wrap{
1919
+ position: relative;
1920
+ float: left;
1921
+ width: 100px;
1922
+ }
1923
+
1924
+ .csf--unit{
1925
+ position: absolute;
1926
+ z-index: 1;
1927
+ right: 4px;
1928
+ top: 4px;
1929
+ bottom: 4px;
1930
+ padding: 2px 6px;
1931
+ color: #666;
1932
+ font-size: 11px;
1933
+ line-height: 1;
1934
+ border-radius: 2px;
1935
+ background: #eee;
1936
+ user-select: none;
1937
+ display: flex;
1938
+ justify-content: center;
1939
+ flex-direction: column;
1940
+ }
1941
+ }
1942
+
1943
+ /**
1944
+ * 03. 39. others
1945
+ */
1946
+ .csf-help{
1947
+ cursor: help;
1948
+ position: absolute;
1949
+ top: 0;
1950
+ right: 0;
1951
+ padding: 5px;
1952
+ font-size: 14px;
1953
+ color: #aaa;
1954
+
1955
+ .csf-help-text{
1956
+ display: none;
1957
+ }
1958
+ }
1959
+
1960
+ .csf-image-preview{
1961
+ display: inline-block;
1962
+ position: relative;
1963
+ padding: 4px;
1964
+ min-width: 44px;
1965
+ min-height: 22px;
1966
+ margin-bottom: 10px;
1967
+ border: 1px solid #ccc;
1968
+ background-color: #f9f9f9;
1969
+ @include box-shadow(0 1px 0 rgba(black, 0.08));
1970
+
1971
+ img{
1972
+ max-height: 90px;
1973
+ display: inline-block;
1974
+ vertical-align: middle;
1975
+ }
1976
+ }
1977
+
1978
+ .csf-field-custom{
1979
+
1980
+ .csf-field{
1981
+ padding: 0;
1982
+ }
1983
+ }
1984
+
1985
+ .csf-field{
1986
+
1987
+ .chosen-container-single .chosen-single{
1988
+ height: 28px;
1989
+ line-height: 26px;
1990
+ }
1991
+
1992
+ .chosen-container-single .chosen-single abbr{
1993
+ top: 0;
1994
+ right: 20px;
1995
+ font-family: FontAwesome;
1996
+ font-size: 12px;
1997
+ height: 100%;
1998
+ width: 18px;
1999
+ color: #aaa;
2000
+ text-align: center;
2001
+ background: none;
2002
+
2003
+ &:before{
2004
+ content: "\f00d";
2005
+ }
2006
+
2007
+ &:hover{
2008
+ color: #555;
2009
+ }
2010
+ }
2011
+
2012
+ .chosen-container-multi .chosen-choices li.search-choice .search-choice-close{
2013
+ font-family: FontAwesome;
2014
+ font-size: 12px;
2015
+ height: 100%;
2016
+ width: 18px;
2017
+ color: #aaa;
2018
+ text-align: center;
2019
+ background: none;
2020
+
2021
+ &:before{
2022
+ content: "\f00d";
2023
+ display: inline-block;
2024
+ padding-top: 3px;
2025
+ }
2026
+
2027
+ &:hover{
2028
+ color: #555;
2029
+ }
2030
+ }
2031
+
2032
+ .chosen-container-single .chosen-single div b{
2033
+ font-family: FontAwesome;
2034
+ font-size: 14px;
2035
+ color: #aaa;
2036
+ background: none;
2037
+
2038
+ &:before{
2039
+ content: "\f107";
2040
+ }
2041
+
2042
+ &:hover{
2043
+ color: #555;
2044
+ }
2045
+ }
2046
+
2047
+ .chosen-container-multi .chosen-choices li.search-choice-placeholder {
2048
+ border: 1px dashed #aaa;
2049
+ margin: 3px 5px 3px 0;
2050
+ }
2051
+
2052
+ .chosen-container-multi .ui-sortable li.search-choice span {
2053
+ cursor: move;
2054
+ }
2055
+
2056
+ .chosen-container-active.chosen-with-drop .chosen-single div b{
2057
+
2058
+ &:before{
2059
+ content: "\f106";
2060
+ }
2061
+ }
2062
+
2063
+ .chosen-container-single .chosen-single-with-deselect span{
2064
+ margin-right: 40px;
2065
+ }
2066
+
2067
+ .chosen-container-single .chosen-search input[type="text"]{
2068
+ background: none;
2069
+ }
2070
+
2071
+ .chosen-container-single .chosen-search{
2072
+
2073
+ &:before{
2074
+ font-family: FontAwesome;
2075
+ position: absolute;
2076
+ content: "\f002";
2077
+ font-size: 11px;
2078
+ right: 10px;
2079
+ top: 7px;
2080
+ color: #aaa;
2081
+ }
2082
+ }
2083
+
2084
+ .wp-picker-container{
2085
+ display: inline-block;
2086
+ }
2087
+
2088
+ .csf--transparent-wrap{
2089
+ display: none;
2090
+ position: relative;
2091
+ top: -1px;
2092
+ width: 235px;
2093
+ padding: 9px 10px;
2094
+ border: 1px solid #dfdfdf;
2095
+ border-top: none;
2096
+ background-color: #fff;
2097
+ }
2098
+
2099
+ .wp-picker-active .csf--transparent-wrap{
2100
+ display: block;
2101
+ }
2102
+
2103
+ .csf--transparent-slider{
2104
+ position: absolute;
2105
+ width: 190px;
2106
+ margin-left: 2px;
2107
+ height: 18px;
2108
+
2109
+ .ui-slider-handle{
2110
+ position: absolute;
2111
+ top: -3px;
2112
+ bottom: -3px;
2113
+ z-index: 5;
2114
+ border-color: #aaa;
2115
+ border-style: solid;
2116
+ border-width: 4px 3px;
2117
+ width: 10px;
2118
+ height: 16px;
2119
+ margin: 0 -5px;
2120
+ background: none;
2121
+ cursor: ew-resize;
2122
+ @include opacity(0.9);
2123
+ @include border-radius(4px);
2124
+ @include box-shadow(0 1px 2px rgba(black, 0.2));
2125
+
2126
+ &:before{
2127
+ content: " ";
2128
+ position: absolute;
2129
+ left: -2px;
2130
+ right: -2px;
2131
+ top: -3px;
2132
+ bottom: -3px;
2133
+ border: 2px solid #fff;
2134
+ @include border-radius(3px);
2135
+ }
2136
+ }
2137
+ }
2138
+
2139
+ .csf--transparent-offset{
2140
+ height: 18px;
2141
+ width: 200px;
2142
+ background: url(../images/checkerboard.png) repeat-y center left scroll #fff;
2143
+ @include box-shadow(0 0 5px rgba(black, 0.4) inset);
2144
+ @include border-radius(2px);
2145
+ }
2146
+
2147
+ .csf--transparent-text{
2148
+ position: absolute;
2149
+ top: 12px;
2150
+ right: 10px;
2151
+ width: 30px;
2152
+ font-size: 12px;
2153
+ line-height: 12px;
2154
+ text-align: center;
2155
+ color: #999;
2156
+ }
2157
+
2158
+ .csf--transparent-button{
2159
+ cursor: pointer;
2160
+ user-select: none;
2161
+ margin-top: 10px;
2162
+ font-size: 11px;
2163
+ text-align: center;
2164
+ border-radius: 2px;
2165
+ padding: 3px 7px;
2166
+ box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
2167
+ letter-spacing: 0.2px;
2168
+ color: #777;
2169
+ border: 1px solid #ccc;
2170
+ background-color: #f7f7f7;
2171
+ transition: background-color .2s, border-color .2s, color .2s;
2172
+ }
2173
+
2174
+ .csf--transparent-active{
2175
+
2176
+ .wp-color-result{
2177
+ background-image: url(../images/checkerboard.png);
2178
+ background-size: 135px;
2179
+ background-position: center left;
2180
+ background-color: transparent !important;
2181
+ }
2182
+
2183
+ .csf--transparent-button{
2184
+ color: #fff;
2185
+ border-color: #3ea032;
2186
+ background-color: #4fb845;
2187
+ }
2188
+
2189
+ .fa:before{
2190
+ content: "\f205";
2191
+ }
2192
+ }
2193
+ }
admin/settings/assets/scss/vendor/_helper.scss ADDED
@@ -0,0 +1,183 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * 08. Helper
3
+ */
4
+ .csf-text-desc,
5
+ .csf-text-subtitle{
6
+ font-weight: 400;
7
+ margin-top: 10px;
8
+ color: #999;
9
+ }
10
+
11
+ .csf-text-success{
12
+ color: #2b542c;
13
+ }
14
+
15
+ .csf-text-error{
16
+ color: #d02c21;
17
+ }
18
+
19
+ .csf-text-info{
20
+ color: #31708f;
21
+ }
22
+
23
+ .csf-text-warning{
24
+ color: #ffb900;
25
+ }
26
+
27
+ .csf-text-muted{
28
+ color: #aaa;
29
+ }
30
+
31
+ .csf-text-left{
32
+ text-align: left;
33
+ }
34
+
35
+ .csf-text-center{
36
+ text-align: center;
37
+ }
38
+
39
+ .csf-text-right{
40
+ text-align: right;
41
+ }
42
+
43
+ .csf-block-left{
44
+ float: left;
45
+ }
46
+
47
+ .csf-block-right{
48
+ float: right;
49
+ }
50
+
51
+ .csf-full-width{
52
+ width: 100%;
53
+ }
54
+
55
+ .csf-full-half{
56
+ width: 50%;
57
+ }
58
+
59
+ .csf-table{
60
+ width: 100%;
61
+ display: table;
62
+ }
63
+
64
+ .csf-table-cell{
65
+ display: table-cell;
66
+ vertical-align: middle;
67
+ }
68
+
69
+ .csf-table-expanded{
70
+ width: 100%;
71
+ }
72
+
73
+ .csf-nowrap{
74
+ white-space: nowrap;
75
+ }
76
+
77
+ .csf-text-highlight{
78
+ padding: 2px 4px;
79
+ font-size: 90%;
80
+ color: #c7254e;
81
+ background-color: #f9f2f4;
82
+ @include border-radius(2px);
83
+ }
84
+
85
+ .csf-text-highlight-gray{
86
+ padding: 2px 4px;
87
+ font-size: 90%;
88
+ background-color: #f0f0f0;
89
+ @include border-radius(2px);
90
+ }
91
+
92
+ .csf-hidden{
93
+ display: none;
94
+ }
95
+
96
+ .csf-hide{
97
+ display: none !important;
98
+ }
99
+
100
+ .csf-show{
101
+ display: block !important;
102
+ }
103
+
104
+ .csf-opacity{
105
+ opacity: 0.5;
106
+ }
107
+
108
+ .csf-warning-primary{
109
+ color: #fff !important;
110
+ border-color: #dc3545 !important;
111
+ background: #dc3545 !important;
112
+
113
+ &:hover,
114
+ &:focus{
115
+ border-color: #bd2130 !important;
116
+ background: #bd2130 !important;
117
+ }
118
+
119
+ &:focus{
120
+ box-shadow: 0 0 0 1px #fff, 0 0 0 3px #bd2130 !important;
121
+ }
122
+
123
+ &:active{
124
+ border-color: #bd2130 !important;
125
+ background: #bd2130 !important;
126
+ }
127
+ }
128
+
129
+ .csf-form-result{
130
+ display: none;
131
+ float: left;
132
+ padding: 0 8px;
133
+ margin-right: 4px;
134
+ font-size: 11px;
135
+ line-height: 28px;
136
+ user-select: none;
137
+ border-radius: 2px;
138
+ }
139
+
140
+ .csf-form-show{
141
+ display: block;
142
+ }
143
+
144
+ .csf-form-success{
145
+ color: #fff;
146
+ background-color: #46b450;
147
+ }
148
+
149
+ .csf-form-warning{
150
+ color: #8a6d3b;
151
+ background-color: #faebcc;
152
+ }
153
+
154
+ .csf-label-error{
155
+ position: relative;
156
+ top: -2px;
157
+ display: inline-block;
158
+ font-size: 10px;
159
+ line-height: 10px;
160
+ height: 10px;
161
+ width: 10px;
162
+ padding: 1px;
163
+ font-style: normal;
164
+ text-align: center;
165
+ color: #fff;
166
+ vertical-align: middle;
167
+ background-color: #e10000;
168
+ @include border-radius(2px);
169
+ }
170
+
171
+ .csf-no-option{
172
+ padding: 30px;
173
+ }
174
+
175
+ .csf-input-number{
176
+ -moz-appearance:textfield;
177
+ }
178
+
179
+ .csf-input-number::-webkit-inner-spin-button,
180
+ .csf-input-number::-webkit-outer-spin-button{
181
+ -webkit-appearance: none;
182
+ margin: 0;
183
+ }
admin/settings/assets/scss/vendor/_mixins.scss ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ @mixin opacity( $opacity ) {
2
+ opacity: $opacity;
3
+ }
admin/settings/assets/scss/vendor/_modal.scss ADDED
@@ -0,0 +1,339 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * 08. Modal
3
+ */
4
+ .csf-modal{
5
+ display: none;
6
+ position: fixed;
7
+ z-index: 100101;
8
+ top: 0;
9
+ left: 0;
10
+ width: 100%;
11
+ height: 100%;
12
+ }
13
+
14
+ .csf-modal-icon{
15
+ z-index: 100102;
16
+ }
17
+
18
+ .csf-modal-table{
19
+ display: table;
20
+ width: 100%;
21
+ height: 100%;
22
+ }
23
+
24
+ .csf-modal-table-cell{
25
+ display: table-cell;
26
+ vertical-align: middle;
27
+ margin: 100px 0;
28
+ }
29
+
30
+ .csf-modal-inner{
31
+ position: relative;
32
+ z-index: 10;
33
+ width: 760px;
34
+ height: 750px;
35
+ margin: 0 auto;
36
+ background-color: #fff;
37
+ }
38
+
39
+ .csf-modal-content{
40
+ position: relative;
41
+ overflow: hidden;
42
+ overflow-y: auto;
43
+ height: 595px;
44
+
45
+ .csf-shortcode-button{
46
+ display: none;
47
+ }
48
+
49
+ .csf-fieldset{
50
+ margin-left: 25%;
51
+ }
52
+
53
+ .csf-title{
54
+ width: 20%;
55
+ }
56
+
57
+ .csf-field{
58
+ padding: 15px 30px 15px 15px;
59
+ }
60
+
61
+ a{
62
+ &:active,
63
+ &:focus{
64
+ outline: none;
65
+ @include box-shadow(none);
66
+ }
67
+ }
68
+
69
+ h4{
70
+ font-size: 13px;
71
+
72
+ small{
73
+ font-style: italic;
74
+ font-weight: 400;
75
+ color: #aaa;
76
+ }
77
+ }
78
+ }
79
+
80
+ .csf-modal-title{
81
+ position: relative;
82
+ background-color: #fcfcfc;
83
+ border-bottom: 1px solid #ddd;
84
+ height: 36px;
85
+ font-size: 16px;
86
+ font-weight: 600;
87
+ line-height: 36px;
88
+ margin: 0;
89
+ padding: 0 36px 0 16px;
90
+ }
91
+
92
+ .csf-modal-header{
93
+ width: 100%;
94
+ padding: 14px 0;
95
+ background-color: #f5f5f5;
96
+ border-bottom: 1px solid #eee;
97
+
98
+ select{
99
+ display: block;
100
+ width: 250px;
101
+ margin: 0 auto;
102
+ font-size: 13px;
103
+ line-height: 1;
104
+ height: 30px;
105
+ min-height: 30px;
106
+ background-color: #fff;
107
+ }
108
+ }
109
+
110
+ .csf-modal-close{
111
+ color: #666;
112
+ padding: 0;
113
+ position: absolute;
114
+ top: 0;
115
+ right: 0;
116
+ width: 36px;
117
+ height: 36px;
118
+ text-align: center;
119
+ background: none;
120
+ border: none;
121
+ cursor: pointer;
122
+
123
+ &:before{
124
+ font: normal 20px/36px dashicons;
125
+ content: "\f158";
126
+ vertical-align: top;
127
+ width: 36px;
128
+ height: 36px;
129
+ }
130
+
131
+ &:hover{
132
+ @include opacity(0.5);
133
+ }
134
+ }
135
+
136
+ .csf-modal-insert-wrapper{
137
+ text-align: center;
138
+ width: 100%;
139
+ padding: 15px 0;
140
+ background-color: #f5f5f5;
141
+ border-top: 1px solid #eee;
142
+ }
143
+
144
+ .csf-modal-overlay{
145
+ position: absolute;
146
+ top: 0;
147
+ left: 0;
148
+ width: 100%;
149
+ height: 100%;
150
+ background-color: #000;
151
+ @include opacity(0.5);
152
+ }
153
+
154
+ /**
155
+ * 08. 01. Shortcode Modal
156
+ */
157
+ .csf--repeatable{
158
+ padding: 15px 15px 0 15px;
159
+ }
160
+
161
+ .csf--repeat-button-block{
162
+ text-align: center;
163
+ padding-bottom: 15px;
164
+ }
165
+
166
+ .csf--repeat-shortcode{
167
+ position: relative;
168
+ margin-bottom: 15px;
169
+ border: 1px dashed #ddd;
170
+
171
+ &:first-child{
172
+
173
+ .csf-repeat-remove{
174
+ display: none;
175
+ }
176
+ }
177
+
178
+ .csf-repeat-remove{
179
+ position: absolute;
180
+ right: 10px;
181
+ top: 10px;
182
+ z-index: 10;
183
+ cursor: pointer;
184
+ display: inline-block;
185
+ font-size: 11px;
186
+ width: 18px;
187
+ height: 18px;
188
+ line-height: 18px;
189
+ text-align: center;
190
+ border-radius: 2px;
191
+ color: #fff;
192
+ background-color: #e14d43;
193
+ @include opacity(0.5);
194
+
195
+ &:hover{
196
+ @include opacity(1);
197
+ }
198
+ }
199
+ }
200
+
201
+ .csf-shortcode-single{
202
+
203
+ .csf-modal-inner{
204
+ height: 750px;
205
+ }
206
+
207
+ .csf-modal-content{
208
+ height: 652px;
209
+ }
210
+ }
211
+
212
+ .elementor-editor-active{
213
+
214
+ .csf-shortcode-button{
215
+ margin-left: 5px;
216
+ }
217
+
218
+ .csf-modal .hidden{
219
+ display: none !important;
220
+ }
221
+ }
222
+
223
+ /**
224
+ * 08. 02. Gutenberg Modal
225
+ */
226
+ .csf-shortcode-block{
227
+ text-align: center;
228
+ padding: 14px;
229
+ font-size: 13px;
230
+ background-color: #f5f5f5;
231
+ font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
232
+ }
233
+
234
+ .csf-shortcode-block .button{
235
+ margin: 10px 0;
236
+ }
237
+
238
+ /**
239
+ * 08. 03. Icon Modal
240
+ */
241
+ .csf-modal-icon{
242
+
243
+ .csf-icon-title{
244
+ padding: 15px 0;
245
+ margin: 4px;
246
+ font-size: 14px;
247
+ font-weight: bold;
248
+ text-align: center;
249
+ border: 1px solid #eee;
250
+ background-color: #f7f7f7;
251
+ }
252
+
253
+ .csf-icon-search{
254
+ width: 250px;
255
+ height: 40px;
256
+ line-height: 40px;
257
+ }
258
+
259
+ a{
260
+ display: inline-block;
261
+ padding: 4px;
262
+ cursor: pointer;
263
+
264
+ .csf-icon{
265
+ position: relative;
266
+ padding: 4px;
267
+ display: inline-block;
268
+ font-size: 14px;
269
+ width: 30px;
270
+ height: 26px;
271
+ line-height: 26px;
272
+ text-align: center;
273
+ vertical-align: top;
274
+ color: #555;
275
+ border: 1px solid #ccc;
276
+ background-color: #f7f7f7;
277
+ @include border-radius(3px);
278
+ @include box-shadow(0 1px 0 rgba(black, 0.08));
279
+ @include box-sizing(content-box);
280
+ }
281
+
282
+ &:hover .csf-icon{
283
+ color: #fff;
284
+ border-color: #222;
285
+ background-color: #222;
286
+ }
287
+ }
288
+
289
+ .csf-modal-content{
290
+ padding: 10px;
291
+ height: 618px;
292
+ }
293
+
294
+ .csf-text-error{
295
+ padding: 10px;
296
+ }
297
+ }
298
+
299
+ .csf-modal-loading{
300
+ display: none;
301
+ position: absolute;
302
+ left: 15px;
303
+ top: 15px;
304
+ }
305
+
306
+ .csf-loading{
307
+ position: relative;
308
+ width: 20px;
309
+ height: 20px;
310
+ background: #ccc;
311
+ @include border-radius(20px);
312
+ @include box-shadow(0 2px 5px rgba(black, 0.070));
313
+
314
+ &:after{
315
+ position: absolute;
316
+ top: 50%;
317
+ left: 50%;
318
+ width: 4px;
319
+ height: 4px;
320
+ content: "";
321
+ margin-top: -2px;
322
+ margin-left: -2px;
323
+ background-color: white;
324
+ @include animation-duration(0.5s);
325
+ @include animation-iteration-count(infinite);
326
+ @include animation-timing-function(linear);
327
+ @include animation-name(csfLoader);
328
+ @include border-radius(4px);
329
+ }
330
+ }
331
+
332
+ @include keyframes(csfLoader){
333
+ 0%{
334
+ @include transform( rotate(0deg) translateX(-6px) rotate(0deg) );
335
+ }
336
+ 100%{
337
+ @include transform( rotate(360deg) translateX(-6px) rotate(-360deg) );
338
+ }
339
+ }
admin/settings/assets/scss/vendor/_profile.scss ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * 06. Profile
3
+ */
4
+ .csf-profile{
5
+
6
+ > h2 > .fa {
7
+ padding-right: 7px;
8
+ }
9
+
10
+ > .csf-field{
11
+ padding: 15px 0;
12
+ border-top: none !important;
13
+
14
+ > .csf-title{
15
+ width: 220px;
16
+
17
+ h4{
18
+ font-size: 14px;
19
+ font-weight: 600;
20
+ line-height: 1.3;
21
+ display: inline-block;
22
+ vertical-align: middle;
23
+ }
24
+ }
25
+
26
+ > .csf-fieldset{
27
+ margin-left: 220px;
28
+
29
+ > .csf-help{
30
+ top: -15px;
31
+ right: -5px;
32
+ }
33
+ }
34
+ }
35
+
36
+ > .csf-field-heading{
37
+ font-size: 1.1em;
38
+ }
39
+
40
+ > .csf-field-subheading{
41
+ font-size: 12px;
42
+ }
43
+
44
+ > .csf-field-subheading,
45
+ > .csf-field-heading{
46
+ margin: 10px 0;
47
+ padding: 15px !important;
48
+ border: 1px solid #ddd;
49
+ }
50
+
51
+ > .csf-field-submessage{
52
+ margin: 20px 0;
53
+
54
+ .csf-submessage{
55
+ padding: 10px;
56
+ border-left-width: 1px;
57
+ border-left-style: solid;
58
+ border-right-width: 1px;
59
+ border-right-style: solid;
60
+ }
61
+ }
62
+
63
+ > .csf-field-notice{
64
+ background-color: transparent;
65
+ }
66
+ }
admin/settings/assets/scss/vendor/_responsive.scss ADDED
@@ -0,0 +1,141 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * 11. Responsive
3
+ */
4
+ @media only screen and (max-width:1200px){
5
+
6
+ .csf-metabox{
7
+
8
+ .csf-field{
9
+
10
+ .csf-title{
11
+ float: none;
12
+ width: 100%;
13
+ margin-bottom: 10px;
14
+ }
15
+
16
+ .csf-fieldset{
17
+ margin-left: 0;
18
+ }
19
+ }
20
+ }
21
+ }
22
+
23
+ @media only screen and (max-width:782px){
24
+
25
+ .csf-header-inner{
26
+ text-align: center;
27
+
28
+ h1{
29
+ width: 100%;
30
+ margin-bottom: 10px;
31
+ }
32
+ }
33
+
34
+ .csf-form-result{
35
+ float: none;
36
+ margin-right: 0;
37
+ margin-bottom: 10px;
38
+ }
39
+
40
+ .csf-search,
41
+ .csf-header-right,
42
+ .csf-header-left{
43
+ width: 100%;
44
+ }
45
+
46
+ .csf-search{
47
+ text-align: center;
48
+ margin-bottom: 15px;
49
+ }
50
+
51
+ .csf-footer{
52
+ text-align: center;
53
+ }
54
+
55
+ .csf-buttons{
56
+ float: none;
57
+ }
58
+
59
+ .csf-copyright{
60
+ float: none;
61
+ margin-top: 10px;
62
+ }
63
+
64
+ .csf-nav,
65
+ .csf-expand-all,
66
+ .csf-reset-section,
67
+ .csf-nav-background{
68
+ display: none !important;
69
+ }
70
+
71
+ .csf-content{
72
+ margin-left: 0;
73
+ }
74
+
75
+ .csf-section-title,
76
+ .csf-section{
77
+ display: block !important;
78
+ }
79
+
80
+ .csf-field{
81
+
82
+ .csf-title{
83
+ float: none;
84
+ width: 100%;
85
+ margin-bottom: 10px;
86
+ }
87
+
88
+ .csf-fieldset{
89
+ margin-left: 0;
90
+ }
91
+ }
92
+
93
+ .csf-modal-inner{
94
+ width: 350px;
95
+ height: 400px;
96
+ }
97
+
98
+ .csf-modal-content{
99
+ height: 237px;
100
+ }
101
+
102
+ .csf-icon-dialog{
103
+
104
+ .csf-modal-inner{
105
+ width: 305px;
106
+ height: 380px;
107
+ }
108
+
109
+ .csf-modal-content{
110
+ height: 267px;
111
+ }
112
+ }
113
+
114
+ .csf-modal-icon{
115
+
116
+ .csf-modal-inner{
117
+ width: 330px;
118
+ height: 385px;
119
+ }
120
+
121
+ .csf-modal-content{
122
+ height: 252px;
123
+ }
124
+ }
125
+
126
+ .csf-profile{
127
+
128
+ > .csf-field{
129
+
130
+ > .csf-title{
131
+ float: none;
132
+ width: 100%;
133
+ margin-bottom: 10px;
134
+ }
135
+
136
+ > .csf-fieldset{
137
+ margin-left: 0;
138
+ }
139
+ }
140
+ }
141
+ }
admin/settings/assets/scss/vendor/_taxonomy.scss ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * 06. Taxonomy
3
+ */
4
+ .csf-taxonomy{
5
+
6
+ > .csf-field{
7
+ border-top: none !important;
8
+ }
9
+
10
+ > .csf-field-heading{
11
+ font-size: 1.1em;
12
+ padding: 20px !important;
13
+ border: 1px solid #ddd;
14
+ }
15
+
16
+ > .csf-field-subheading{
17
+ font-size: 12px;
18
+ padding: 15px !important;
19
+ border: 1px solid #ddd;
20
+ }
21
+
22
+ > .csf-field-submessage{
23
+
24
+ .csf-submessage{
25
+ padding: 15px;
26
+ border-left-width: 1px;
27
+ border-left-style: solid;
28
+ border-right-width: 1px;
29
+ border-right-style: solid;
30
+ }
31
+ }
32
+
33
+ > .csf-field-notice{
34
+ background-color: transparent;
35
+ }
36
+
37
+ .csf-section-title{
38
+ display: block;
39
+ padding: 15px ;
40
+ background-color: #f9f9f9;
41
+ border: 1px solid #e5e5e5;
42
+ @include box-shadow(0 1px 1px rgba(black, 0.04));
43
+ }
44
+ }
45
+
46
+ .csf-taxonomy-add-fields{
47
+
48
+ > .csf-field{
49
+ padding: 8px 0;
50
+
51
+ > .csf-title{
52
+ float: none;
53
+ width: 100%;
54
+ padding: 2px 2px 4px 0;
55
+
56
+ h4{
57
+ font-size: 12px;
58
+ font-weight: normal;
59
+ }
60
+ }
61
+
62
+ > .csf-fieldset{
63
+ margin-left: 0;
64
+
65
+ > .csf-help{
66
+ right: -5px;
67
+ }
68
+ }
69
+ }
70
+
71
+ + p.submit{
72
+ margin-top: 0;
73
+ }
74
+ }
75
+
76
+ .csf-taxonomy-edit-fields{
77
+
78
+ > .csf-field{
79
+ padding: 20px 0;
80
+
81
+ > .csf-title{
82
+ width: 225px;
83
+
84
+ h4{
85
+ font-size: 14px;
86
+ font-weight: 600;
87
+ line-height: 1.3;
88
+ display: inline-block;
89
+ vertical-align: middle;
90
+ }
91
+ }
92
+
93
+ > .csf-fieldset{
94
+ margin-left: 225px;
95
+
96
+ > .csf-help{
97
+ top: -5px;
98
+ right: -5px;
99
+ }
100
+ }
101
+ }
102
+
103
+ > .csf-field-submessage{
104
+ margin: 20px 0;
105
+ }
106
+
107
+ > .csf-field-subheading,
108
+ > .csf-field-heading{
109
+ margin: 20px 0;
110
+ border: 1px solid #ddd;
111
+ }
112
+ }
admin/settings/assets/scss/vendor/_themes.scss ADDED
@@ -0,0 +1,204 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * 02. Themes
3
+ */
4
+
5
+ /**
6
+ * 02. 01. Theme Dark
7
+ */
8
+ .csf-theme-dark{
9
+
10
+ .csf-header-inner{
11
+ background-color: #050505;
12
+
13
+ h1{
14
+ color: #fff;
15
+
16
+ small{
17
+ color: #555;
18
+ }
19
+ }
20
+ }
21
+
22
+ .csf-expand-all{
23
+ color: #999;
24
+ background-color: #222;
25
+
26
+ &:hover{
27
+ color: #fff;
28
+ background-color: #333;
29
+ }
30
+ }
31
+
32
+ .csf-search{
33
+
34
+ input{
35
+ color: #fff;
36
+ background-color: #222;
37
+ }
38
+
39
+ &:focus{
40
+ background-color: #444;
41
+ }
42
+
43
+ &::-webkit-input-placeholder{
44
+ color: #666;
45
+ }
46
+ }
47
+
48
+ .csf-nav{
49
+
50
+ ul{
51
+
52
+ li{
53
+
54
+ a{
55
+ color: #999;
56
+ background-color: #222;
57
+ border-bottom: 1px solid #2f2f2f;
58
+
59
+ &:hover{
60
+ color: #fff;
61
+ }
62
+ }
63
+
64
+ .csf-section-active{
65
+ color: #fff;
66
+ background-color: #111;
67
+ }
68
+ }
69
+
70
+ ul{
71
+
72
+ li{
73
+
74
+ a{
75
+ background-color: #191919;
76
+ border-bottom: 1px solid #2f2f2f;
77
+ }
78
+
79
+ .csf-section-active{
80
+ background-color: #101010;
81
+ }
82
+ }
83
+
84
+ &:before{
85
+ background-color: rgba(#222, 0.75);
86
+ }
87
+ }
88
+ }
89
+
90
+ > ul > li:last-child > a{
91
+ border-bottom: none;
92
+ }
93
+ }
94
+
95
+ .csf-nav-background{
96
+ background-color: #222;
97
+ }
98
+
99
+ .csf-footer{
100
+ color: #555;
101
+ background-color: #050505;
102
+ }
103
+ }
104
+
105
+ /**
106
+ * 02. 02. Theme Light
107
+ */
108
+ .csf-theme-light{
109
+
110
+ .csf-container{
111
+ border: 1px solid #e5e5e5;
112
+ @include box-shadow(0 0 15px rgba(black, 0.04));
113
+ }
114
+
115
+ .csf-header-inner{
116
+ border-bottom: 1px solid #e5e5e5;
117
+ background-color: #f5f5f5;
118
+ background: linear-gradient(#fefefe, #f5f5f5);
119
+
120
+ h1{
121
+
122
+ small{
123
+ color: #999;
124
+ }
125
+ }
126
+ }
127
+
128
+ .csf-expand-all{
129
+ color: #999;
130
+ background-color: #fff;
131
+ @include box-shadow(0 1px 1px rgba(black, 0.05));
132
+
133
+ &:hover{
134
+ color: #555;
135
+ }
136
+ }
137
+
138
+ .csf-search{
139
+
140
+ input{
141
+ color: #555;
142
+ background-color: #fff;
143
+ @include box-shadow(0px 1px 1px rgba(black, 0.05));
144
+
145
+ &::-webkit-input-placeholder{
146
+ color: #bbb;
147
+ }
148
+ }
149
+ }
150
+
151
+ .csf-nav{
152
+
153
+ ul{
154
+
155
+ li{
156
+
157
+ a{
158
+ color: #666;
159
+ background-color: #f5f5f5;
160
+ border-bottom: 1px solid #e5e5e5;
161
+
162
+ &:hover{
163
+ color: #222;
164
+ }
165
+ }
166
+
167
+ .csf-section-active{
168
+ color: #222;
169
+ background-color: #fff;
170
+
171
+ &:after{
172
+ display: none;
173
+ }
174
+ }
175
+ }
176
+
177
+ ul{
178
+
179
+ li{
180
+
181
+ a{
182
+ background-color: #eee;
183
+ border-bottom: 1px solid #e5e5e5;
184
+ }
185
+ }
186
+ }
187
+ }
188
+
189
+ > ul > li:last-child > a{
190
+ border-bottom: none;
191
+ }
192
+ }
193
+
194
+ .csf-nav-background{
195
+ background-color: #f5f5f5;
196
+ }
197
+
198
+ .csf-footer{
199
+ color: #555;
200
+ border-top: 1px solid #e5e5e5;
201
+ background-color: #f5f5f5;
202
+ background: linear-gradient(#fafafa, #f5f5f5);
203
+ }
204
+ }
admin/settings/assets/scss/vendor/_welcome.scss ADDED
@@ -0,0 +1,346 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * 10. Welcome Page
3
+ */
4
+ .csf-welcome-wrap{
5
+ position: relative;
6
+ margin: 25px 40px 0 20px;
7
+ font-size: 15px;
8
+ max-width: 1200px;
9
+
10
+ p{
11
+ font-size: 14px;
12
+ line-height: 1.5;
13
+ }
14
+
15
+ h1{
16
+ margin: 0.2em 200px 0 0;
17
+ padding: 0;
18
+ color: #32373c;
19
+ line-height: 1.2em;
20
+ font-size: 2.8em;
21
+ font-weight: 400;
22
+ }
23
+
24
+ .csf-logo{
25
+ position: absolute;
26
+ overflow: hidden;
27
+ top: 0;
28
+ right: 0;
29
+ height: 160px;
30
+ width: 140px;
31
+ background-image: linear-gradient( 45deg, #2d67cb, #ad19f3);
32
+ box-shadow: 0 1px 4px rgba(0,0,0,0.25), inset 0 0 0 4px rgba(0,0,0,0.25);
33
+
34
+ .csf--effects i{
35
+ position: absolute;
36
+ width: 200px;
37
+ height: 100px;
38
+ background-color: rgba(0,0,0,0.15);
39
+ transform: rotate(-45deg);
40
+ }
41
+
42
+ .csf--effects i:nth-child(1){
43
+ bottom: -20px;
44
+ right: -70px;
45
+ }
46
+
47
+ .csf--effects i:nth-child(2){
48
+ bottom: -35px;
49
+ right: -80px;
50
+ }
51
+
52
+ .csf--effects i:nth-child(3){
53
+ bottom: -50px;
54
+ right: -90px;
55
+ }
56
+
57
+ .csf--effects i:nth-child(4){
58
+ bottom: -65px;
59
+ right: -100px;
60
+ }
61
+
62
+ .csf--wp-logos{
63
+ position: relative;
64
+ padding-top: 25px;
65
+ text-align: center;
66
+ }
67
+
68
+ .csf--wp-logo{
69
+ position: absolute;
70
+ left: 20px;
71
+ width: 20px;
72
+ height: 20px;
73
+ background-repeat: no-repeat;
74
+ background-position: center center;
75
+ background-image: url(../images/wp-logo.svg);
76
+ }
77
+
78
+ .csf--wp-plugin-logo{
79
+ display: inline-block;
80
+ width: 50px;
81
+ height: 50px;
82
+ border: 3px solid #fff;
83
+ background-size: 40px;
84
+ background-repeat: no-repeat;
85
+ background-position: center center;
86
+ background-image: url(../images/wp-plugin-logo.svg);
87
+ border-radius: 100%;
88
+ vertical-align: middle;
89
+ }
90
+
91
+ .csf--text{
92
+ position: absolute;
93
+ left: 0;
94
+ right: 0;
95
+ top: 90px;
96
+ color: #fff;
97
+ font-size: 13px;
98
+ line-height: 1.2em;
99
+ font-weight: 600;
100
+ text-align: center;
101
+ text-transform: uppercase;
102
+ text-shadow: 1px 1px 0 rgba(0,0,0,0.25);
103
+ }
104
+
105
+ .csf--version{
106
+ top: auto;
107
+ left: auto;
108
+ right: 8px;
109
+ bottom: 4px;
110
+ font-size: 11px;
111
+ text-transform: lowercase;
112
+ }
113
+ }
114
+
115
+ .csf-about-text{
116
+ font-weight: 400;
117
+ line-height: 1.6em;
118
+ font-size: 19px;
119
+ margin: 1em 200px 1em 0;
120
+ color: #555d66;
121
+ }
122
+
123
+ .csf-demo-button{
124
+ margin: 1em 200px 2em 0;
125
+ }
126
+
127
+ .nav-tab-wrapper{
128
+ margin-bottom: 20px;
129
+ }
130
+
131
+ ul{
132
+ list-style-type: disc;
133
+ padding-left: 15px;
134
+ }
135
+
136
+ .csf--col{
137
+ float: left;
138
+ padding-right: 20px;
139
+ box-sizing: border-box;
140
+ }
141
+
142
+ .csf--col-2{
143
+ width: 50%;
144
+ }
145
+
146
+ .csf--col-3{
147
+ width: 33.333%;
148
+ }
149
+
150
+ .csf--col-4{
151
+ width: 25%;
152
+ }
153
+
154
+ .csf--col-5{
155
+ width: 20%;
156
+ }
157
+
158
+ .csf--col-last{
159
+ padding-right: 0;
160
+ }
161
+
162
+ .csf--col-upgrade{
163
+ padding: 10px 0;
164
+ text-align: center;
165
+ border-top: 1px solid #e5e5e5;
166
+ }
167
+ }
168
+
169
+ .csf--table-compare{
170
+
171
+ thead,
172
+ tfoot{
173
+ td{
174
+ text-align: center;
175
+ }
176
+ }
177
+
178
+ td{
179
+ font-size: 14px;
180
+ text-align: center;
181
+ vertical-align: middle;
182
+ padding: 10px;
183
+ }
184
+
185
+ td:first-child{
186
+ text-align: left;
187
+ }
188
+
189
+ tfoot{
190
+ td{
191
+ padding: 15px 0;
192
+ }
193
+ }
194
+
195
+ .fa{
196
+ font-size: 18px;
197
+ }
198
+
199
+ .fa-check-circle{
200
+ color: #46b450;
201
+ }
202
+
203
+ .fa-times-circle{
204
+ color: #dc3232;
205
+ }
206
+ }
207
+
208
+ .csf-welcome-cols{
209
+ clear: both;
210
+ margin: 20px 0;
211
+ background-color: #fff;
212
+ padding: 0 0;
213
+ border-radius: 2px;
214
+ border: 1px solid #e5e5e5;
215
+
216
+ .csf--col{
217
+ width: 25%;
218
+ float: left;
219
+ padding: 20px;
220
+ text-align: center;
221
+ box-sizing: border-box;
222
+ min-height: 200px;
223
+ border-right: 1px solid #e5e5e5;
224
+ }
225
+
226
+ .csf--left,
227
+ .csf--block{
228
+ float: left;
229
+ width: 20%;
230
+ padding: 0 30px;
231
+ text-align: center;
232
+ box-sizing: border-box;
233
+ }
234
+
235
+ .csf--block{
236
+ width: 80%;
237
+ }
238
+
239
+ .csf--col-first{
240
+ border-bottom: 1px solid #e5e5e5;
241
+ }
242
+
243
+ .csf--last{
244
+ border-right: none;
245
+ }
246
+
247
+ .csf--space{
248
+ height: 20px;
249
+ }
250
+
251
+ .csf--icon{
252
+ display: inline-block;
253
+ font-size: 20px;
254
+ width: 30px;
255
+ height: 30px;
256
+ line-height: 30px;
257
+ text-align: center;
258
+ margin-bottom: 10px;
259
+ color: #fff;
260
+ background-color: #555;
261
+ border-radius: 30px;
262
+ }
263
+
264
+ .csf--active{
265
+ background-color: #5cb85c;
266
+ }
267
+
268
+ .csf--deactive{
269
+ background-color: #e14d43;
270
+ }
271
+
272
+ .csf--title{
273
+ font-weight: bold;
274
+ display: block;
275
+ }
276
+
277
+ p:last-child{
278
+ margin-bottom: 0;
279
+ }
280
+ }
281
+
282
+ .csf-features-cols{
283
+
284
+ .csf--key-features{
285
+ width: 30%;
286
+ }
287
+ .csf--available-fields{
288
+ width: 70%;
289
+ }
290
+ }
291
+
292
+ .csf-code-block{
293
+ margin: 20px 0;
294
+ padding: 5px 20px;
295
+ background-color: #fff;
296
+ border-radius: 2px;
297
+ box-shadow: 0 1px 1px rgba(0,0,0,0.15);
298
+
299
+ pre{
300
+ font-size: 13px;
301
+ color: #0073aa;
302
+
303
+ span{
304
+ color: #999;
305
+ }
306
+ }
307
+ }
308
+
309
+ .csf--table-fields{
310
+ td{
311
+ font-size: 14px;
312
+ }
313
+ }
314
+
315
+ .csf--upgrade a{
316
+ color: #5cb85c;
317
+ font-weight: bold;
318
+
319
+ &:focus,
320
+ &:hover{
321
+ color: #4aa14a;
322
+ outline: none;
323
+ box-shadow: none;
324
+ }
325
+ }
326
+
327
+ @media only screen and (max-width:782px){
328
+
329
+ .csf-welcome-cols{
330
+ .csf--col{
331
+ width: 100%;
332
+ min-height: auto;
333
+ border-right: none;
334
+ border-bottom: 1px solid #e5e5e5;
335
+ }
336
+ }
337
+
338
+ .csf-features-cols{
339
+ .csf--key-features{
340
+ width: 100%;
341
+ }
342
+ .csf--available-fields{
343
+ width: 100%;
344
+ }
345
+ }
346
+ }
admin/settings/assets/scss/vendor/_widget.scss ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * 04. Widget
3
+ */
4
+ .csf-widgets{
5
+
6
+ > .csf-field{
7
+ position: relative;
8
+ top: -1px;
9
+ margin-right: -15px;
10
+ margin-left: -15px;
11
+ padding: 12px 15px;
12
+
13
+ .csf-field{
14
+ margin-left: 0;
15
+ margin-right: 0;
16
+ }
17
+
18
+ .csf-title{
19
+ float: none;
20
+ width: 100%;
21
+ margin-bottom: 5px;
22
+ }
23
+
24
+ .csf-fieldset{
25
+ margin-left: 0;
26
+ }
27
+ }
28
+
29
+ .csf-field-text input{
30
+ width: 100%;
31
+ }
32
+
33
+ .csf-field-notice .csf-notice{
34
+ padding: 15px;
35
+ }
36
+ }
37
+
38
+ .control-section{
39
+
40
+ .csf-widgets{
41
+
42
+ > .csf-field{
43
+ margin-right: -10px;
44
+ margin-left: -10px;
45
+ padding: 10px 12px;
46
+ }
47
+ }
48
+ }
admin/settings/classes/abstract.class.php ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Abstract Class
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF_Abstract' ) ) {
11
+ abstract class CSF_Abstract {
12
+
13
+ public $abstract = '';
14
+ public $output_css = '';
15
+ public $typographies = array();
16
+
17
+ public function __construct() {
18
+
19
+ // Check for embed google web fonts
20
+ if( ! empty( $this->args['enqueue_webfont'] ) ) {
21
+ add_action( 'wp_enqueue_scripts', array( &$this, 'add_enqueue_google_fonts' ), 100 );
22
+ }
23
+
24
+ // Check for embed custom css styles
25
+ if( ! empty( $this->args['output_css'] ) ) {
26
+ add_action( 'wp_head', array( &$this, 'add_output_css' ), 100 );
27
+ }
28
+
29
+ }
30
+
31
+ public function add_enqueue_google_fonts() {
32
+
33
+ if( ! empty( $this->pre_fields ) ) {
34
+
35
+ foreach( $this->pre_fields as $field ) {
36
+
37
+ $field_id = ( ! empty( $field['id'] ) ) ? $field['id'] : '';
38
+ $field_type = ( ! empty( $field['type'] ) ) ? $field['type'] : '';
39
+ $field_output = ( ! empty( $field['output'] ) ) ? $field['output'] : '';
40
+ $field_check = ( $field_type === 'typography' || $field_output ) ? true : false;
41
+
42
+ if( $field_type && $field_id ) {
43
+
44
+ CSF::maybe_include_field( $field_type );
45
+
46
+ $class_name = 'CSF_Field_' . $field_type;
47
+
48
+ if( class_exists( $class_name ) ) {
49
+
50
+ if( method_exists( $class_name, 'output' ) || method_exists( $class_name, 'enqueue_google_fonts' ) ) {
51
+
52
+ $field_value = '';
53
+
54
+ if( $field_check && ( $this->abstract === 'options' || $this->abstract === 'customize' ) ) {
55
+ $field_value = ( isset( $this->options[$field_id] ) && $this->options[$field_id] !== '' ) ? $this->options[$field_id] : '';
56
+ } else if( $field_check && $this->abstract === 'metabox' ) {
57
+ $field_value = $this->get_meta_value( $field );
58
+ }
59
+
60
+ $instance = new $class_name( $field, $field_value, $this->unique, 'wp/enqueue', $this );
61
+
62
+ // typography enqueue and embed google web fonts
63
+ if( $field_type === 'typography' && $this->args['enqueue_webfont'] && ! empty( $field_value['font-family'] ) ) {
64
+ $instance->enqueue_google_fonts();
65
+ }
66
+
67
+ // output css
68
+ if( $field_output && $this->args['output_css'] ) {
69
+ $instance->output();
70
+ }
71
+
72
+ unset( $instance );
73
+
74
+ }
75
+
76
+ }
77
+
78
+ }
79
+
80
+ }
81
+
82
+ }
83
+
84
+ if( ! empty( $this->typographies ) && empty( $this->args['async_webfont'] ) ) {
85
+
86
+ $query = array( 'family' => implode( '%7C', $this->typographies ) );
87
+ $api = '//fonts.googleapis.com/css';
88
+ $handle = 'csf-google-web-fonts-'. $this->unique;
89
+ $src = esc_url( add_query_arg( $query, $api ) );
90
+
91
+ wp_enqueue_style( $handle, $src, array(), null );
92
+
93
+ }
94
+
95
+ if( ! empty( $this->typographies ) && ! empty( $this->args['async_webfont'] ) ) {
96
+
97
+ $api = '//ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js';
98
+ echo '<script type="text/javascript">';
99
+ echo 'WebFontConfig={google:{families:['. "'" . implode( "','", $this->typographies ) . "'" .']}};';
100
+ echo '!function(e){var t=e.createElement("script"),s=e.scripts[0];t.src="'. $api .'",t.async=!0,s.parentNode.insertBefore(t,s)}(document);';
101
+ echo '</script>';
102
+
103
+ }
104
+
105
+ }
106
+
107
+ public function add_output_css() {
108
+
109
+ $this->output_css = apply_filters( "csf_{$this->unique}_output_css", $this->output_css, $this );
110
+
111
+ if ( ! empty( $this->output_css ) ) {
112
+ echo '<style type="text/css">'. $this->output_css . '</style>';
113
+ }
114
+
115
+ }
116
+
117
+ }
118
+ }
admin/settings/classes/comment-metabox.class.php ADDED
@@ -0,0 +1,337 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Comment Metabox Class
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF_Comment_Metabox' ) ) {
11
+ class CSF_Comment_Metabox extends CSF_Abstract{
12
+
13
+ // constans
14
+ public $unique = '';
15
+ public $abstract = 'comment_metabox';
16
+ public $pre_fields = array();
17
+ public $sections = array();
18
+ public $args = array(
19
+ 'title' => '',
20
+ 'data_type' => 'serialize',
21
+ 'priority' => 'default',
22
+ 'show_restore' => false,
23
+ 'theme' => 'dark',
24
+ 'class' => '',
25
+ 'defaults' => array(),
26
+ );
27
+
28
+ // run comment metabox construct
29
+ public function __construct( $key, $params = array() ) {
30
+
31
+ $this->unique = $key;
32
+ $this->args = apply_filters( "csf_{$this->unique}_args", wp_parse_args( $params['args'], $this->args ), $this );
33
+ $this->sections = apply_filters( "csf_{$this->unique}_sections", $params['sections'], $this );
34
+ $this->pre_fields = $this->pre_fields( $this->sections );
35
+
36
+ add_action( 'add_meta_boxes_comment', array( &$this, 'add_comment_meta_box' ) );
37
+ add_action( 'edit_comment', array( &$this, 'save_comment_meta_box' ) );
38
+
39
+ if( ! empty( $this->args['class'] ) ) {
40
+ add_filter( 'postbox_classes_comment_'. $this->unique, array( &$this, 'add_comment_metabox_classes' ) );
41
+ }
42
+
43
+ // wp enqeueu for typography and output css
44
+ parent::__construct();
45
+
46
+ }
47
+
48
+ // instance
49
+ public static function instance( $key, $params = array() ) {
50
+ return new self( $key, $params );
51
+ }
52
+
53
+ public function pre_fields( $sections ) {
54
+
55
+ $result = array();
56
+
57
+ foreach( $sections as $key => $section ) {
58
+ if( ! empty( $section['fields'] ) ) {
59
+ foreach( $section['fields'] as $field ) {
60
+ $result[] = $field;
61
+ }
62
+ }
63
+ }
64
+
65
+ return $result;
66
+ }
67
+
68
+ public function add_comment_metabox_classes( $classes ) {
69
+
70
+ if( ! empty( $this->args['class'] ) ) {
71
+ $classes[] = $this->args['class'];
72
+ }
73
+
74
+ return $classes;
75
+
76
+ }
77
+
78
+ // add comment metabox
79
+ public function add_comment_meta_box( $post_type ) {
80
+
81
+ add_meta_box( $this->unique, $this->args['title'], array( &$this, 'add_comment_meta_box_content' ), 'comment', 'normal', $this->args['priority'], $this->args );
82
+
83
+ }
84
+
85
+ // get default value
86
+ public function get_default( $field ) {
87
+
88
+ $default = ( isset( $field['id'] ) && isset( $this->args['defaults'][$field['id']] ) ) ? $this->args['defaults'][$field['id']] : null;
89
+ $default = ( isset( $field['default'] ) ) ? $field['default'] : $default;
90
+
91
+ return $default;
92
+
93
+ }
94
+
95
+ // get meta value
96
+ public function get_meta_value( $comment_id, $field ) {
97
+
98
+ $value = null;
99
+
100
+ if( ! empty( $comment_id ) && ! empty( $field['id'] ) ) {
101
+
102
+ if( $this->args['data_type'] !== 'serialize' ) {
103
+ $meta = get_comment_meta( $comment_id, $field['id'] );
104
+ $value = ( isset( $meta[0] ) ) ? $meta[0] : null;
105
+ } else {
106
+ $meta = get_comment_meta( $comment_id, $this->unique, true );
107
+ $value = ( isset( $meta[$field['id']] ) ) ? $meta[$field['id']] : null;
108
+ }
109
+
110
+ }
111
+
112
+ $default = $this->get_default( $field );
113
+ $value = ( isset( $value ) ) ? $value : $default;
114
+
115
+ return $value;
116
+
117
+ }
118
+
119
+ // add comment metabox content
120
+ public function add_comment_meta_box_content( $comment, $callback ) {
121
+
122
+ $has_nav = ( count( $this->sections ) > 1 ) ? true : false;
123
+ $show_all = ( ! $has_nav ) ? ' csf-show-all' : '';
124
+ $errors = ( is_object ( $comment ) ) ? get_comment_meta( $comment->comment_ID, '_csf_errors', true ) : array();
125
+ $errors = ( ! empty( $errors ) ) ? $errors : array();
126
+ $theme = ( $this->args['theme'] ) ? ' csf-theme-'. $this->args['theme'] : '';
127
+
128
+ if( is_object ( $comment ) && ! empty( $errors ) ) {
129
+ delete_comment_meta( $comment->comment_ID, '_csf_errors' );
130
+ }
131
+
132
+ wp_nonce_field( 'csf_comment_metabox_nonce', 'csf_comment_metabox_nonce'. $this->unique );
133
+
134
+ echo '<div class="csf csf-comment-metabox'. $theme .'">';
135
+
136
+ echo '<div class="csf-wrapper'. $show_all .'">';
137
+
138
+ if( $has_nav ) {
139
+
140
+ echo '<div class="csf-nav csf-nav-metabox" data-unique="'. $this->unique .'">';
141
+
142
+ echo '<ul>';
143
+ $tab_key = 1;
144
+ foreach( $this->sections as $section ) {
145
+
146
+ $tab_error = ( ! empty( $errors['sections'][$tab_key] ) ) ? '<i class="csf-label-error csf-error">!</i>' : '';
147
+ $tab_icon = ( ! empty( $section['icon'] ) ) ? '<i class="csf-icon '. $section['icon'] .'"></i>' : '';
148
+
149
+ echo '<li><a href="#" data-section="'. $this->unique .'_'. $tab_key .'">'. $tab_icon . $section['title'] . $tab_error .'</a></li>';
150
+
151
+ $tab_key++;
152
+ }
153
+ echo '</ul>';
154
+
155
+ echo '</div>';
156
+
157
+ }
158
+
159
+ echo '<div class="csf-content">';
160
+
161
+ echo '<div class="csf-sections">';
162
+
163
+ $section_key = 1;
164
+
165
+ foreach( $this->sections as $section ) {
166
+
167
+ $onload = ( ! $has_nav ) ? ' csf-onload' : '';
168
+
169
+ echo '<div id="csf-section-'. $this->unique .'_'. $section_key .'" class="csf-section'. $onload .'">';
170
+
171
+ $section_icon = ( ! empty( $section['icon'] ) ) ? '<i class="csf-icon '. $section['icon'] .'"></i>' : '';
172
+ $section_title = ( ! empty( $section['title'] ) ) ? $section['title'] : '';
173
+
174
+ echo ( $section_title || $section_icon ) ? '<div class="csf-section-title"><h3>'. $section_icon . $section_title .'</h3></div>' : '';
175
+
176
+ if( ! empty( $section['fields'] ) ) {
177
+
178
+ foreach ( $section['fields'] as $field ) {
179
+
180
+ if( ! empty( $field['id'] ) && ! empty( $errors['fields'][$field['id']] ) ) {
181
+ $field['_error'] = $errors['fields'][$field['id']];
182
+ }
183
+
184
+ CSF::field( $field, $this->get_meta_value( $comment->comment_ID, $field ), $this->unique, 'comment_metabox' );
185
+
186
+ }
187
+
188
+ } else {
189
+
190
+ echo '<div class="csf-no-option csf-text-muted">'. esc_html__( 'No option provided by developer.', 'csf' ) .'</div>';
191
+
192
+ }
193
+
194
+ echo '</div>';
195
+
196
+ $section_key++;
197
+ }
198
+
199
+ echo '</div>';
200
+
201
+ echo '<div class="clear"></div>';
202
+
203
+ if( ! empty( $this->args['show_restore'] ) ) {
204
+
205
+ echo '<div class="csf-restore-wrapper">';
206
+ echo '<label>';
207
+ echo '<input type="checkbox" name="'. $this->unique .'[_restore]" />';
208
+ echo '<span class="button csf-button-restore">'. esc_html__( 'Restore', 'csf' ) .'</span>';
209
+ echo '<span class="button csf-button-cancel">'. sprintf( '<small>( %s )</small> %s', esc_html__( 'update post for restore ', 'csf' ), esc_html__( 'Cancel', 'csf' ) ) .'</span>';
210
+ echo '</label>';
211
+ echo '</div>';
212
+
213
+ }
214
+
215
+ echo '</div>';
216
+
217
+ echo ( $has_nav ) ? '<div class="csf-nav-background"></div>' : '';
218
+
219
+ echo '<div class="clear"></div>';
220
+
221
+ echo '</div>';
222
+
223
+ echo '</div>';
224
+
225
+ }
226
+
227
+ // save comment metabox
228
+ public function save_comment_meta_box( $comment_id ) {
229
+
230
+
231
+ if( ! wp_verify_nonce( csf_get_var( 'csf_comment_metabox_nonce'. $this->unique ), 'csf_comment_metabox_nonce' ) ) {
232
+ return $comment_id;
233
+ }
234
+
235
+ if( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
236
+ return $comment_id;
237
+ }
238
+
239
+ $errors = array();
240
+ $request = csf_get_var( $this->unique );
241
+
242
+ if( ! empty( $request ) ) {
243
+
244
+ // ignore _nonce
245
+ if( isset( $request['_nonce'] ) ) {
246
+ unset( $request['_nonce'] );
247
+ }
248
+
249
+ // sanitize and validate
250
+ $section_key = 1;
251
+ foreach( $this->sections as $section ) {
252
+
253
+ if( ! empty( $section['fields'] ) ) {
254
+
255
+ foreach( $section['fields'] as $field ) {
256
+
257
+ if( ! empty( $field['id'] ) ) {
258
+
259
+ // sanitize
260
+ if( ! empty( $field['sanitize'] ) ) {
261
+
262
+ $sanitize = $field['sanitize'];
263
+ $value_sanitize = isset( $request[$field['id']] ) ? $request[$field['id']] : '';
264
+ $request[$field['id']] = call_user_func( $sanitize, $value_sanitize );
265
+
266
+ }
267
+
268
+ // validate
269
+ if( ! empty( $field['validate'] ) ) {
270
+
271
+ $validate = $field['validate'];
272
+ $value_validate = isset( $request[$field['id']] ) ? $request[$field['id']] : '';
273
+ $has_validated = call_user_func( $validate, $value_validate );
274
+
275
+ if( ! empty( $has_validated ) ) {
276
+
277
+ $errors['sections'][$section_key] = true;
278
+ $errors['fields'][$field['id']] = $has_validated;
279
+ $request[$field['id']] = $this->get_meta_value( $comment_id, $field );
280
+
281
+ }
282
+
283
+ }
284
+
285
+ // auto sanitize
286
+ if( ! isset( $request[$field['id']] ) || is_null( $request[$field['id']] ) ) {
287
+ $request[$field['id']] = '';
288
+ }
289
+
290
+ }
291
+
292
+ }
293
+
294
+ }
295
+
296
+ $section_key++;
297
+ }
298
+
299
+ }
300
+
301
+ $request = apply_filters( "csf_{$this->unique}_save", $request, $comment_id, $this );
302
+
303
+ do_action( "csf_{$this->unique}_save_before", $request, $comment_id, $this );
304
+
305
+ if( empty( $request ) || ! empty( $request['_restore'] ) ) {
306
+
307
+ if( $this->args['data_type'] !== 'serialize' ) {
308
+ foreach ( $request as $key => $value ) {
309
+ delete_comment_meta( $comment_id, $key );
310
+ }
311
+ } else {
312
+ delete_comment_meta( $comment_id, $this->unique );
313
+ }
314
+
315
+ } else {
316
+
317
+ if( $this->args['data_type'] !== 'serialize' ) {
318
+ foreach ( $request as $key => $value ) {
319
+ update_comment_meta( $comment_id, $key, $value );
320
+ }
321
+ } else {
322
+ update_comment_meta( $comment_id, $this->unique, $request );
323
+ }
324
+
325
+ if( ! empty( $errors ) ) {
326
+ update_comment_meta( $comment_id, '_csf_errors', $errors );
327
+ }
328
+
329
+ }
330
+
331
+ do_action( "csf_{$this->unique}_saved", $request, $comment_id, $this );
332
+
333
+ do_action( "csf_{$this->unique}_save_after", $request, $comment_id, $this );
334
+
335
+ }
336
+ }
337
+ }
admin/settings/classes/customize-options.class.php ADDED
@@ -0,0 +1,279 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Customize Options Class
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF_Customize_Options' ) ) {
11
+ class CSF_Customize_Options extends CSF_Abstract {
12
+
13
+ // constans
14
+ public $unique = '';
15
+ public $abstract = 'customize';
16
+ public $options = array();
17
+ public $sections = array();
18
+ public $pre_fields = array();
19
+ public $pre_tabs = array();
20
+ public $priority = 10;
21
+ public $args = array(
22
+ 'database' => 'option',
23
+ 'transport' => 'refresh',
24
+ 'capability' => 'manage_options',
25
+ 'save_defaults' => true,
26
+ 'enqueue_webfont' => true,
27
+ 'async_webfont' => false,
28
+ 'output_css' => true,
29
+ 'defaults' => array()
30
+ );
31
+
32
+ // run customize construct
33
+ public function __construct( $key, $params ) {
34
+
35
+ $this->unique = $key;
36
+ $this->args = apply_filters( "csf_{$this->unique}_args", wp_parse_args( $params['args'], $this->args ), $this );
37
+ $this->sections = apply_filters( "csf_{$this->unique}_sections", $params['sections'], $this );
38
+ $this->pre_fields = $this->pre_fields( $this->sections );
39
+
40
+ $this->get_options();
41
+ $this->save_defaults();
42
+
43
+ add_action( 'customize_register', array( &$this, 'add_customize_options' ) );
44
+ add_action( 'customize_save_after', array( &$this, 'add_customize_save_after' ) );
45
+
46
+ // Get options for enqueue actions
47
+ if( is_customize_preview() ) {
48
+ add_action( 'wp_enqueue_scripts', array( &$this, 'get_options' ) );
49
+ }
50
+
51
+ // wp enqeueu for typography and output css
52
+ parent::__construct();
53
+
54
+ }
55
+
56
+ // instance
57
+ public static function instance( $key, $params = array() ) {
58
+ return new self( $key, $params );
59
+ }
60
+
61
+ public function add_customize_save_after( $wp_customize ) {
62
+ do_action( "csf_{$this->unique}_save_before", $this->get_options(), $this, $wp_customize );
63
+ do_action( "csf_{$this->unique}_saved", $this->get_options(), $this, $wp_customize );
64
+ do_action( "csf_{$this->unique}_save_after", $this->get_options(), $this, $wp_customize );
65
+ }
66
+
67
+ // get default value
68
+ public function get_default( $field ) {
69
+
70
+ $default = ( isset( $this->args['defaults'][$field['id']] ) ) ? $this->args['defaults'][$field['id']] : null;
71
+ $default = ( isset( $field['default'] ) ) ? $field['default'] : $default;
72
+
73
+ return $default;
74
+
75
+ }
76
+
77
+ // get option
78
+ public function get_options() {
79
+
80
+ if( $this->args['database'] === 'theme_mod' ) {
81
+ $this->options = get_theme_mod( $this->unique, array() );
82
+ } else {
83
+ $this->options = get_option( $this->unique, array() );
84
+ }
85
+
86
+ if( empty( $this->options ) ) {
87
+ $this->options = array();
88
+ }
89
+
90
+ return $this->options;
91
+
92
+ }
93
+
94
+ // save defaults and set new fields value to main options
95
+ public function save_defaults() {
96
+
97
+ $tmp_options = $this->options;
98
+
99
+ if( ! empty( $this->pre_fields ) ) {
100
+ foreach( $this->pre_fields as $field ) {
101
+ if( ! empty( $field['id'] ) ) {
102
+ $this->options[$field['id']] = ( isset( $this->options[$field['id']] ) ) ? $this->options[$field['id']] : $this->get_default( $field );
103
+ }
104
+ }
105
+ }
106
+
107
+ if( $this->args['save_defaults'] && empty( $this->args['show_in_customizer'] ) && empty( $tmp_options ) ) {
108
+
109
+ if( $this->args['database'] === 'theme_mod' ) {
110
+ set_theme_mod( $this->unique, $this->options );
111
+ } else {
112
+ update_option( $this->unique, $this->options );
113
+ }
114
+
115
+ }
116
+
117
+ }
118
+
119
+ public function pre_fields( $sections ) {
120
+
121
+ $result = array();
122
+
123
+ foreach( $sections as $key => $section ) {
124
+ if( ! empty( $section['fields'] ) ) {
125
+ foreach( $section['fields'] as $field ) {
126
+ $result[] = $field;
127
+ }
128
+ }
129
+ }
130
+
131
+ return $result;
132
+ }
133
+
134
+
135
+ public function pre_tabs( $sections ) {
136
+
137
+ $result = array();
138
+ $parents = array();
139
+
140
+ foreach( $sections as $key => $section ) {
141
+ if( ! empty( $section['parent'] ) ) {
142
+ $parents[$section['parent']][] = $section;
143
+ unset( $sections[$key] );
144
+ }
145
+ }
146
+
147
+ foreach( $sections as $key => $section ) {
148
+ if( ! empty( $section['id'] ) && ! empty( $parents[$section['id']] ) ) {
149
+ $section['subs'] = $parents[$section['id']];
150
+ }
151
+ $result[] = $section;
152
+ }
153
+
154
+ return $result;
155
+
156
+ }
157
+
158
+ public function add_customize_options( $wp_customize ) {
159
+
160
+ if( ! class_exists( 'WP_Customize_Panel_CSF' ) ) {
161
+ CSF::include_plugin_file( 'functions/customize.php' );
162
+ }
163
+
164
+ if( ! empty( $this->sections ) ) {
165
+
166
+ $sections = $this->pre_tabs( $this->sections );
167
+
168
+ foreach( $sections as $section ) {
169
+
170
+ if( ! empty( $section['subs'] ) ) {
171
+
172
+ $panel_id = ( isset( $section['id'] ) ) ? $section['id'] : $this->unique .'-panel-'. $this->priority;
173
+
174
+ $wp_customize->add_panel( new WP_Customize_Panel_CSF( $wp_customize, $panel_id, array(
175
+ 'title' => ( isset( $section['title'] ) ) ? $section['title'] : null,
176
+ 'description' => ( isset( $section['description'] ) ) ? $section['description'] : null,
177
+ 'priority' => ( isset( $section['priority'] ) ) ? $section['priority'] : null,
178
+ ) ) );
179
+
180
+ $this->priority++;
181
+
182
+ foreach( $section['subs'] as $sub_section ) {
183
+
184
+ $section_id = ( isset( $sub_section['id'] ) ) ? $sub_section['id'] : $this->unique .'-section-'. $this->priority;
185
+
186
+ $this->add_section( $wp_customize, $section_id, $sub_section, $panel_id );
187
+
188
+ $this->priority++;
189
+
190
+ }
191
+
192
+ } else {
193
+
194
+ $section_id = ( isset( $section['id'] ) ) ? $section['id'] : $this->unique .'-section-'. $this->priority;
195
+
196
+ $this->add_section( $wp_customize, $section_id, $section, false );
197
+
198
+ $this->priority++;
199
+
200
+ }
201
+
202
+ }
203
+
204
+ }
205
+
206
+ }
207
+
208
+ // add customize section
209
+ public function add_section( $wp_customize, $section_id, $section_args, $panel_id ) {
210
+
211
+ if( ! empty( $section_args['assign'] ) ) {
212
+
213
+ $section_id = $section_args['assign'];
214
+
215
+ } else {
216
+
217
+ $wp_customize->add_section( new WP_Customize_Section_CSF( $wp_customize, $section_id, array(
218
+ 'title' => ( isset( $section_args['title'] ) ) ? $section_args['title'] : null,
219
+ 'description' => ( isset( $section_args['description'] ) ) ? $section_args['description'] : null,
220
+ 'priority' => ( isset( $section_args['priority'] ) ) ? $section_args['priority'] : null,
221
+ 'panel' => ( $panel_id ) ? $panel_id : null,
222
+ ) ) );
223
+
224
+ }
225
+
226
+ if( ! empty( $section_args['fields'] ) ) {
227
+
228
+ $field_key = 1;
229
+
230
+ foreach( $section_args['fields'] as $field ) {
231
+
232
+ if( isset( $field['id'] ) ) {
233
+ $field['default'] = $this->get_default( $field );
234
+ }
235
+
236
+ $field_id = ( isset( $field['id'] ) ) ? $field['id'] : '_nonce-'. $section_id .'-'. $field_key;
237
+ $setting_id = $this->unique .'['. $field_id .']';
238
+ $setting_args = ( isset( $field['setting_args'] ) ) ? $field['setting_args'] : array();
239
+ $control_args = ( isset( $field['control_args'] ) ) ? $field['control_args'] : array();
240
+ $field_transport = ( isset( $field['transport'] ) ) ? $field['transport'] : $this->args['transport'];
241
+ $field_sanitize = ( isset( $field['sanitize'] ) ) ? $field['sanitize'] : null;
242
+ $field_validate = ( isset( $field['validate'] ) ) ? $field['validate'] : null;
243
+ $field_default = ( isset( $field['default'] ) ) ? $field['default'] : null;
244
+ $has_selective = ( isset( $field['selective_refresh'] ) && isset( $wp_customize->selective_refresh ) ) ? true : false;
245
+
246
+ $wp_customize->add_setting( $setting_id,
247
+ wp_parse_args( $setting_args, array(
248
+ 'default' => $field_default,
249
+ 'type' => $this->args['database'],
250
+ 'transport' => ( $has_selective ) ? 'postMessage' : $field_transport,
251
+ 'capability' => $this->args['capability'],
252
+ 'sanitize_callback' => $field_sanitize,
253
+ 'validate_callback' => $field_validate
254
+ ) )
255
+ );
256
+
257
+ $wp_customize->add_control( new WP_Customize_Control_CSF( $wp_customize, $setting_id,
258
+ wp_parse_args( $control_args, array(
259
+ 'unique' => $this->unique,
260
+ 'field' => $field,
261
+ 'section' => $section_id,
262
+ 'settings' => $setting_id
263
+ ) )
264
+ ) );
265
+
266
+ if( $has_selective ) {
267
+ $wp_customize->selective_refresh->add_partial( $setting_id, $field['selective_refresh'] );
268
+ }
269
+
270
+ $field_key++;
271
+ }
272
+
273
+ }
274
+
275
+
276
+ }
277
+
278
+ }
279
+ }
admin/settings/classes/fields.class.php ADDED
@@ -0,0 +1,379 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Fields Class
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF_Fields' ) ) {
11
+ abstract class CSF_Fields extends CSF_Abstract {
12
+
13
+ public function __construct( $field = array(), $value = '', $unique = '', $where = '', $parent = '' ) {
14
+ $this->field = $field;
15
+ $this->value = $value;
16
+ $this->unique = $unique;
17
+ $this->where = $where;
18
+ $this->parent = $parent;
19
+ }
20
+
21
+ public function field_name( $nested_name = '' ) {
22
+
23
+ $field_id = ( ! empty( $this->field['id'] ) ) ? $this->field['id'] : '';
24
+ $unique_id = ( ! empty( $this->unique ) ) ? $this->unique .'['. $field_id .']' : $field_id;
25
+ $field_name = ( ! empty( $this->field['name'] ) ) ? $this->field['name'] : $unique_id;
26
+ $tag_prefix = ( ! empty( $this->field['tag_prefix'] ) ) ? $this->field['tag_prefix'] : '';
27
+
28
+ if( ! empty( $tag_prefix ) ) {
29
+ $nested_name = str_replace( '[', '['. $tag_prefix, $nested_name );
30
+ }
31
+
32
+ return $field_name . $nested_name;
33
+
34
+ }
35
+
36
+ public function field_attributes( $custom_atts = array() ) {
37
+
38
+ $field_id = ( ! empty( $this->field['id'] ) ) ? $this->field['id'] : '';
39
+ $attributes = ( ! empty( $this->field['attributes'] ) ) ? $this->field['attributes'] : array();
40
+
41
+ if( ! empty( $field_id ) && empty( $attributes['data-depend-id'] ) ) {
42
+ $attributes['data-depend-id'] = $field_id;
43
+ }
44
+
45
+ if( ! empty( $this->field['placeholder'] ) ) {
46
+ $attributes['placeholder'] = $this->field['placeholder'];
47
+ }
48
+
49
+ $attributes = wp_parse_args( $attributes, $custom_atts );
50
+
51
+ $atts = '';
52
+
53
+ if( ! empty( $attributes ) ) {
54
+ foreach( $attributes as $key => $value ) {
55
+ if( $value === 'only-key' ) {
56
+ $atts .= ' '. $key;
57
+ } else {
58
+ $atts .= ' '. $key . '="'. $value .'"';
59
+ }
60
+ }
61
+ }
62
+
63
+ return $atts;
64
+
65
+ }
66
+
67
+ public function field_before() {
68
+ return ( ! empty( $this->field['before'] ) ) ? $this->field['before'] : '';
69
+ }
70
+
71
+ public function field_after() {
72
+
73
+ $output = ( ! empty( $this->field['after'] ) ) ? $this->field['after'] : '';
74
+ $output .= ( ! empty( $this->field['desc'] ) ) ? '<p class="csf-text-desc">'. $this->field['desc'] .'</p>' : '';
75
+ $output .= ( ! empty( $this->field['help'] ) ) ? '<span class="csf-help"><span class="csf-help-text">'. $this->field['help'] .'</span><span class="fa fa-question-circle"></span></span>' : '';
76
+ $output .= ( ! empty( $this->field['_error'] ) ) ? '<p class="csf-text-error">'. $this->field['_error'] .'</p>' : '';
77
+
78
+ return $output;
79
+
80
+ }
81
+
82
+ public static function field_data( $type = '', $term = false, $query_args = array() ) {
83
+
84
+ $options = array();
85
+ $array_search = false;
86
+
87
+ // sanitize type name
88
+ if( in_array( $type, array( 'page', 'pages' ) ) ) {
89
+ $option = 'page';
90
+ } else if( in_array( $type, array( 'post', 'posts' ) ) ) {
91
+ $option = 'post';
92
+ } else if( in_array( $type, array( 'category', 'categories' ) ) ) {
93
+ $option = 'category';
94
+ } else if( in_array( $type, array( 'tag', 'tags' ) ) ) {
95
+ $option = 'post_tag';
96
+ } else if( in_array( $type, array( 'menu', 'menus' ) ) ) {
97
+ $option = 'nav_menu';
98
+ } else {
99
+ $option = '';
100
+ }
101
+
102
+ // switch type
103
+ switch( $type ) {
104
+
105
+ case 'page':
106
+ case 'pages':
107
+ case 'post':
108
+ case 'posts':
109
+
110
+ // term query required for ajax select
111
+ if( ! empty( $term ) ) {
112
+
113
+ $query = new WP_Query( wp_parse_args( $query_args, array(
114
+ 's' => $term,
115
+ 'post_type' => $option,
116
+ 'post_status' => 'publish',
117
+ 'posts_per_page' => 25,
118
+ ) ) );
119
+
120
+ } else {
121
+
122
+ $query = new WP_Query( wp_parse_args( $query_args, array(
123
+ 'post_type' => $option,
124
+ 'post_status' => 'publish',
125
+ ) ) );
126
+
127
+ }
128
+
129
+ if( ! is_wp_error( $query ) && ! empty( $query->posts ) ) {
130
+ foreach( $query->posts as $item ) {
131
+ $options[$item->ID] = $item->post_title;
132
+ }
133
+ }
134
+
135
+ break;
136
+
137
+ case 'category':
138
+ case 'categories':
139
+ case 'tag':
140
+ case 'tags':
141
+ case 'menu':
142
+ case 'menus':
143
+
144
+ if( ! empty( $term ) ) {
145
+
146
+ $query = new WP_Term_Query( wp_parse_args( $query_args, array(
147
+ 'search' => $term,
148
+ 'taxonomy' => $option,
149
+ 'hide_empty' => false,
150
+ 'number' => 25,
151
+ ) ) );
152
+
153
+ } else {
154
+
155
+ $query = new WP_Term_Query( wp_parse_args( $query_args, array(
156
+ 'taxonomy' => $option,
157
+ 'hide_empty' => false,
158
+ ) ) );
159
+
160
+ }
161
+
162
+ if( ! is_wp_error( $query ) && ! empty( $query->terms ) ) {
163
+ foreach( $query->terms as $item ) {
164
+ $options[$item->term_id] = $item->name;
165
+ }
166
+ }
167
+
168
+ break;
169
+
170
+ case 'user':
171
+ case 'users':
172
+
173
+ if( ! empty( $term ) ) {
174
+
175
+ $query = new WP_User_Query( array(
176
+ 'search' => '*'. $term .'*',
177
+ 'number' => 25,
178
+ 'orderby' => 'title',
179
+ 'order' => 'ASC',
180
+ 'fields' => array( 'display_name', 'ID' )
181
+ ) );
182
+
183
+ } else {
184
+
185
+ $query = new WP_User_Query( array( 'fields' => array( 'display_name', 'ID' ) ) );
186
+
187
+ }
188
+
189
+ if( ! is_wp_error( $query ) && ! empty( $query->get_results() ) ) {
190
+ foreach( $query->get_results() as $item ) {
191
+ $options[$item->ID] = $item->display_name;
192
+ }
193
+ }
194
+
195
+ break;
196
+
197
+ case 'sidebar':
198
+ case 'sidebars':
199
+
200
+ global $wp_registered_sidebars;
201
+
202
+ if( ! empty( $wp_registered_sidebars ) ) {
203
+ foreach( $wp_registered_sidebars as $sidebar ) {
204
+ $options[$sidebar['id']] = $sidebar['name'];
205
+ }
206
+ }
207
+
208
+ $array_search = true;
209
+
210
+ break;
211
+
212
+ case 'role':
213
+ case 'roles':
214
+
215
+ global $wp_roles;
216
+
217
+ if( ! empty( $wp_roles ) ) {
218
+ if( ! empty( $wp_roles->roles ) ) {
219
+ foreach( $wp_roles->roles as $role_key => $role_value ) {
220
+ $options[$role_key] = $role_value['name'];
221
+ }
222
+ }
223
+ }
224
+
225
+ $array_search = true;
226
+
227
+ break;
228
+
229
+ case 'post_type':
230
+ case 'post_types':
231
+
232
+ $post_types = get_post_types( array( 'show_in_nav_menus' => true ), 'objects' );
233
+
234
+ if( ! is_wp_error( $post_types ) && ! empty( $post_types ) ) {
235
+ foreach( $post_types as $post_type ) {
236
+ $options[$post_type->name] = $post_type->labels->name;
237
+ }
238
+ }
239
+
240
+ $array_search = true;
241
+
242
+ break;
243
+
244
+ default:
245
+
246
+ if( function_exists( $type ) ) {
247
+ if( ! empty( $term ) ) {
248
+ $options = call_user_func( $type, $query_args );
249
+ } else {
250
+ $options = call_user_func( $type, $term, $query_args );
251
+ }
252
+ }
253
+
254
+ break;
255
+
256
+ }
257
+
258
+ // Array search by "term"
259
+ if( ! empty( $term ) && ! empty( $options ) && ! empty( $array_search ) ) {
260
+ $options = preg_grep( '/'. $term .'/i', $options );
261
+ }
262
+
263
+ // Make multidimensional array for ajax search
264
+ if( ! empty( $term ) && ! empty( $options ) ) {
265
+ $arr = array();
266
+ foreach( $options as $option_key => $option_value ) {
267
+ $arr[] = array( 'value' => $option_key, 'text' => $option_value );
268
+ }
269
+ $options = $arr;
270
+ }
271
+
272
+ return $options;
273
+
274
+ }
275
+
276
+ public function field_wp_query_data_title( $type, $values ) {
277
+
278
+ $options = array();
279
+
280
+ if( ! empty( $values ) && is_array( $values ) ) {
281
+
282
+ foreach( $values as $value ) {
283
+
284
+ switch( $type ) {
285
+
286
+ case 'post':
287
+ case 'posts':
288
+ case 'page':
289
+ case 'pages':
290
+
291
+ $title = get_the_title( $value );
292
+
293
+ if( ! is_wp_error( $title ) && ! empty( $title ) ) {
294
+ $options[$value] = $title;
295
+ }
296
+
297
+ break;
298
+
299
+ case 'category':
300
+ case 'categories':
301
+ case 'tag':
302
+ case 'tags':
303
+ case 'menu':
304
+ case 'menus':
305
+
306
+ $term = get_term( $value );
307
+
308
+ if( ! is_wp_error( $term ) && ! empty( $term ) ) {
309
+ $options[$value] = $term->name;
310
+ }
311
+
312
+ break;
313
+
314
+ case 'user':
315
+ case 'users':
316
+
317
+ $user = get_user_by( 'id', $value );
318
+
319
+ if( ! is_wp_error( $user ) && ! empty( $user ) ) {
320
+ $options[$value] = $user->display_name;
321
+ }
322
+
323
+ break;
324
+
325
+ case 'sidebar':
326
+ case 'sidebars':
327
+
328
+ global $wp_registered_sidebars;
329
+
330
+ if( ! empty( $wp_registered_sidebars[$value] ) ) {
331
+ $options[$value] = $wp_registered_sidebars[$value]['name'];
332
+ }
333
+
334
+ break;
335
+
336
+ case 'role':
337
+ case 'roles':
338
+
339
+ global $wp_roles;
340
+
341
+ if( ! empty( $wp_roles ) && ! empty( $wp_roles->roles ) && ! empty( $wp_roles->roles[$value] ) ) {
342
+ $options[$value] = $wp_roles->roles[$value]['name'];
343
+ }
344
+
345
+ break;
346
+
347
+ case 'post_type':
348
+ case 'post_types':
349
+
350
+ $post_types = get_post_types( array( 'show_in_nav_menus' => true ) );
351
+
352
+ if( ! is_wp_error( $post_types ) && ! empty( $post_types ) && ! empty( $post_types[$value] ) ) {
353
+ $options[$value] = ucfirst( $value );
354
+ }
355
+
356
+ break;
357
+
358
+ default:
359
+
360
+ if( function_exists( $type .'_title' ) ) {
361
+ $options[$value] = call_user_func( $type .'_title', $value );
362
+ } else {
363
+ $options[$value] = ucfirst( $value );
364
+ }
365
+
366
+ break;
367
+
368
+ }
369
+
370
+ }
371
+
372
+ }
373
+
374
+ return $options;
375
+
376
+ }
377
+
378
+ }
379
+ }
admin/settings/classes/metabox.class.php ADDED
@@ -0,0 +1,401 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Metabox Class
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF_Metabox' ) ) {
11
+ class CSF_Metabox extends CSF_Abstract{
12
+
13
+ // constans
14
+ public $unique = '';
15
+ public $abstract = 'metabox';
16
+ public $pre_fields = array();
17
+ public $sections = array();
18
+ public $post_type = array();
19
+ public $args = array(
20
+ 'title' => '',
21
+ 'post_type' => 'post',
22
+ 'data_type' => 'serialize',
23
+ 'context' => 'advanced',
24
+ 'priority' => 'default',
25
+ 'exclude_post_types' => array(),
26
+ 'page_templates' => '',
27
+ 'post_formats' => '',
28
+ 'show_restore' => false,
29
+ 'enqueue_webfont' => true,
30
+ 'async_webfont' => false,
31
+ 'output_css' => true,
32
+ 'theme' => 'dark',
33
+ 'class' => '',
34
+ 'defaults' => array(),
35
+ );
36
+
37
+ // run metabox construct
38
+ public function __construct( $key, $params = array() ) {
39
+
40
+ $this->unique = $key;
41
+ $this->args = apply_filters( "csf_{$this->unique}_args", wp_parse_args( $params['args'], $this->args ), $this );
42
+ $this->sections = apply_filters( "csf_{$this->unique}_sections", $params['sections'], $this );
43
+ $this->post_type = ( is_array( $this->args['post_type'] ) ) ? $this->args['post_type'] : array_filter( (array) $this->args['post_type'] );
44
+ $this->post_formats = ( is_array( $this->args['post_formats'] ) ) ? $this->args['post_formats'] : array_filter( (array) $this->args['post_formats'] );
45
+ $this->page_templates = ( is_array( $this->args['page_templates'] ) ) ? $this->args['page_templates'] : array_filter( (array) $this->args['page_templates'] );
46
+ $this->pre_fields = $this->pre_fields( $this->sections );
47
+
48
+ add_action( 'add_meta_boxes', array( &$this, 'add_meta_box' ) );
49
+ add_action( 'save_post', array( &$this, 'save_meta_box' ) );
50
+ add_action( 'edit_attachment', array( &$this, 'save_meta_box' ) );
51
+
52
+ if( ! empty( $this->page_templates ) || ! empty( $this->post_formats ) || ! empty( $this->args['class'] ) ) {
53
+ foreach( $this->post_type as $post_type ) {
54
+ add_filter( 'postbox_classes_'. $post_type .'_'. $this->unique, array( &$this, 'add_metabox_classes' ) );
55
+ }
56
+ }
57
+
58
+ // wp enqeueu for typography and output css
59
+ parent::__construct();
60
+
61
+ }
62
+
63
+ // instance
64
+ public static function instance( $key, $params = array() ) {
65
+ return new self( $key, $params );
66
+ }
67
+
68
+ public function pre_fields( $sections ) {
69
+
70
+ $result = array();
71
+
72
+ foreach( $sections as $key => $section ) {
73
+ if( ! empty( $section['fields'] ) ) {
74
+ foreach( $section['fields'] as $field ) {
75
+ $result[] = $field;
76
+ }
77
+ }
78
+ }
79
+
80
+ return $result;
81
+ }
82
+
83
+ public function add_metabox_classes( $classes ) {
84
+
85
+ global $post;
86
+
87
+ if( ! empty( $this->post_formats ) ) {
88
+
89
+ $saved_post_format = ( is_object( $post ) ) ? get_post_format( $post ) : false;
90
+ $saved_post_format = ( ! empty( $saved_post_format ) ) ? $saved_post_format : 'default';
91
+
92
+ $classes[] = 'csf-post-formats';
93
+
94
+ // Sanitize post format for standard to default
95
+ if( ( $key = array_search( 'standard', $this->post_formats ) ) !== false ) {
96
+ $this->post_formats[$key] = 'default';
97
+ }
98
+
99
+ foreach( $this->post_formats as $format ) {
100
+ $classes[] = 'csf-post-format-'. $format;
101
+ }
102
+
103
+ if( ! in_array( $saved_post_format, $this->post_formats ) ) {
104
+ $classes[] = 'csf-hide';
105
+ } else {
106
+ $classes[] = 'csf-show';
107
+ }
108
+
109
+ }
110
+
111
+ if( ! empty( $this->page_templates ) ) {
112
+
113
+ $saved_template = ( is_object( $post ) && ! empty( $post->page_template ) ) ? $post->page_template : 'default';
114
+
115
+ $classes[] = 'csf-page-templates';
116
+
117
+ foreach( $this->page_templates as $template ) {
118
+ $classes[] = 'csf-page-'. preg_replace( '/[^a-zA-Z0-9]+/', '-', strtolower( $template ) );
119
+ }
120
+
121
+ if( ! in_array( $saved_template, $this->page_templates ) ) {
122
+ $classes[] = 'csf-hide';
123
+ } else {
124
+ $classes[] = 'csf-show';
125
+ }
126
+
127
+ }
128
+
129
+ if( ! empty( $this->args['class'] ) ) {
130
+ $classes[] = $this->args['class'];
131
+ }
132
+
133
+ return $classes;
134
+
135
+ }
136
+
137
+ // add metabox
138
+ public function add_meta_box( $post_type ) {
139
+
140
+ if( ! in_array( $post_type, $this->args['exclude_post_types'] ) ) {
141
+ add_meta_box( $this->unique, $this->args['title'], array( &$this, 'add_meta_box_content' ), $this->post_type, $this->args['context'], $this->args['priority'], $this->args );
142
+ }
143
+
144
+ }
145
+
146
+ // get default value
147
+ public function get_default( $field ) {
148
+
149
+ $default = ( isset( $field['id'] ) && isset( $this->args['defaults'][$field['id']] ) ) ? $this->args['defaults'][$field['id']] : null;
150
+ $default = ( isset( $field['default'] ) ) ? $field['default'] : $default;
151
+
152
+ return $default;
153
+
154
+ }
155
+
156
+ // get meta value
157
+ public function get_meta_value( $field ) {
158
+
159
+ global $post;
160
+
161
+ $value = null;
162
+
163
+ if( is_object( $post ) && ! empty( $field['id'] ) ) {
164
+
165
+ if( $this->args['data_type'] !== 'serialize' ) {
166
+ $meta = get_post_meta( $post->ID, $field['id'] );
167
+ $value = ( isset( $meta[0] ) ) ? $meta[0] : null;
168
+ } else {
169
+ $meta = get_post_meta( $post->ID, $this->unique, true );
170
+ $value = ( isset( $meta[$field['id']] ) ) ? $meta[$field['id']] : null;
171
+ }
172
+
173
+ }
174
+
175
+ $default = $this->get_default( $field );
176
+ $value = ( isset( $value ) ) ? $value : $default;
177
+
178
+ return $value;
179
+
180
+ }
181
+
182
+ // add metabox content
183
+ public function add_meta_box_content( $post, $callback ) {
184
+
185
+ global $post;
186
+
187
+ $has_nav = ( count( $this->sections ) > 1 && $this->args['context'] !== 'side' ) ? true : false;
188
+ $show_all = ( ! $has_nav ) ? ' csf-show-all' : '';
189
+ $errors = ( is_object ( $post ) ) ? get_post_meta( $post->ID, '_csf_errors', true ) : array();
190
+ $errors = ( ! empty( $errors ) ) ? $errors : array();
191
+ $theme = ( $this->args['theme'] ) ? ' csf-theme-'. $this->args['theme'] : '';
192
+
193
+ if( is_object ( $post ) && ! empty( $errors ) ) {
194
+ delete_post_meta( $post->ID, '_csf_errors' );
195
+ }
196
+
197
+ wp_nonce_field( 'csf_metabox_nonce', 'csf_metabox_nonce'. $this->unique );
198
+
199
+ echo '<div class="csf csf-metabox'. $theme .'">';
200
+
201
+ echo '<div class="csf-wrapper'. $show_all .'">';
202
+
203
+ if( $has_nav ) {
204
+
205
+ echo '<div class="csf-nav csf-nav-metabox" data-unique="'. $this->unique .'">';
206
+
207
+ echo '<ul>';
208
+ $tab_key = 1;
209
+ foreach( $this->sections as $section ) {
210
+
211
+ $tab_error = ( ! empty( $errors['sections'][$tab_key] ) ) ? '<i class="csf-label-error csf-error">!</i>' : '';
212
+ $tab_icon = ( ! empty( $section['icon'] ) ) ? '<i class="csf-icon '. $section['icon'] .'"></i>' : '';
213
+
214
+ echo '<li><a href="#" data-section="'. $this->unique .'_'. $tab_key .'">'. $tab_icon . $section['title'] . $tab_error .'</a></li>';
215
+
216
+ $tab_key++;
217
+ }
218
+ echo '</ul>';
219
+
220
+ echo '</div>';
221
+
222
+ }
223
+
224
+ echo '<div class="csf-content">';
225
+
226
+ echo '<div class="csf-sections">';
227
+
228
+ $section_key = 1;
229
+
230
+ foreach( $this->sections as $section ) {
231
+
232
+ $onload = ( ! $has_nav ) ? ' csf-onload' : '';
233
+
234
+ echo '<div id="csf-section-'. $this->unique .'_'. $section_key .'" class="csf-section'. $onload .'">';
235
+
236
+ $section_icon = ( ! empty( $section['icon'] ) ) ? '<i class="csf-icon '. $section['icon'] .'"></i>' : '';
237
+ $section_title = ( ! empty( $section['title'] ) ) ? $section['title'] : '';
238
+
239
+ echo ( $section_title || $section_icon ) ? '<div class="csf-section-title"><h3>'. $section_icon . $section_title .'</h3></div>' : '';
240
+
241
+ if( ! empty( $section['fields'] ) ) {
242
+
243
+ foreach ( $section['fields'] as $field ) {
244
+
245
+ if( ! empty( $field['id'] ) && ! empty( $errors['fields'][$field['id']] ) ) {
246
+ $field['_error'] = $errors['fields'][$field['id']];
247
+ }
248
+
249
+ CSF::field( $field, $this->get_meta_value( $field ), $this->unique, 'metabox' );
250
+
251
+ }
252
+
253
+ } else {
254
+
255
+ echo '<div class="csf-no-option csf-text-muted">'. esc_html__( 'No option provided by developer.', 'csf' ) .'</div>';
256
+
257
+ }
258
+
259
+ echo '</div>';
260
+
261
+ $section_key++;
262
+ }
263
+
264
+ echo '</div>';
265
+
266
+ echo '<div class="clear"></div>';
267
+
268
+ if( ! empty( $this->args['show_restore'] ) ) {
269
+
270
+ echo '<div class="csf-restore-wrapper">';
271
+ echo '<label>';
272
+ echo '<input type="checkbox" name="'. $this->unique .'[_restore]" />';
273
+ echo '<span class="button csf-button-restore">'. esc_html__( 'Restore', 'csf' ) .'</span>';
274
+ echo '<span class="button csf-button-cancel">'. sprintf( '<small>( %s )</small> %s', esc_html__( 'update post for restore ', 'csf' ), esc_html__( 'Cancel', 'csf' ) ) .'</span>';
275
+ echo '</label>';
276
+ echo '</div>';
277
+
278
+ }
279
+
280
+ echo '</div>';
281
+
282
+ echo ( $has_nav ) ? '<div class="csf-nav-background"></div>' : '';
283
+
284
+ echo '<div class="clear"></div>';
285
+
286
+ echo '</div>';
287
+
288
+ echo '</div>';
289
+
290
+ }
291
+
292
+ // save metabox
293
+ public function save_meta_box( $post_id ) {
294
+
295
+ if( ! wp_verify_nonce( csf_get_var( 'csf_metabox_nonce'. $this->unique ), 'csf_metabox_nonce' ) ) {
296
+ return $post_id;
297
+ }
298
+
299
+ if( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
300
+ return $post_id;
301
+ }
302
+
303
+ $errors = array();
304
+ $request = csf_get_var( $this->unique );
305
+
306
+ if( ! empty( $request ) ) {
307
+
308
+ // ignore _nonce
309
+ if( isset( $request['_nonce'] ) ) {
310
+ unset( $request['_nonce'] );
311
+ }
312
+
313
+ // sanitize and validate
314
+ $section_key = 1;
315
+ foreach( $this->sections as $section ) {
316
+
317
+ if( ! empty( $section['fields'] ) ) {
318
+
319
+ foreach( $section['fields'] as $field ) {
320
+
321
+ if( ! empty( $field['id'] ) ) {
322
+
323
+ // sanitize
324
+ if( ! empty( $field['sanitize'] ) ) {
325
+
326
+ $sanitize = $field['sanitize'];
327
+ $value_sanitize = isset( $request[$field['id']] ) ? $request[$field['id']] : '';
328
+ $request[$field['id']] = call_user_func( $sanitize, $value_sanitize );
329
+
330
+ }
331
+
332
+ // validate
333
+ if( ! empty( $field['validate'] ) ) {
334
+
335
+ $validate = $field['validate'];
336
+ $value_validate = isset( $request[$field['id']] ) ? $request[$field['id']] : '';
337
+ $has_validated = call_user_func( $validate, $value_validate );
338
+
339
+ if( ! empty( $has_validated ) ) {
340
+
341
+ $errors['sections'][$section_key] = true;
342
+ $errors['fields'][$field['id']] = $has_validated;
343
+ $request[$field['id']] = $this->get_meta_value( $field );
344
+
345
+ }
346
+
347
+ }
348
+
349
+ // auto sanitize
350
+ if( ! isset( $request[$field['id']] ) || is_null( $request[$field['id']] ) ) {
351
+ $request[$field['id']] = '';
352
+ }
353
+
354
+ }
355
+
356
+ }
357
+
358
+ }
359
+
360
+ $section_key++;
361
+ }
362
+
363
+ }
364
+
365
+ $request = apply_filters( "csf_{$this->unique}_save", $request, $post_id, $this );
366
+
367
+ do_action( "csf_{$this->unique}_save_before", $request, $post_id, $this );
368
+
369
+ if( empty( $request ) || ! empty( $request['_restore'] ) ) {
370
+
371
+ if( $this->args['data_type'] !== 'serialize' ) {
372
+ foreach ( $request as $key => $value ) {
373
+ delete_post_meta( $post_id, $key );
374
+ }
375
+ } else {
376
+ delete_post_meta( $post_id, $this->unique );
377
+ }
378
+
379
+ } else {
380
+
381
+ if( $this->args['data_type'] !== 'serialize' ) {
382
+ foreach ( $request as $key => $value ) {
383
+ update_post_meta( $post_id, $key, $value );
384
+ }
385
+ } else {
386
+ update_post_meta( $post_id, $this->unique, $request );
387
+ }
388
+
389
+ if( ! empty( $errors ) ) {
390
+ update_post_meta( $post_id, '_csf_errors', $errors );
391
+ }
392
+
393
+ }
394
+
395
+ do_action( "csf_{$this->unique}_saved", $request, $post_id, $this );
396
+
397
+ do_action( "csf_{$this->unique}_save_after", $request, $post_id, $this );
398
+
399
+ }
400
+ }
401
+ }
admin/settings/classes/options.class.php ADDED
@@ -0,0 +1,705 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Options Class
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF_Options' ) ) {
11
+ class CSF_Options extends CSF_Abstract {
12
+
13
+ // constans
14
+ public $unique = '';
15
+ public $notice = '';
16
+ public $abstract = 'options';
17
+ public $sections = array();
18
+ public $options = array();
19
+ public $errors = array();
20
+ public $pre_tabs = array();
21
+ public $pre_fields = array();
22
+ public $pre_sections = array();
23
+ public $args = array(
24
+
25
+ // framework title
26
+ 'framework_title' => 'Codestar Framework <small>by Codestar</small>',
27
+ 'framework_class' => '',
28
+
29
+ // menu settings
30
+ 'menu_title' => '',
31
+ 'menu_slug' => '',
32
+ 'menu_type' => 'menu',
33
+ 'menu_capability' => 'manage_options',
34
+ 'menu_icon' => null,
35
+ 'menu_position' => null,
36
+ 'menu_hidden' => false,
37
+ 'menu_parent' => '',
38
+ 'sub_menu_title' => '',
39
+
40
+ // menu extras
41
+ 'show_bar_menu' => true,
42
+ 'show_sub_menu' => true,
43
+ 'show_network_menu' => true,
44
+ 'show_in_customizer' => false,
45
+
46
+ 'show_search' => true,
47
+ 'show_reset_all' => true,
48
+ 'show_reset_section' => true,
49
+ 'show_footer' => true,
50
+ 'show_all_options' => true,
51
+ 'show_form_warning' => true,
52
+ 'sticky_header' => true,
53
+ 'save_defaults' => true,
54
+ 'ajax_save' => true,
55
+
56
+ // admin bar menu settings
57
+ 'admin_bar_menu_icon' => '',
58
+ 'admin_bar_menu_priority' => 80,
59
+
60
+ // footer
61
+ 'footer_text' => '',
62
+ 'footer_after' => '',
63
+ 'footer_credit' => '',
64
+
65
+ // database model
66
+ 'database' => '', // options, transient, theme_mod, network
67
+ 'transient_time' => 0,
68
+
69
+ // contextual help
70
+ 'contextual_help' => array(),
71
+ 'contextual_help_sidebar' => '',
72
+
73
+ // typography options
74
+ 'enqueue_webfont' => true,
75
+ 'async_webfont' => false,
76
+
77
+ // others
78
+ 'output_css' => true,
79
+
80
+ // theme
81
+ 'theme' => 'dark',
82
+ 'class' => '',
83
+
84
+ // external default values
85
+ 'defaults' => array(),
86
+
87
+ );
88
+
89
+ // run framework construct
90
+ public function __construct( $key, $params = array() ) {
91
+
92
+ $this->unique = $key;
93
+ $this->args = apply_filters( "csf_{$this->unique}_args", wp_parse_args( $params['args'], $this->args ), $this );
94
+ $this->sections = apply_filters( "csf_{$this->unique}_sections", $params['sections'], $this );
95
+
96
+ // run only is admin panel options, avoid performance loss
97
+ $this->pre_tabs = $this->pre_tabs( $this->sections );
98
+ $this->pre_fields = $this->pre_fields( $this->sections );
99
+ $this->pre_sections = $this->pre_sections( $this->sections );
100
+
101
+ $this->get_options();
102
+ $this->set_options();
103
+ $this->save_defaults();
104
+
105
+ add_action( 'admin_menu', array( &$this, 'add_admin_menu' ) );
106
+ add_action( 'admin_bar_menu', array( &$this, 'add_admin_bar_menu' ), $this->args['admin_bar_menu_priority'] );
107
+ add_action( 'wp_ajax_csf_'. $this->unique .'_ajax_save', array( &$this, 'ajax_save' ) );
108
+
109
+ if( ! empty( $this->args['show_network_menu'] ) ) {
110
+ add_action( 'network_admin_menu', array( &$this, 'add_admin_menu' ) );
111
+ }
112
+
113
+ // wp enqeueu for typography and output css
114
+ parent::__construct();
115
+
116
+ }
117
+
118
+ // instance
119
+ public static function instance( $key, $params = array() ) {
120
+ return new self( $key, $params );
121
+ }
122
+
123
+ public function pre_tabs( $sections ) {
124
+
125
+ $result = array();
126
+ $parents = array();
127
+ $count = 100;
128
+
129
+ foreach( $sections as $key => $section ) {
130
+ if( ! empty( $section['parent'] ) ) {
131
+ $section['priority'] = ( isset( $section['priority'] ) ) ? $section['priority'] : $count;
132
+ $parents[$section['parent']][] = $section;
133
+ unset( $sections[$key] );
134
+ }
135
+ $count++;
136
+ }
137
+
138
+ foreach( $sections as $key => $section ) {
139
+ $section['priority'] = ( isset( $section['priority'] ) ) ? $section['priority'] : $count;
140
+ if( ! empty( $section['id'] ) && ! empty( $parents[$section['id']] ) ) {
141
+ $section['subs'] = wp_list_sort( $parents[$section['id']], array( 'priority' => 'ASC' ), 'ASC', true );
142
+ }
143
+ $result[] = $section;
144
+ $count++;
145
+ }
146
+
147
+ return wp_list_sort( $result, array( 'priority' => 'ASC' ), 'ASC', true );
148
+ }
149
+
150
+ public function pre_fields( $sections ) {
151
+
152
+ $result = array();
153
+
154
+ foreach( $sections as $key => $section ) {
155
+ if( ! empty( $section['fields'] ) ) {
156
+ foreach( $section['fields'] as $field ) {
157
+ $result[] = $field;
158
+ }
159
+ }
160
+ }
161
+
162
+ return $result;
163
+ }
164
+
165
+ public function pre_sections( $sections ) {
166
+
167
+ $result = array();
168
+
169
+ foreach( $this->pre_tabs as $tab ) {
170
+ if( ! empty( $tab['subs'] ) ) {
171
+ foreach( $tab['subs'] as $sub ) {
172
+ $result[] = $sub;
173
+ }
174
+ }
175
+ if( empty( $tab['subs'] ) ) {
176
+ $result[] = $tab;
177
+ }
178
+ }
179
+
180
+ return $result;
181
+ }
182
+
183
+ // add admin bar menu
184
+ public function add_admin_bar_menu( $wp_admin_bar ) {
185
+
186
+ if( ! empty( $this->args['show_bar_menu'] ) && empty( $this->args['menu_hidden'] ) ) {
187
+
188
+ global $submenu;
189
+
190
+ $menu_slug = $this->args['menu_slug'];
191
+ $menu_icon = ( ! empty( $this->args['admin_bar_menu_icon'] ) ) ? '<span class="csf-ab-icon ab-icon '. $this->args['admin_bar_menu_icon'] .'"></span>' : '';
192
+
193
+ $wp_admin_bar->add_node( array(
194
+ 'id' => $menu_slug,
195
+ 'title' => $menu_icon . $this->args['menu_title'],
196
+ 'href' => ( is_network_admin() ) ? network_admin_url( 'admin.php?page='. $menu_slug ) : admin_url( 'admin.php?page='. $menu_slug ),
197
+ ) );
198
+
199
+ if( ! empty( $submenu[$menu_slug] ) ) {
200
+ foreach( $submenu[$menu_slug] as $key => $menu ) {
201
+ $wp_admin_bar->add_node( array(
202
+ 'parent' => $menu_slug,
203
+ 'id' => $menu_slug .'-'. $key,
204
+ 'title' => $menu[0],
205
+ 'href' => ( is_network_admin() ) ? network_admin_url( 'admin.php?page='. $menu[2] ) : admin_url( 'admin.php?page='. $menu[2] ),
206
+ ) );
207
+ }
208
+ }
209
+
210
+ if( ! empty( $this->args['show_network_menu'] ) ) {
211
+ $wp_admin_bar->add_node( array(
212
+ 'parent' => 'network-admin',
213
+ 'id' => $menu_slug .'-network-admin',
214
+ 'title' => $menu_icon . $this->args['menu_title'],
215
+ 'href' => network_admin_url( 'admin.php?page='. $menu_slug ),
216
+ ) );
217
+ }
218
+
219
+ }
220
+
221
+ }
222
+
223
+ public function ajax_save() {
224
+
225
+ if( ! empty( $_POST['data'] ) ) {
226
+
227
+ $_POST = json_decode( stripslashes( $_POST['data'] ), true );
228
+
229
+ if( wp_verify_nonce( csf_get_var( 'csf_options_nonce'. $this->unique ), 'csf_options_nonce' ) ) {
230
+
231
+ $this->set_options();
232
+
233
+ wp_send_json_success( array( 'success' => true, 'notice' => $this->notice, 'errors' => $this->errors ) );
234
+
235
+ }
236
+
237
+ }
238
+
239
+ wp_send_json_error( array( 'success' => false, 'error' => esc_html__( 'Error while saving.', 'csf' ) ) );
240
+
241
+ }
242
+
243
+ // get default value
244
+ public function get_default( $field, $options = array() ) {
245
+
246
+ $default = ( isset( $this->args['defaults'][$field['id']] ) ) ? $this->args['defaults'][$field['id']] : '';
247
+ $default = ( isset( $field['default'] ) ) ? $field['default'] : $default;
248
+ $default = ( isset( $options[$field['id']] ) ) ? $options[$field['id']] : $default;
249
+
250
+ return $default;
251
+
252
+ }
253
+
254
+ // save defaults and set new fields value to main options
255
+ public function save_defaults() {
256
+
257
+ $tmp_options = $this->options;
258
+
259
+ foreach( $this->pre_fields as $field ) {
260
+ if( ! empty( $field['id'] ) ) {
261
+ $this->options[$field['id']] = $this->get_default( $field, $this->options );
262
+ }
263
+ }
264
+
265
+ if( $this->args['save_defaults'] && empty( $tmp_options ) ) {
266
+ $this->save_options( $this->options );
267
+ }
268
+
269
+ }
270
+
271
+ // set options
272
+ public function set_options() {
273
+
274
+ if( wp_verify_nonce( csf_get_var( 'csf_options_nonce'. $this->unique ), 'csf_options_nonce' ) ) {
275
+
276
+ $request = csf_get_var( $this->unique, array() );
277
+ $transient = csf_get_var( 'csf_transient' );
278
+ $section_id = ( ! empty( $transient['section'] ) ) ? $transient['section'] : '';
279
+
280
+ // import data
281
+ if( ! empty( $transient['csf_import_data'] ) ) {
282
+
283
+ $import_data = json_decode( stripslashes( trim( $transient['csf_import_data'] ) ), true );
284
+ $request = ( is_array( $import_data ) ) ? $import_data : array();
285
+
286
+ $this->notice = esc_html__( 'Success. Imported backup options.', 'csf' );
287
+
288
+ } else if( ! empty( $transient['reset'] ) ) {
289
+
290
+ foreach( $this->pre_fields as $field ) {
291
+ if( ! empty( $field['id'] ) ) {
292
+ $request[$field['id']] = $this->get_default( $field );
293
+ }
294
+ }
295
+
296
+ $this->notice = esc_html__( 'Default options restored.', 'csf' );
297
+
298
+ } else if( ! empty( $transient['reset_section'] ) && ! empty( $section_id ) ) {
299
+
300
+ if( ! empty( $this->pre_sections[$section_id-1]['fields'] ) ) {
301
+
302
+ foreach( $this->pre_sections[$section_id-1]['fields'] as $field ) {
303
+ if( ! empty( $field['id'] ) ) {
304
+ $request[$field['id']] = $this->get_default( $field );
305
+ }
306
+ }
307
+
308
+ }
309
+
310
+ $this->notice = esc_html__( 'Default options restored for only this section.', 'csf' );
311
+
312
+ } else {
313
+
314
+ // sanitize and validate
315
+ foreach( $this->pre_fields as $field ) {
316
+
317
+ if( ! empty( $field['id'] ) ) {
318
+
319
+ // sanitize
320
+ if( ! empty( $field['sanitize'] ) ) {
321
+
322
+ $sanitize = $field['sanitize'];
323
+ $value_sanitize = isset( $request[$field['id']] ) ? $request[$field['id']] : '';
324
+ $request[$field['id']] = call_user_func( $sanitize, $value_sanitize );
325
+
326
+ }
327
+
328
+ // validate
329
+ if( ! empty( $field['validate'] ) ) {
330
+
331
+ $value_validate = isset( $request[$field['id']] ) ? $request[$field['id']] : '';
332
+ $has_validated = call_user_func( $field['validate'], $value_validate );
333
+
334
+ if( ! empty( $has_validated ) ) {
335
+ $request[$field['id']] = ( isset( $this->options[$field['id']] ) ) ? $this->options[$field['id']] : '';
336
+ $this->errors[$field['id']] = $has_validated;
337
+ }
338
+
339
+ }
340
+
341
+ // auto sanitize
342
+ if( ! isset( $request[$field['id']] ) || is_null( $request[$field['id']] ) ) {
343
+ $request[$field['id']] = '';
344
+ }
345
+
346
+ }
347
+
348
+ }
349
+
350
+ }
351
+
352
+ // ignore nonce requests
353
+ if( isset( $request['_nonce'] ) ) { unset( $request['_nonce'] ); }
354
+
355
+ $request = wp_unslash( $request );
356
+
357
+ $request = apply_filters( "csf_{$this->unique}_save", $request, $this );
358
+
359
+ do_action( "csf_{$this->unique}_save_before", $request, $this );
360
+
361
+ $this->options = $request;
362
+
363
+ $this->save_options( $request );
364
+
365
+ do_action( "csf_{$this->unique}_save_after", $request, $this );
366
+
367
+ if( empty( $this->notice ) ) {
368
+ $this->notice = esc_html__( 'Settings saved.', 'csf' );
369
+ }
370
+
371
+ }
372
+
373
+ return true;
374
+
375
+ }
376
+
377
+ // save options database
378
+ public function save_options( $request ) {
379
+
380
+ if( $this->args['database'] === 'transient' ) {
381
+ set_transient( $this->unique, $request, $this->args['transient_time'] );
382
+ } else if( $this->args['database'] === 'theme_mod' ) {
383
+ set_theme_mod( $this->unique, $request );
384
+ } else if( $this->args['database'] === 'network' ) {
385
+ update_site_option( $this->unique, $request );
386
+ } else {
387
+ update_option( $this->unique, $request );
388
+ }
389
+
390
+ do_action( "csf_{$this->unique}_saved", $request, $this );
391
+
392
+ }
393
+
394
+ // get options from database
395
+ public function get_options() {
396
+
397
+ if( $this->args['database'] === 'transient' ) {
398
+ $this->options = get_transient( $this->unique );
399
+ } else if( $this->args['database'] === 'theme_mod' ) {
400
+ $this->options = get_theme_mod( $this->unique );
401
+ } else if( $this->args['database'] === 'network' ) {
402
+ $this->options = get_site_option( $this->unique );
403
+ } else {
404
+ $this->options = get_option( $this->unique );
405
+ }
406
+
407
+ if( empty( $this->options ) ) {
408
+ $this->options = array();
409
+ }
410
+
411
+ return $this->options;
412
+
413
+ }
414
+
415
+ // wp api: admin menu
416
+ public function add_admin_menu() {
417
+
418
+ extract( $this->args );
419
+
420
+ if( $menu_type === 'submenu' ) {
421
+
422
+ $menu_page = call_user_func( 'add_submenu_page', $menu_parent, $menu_title, $menu_title, $menu_capability, $menu_slug, array( &$this, 'add_options_html' ) );
423
+
424
+ } else {
425
+
426
+ $menu_page = call_user_func( 'add_menu_page', $menu_title, $menu_title, $menu_capability, $menu_slug, array( &$this, 'add_options_html' ), $menu_icon, $menu_position );
427
+
428
+ if ( ! empty( $sub_menu_title ) ) {
429
+ call_user_func( 'add_submenu_page', $menu_slug, $sub_menu_title, $sub_menu_title, $menu_capability, $menu_slug, array( &$this, 'add_options_html' ) );
430
+ }
431
+
432
+ if( ! empty( $this->args['show_sub_menu'] ) && count( $this->pre_tabs ) > 1 ) {
433
+
434
+ // create submenus
435
+ $tab_key = 1;
436
+ foreach ( $this->pre_tabs as $section ) {
437
+
438
+ call_user_func( 'add_submenu_page', $menu_slug, $section['title'], $section['title'], $menu_capability, $menu_slug .'#tab='. $tab_key, '__return_null' );
439
+
440
+ if( ! empty( $section['subs'] ) ) {
441
+ $tab_key += ( count( $section['subs'] )-1 );
442
+ }
443
+
444
+ $tab_key++;
445
+
446
+ }
447
+
448
+ remove_submenu_page( $menu_slug, $menu_slug );
449
+
450
+ }
451
+
452
+ if( ! empty( $menu_hidden ) ) {
453
+ remove_menu_page( $menu_slug );
454
+ }
455
+
456
+ }
457
+
458
+ add_action( 'load-'. $menu_page, array( &$this, 'add_page_on_load' ) );
459
+
460
+ }
461
+
462
+ public function add_page_on_load() {
463
+
464
+ if( ! empty( $this->args['contextual_help'] ) ) {
465
+
466
+ $screen = get_current_screen();
467
+
468
+ foreach( $this->args['contextual_help'] as $tab ) {
469
+ $screen->add_help_tab( $tab );
470
+ }
471
+
472
+ if( ! empty( $this->args['contextual_help_sidebar'] ) ) {
473
+ $screen->set_help_sidebar( $this->args['contextual_help_sidebar'] );
474
+ }
475
+
476
+ }
477
+
478
+ add_filter( 'admin_footer_text', array( &$this, 'add_admin_footer_text' ) );
479
+
480
+ }
481
+
482
+ public function add_admin_footer_text() {
483
+ $default = 'Thank you for creating with <a href="http://codestarframework.com/" target="_blank">Codestar Framework</a>';
484
+ echo ( ! empty( $this->args['footer_credit'] ) ) ? $this->args['footer_credit'] : $default;
485
+ }
486
+
487
+ public function error_check( $sections, $err = '' ) {
488
+
489
+ if( ! $this->args['ajax_save'] ) {
490
+
491
+ if( ! empty( $sections['fields'] ) ) {
492
+ foreach( $sections['fields'] as $field ) {
493
+ if( ! empty( $field['id'] ) ) {
494
+ if( array_key_exists( $field['id'], $this->errors ) ) {
495
+ $err = '<span class="csf-label-error">!</span>';
496
+ }
497
+ }
498
+ }
499
+ }
500
+
501
+ if( ! empty( $sections['subs'] ) ) {
502
+ foreach( $sections['subs'] as $sub ) {
503
+ $err = $this->error_check( $sub, $err );
504
+ }
505
+ }
506
+
507
+ if( ! empty( $sections['id'] ) && array_key_exists( $sections['id'], $this->errors ) ) {
508
+ $err = $this->errors[$sections['id']];
509
+ }
510
+
511
+ }
512
+
513
+ return $err;
514
+ }
515
+
516
+ // option page html output
517
+ public function add_options_html() {
518
+
519
+ $has_nav = ( count( $this->pre_tabs ) > 1 ) ? true : false;
520
+ $show_all = ( ! $has_nav ) ? ' csf-show-all' : '';
521
+ $ajax_class = ( $this->args['ajax_save'] ) ? ' csf-save-ajax' : '';
522
+ $sticky_class = ( $this->args['sticky_header'] ) ? ' csf-sticky-header' : '';
523
+ $wrapper_class = ( $this->args['framework_class'] ) ? ' '. $this->args['framework_class'] : '';
524
+ $theme = ( $this->args['theme'] ) ? ' csf-theme-'. $this->args['theme'] : '';
525
+ $class = ( $this->args['class'] ) ? ' '. $this->args['class'] : '';
526
+
527
+ do_action( 'csf_options_before' );
528
+
529
+ echo '<div class="csf csf-options'. $theme . $class . $wrapper_class .'" data-slug="'. $this->args['menu_slug'] .'" data-unique="'. $this->unique .'">';
530
+
531
+ echo '<div class="csf-container">';
532
+
533
+ echo '<form method="post" action="" enctype="multipart/form-data" id="csf-form" autocomplete="off">';
534
+
535
+ echo '<input type="hidden" class="csf-section-id" name="csf_transient[section]" value="1">';
536
+
537
+ wp_nonce_field( 'csf_options_nonce', 'csf_options_nonce'. $this->unique );
538
+
539
+ echo '<div class="csf-header'. esc_attr( $sticky_class ) .'">';
540
+ echo '<div class="csf-header-inner">';
541
+
542
+ echo '<div class="csf-header-left">';
543
+ echo '<h1>'. $this->args['framework_title'] .'</h1>';
544
+ echo '</div>';
545
+
546
+ echo '<div class="csf-header-right">';
547
+
548
+ $notice_class = ( ! empty( $this->notice ) ) ? ' csf-form-show' : '';
549
+ $notice_text = ( ! empty( $this->notice ) ) ? $this->notice : '';
550
+
551
+ echo '<div class="csf-form-result csf-form-success'. $notice_class .'">'. $notice_text .'</div>';
552
+
553
+ echo ( $this->args['show_form_warning'] ) ? '<div class="csf-form-result csf-form-warning">'. esc_html__( 'Settings have changed, you should save them!', 'csf' ) .'</div>' : '';
554
+
555
+ echo ( $has_nav && $this->args['show_all_options'] ) ? '<div class="csf-expand-all" title="'. esc_html__( 'show all options', 'csf' ) .'"><i class="fa fa-outdent"></i></div>' : '';
556
+
557
+ echo ( $this->args['show_search'] ) ? '<div class="csf-search"><input type="text" name="csf-search" placeholder="'. esc_html__( 'Search option(s)', 'csf' ) .'" autocomplete="off" /></div>' : '';
558
+
559
+ echo '<div class="csf-buttons">';
560
+ echo '<input type="submit" name="'. $this->unique .'[_nonce][save]" class="button button-primary csf-top-save csf-save'. $ajax_class .'" value="'. esc_html__( 'Save', 'csf' ) .'" data-save="'. esc_html__( 'Saving...', 'csf' ) .'">';
561
+ echo ( $this->args['show_reset_section'] ) ? '<input type="submit" name="csf_transient[reset_section]" class="button button-secondary csf-reset-section csf-confirm" value="'. esc_html__( 'Reset Section', 'csf' ) .'" data-confirm="'. esc_html__( 'Are you sure to reset this section options?', 'csf' ) .'">' : '';
562
+ echo ( $this->args['show_reset_all'] ) ? '<input type="submit" name="csf_transient[reset]" class="button csf-warning-primary csf-reset-all csf-confirm" value="'. esc_html__( 'Reset All', 'csf' ) .'" data-confirm="'. esc_html__( 'Are you sure to reset all options?', 'csf' ) .'">' : '';
563
+ echo '</div>';
564
+
565
+ echo '</div>';
566
+
567
+ echo '<div class="clear"></div>';
568
+ echo '</div>';
569
+ echo '</div>';
570
+
571
+ echo '<div class="csf-wrapper'. $show_all .'">';
572
+
573
+ if( $has_nav ) {
574
+ echo '<div class="csf-nav csf-nav-options">';
575
+
576
+ echo '<ul>';
577
+
578
+ $tab_key = 1;
579
+
580
+ foreach( $this->pre_tabs as $tab ) {
581
+
582
+ $tab_error = $this->error_check( $tab );
583
+ $tab_icon = ( ! empty( $tab['icon'] ) ) ? '<i class="'. $tab['icon'] .'"></i>' : '';
584
+
585
+ if( ! empty( $tab['subs'] ) ) {
586
+
587
+ echo '<li class="csf-tab-depth-0">';
588
+
589
+ echo '<a href="#tab='. $tab_key .'" class="csf-arrow">'. $tab_icon . $tab['title'] . $tab_error .'</a>';
590
+
591
+ echo '<ul>';
592
+
593
+ foreach ( $tab['subs'] as $sub ) {
594
+
595
+ $sub_error = $this->error_check( $sub );
596
+ $sub_icon = ( ! empty( $sub['icon'] ) ) ? '<i class="'. $sub['icon'] .'"></i>' : '';
597
+
598
+ echo '<li class="csf-tab-depth-1"><a id="csf-tab-link-'. $tab_key .'" href="#tab='. $tab_key .'">'. $sub_icon . $sub['title'] . $sub_error .'</a></li>';
599
+
600
+ $tab_key++;
601
+ }
602
+
603
+ echo '</ul>';
604
+
605
+ echo '</li>';
606
+
607
+ } else {
608
+
609
+ echo '<li class="csf-tab-depth-0"><a id="csf-tab-link-'. $tab_key .'" href="#tab='. $tab_key .'">'. $tab_icon . $tab['title'] . $tab_error .'</a></li>';
610
+
611
+ $tab_key++;
612
+ }
613
+
614
+ }
615
+
616
+ echo '</ul>';
617
+
618
+ echo '</div>';
619
+
620
+ }
621
+
622
+ echo '<div class="csf-content">';
623
+
624
+ echo '<div class="csf-sections">';
625
+
626
+ $section_key = 1;
627
+
628
+ foreach( $this->pre_sections as $section ) {
629
+
630
+ $onload = ( ! $has_nav ) ? ' csf-onload' : '';
631
+ $section_icon = ( ! empty( $section['icon'] ) ) ? '<i class="csf-icon '. $section['icon'] .'"></i>' : '';
632
+
633
+ echo '<div id="csf-section-'. $section_key .'" class="csf-section'. $onload .'">';
634
+ echo ( $has_nav ) ? '<div class="csf-section-title"><h3>'. $section_icon . $section['title'] .'</h3></div>' : '';
635
+ echo ( ! empty( $section['description'] ) ) ? '<div class="csf-field csf-section-description">'. $section['description'] .'</div>' : '';
636
+
637
+ if( ! empty( $section['fields'] ) ) {
638
+
639
+ foreach( $section['fields'] as $field ) {
640
+
641
+ $is_field_error = $this->error_check( $field );
642
+
643
+ if( ! empty( $is_field_error ) ) {
644
+ $field['_error'] = $is_field_error;
645
+ }
646
+
647
+ $value = ( ! empty( $field['id'] ) && isset( $this->options[$field['id']] ) ) ? $this->options[$field['id']] : '';
648
+
649
+ CSF::field( $field, $value, $this->unique, 'options' );
650
+
651
+ }
652
+
653
+ } else {
654
+
655
+ echo '<div class="csf-no-option csf-text-muted">'. esc_html__( 'No option provided by developer.', 'csf' ) .'</div>';
656
+
657
+ }
658
+
659
+ echo '</div>';
660
+
661
+ $section_key++;
662
+ }
663
+
664
+ echo '</div>';
665
+
666
+ echo '<div class="clear"></div>';
667
+
668
+ echo '</div>';
669
+
670
+ echo '<div class="csf-nav-background"></div>';
671
+
672
+ echo '</div>';
673
+
674
+ if( ! empty( $this->args['show_footer'] ) ) {
675
+
676
+ echo '<div class="csf-footer">';
677
+
678
+ echo '<div class="csf-buttons">';
679
+ echo '<input type="submit" name="csf_transient[save]" class="button button-primary csf-save'. $ajax_class .'" value="'. esc_html__( 'Save', 'csf' ) .'" data-save="'. esc_html__( 'Saving...', 'csf' ) .'">';
680
+ echo ( $this->args['show_reset_section'] ) ? '<input type="submit" name="csf_transient[reset_section]" class="button button-secondary csf-reset-section csf-confirm" value="'. esc_html__( 'Reset Section', 'csf' ) .'" data-confirm="'. esc_html__( 'Are you sure to reset this section options?', 'csf' ) .'">' : '';
681
+ echo ( $this->args['show_reset_all'] ) ? '<input type="submit" name="csf_transient[reset]" class="button csf-warning-primary csf-reset-all csf-confirm" value="'. esc_html__( 'Reset All', 'csf' ) .'" data-confirm="'. esc_html__( 'Are you sure to reset all options?', 'csf' ) .'">' : '';
682
+ echo '</div>';
683
+
684
+ echo ( ! empty( $this->args['footer_text'] ) ) ? '<div class="csf-copyright">'. $this->args['footer_text'] .'</div>' : '';
685
+
686
+ echo '<div class="clear"></div>';
687
+ echo '</div>';
688
+
689
+ }
690
+
691
+ echo '</form>';
692
+
693
+ echo '</div>';
694
+
695
+ echo '<div class="clear"></div>';
696
+
697
+ echo ( ! empty( $this->args['footer_after'] ) ) ? $this->args['footer_after'] : '';
698
+
699
+ echo '</div>';
700
+
701
+ do_action( 'csf_options_after' );
702
+
703
+ }
704
+ }
705
+ }
admin/settings/classes/profile-options.class.php ADDED
@@ -0,0 +1,227 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Profile Options Class
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF_Profile_Options' ) ) {
11
+ class CSF_Profile_Options extends CSF_Abstract{
12
+
13
+ // constans
14
+ public $unique = '';
15
+ public $abstract = 'profile';
16
+ public $sections = array();
17
+ public $args = array(
18
+ 'data_type' => 'serialize',
19
+ 'defaults' => array(),
20
+ 'class' => '',
21
+ );
22
+
23
+ // run profile construct
24
+ public function __construct( $key, $params ) {
25
+
26
+ $this->unique = $key;
27
+ $this->args = apply_filters( "csf_{$this->unique}_args", wp_parse_args( $params['args'], $this->args ), $this );
28
+ $this->sections = apply_filters( "csf_{$this->unique}_sections", $params['sections'], $this );
29
+
30
+ add_action( 'admin_init', array( &$this, 'add_profile_options' ) );
31
+
32
+ }
33
+
34
+ // instance
35
+ public static function instance( $key, $params ) {
36
+ return new self( $key, $params );
37
+ }
38
+
39
+ // add profile add/edit fields
40
+ public function add_profile_options() {
41
+
42
+ add_action( 'show_user_profile', array( &$this, 'render_profile_form_fields' ) );
43
+ add_action( 'edit_user_profile', array( &$this, 'render_profile_form_fields' ) );
44
+
45
+ add_action( 'personal_options_update', array( &$this, 'save_profile' ) );
46
+ add_action( 'edit_user_profile_update', array( &$this, 'save_profile' ) );
47
+
48
+ }
49
+
50
+ // get default value
51
+ public function get_default( $field ) {
52
+
53
+ $default = ( isset( $field['id'] ) && isset( $this->args['defaults'][$field['id']] ) ) ? $this->args['defaults'][$field['id']] : null;
54
+ $default = ( isset( $field['default'] ) ) ? $field['default'] : $default;
55
+
56
+ return $default;
57
+
58
+ }
59
+
60
+ // get default value
61
+ public function get_meta_value( $user_id, $field ) {
62
+
63
+ $value = null;
64
+
65
+ if( ! empty( $user_id ) && ! empty( $field['id'] ) ) {
66
+
67
+ if( $this->args['data_type'] !== 'serialize' ) {
68
+ $meta = get_user_meta( $user_id, $field['id'] );
69
+ $value = ( isset( $meta[0] ) ) ? $meta[0] : null;
70
+ } else {
71
+ $meta = get_user_meta( $user_id, $this->unique, true );
72
+ $value = ( isset( $meta[$field['id']] ) ) ? $meta[$field['id']] : null;
73
+ }
74
+
75
+ }
76
+
77
+ $default = $this->get_default( $field );
78
+ $value = ( isset( $value ) ) ? $value : $default;
79
+
80
+ return $value;
81
+
82
+ }
83
+
84
+ // render profile add/edit form fields
85
+ public function render_profile_form_fields( $profileuser ) {
86
+
87
+ $is_profile = ( is_object( $profileuser ) && isset( $profileuser->ID ) ) ? true : false;
88
+ $profile_id = ( $is_profile ) ? $profileuser->ID : 0;
89
+ $errors = ( ! empty( $profile_id ) ) ? get_user_meta( $profile_id, '_csf_errors', true ) : array();
90
+ $errors = ( ! empty( $errors ) ) ? $errors : array();
91
+ $class = ( $this->args['class'] ) ? ' '. $this->args['class'] : '';
92
+
93
+ // clear errors
94
+ if( ! empty( $errors ) ) {
95
+ delete_user_meta( $profile_id, '_csf_errors' );
96
+ }
97
+
98
+ echo '<div class="csf csf-profile csf-onload'. $class .'">';
99
+
100
+ wp_nonce_field( 'csf_profile_nonce', 'csf_profile_nonce'. $this->unique );
101
+
102
+ foreach( $this->sections as $section ) {
103
+
104
+ $section_icon = ( ! empty( $section['icon'] ) ) ? '<i class="csf-icon '. $section['icon'] .'"></i>' : '';
105
+ $section_title = ( ! empty( $section['title'] ) ) ? $section['title'] : '';
106
+
107
+ echo ( $section_title || $section_icon ) ? '<h2>'. $section_icon . $section_title .'</h2>' : '';
108
+
109
+ if( ! empty( $section['fields'] ) ) {
110
+ foreach( $section['fields'] as $field ) {
111
+
112
+ if( ! empty( $field['id'] ) && ! empty( $errors[$field['id']] ) ) {
113
+ $field['_error'] = $errors[$field['id']];
114
+ }
115
+
116
+ CSF::field( $field, $this->get_meta_value( $profile_id, $field ), $this->unique, 'profile' );
117
+
118
+ }
119
+ }
120
+
121
+ }
122
+
123
+ echo '</div>';
124
+
125
+ }
126
+
127
+ // save profile form fields
128
+ public function save_profile( $user_id ) {
129
+
130
+ if ( wp_verify_nonce( csf_get_var( 'csf_profile_nonce'. $this->unique ), 'csf_profile_nonce' ) ) {
131
+
132
+ $errors = array();
133
+
134
+ foreach ( $this->sections as $section ) {
135
+
136
+ $request = csf_get_var( $this->unique, array() );
137
+
138
+ // ignore _nonce
139
+ if( isset( $request['_nonce'] ) ) {
140
+ unset( $request['_nonce'] );
141
+ }
142
+
143
+ // sanitize and validate
144
+ if( ! empty( $section['fields'] ) ) {
145
+
146
+ foreach( $section['fields'] as $field ) {
147
+
148
+ if( ! empty( $field['id'] ) ) {
149
+
150
+ // sanitize
151
+ if( ! empty( $field['sanitize'] ) ) {
152
+
153
+ $sanitize = $field['sanitize'];
154
+ $value_sanitize = csf_get_vars( $this->unique, $field['id'] );
155
+ $request[$field['id']] = call_user_func( $sanitize, $value_sanitize );
156
+
157
+ }
158
+
159
+ // validate
160
+ if( ! empty( $field['validate'] ) ) {
161
+
162
+ $validate = $field['validate'];
163
+ $value_validate = csf_get_vars( $this->unique, $field['id'] );
164
+ $has_validated = call_user_func( $validate, $value_validate );
165
+
166
+ if( ! empty( $has_validated ) ) {
167
+
168
+ $errors[$field['id']] = $has_validated;
169
+ $request[$field['id']] = $this->get_meta_value( $user_id, $field );
170
+
171
+ }
172
+
173
+ }
174
+
175
+ // auto sanitize
176
+ if( ! isset( $request[$field['id']] ) || is_null( $request[$field['id']] ) ) {
177
+ $request[$field['id']] = '';
178
+ }
179
+
180
+ }
181
+
182
+ }
183
+
184
+ }
185
+
186
+ $request = apply_filters( "csf_{$this->unique}_save", $request, $user_id, $this );
187
+
188
+ do_action( "csf_{$this->unique}_save_before", $request, $user_id, $this );
189
+
190
+ if( empty( $request ) ) {
191
+
192
+ if( $this->args['data_type'] !== 'serialize' ) {
193
+ foreach ( $request as $key => $value ) {
194
+ delete_user_meta( $user_id, $key );
195
+ }
196
+ } else {
197
+ delete_user_meta( $user_id, $this->unique );
198
+ }
199
+
200
+ } else {
201
+
202
+ if( $this->args['data_type'] !== 'serialize' ) {
203
+ foreach ( $request as $key => $value ) {
204
+ update_user_meta( $user_id, $key, $value );
205
+ }
206
+ } else {
207
+ update_user_meta( $user_id, $this->unique, $request );
208
+ }
209
+
210
+ if( ! empty( $errors ) ) {
211
+ update_user_meta( $user_id, '_csf_errors', $errors );
212
+ }
213
+
214
+ }
215
+
216
+ do_action( "csf_{$this->unique}_saved", $request, $user_id, $this );
217
+
218
+ do_action( "csf_{$this->unique}_save_after", $request, $user_id, $this );
219
+
220
+ }
221
+
222
+ }
223
+
224
+ }
225
+
226
+ }
227
+ }
admin/settings/classes/setup.class.php ADDED
@@ -0,0 +1,586 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Setup Class
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF' ) ) {
11
+ class CSF {
12
+
13
+ // constants
14
+ public static $version = '2.1.3';
15
+ public static $premium = true;
16
+ public static $dir = null;
17
+ public static $url = null;
18
+ public static $inited = array();
19
+ public static $fields = array();
20
+ public static $args = array(
21
+ 'options' => array(),
22
+ 'customize_options' => array(),
23
+ 'metaboxes' => array(),
24
+ 'profile_options' => array(),
25
+ 'shortcoders' => array(),
26
+ 'taxonomy_options' => array(),
27
+ 'widgets' => array(),
28
+ 'comment_metaboxes' => array(),
29
+ );
30
+
31
+ // shortcode instances
32
+ public static $shortcode_instances = array();
33
+
34
+ // init
35
+ public static function init() {
36
+
37
+ // init action
38
+ do_action( 'csf_init' );
39
+
40
+ // set constants
41
+ self::constants();
42
+
43
+ // include files
44
+ self::includes();
45
+
46
+ // setup textdomain
47
+ self::textdomain();
48
+
49
+ add_action( 'after_setup_theme', array( 'CSF', 'setup' ) );
50
+ add_action( 'init', array( 'CSF', 'setup' ) );
51
+ add_action( 'switch_theme', array( 'CSF', 'setup' ) );
52
+ add_action( 'admin_enqueue_scripts', array( 'CSF', 'add_admin_enqueue_scripts' ), 20 );
53
+ add_action( 'admin_head', array( 'CSF', 'add_admin_head_css' ), 99 );
54
+ add_action( 'customize_controls_print_styles', array( 'CSF', 'add_admin_head_css' ), 99 );
55
+
56
+ }
57
+
58
+ // setup
59
+ public static function setup() {
60
+
61
+ // welcome page
62
+ self::include_plugin_file( 'views/welcome.php' );
63
+
64
+ // setup options
65
+ $params = array();
66
+ if ( ! empty( self::$args['options'] ) ) {
67
+ foreach( self::$args['options'] as $key => $value ) {
68
+ if( ! empty( self::$args['sections'][$key] ) && ! isset( self::$inited[$key] ) ) {
69
+
70
+ $params['args'] = $value;
71
+ $params['sections'] = self::$args['sections'][$key];
72
+ self::$inited[$key] = true;
73
+
74
+ CSF_Options::instance( $key, $params );
75
+
76
+ if( ! empty( $value['show_in_customizer'] ) ) {
77
+ $value['output_css'] = false;
78
+ $value['enqueue_webfont'] = false;
79
+ self::$args['customize_options'][$key] = $value;
80
+ self::$inited[$key] = null;
81
+ }
82
+
83
+ }
84
+ }
85
+ }
86
+
87
+ // setup customize options
88
+ $params = array();
89
+ if ( ! empty( self::$args['customize_options'] ) ) {
90
+ foreach( self::$args['customize_options'] as $key => $value ) {
91
+ if( ! empty( self::$args['sections'][$key] ) && ! isset( self::$inited[$key] ) ) {
92
+
93
+ $params['args'] = $value;
94
+ $params['sections'] = self::$args['sections'][$key];
95
+ self::$inited[$key] = true;
96
+
97
+ CSF_Customize_Options::instance( $key, $params );
98
+
99
+
100
+ }
101
+ }
102
+ }
103
+
104
+ // setup metaboxes
105
+ $params = array();
106
+ if ( ! empty( self::$args['metaboxes'] ) ) {
107
+ foreach( self::$args['metaboxes'] as $key => $value ) {
108
+ if( ! empty( self::$args['sections'][$key] ) && ! isset( self::$inited[$key] ) ) {
109
+
110
+ $params['args'] = $value;
111
+ $params['sections'] = self::$args['sections'][$key];
112
+ self::$inited[$key] = true;
113
+
114
+ CSF_Metabox::instance( $key, $params );
115
+
116
+ }
117
+ }
118
+ }
119
+
120
+ // setup profile options
121
+ $params = array();
122
+ if ( ! empty( self::$args['profile_options'] ) ) {
123
+ foreach( self::$args['profile_options'] as $key => $value ) {
124
+ if( ! empty( self::$args['sections'][$key] ) && ! isset( self::$inited[$key] ) ) {
125
+
126
+ $params['args'] = $value;
127
+ $params['sections'] = self::$args['sections'][$key];
128
+ self::$inited[$key] = true;
129
+
130
+ CSF_Profile_Options::instance( $key, $params );
131
+
132
+ }
133
+ }
134
+ }
135
+
136
+ // setup shortcoders
137
+ $params = array();
138
+ if ( ! empty( self::$args['shortcoders'] ) ) {
139
+
140
+ foreach( self::$args['shortcoders'] as $key => $value ) {
141
+ if( ! empty( self::$args['sections'][$key] ) && ! isset( self::$inited[$key] ) ) {
142
+
143
+ $params['args'] = $value;
144
+ $params['sections'] = self::$args['sections'][$key];
145
+ self::$inited[$key] = true;
146
+
147
+ CSF_Shortcoder::instance( $key, $params );
148
+
149
+ }
150
+ }
151
+
152
+ // Once editor setup for gutenberg and media buttons
153
+ if( ! empty( CSF::$shortcode_instances ) ) {
154
+ CSF_Shortcoder::once_editor_setup();
155
+ }
156
+
157
+ }
158
+
159
+ // setup taxonomy options
160
+ $params = array();
161
+ if ( ! empty( self::$args['taxonomy_options'] ) ) {
162
+ foreach( self::$args['taxonomy_options'] as $key => $value ) {
163
+ if( ! empty( self::$args['sections'][$key] ) && ! isset( self::$inited[$key] ) ) {
164
+
165
+ $params['args'] = $value;
166
+ $params['sections'] = self::$args['sections'][$key];
167
+ self::$inited[$key] = true;
168
+
169
+ CSF_Taxonomy_Options::instance( $key, $params );
170
+
171
+ }
172
+ }
173
+ }
174
+
175
+ // create widgets
176
+ if ( ! empty( self::$args['widgets'] ) && class_exists( 'WP_Widget_Factory' ) ) {
177
+
178
+ $wp_widget_factory = new WP_Widget_Factory();
179
+
180
+ foreach( self::$args['widgets'] as $key => $value ) {
181
+ if( ! isset( self::$inited[$key] ) ) {
182
+ self::$inited[$key] = true;
183
+ $wp_widget_factory->register( CSF_Widget::instance( $key, $value ) );
184
+ }
185
+ }
186
+
187
+ }
188
+
189
+ // setup comment metabox
190
+ $params = array();
191
+ if ( ! empty( self::$args['comment_metaboxes'] ) ) {
192
+ foreach( self::$args['comment_metaboxes'] as $key => $value ) {
193
+ if( ! empty( self::$args['sections'][$key] ) && ! isset( self::$inited[$key] ) ) {
194
+
195
+ $params['args'] = $value;
196
+ $params['sections'] = self::$args['sections'][$key];
197
+ self::$inited[$key] = true;
198
+
199
+ CSF_Comment_Metabox::instance( $key, $params );
200
+
201
+ }
202
+ }
203
+ }
204
+
205
+ do_action( 'csf_loaded' );
206
+
207
+ }
208
+
209
+ // create options
210
+ public static function createOptions( $id, $args = array() ) {
211
+ self::$args['options'][$id] = $args;
212
+ }
213
+
214
+ // create customize options
215
+ public static function createCustomizeOptions( $id, $args = array() ) {
216
+ self::$args['customize_options'][$id] = $args;
217
+ }
218
+
219
+ // create metabox options
220
+ public static function createMetabox( $id, $args = array() ) {
221
+ self::$args['metaboxes'][$id] = $args;
222
+ }
223
+
224
+ // create shortcoder options
225
+ public static function createShortcoder( $id, $args = array() ) {
226
+ self::$args['shortcoders'][$id] = $args;
227
+ }
228
+
229
+ // create taxonomy options
230
+ public static function createTaxonomyOptions( $id, $args = array() ) {
231
+ self::$args['taxonomy_options'][$id] = $args;
232
+ }
233
+
234
+ // create profile options
235
+ public static function createProfileOptions( $id, $args = array() ) {
236
+ self::$args['profile_options'][$id] = $args;
237
+ }
238
+
239
+ // create widget
240
+ public static function createWidget( $id, $args = array() ) {
241
+ self::$args['widgets'][$id] = $args;
242
+ self::set_used_fields( $args );
243
+ }
244
+
245
+ // create comment metabox
246
+ public static function createCommentMetabox( $id, $args = array() ) {
247
+ self::$args['comment_metaboxes'][$id] = $args;
248
+ }
249
+
250
+ // create section
251
+ public static function createSection( $id, $sections ) {
252
+ self::$args['sections'][$id][] = $sections;
253
+ self::set_used_fields( $sections );
254
+ }
255
+
256
+ // constants
257
+ public static function constants() {
258
+
259
+ // we need this path-finder code for set URL of framework
260
+ $dirname = wp_normalize_path( dirname( dirname( __FILE__ ) ) );
261
+ $theme_dir = wp_normalize_path( get_parent_theme_file_path() );
262
+ $plugin_dir = wp_normalize_path( WP_PLUGIN_DIR );
263
+ $located_plugin = ( preg_match( '#'. self::sanitize_dirname( $plugin_dir ) .'#', self::sanitize_dirname( $dirname ) ) ) ? true : false;
264
+ $directory = ( $located_plugin ) ? $plugin_dir : $theme_dir;
265
+ $directory_uri = ( $located_plugin ) ? WP_PLUGIN_URL : get_parent_theme_file_uri();
266
+ $foldername = str_replace( $directory, '', $dirname );
267
+ $protocol_uri = ( is_ssl() ) ? 'https' : 'http';
268
+ $directory_uri = set_url_scheme( $directory_uri, $protocol_uri );
269
+
270
+ self::$dir = $dirname;
271
+ self::$url = $directory_uri . $foldername;
272
+
273
+ }
274
+
275
+ public static function include_plugin_file( $file, $load = true ) {
276
+
277
+ $path = '';
278
+ $file = ltrim( $file, '/' );
279
+ $override = apply_filters( 'csf_override', 'csf-override' );
280
+
281
+ if( file_exists( get_parent_theme_file_path( $override .'/'. $file ) ) ) {
282
+ $path = get_parent_theme_file_path( $override .'/'. $file );
283
+ } elseif ( file_exists( get_theme_file_path( $override .'/'. $file ) ) ) {
284
+ $path = get_theme_file_path( $override .'/'. $file );
285
+ } elseif ( file_exists( self::$dir .'/'. $override .'/'. $file ) ) {
286
+ $path = self::$dir .'/'. $override .'/'. $file;
287
+ } elseif ( file_exists( self::$dir .'/'. $file ) ) {
288
+ $path = self::$dir .'/'. $file;
289
+ }
290
+
291
+ if( ! empty( $path ) && ! empty( $file ) && $load ) {
292
+
293
+ global $wp_query;
294
+
295
+ if( is_object( $wp_query ) && function_exists( 'load_template' ) ) {
296
+
297
+ load_template( $path, true );
298
+
299
+ } else {
300
+
301
+ require_once( $path );
302
+
303
+ }
304
+
305
+ } else {
306
+
307
+ return self::$dir .'/'. $file;
308
+
309
+ }
310
+
311
+ }
312
+
313
+ public static function is_active_plugin( $file = '' ) {
314
+ return in_array( $file, (array) get_option( 'active_plugins', array() ) );
315
+ }
316
+
317
+ // Sanitize dirname
318
+ public static function sanitize_dirname( $dirname ) {
319
+ return preg_replace( '/[^A-Za-z]/', '', $dirname );
320
+ }
321
+
322
+ // Set plugin url
323
+ public static function include_plugin_url( $file ) {
324
+ return self::$url .'/'. ltrim( $file, '/' );
325
+ }
326
+
327
+ // General includes
328
+ public static function includes() {
329
+
330
+ // includes helpers
331
+ self::include_plugin_file( 'functions/actions.php' );
332
+ self::include_plugin_file( 'functions/deprecated.php' );
333
+ self::include_plugin_file( 'functions/helpers.php' );
334
+ self::include_plugin_file( 'functions/sanitize.php' );
335
+ self::include_plugin_file( 'functions/validate.php' );
336
+
337
+ // includes free version classes
338
+ self::include_plugin_file( 'classes/abstract.class.php' );
339
+ self::include_plugin_file( 'classes/fields.class.php' );
340
+ self::include_plugin_file( 'classes/options.class.php' );
341
+
342
+ // includes premium version classes
343
+ if( self::$premium ) {
344
+ self::include_plugin_file( 'classes/customize-options.class.php' );
345
+ self::include_plugin_file( 'classes/metabox.class.php' );
346
+ self::include_plugin_file( 'classes/profile-options.class.php' );
347
+ self::include_plugin_file( 'classes/shortcoder.class.php' );
348
+ self::include_plugin_file( 'classes/taxonomy-options.class.php' );
349
+ self::include_plugin_file( 'classes/widgets.class.php' );
350
+ self::include_plugin_file( 'classes/comment-metabox.class.php' );
351
+ }
352
+
353
+ }
354
+
355
+ // Include field
356
+ public static function maybe_include_field( $type = '' ) {
357
+ if( ! class_exists( 'CSF_Field_'. $type ) && class_exists( 'CSF_Fields' ) ) {
358
+ self::include_plugin_file( 'fields/'. $type .'/'. $type .'.php' );
359
+ }
360
+ }
361
+
362
+ // Load textdomain
363
+ public static function textdomain() {
364
+ load_textdomain( 'csf', self::$dir .'/languages/'. get_locale() .'.mo' );
365
+ }
366
+
367
+ // Get all of fields
368
+ public static function set_used_fields( $sections ) {
369
+
370
+ if( ! empty( $sections['fields'] ) ) {
371
+
372
+ foreach( $sections['fields'] as $field ) {
373
+
374
+ if( ! empty( $field['fields'] ) ) {
375
+ self::set_used_fields( $field );
376
+ }
377
+
378
+ if( ! empty( $field['tabs'] ) ) {
379
+ self::set_used_fields( array( 'fields' => $field['tabs'] ) );
380
+ }
381
+
382
+ if( ! empty( $field['accordions'] ) ) {
383
+ self::set_used_fields( array( 'fields' => $field['accordions'] ) );
384
+ }
385
+
386
+ if( ! empty( $field['type'] ) ) {
387
+ self::$fields[$field['type']] = $field;
388
+ }
389
+
390
+ }
391
+
392
+ }
393
+
394
+ }
395
+
396
+ //
397
+ // Enqueue admin and fields styles and scripts.
398
+ public static function add_admin_enqueue_scripts() {
399
+
400
+ // check for developer mode
401
+ $min = ( apply_filters( 'csf_dev_mode', false ) || WP_DEBUG ) ? '' : '.min';
402
+
403
+ // admin utilities
404
+ wp_enqueue_media();
405
+
406
+ // wp color picker
407
+ wp_enqueue_style( 'wp-color-picker' );
408
+ wp_enqueue_script( 'wp-color-picker' );
409
+
410
+ // cdn styles
411
+ wp_enqueue_style( 'csf-fa', 'https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css', array(), '4.7.1', 'all' );
412
+
413
+ // framework core styles
414
+ wp_enqueue_style( 'csf', CSF::include_plugin_url( 'assets/css/csf'. $min .'.css' ), array(), '1.0.0', 'all' );
415
+
416
+ // rtl styles
417
+ if( is_rtl() ) {
418
+ wp_enqueue_style( 'csf-rtl', CSF::include_plugin_url( 'assets/css/csf-rtl'. $min .'.css' ), array(), '1.0.0', 'all' );
419
+ }
420
+
421
+ // framework core scripts
422
+ wp_enqueue_script( 'csf-plugins', CSF::include_plugin_url( 'assets/js/csf-plugins'. $min .'.js' ), array(), '1.0.0', true );
423
+ wp_enqueue_script( 'csf', CSF::include_plugin_url( 'assets/js/csf'. $min .'.js' ), array( 'csf-plugins' ), '1.0.0', true );
424
+
425
+ wp_localize_script( 'csf', 'csf_vars', array(
426
+ 'color_palette' => apply_filters( 'csf_color_palette', array() ),
427
+ 'i18n' => array(
428
+ // global localize
429
+ 'confirm' => esc_html__( 'Are you sure?', 'csf' ),
430
+ 'reset_notification' => esc_html__( 'Restoring options.', 'csf' ),
431
+ 'import_notification' => esc_html__( 'Importing options.', 'csf' ),
432
+
433
+ // chosen localize
434
+ 'typing_text' => esc_html__( 'Please enter %s or more characters', 'csf' ),
435
+ 'searching_text' => esc_html__( 'Searching...', 'csf' ),
436
+ 'no_results_text' => esc_html__( 'No results match', 'csf' ),
437
+ ),
438
+ ) );
439
+
440
+ // load admin enqueue scripts and styles
441
+ $enqueued = array();
442
+
443
+ if( ! empty( self::$fields ) ) {
444
+ foreach( self::$fields as $field ) {
445
+ if( ! empty( $field['type'] ) ) {
446
+ $classname = 'CSF_Field_' . $field['type'];
447
+ self::maybe_include_field( $field['type'] );
448
+ if( class_exists( $classname ) && method_exists( $classname, 'enqueue' ) ) {
449
+ $instance = new $classname( $field );
450
+ if( method_exists( $classname, 'enqueue' ) ) {
451
+ $instance->enqueue();
452
+ }
453
+ unset( $instance );
454
+ }
455
+ }
456
+ }
457
+ }
458
+
459
+ do_action( 'csf_enqueue' );
460
+
461
+ }
462
+
463
+ //
464
+ // WP 5.2 fallback
465
+ //
466
+ // This function has been created as temporary.
467
+ // It will be remove after stable version of wp 5.3.
468
+ //
469
+ public static function add_admin_head_css() {
470
+
471
+ global $wp_version;
472
+
473
+ $current_branch = implode( '.', array_slice( preg_split( '/[.-]/', $wp_version ), 0, 2 ) );
474
+
475
+ if( version_compare( $current_branch, '5.3', '<' ) ) {
476
+
477
+ echo '<style type="text/css">
478
+ .csf-field-slider .csf--unit,
479
+ .csf-field-border .csf--label,
480
+ .csf-field-spacing .csf--label,
481
+ .csf-field-dimensions .csf--label,
482
+ .csf-field-spinner .ui-button-text-only{
483
+ border-color: #ddd;
484
+ }
485
+ .csf-warning-primary{
486
+ box-shadow: 0 1px 0 #bd2130 !important;
487
+ }
488
+ .csf-warning-primary:focus{
489
+ box-shadow: none !important;
490
+ }
491
+ </style>';
492
+
493
+ }
494
+
495
+ }
496
+
497
+ //
498
+ // Add a new framework field
499
+ public static function field( $field = array(), $value = '', $unique = '', $where = '', $parent = '' ) {
500
+
501
+ // Check for unallow fields
502
+ if( ! empty( $field['_notice'] ) ) {
503
+
504
+ $field_type = $field['type'];
505
+
506
+ $field = array();
507
+ $field['content'] = sprintf( esc_html__( 'Ooops! This field type (%s) can not be used here, yet.', 'csf' ), '<strong>'. $field_type .'</strong>' );
508
+ $field['type'] = 'notice';
509
+ $field['style'] = 'danger';
510
+
511
+ }
512
+
513
+ $depend = '';
514
+ $hidden = '';
515
+ $unique = ( ! empty( $unique ) ) ? $unique : '';
516
+ $class = ( ! empty( $field['class'] ) ) ? ' ' . $field['class'] : '';
517
+ $is_pseudo = ( ! empty( $field['pseudo'] ) ) ? ' csf-pseudo-field' : '';
518
+ $field_type = ( ! empty( $field['type'] ) ) ? $field['type'] : '';
519
+
520
+ if ( ! empty( $field['dependency'] ) ) {
521
+
522
+ $dependency = $field['dependency'];
523
+ $hidden = ' hidden';
524
+ $data_controller = '';
525
+ $data_condition = '';
526
+ $data_value = '';
527
+ $data_global = '';
528
+
529
+ if( is_array( $dependency[0] ) ) {
530
+ $data_controller = implode( '|', array_column( $dependency, 0 ) );
531
+ $data_condition = implode( '|', array_column( $dependency, 1 ) );
532
+ $data_value = implode( '|', array_column( $dependency, 2 ) );
533
+ $data_global = implode( '|', array_column( $dependency, 3 ) );
534
+ } else {
535
+ $data_controller = ( ! empty( $dependency[0] ) ) ? $dependency[0] : '';
536
+ $data_condition = ( ! empty( $dependency[1] ) ) ? $dependency[1] : '';
537
+ $data_value = ( ! empty( $dependency[2] ) ) ? $dependency[2] : '';
538
+ $data_global = ( ! empty( $dependency[3] ) ) ? $dependency[3] : '';
539
+ }
540
+
541
+ $depend .= ' data-controller="'. $data_controller .'"';
542
+ $depend .= ' data-condition="'. $data_condition .'"';
543
+ $depend .= ' data-value="'. $data_value .'"';
544
+ $depend .= ( ! empty( $data_global ) ) ? ' data-depend-global="true"' : '';
545
+
546
+ }
547
+
548
+ if( ! empty( $field_type ) ) {
549
+
550
+ echo '<div class="csf-field csf-field-'. $field_type . $is_pseudo . $class . $hidden .'"'. $depend .'>';
551
+
552
+ if( ! empty( $field['title'] ) ) {
553
+ $subtitle = ( ! empty( $field['subtitle'] ) ) ? '<p class="csf-text-subtitle">'. $field['subtitle'] .'</p>' : '';
554
+ echo '<div class="csf-title"><h4>' . $field['title'] . '</h4>'. $subtitle .'</div>';
555
+ }
556
+
557
+ echo ( ! empty( $field['title'] ) ) ? '<div class="csf-fieldset">' : '';
558
+
559
+ $value = ( ! isset( $value ) && isset( $field['default'] ) ) ? $field['default'] : $value;
560
+ $value = ( isset( $field['value'] ) ) ? $field['value'] : $value;
561
+
562
+ self::maybe_include_field( $field_type );
563
+
564
+ $classname = 'CSF_Field_'. $field_type;
565
+
566
+ if( class_exists( $classname ) ) {
567
+ $instance = new $classname( $field, $value, $unique, $where, $parent );
568
+ $instance->render();
569
+ } else {
570
+ echo '<p>'. esc_html__( 'This field class is not available!', 'csf' ) .'</p>';
571
+ }
572
+
573
+ } else {
574
+ echo '<p>'. esc_html__( 'This type is not found!', 'csf' ) .'</p>';
575
+ }
576
+
577
+ echo ( ! empty( $field['title'] ) ) ? '</div>' : '';
578
+ echo '<div class="clear"></div>';
579
+ echo '</div>';
580
+
581
+ }
582
+
583
+ }
584
+
585
+ CSF::init();
586
+ }
admin/settings/classes/shortcoder.class.php ADDED
@@ -0,0 +1,326 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Shortcoder Class
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF_Shortcoder' ) ) {
11
+ class CSF_Shortcoder extends CSF_Abstract{
12
+
13
+ // constans
14
+ public $unique = '';
15
+ public $abstract = 'shortcoder';
16
+ public $blocks = array();
17
+ public $sections = array();
18
+ public $pre_tabs = array();
19
+ public $pre_sections = array();
20
+ public $args = array(
21
+ 'button_title' => 'Add Shortcode',
22
+ 'select_title' => 'Select a shortcode',
23
+ 'insert_title' => 'Insert Shortcode',
24
+ 'show_in_editor' => true,
25
+ 'defaults' => array(),
26
+ 'class' => '',
27
+ 'gutenberg' => array(
28
+ 'title' => 'CSF Shortcodes',
29
+ 'description' => 'CSF Shortcode Block',
30
+ 'icon' => 'screenoptions',
31
+ 'category' => 'widgets',
32
+ 'keywords' => array( 'shortcode', 'csf', 'insert' ),
33
+ 'placeholder' => 'Write shortcode here...',
34
+ ),
35
+ );
36
+
37
+ // run shortcode construct
38
+ public function __construct( $key, $params = array() ) {
39
+
40
+ $this->unique = $key;
41
+ $this->args = apply_filters( "csf_{$this->unique}_args", wp_parse_args( $params['args'], $this->args ), $this );
42
+ $this->sections = apply_filters( "csf_{$this->unique}_sections", $params['sections'], $this );
43
+ $this->pre_tabs = $this->pre_tabs( $this->sections );
44
+ $this->pre_sections = $this->pre_sections( $this->sections );
45
+
46
+ add_action( 'admin_footer', array( &$this, 'add_shortcode_modal' ) );
47
+ add_action( 'customize_controls_print_footer_scripts', array( &$this, 'add_shortcode_modal' ) );
48
+ add_action( 'wp_ajax_csf-get-shortcode-'. $this->unique, array( &$this, 'get_shortcode' ) );
49
+
50
+ if( ! empty( $this->args['show_in_editor'] ) ) {
51
+
52
+ CSF::$shortcode_instances[] = wp_parse_args( array( 'hash' => md5( $key ), 'modal_id' => $this->unique ), $this->args );
53
+
54
+ // elementor editor support
55
+ if( CSF::is_active_plugin( 'elementor/elementor.php' ) ) {
56
+ add_action( 'elementor/editor/before_enqueue_scripts', array( 'CSF', 'add_admin_enqueue_scripts' ), 20 );
57
+ add_action( 'elementor/editor/footer', array( &$this, 'add_shortcode_modal' ) );
58
+ add_action( 'elementor/editor/footer', 'csf_set_icons' );
59
+ }
60
+
61
+ }
62
+
63
+ }
64
+
65
+ // instance
66
+ public static function instance( $key, $params = array() ) {
67
+ return new self( $key, $params );
68
+ }
69
+
70
+ public function pre_tabs( $sections ) {
71
+
72
+ $result = array();
73
+ $parents = array();
74
+ $count = 100;
75
+
76
+ foreach( $sections as $key => $section ) {
77
+ if( ! empty( $section['parent'] ) ) {
78
+ $section['priority'] = ( isset( $section['priority'] ) ) ? $section['priority'] : $count;
79
+ $parents[$section['parent']][] = $section;
80
+ unset( $sections[$key] );
81
+ }
82
+ $count++;
83
+ }
84
+
85
+ foreach( $sections as $key => $section ) {
86
+ $section['priority'] = ( isset( $section['priority'] ) ) ? $section['priority'] : $count;
87
+ if( ! empty( $section['id'] ) && ! empty( $parents[$section['id']] ) ) {
88
+ $section['subs'] = wp_list_sort( $parents[$section['id']], array( 'priority' => 'ASC' ), 'ASC', true );
89
+ }
90
+ $result[] = $section;
91
+ $count++;
92
+ }
93
+
94
+ return wp_list_sort( $result, array( 'priority' => 'ASC' ), 'ASC', true );
95
+ }
96
+
97
+ public function pre_sections( $sections ) {
98
+
99
+ $result = array();
100
+
101
+ foreach( $this->pre_tabs as $tab ) {
102
+ if( ! empty( $tab['subs'] ) ) {
103
+ foreach( $tab['subs'] as $sub ) {
104
+ $result[] = $sub;
105
+ }
106
+ }
107
+ if( empty( $tab['subs'] ) ) {
108
+ $result[] = $tab;
109
+ }
110
+ }
111
+
112
+ return $result;
113
+ }
114
+
115
+ // get default value
116
+ public function get_default( $field ) {
117
+
118
+ $default = ( isset( $field['id'] ) && isset( $this->args['defaults'][$field['id']] ) ) ? $this->args['defaults'][$field['id']] : null;
119
+ $default = ( isset( $field['default'] ) ) ? $field['default'] : $default;
120
+
121
+ return $default;
122
+
123
+ }
124
+
125
+ public function add_shortcode_modal() {
126
+
127
+ $class = ( $this->args['class'] ) ? ' '. $this->args['class'] : '';
128
+ $has_select = ( count( $this->pre_tabs ) > 1 ) ? true : false;
129
+ $single_usage = ( ! $has_select ) ? ' csf-shortcode-single' : '';
130
+ $hide_header = ( ! $has_select ) ? ' hidden' : '';
131
+
132
+ ?>
133
+ <div id="csf-modal-<?php echo $this->unique; ?>" class="wp-core-ui csf-modal csf-shortcode<?php echo $single_usage . $class; ?>" data-modal-id="<?php echo $this->unique; ?>" data-nonce="<?php echo wp_create_nonce( 'csf_shortcode_nonce' ); ?>">
134
+ <div class="csf-modal-table">
135
+ <div class="csf-modal-table-cell">
136
+ <div class="csf-modal-overlay"></div>
137
+ <div class="csf-modal-inner">
138
+ <div class="csf-modal-title">
139
+ <?php echo $this->args['button_title']; ?>
140
+ <div class="csf-modal-close"></div>
141
+ </div>
142
+ <?php
143
+
144
+ echo '<div class="csf-modal-header'. $hide_header .'">';
145
+ echo '<select>';
146
+ echo ( $has_select ) ? '<option value="">'. $this->args['select_title'] .'</option>' : '';
147
+
148
+ $tab_key = 1;
149
+ foreach ( $this->pre_tabs as $tab ) {
150
+
151
+ if( ! empty( $tab['subs'] ) ) {
152
+
153
+ echo '<optgroup label="'. $tab['title'] .'">';
154
+
155
+ foreach ( $tab['subs'] as $sub ) {
156
+
157
+ $view = ( ! empty( $sub['view'] ) ) ? ' data-view="'. $sub['view'] .'"' : '';
158
+ $shortcode = ( ! empty( $sub['shortcode'] ) ) ? ' data-shortcode="'. $sub['shortcode'] .'"' : '';
159
+ $group = ( ! empty( $sub['group_shortcode'] ) ) ? ' data-group="'. $sub['group_shortcode'] .'"' : '';
160
+
161
+ echo '<option value="'. $tab_key .'"'. $view . $shortcode . $group .'>'. $sub['title'] .'</option>';
162
+
163
+ $tab_key++;
164
+ }
165
+
166
+ echo '</optgroup>' ;
167
+
168
+ } else {
169
+
170
+ $view = ( ! empty( $tab['view'] ) ) ? ' data-view="'. $tab['view'] .'"' : '';
171
+ $shortcode = ( ! empty( $tab['shortcode'] ) ) ? ' data-shortcode="'. $tab['shortcode'] .'"' : '';
172
+ $group = ( ! empty( $tab['group_shortcode'] ) ) ? ' data-group="'. $tab['group_shortcode'] .'"' : '';
173
+
174
+ echo '<option value="'. $tab_key .'"'. $view . $shortcode . $group .'>'. $tab['title'] .'</option>';
175
+
176
+ $tab_key++;
177
+ }
178
+
179
+ }
180
+
181
+ echo '</select>';
182
+ echo '</div>';
183
+
184
+ ?>
185
+ <div class="csf-modal-content">
186
+ <div class="csf-modal-loading"><div class="csf-loading"></div></div>
187
+ <div class="csf-modal-load"></div>
188
+ </div>
189
+ <div class="csf-modal-insert-wrapper hidden"><a href="#" class="button button-primary csf-modal-insert"><?php echo $this->args['insert_title']; ?></a></div>
190
+ </div>
191
+ </div>
192
+ </div>
193
+ </div>
194
+ <?php
195
+ }
196
+
197
+ public function get_shortcode() {
198
+
199
+ ob_start();
200
+
201
+ $shortcode_key = csf_get_var( 'shortcode_key' );
202
+
203
+ if( ! empty( $shortcode_key ) && wp_verify_nonce( csf_get_var( 'nonce' ), 'csf_shortcode_nonce' ) ) {
204
+
205
+ $unallows = array( 'group', 'repeater', 'sorter' );
206
+ $section = $this->pre_sections[$shortcode_key-1];
207
+ $shortcode = ( ! empty( $section['shortcode'] ) ) ? $section['shortcode'] : '';
208
+ $view = ( ! empty( $section['view'] ) ) ? $section['view'] : 'normal';
209
+
210
+ if( ! empty( $section ) ) {
211
+
212
+ //
213
+ // View: normal
214
+ if( ! empty( $section['fields'] ) && $view !== 'repeater' ) {
215
+
216
+ echo '<div class="csf-fields">';
217
+
218
+ foreach ( $section['fields'] as $field ) {
219
+
220
+ if( in_array( $field['type'], $unallows ) ) { $field['_notice'] = true; }
221
+
222
+ // Extra tag improves for spesific fields (border, spacing, dimensions etc...)
223
+ $field['tag_prefix'] = ( ! empty( $field['tag_prefix'] ) ) ? $field['tag_prefix'] .'_' : '';
224
+
225
+ $field_default = $this->get_default( $field );
226
+
227
+ CSF::field( $field, $field_default, $shortcode, 'shortcode' );
228
+
229
+ }
230
+
231
+ echo '</div>';
232
+
233
+ }
234
+
235
+ //
236
+ // View: group and repeater fields
237
+ $repeatable_fields = ( $view === 'repeater' && ! empty( $section['fields'] ) ) ? $section['fields'] : array();
238
+ $repeatable_fields = ( $view === 'group' && ! empty( $section['group_fields'] ) ) ? $section['group_fields'] : $repeatable_fields;
239
+
240
+ if( ! empty( $repeatable_fields ) ) {
241
+
242
+ $button_title = ( ! empty( $section['button_title'] ) ) ? ' '. $section['button_title'] : esc_html__( 'Add one more', 'csf' );
243
+ $inner_shortcode = ( ! empty( $section['group_shortcode'] ) ) ? $section['group_shortcode'] : $shortcode;
244
+
245
+ echo '<div class="csf--repeatable">';
246
+
247
+ echo '<div class="csf--repeat-shortcode">';
248
+
249
+ echo '<div class="csf-repeat-remove fa fa-times"></div>';
250
+
251
+ echo '<div class="csf-fields">';
252
+
253
+ foreach ( $repeatable_fields as $field ) {
254
+
255
+ if( in_array( $field['type'], $unallows ) ) { $field['_notice'] = true; }
256
+
257
+ // Extra tag improves for spesific fields (border, spacing, dimensions etc...)
258
+ $field['tag_prefix'] = ( ! empty( $field['tag_prefix'] ) ) ? $field['tag_prefix'] .'_' : '';
259
+
260
+ $field_default = $this->get_default( $field );
261
+
262
+ CSF::field( $field, $field_default, $inner_shortcode.'[0]', 'shortcode' );
263
+
264
+ }
265
+
266
+ echo '</div>';
267
+
268
+ echo '</div>';
269
+
270
+ echo '</div>';
271
+
272
+ echo '<div class="csf--repeat-button-block"><a class="button csf--repeat-button" href="#"><i class="fa fa-plus-circle"></i> '. $button_title .'</a></div>';
273
+
274
+ }
275
+
276
+ }
277
+
278
+ } else {
279
+ echo '<div class="csf-field csf-text-error">'. esc_html__( 'Error: Nonce verification has failed. Please try again.', 'csf' ) .'</div>';
280
+ }
281
+
282
+ wp_send_json_success( array( 'content' => ob_get_clean() ) );
283
+
284
+ }
285
+
286
+ // Once editor setup for gutenberg and media buttons
287
+ public static function once_editor_setup() {
288
+
289
+ if ( function_exists( 'register_block_type' ) ) {
290
+ add_action( 'init', array( 'CSF_Shortcoder', 'add_guteberg_block' ) );
291
+ }
292
+
293
+ if ( csf_wp_editor_api() ) {
294
+ add_action( 'media_buttons', array( 'CSF_Shortcoder', 'add_media_buttons' ) );
295
+ }
296
+
297
+ }
298
+
299
+ // Add gutenberg blocks.
300
+ public static function add_guteberg_block() {
301
+
302
+ wp_register_script( 'csf-gutenberg-block', CSF::include_plugin_url( 'assets/js/csf-gutenberg-block.js' ), array( 'wp-blocks', 'wp-editor', 'wp-element', 'wp-components' ) );
303
+
304
+ wp_localize_script( 'csf-gutenberg-block', 'csf_gutenberg_blocks', CSF::$shortcode_instances );
305
+
306
+ foreach( CSF::$shortcode_instances as $hash => $value ) {
307
+
308
+ register_block_type( 'csf-gutenberg-block/block-'. $hash, array(
309
+ 'editor_script' => 'csf-gutenberg-block',
310
+ ) );
311
+
312
+ }
313
+
314
+ }
315
+
316
+ // Add media buttons
317
+ public static function add_media_buttons( $editor_id ) {
318
+
319
+ foreach( CSF::$shortcode_instances as $hash => $value ) {
320
+ echo '<a href="#" class="button button-primary csf-shortcode-button" data-editor-id="'. $editor_id .'" data-modal-id="'. $value['modal_id'] .'">'. $value['button_title'] .'</a>';
321
+ }
322
+
323
+ }
324
+
325
+ }
326
+ }
admin/settings/classes/taxonomy-options.class.php ADDED
@@ -0,0 +1,244 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Taxonomy Options Class
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF_Taxonomy_Options' ) ) {
11
+ class CSF_Taxonomy_Options extends CSF_Abstract{
12
+
13
+ // constans
14
+ public $unique = '';
15
+ public $taxonomy = '';
16
+ public $abstract = 'taxonomy';
17
+ public $sections = array();
18
+ public $taxonomies = array();
19
+ public $args = array(
20
+ 'taxonomy' => '',
21
+ 'data_type' => 'serialize',
22
+ 'defaults' => array(),
23
+ 'class' => '',
24
+ );
25
+
26
+ // run taxonomy construct
27
+ public function __construct( $key, $params ) {
28
+
29
+ $this->unique = $key;
30
+ $this->args = apply_filters( "csf_{$this->unique}_args", wp_parse_args( $params['args'], $this->args ), $this );
31
+ $this->sections = apply_filters( "csf_{$this->unique}_sections", $params['sections'], $this );
32
+ $this->taxonomies = ( is_array( $this->args['taxonomy'] ) ) ? $this->args['taxonomy'] : array_filter( (array) $this->args['taxonomy'] );
33
+ $this->taxonomy = csf_get_var( 'taxonomy' );
34
+
35
+ if( ! empty( $this->taxonomies ) && in_array( $this->taxonomy, $this->taxonomies ) ) {
36
+ add_action( 'admin_init', array( &$this, 'add_taxonomy_options' ) );
37
+ }
38
+
39
+ }
40
+
41
+ // instance
42
+ public static function instance( $key, $params ) {
43
+ return new self( $key, $params );
44
+ }
45
+
46
+ // add taxonomy add/edit fields
47
+ public function add_taxonomy_options() {
48
+
49
+ add_action( $this->taxonomy .'_add_form_fields', array( &$this, 'render_taxonomy_form_fields' ) );
50
+ add_action( $this->taxonomy .'_edit_form', array( &$this, 'render_taxonomy_form_fields' ) );
51
+
52
+ add_action( 'created_'. $this->taxonomy, array( &$this, 'save_taxonomy' ) );
53
+ add_action( 'edited_'. $this->taxonomy, array( &$this, 'save_taxonomy' ) );
54
+
55
+ }
56
+
57
+ // get default value
58
+ public function get_default( $field ) {
59
+
60
+ $default = ( isset( $field['id'] ) && isset( $this->args['defaults'][$field['id']] ) ) ? $this->args['defaults'][$field['id']] : null;
61
+ $default = ( isset( $field['default'] ) ) ? $field['default'] : $default;
62
+
63
+ return $default;
64
+
65
+ }
66
+
67
+ // get default value
68
+ public function get_meta_value( $term_id, $field ) {
69
+
70
+ $value = null;
71
+
72
+ if( ! empty( $term_id ) && ! empty( $field['id'] ) ) {
73
+
74
+ if( $this->args['data_type'] !== 'serialize' ) {
75
+ $meta = get_term_meta( $term_id, $field['id'] );
76
+ $value = ( isset( $meta[0] ) ) ? $meta[0] : null;
77
+ } else {
78
+ $meta = get_term_meta( $term_id, $this->unique, true );
79
+ $value = ( isset( $meta[$field['id']] ) ) ? $meta[$field['id']] : null;
80
+ }
81
+
82
+ }
83
+
84
+ $default = $this->get_default( $field );
85
+ $value = ( isset( $value ) ) ? $value : $default;
86
+
87
+ return $value;
88
+
89
+ }
90
+
91
+ // render taxonomy add/edit form fields
92
+ public function render_taxonomy_form_fields( $term ) {
93
+
94
+ $is_term = ( is_object( $term ) && isset( $term->taxonomy ) ) ? true : false;
95
+ $term_id = ( $is_term ) ? $term->term_id : 0;
96
+ $taxonomy = ( $is_term ) ? $term->taxonomy : $term;
97
+ $classname = ( $is_term ) ? 'edit' : 'add';
98
+ $errors = ( ! empty( $term_id ) ) ? get_term_meta( $term_id, '_csf_errors', true ) : array();
99
+ $errors = ( ! empty( $errors ) ) ? $errors : array();
100
+ $class = ( $this->args['class'] ) ? ' '. $this->args['class'] : '';
101
+
102
+ // clear errors
103
+ if( ! empty( $errors ) ) {
104
+ delete_term_meta( $term_id, '_csf_errors' );
105
+ }
106
+
107
+ wp_nonce_field( 'csf_taxonomy_nonce', 'csf_taxonomy_nonce'. $this->unique );
108
+
109
+ echo '<div class="csf csf-taxonomy csf-show-all csf-onload csf-taxonomy-'. $classname .'-fields'. $class .'">';
110
+
111
+ foreach( $this->sections as $section ) {
112
+
113
+ if( $taxonomy === $this->taxonomy ) {
114
+
115
+ $section_icon = ( ! empty( $section['icon'] ) ) ? '<i class="csf-icon '. $section['icon'] .'"></i>' : '';
116
+ $section_title = ( ! empty( $section['title'] ) ) ? $section['title'] : '';
117
+
118
+ echo ( $section_title || $section_icon ) ? '<div class="csf-section-title"><h3>'. $section_icon . $section_title .'</h3></div>' : '';
119
+
120
+ if( ! empty( $section['fields'] ) ) {
121
+ foreach( $section['fields'] as $field ) {
122
+
123
+ if( ! empty( $field['id'] ) && ! empty( $errors[$field['id']] ) ) {
124
+ $field['_error'] = $errors[$field['id']];
125
+ }
126
+
127
+ CSF::field( $field, $this->get_meta_value( $term_id, $field ), $this->unique, 'taxonomy' );
128
+
129
+ }
130
+ }
131
+ }
132
+
133
+ }
134
+
135
+ echo '</div>';
136
+
137
+ }
138
+
139
+ // save taxonomy form fields
140
+ public function save_taxonomy( $term_id ) {
141
+
142
+ if ( wp_verify_nonce( csf_get_var( 'csf_taxonomy_nonce'. $this->unique ), 'csf_taxonomy_nonce' ) ) {
143
+
144
+ $errors = array();
145
+ $taxonomy = csf_get_var( 'taxonomy' );
146
+
147
+ foreach ( $this->sections as $section ) {
148
+
149
+ if( $taxonomy == $this->taxonomy ) {
150
+
151
+ $request = csf_get_var( $this->unique, array() );
152
+
153
+ // ignore _nonce
154
+ if( isset( $request['_nonce'] ) ) {
155
+ unset( $request['_nonce'] );
156
+ }
157
+
158
+ // sanitize and validate
159
+ if( ! empty( $section['fields'] ) ) {
160
+
161
+ foreach( $section['fields'] as $field ) {
162
+
163
+ if( ! empty( $field['id'] ) ) {
164
+
165
+ // sanitize
166
+ if( ! empty( $field['sanitize'] ) ) {
167
+
168
+ $sanitize = $field['sanitize'];
169
+ $value_sanitize = csf_get_vars( $this->unique, $field['id'] );
170
+ $request[$field['id']] = call_user_func( $sanitize, $value_sanitize );
171
+
172
+ }
173
+
174
+ // validate
175
+ if( ! empty( $field['validate'] ) ) {
176
+
177
+ $validate = $field['validate'];
178
+ $value_validate = csf_get_vars( $this->unique, $field['id'] );
179
+ $has_validated = call_user_func( $validate, $value_validate );
180
+
181
+ if( ! empty( $has_validated ) ) {
182
+
183
+ $errors[$field['id']] = $has_validated;
184
+ $request[$field['id']] = $this->get_meta_value( $term_id, $field );
185
+
186
+ }
187
+
188
+ }
189
+
190
+ // auto sanitize
191
+ if( ! isset( $request[$field['id']] ) || is_null( $request[$field['id']] ) ) {
192
+ $request[$field['id']] = '';
193
+ }
194
+
195
+ }
196
+
197
+ }
198
+
199
+ }
200
+
201
+ $request = apply_filters( "csf_{$this->unique}_save", $request, $term_id, $this );
202
+
203
+ do_action( "csf_{$this->unique}_save_before", $request, $term_id, $this );
204
+
205
+ if( empty( $request ) ) {
206
+
207
+ if( $this->args['data_type'] !== 'serialize' ) {
208
+ foreach ( $request as $key => $value ) {
209
+ delete_term_meta( $term_id, $key );
210
+ }
211
+ } else {
212
+ delete_term_meta( $term_id, $this->unique );
213
+ }
214
+
215
+ } else {
216
+
217
+ if( $this->args['data_type'] !== 'serialize' ) {
218
+ foreach ( $request as $key => $value ) {
219
+ update_term_meta( $term_id, $key, $value );
220
+ }
221
+ } else {
222
+ update_term_meta( $term_id, $this->unique, $request );
223
+ }
224
+
225
+ if( ! empty( $errors ) ) {
226
+ update_term_meta( $term_id, '_csf_errors', $errors );
227
+ }
228
+
229
+ }
230
+
231
+ do_action( "csf_{$this->unique}_saved", $request, $term_id, $this );
232
+
233
+ do_action( "csf_{$this->unique}_save_after", $request, $term_id, $this );
234
+
235
+ }
236
+
237
+ }
238
+
239
+ }
240
+
241
+ }
242
+
243
+ }
244
+ }
admin/settings/classes/widgets.class.php ADDED
@@ -0,0 +1,129 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Widgets Class
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF_Widget' ) ) {
11
+ class CSF_Widget extends WP_Widget {
12
+
13
+ // constans
14
+ public $unique = '';
15
+ public $args = array(
16
+ 'title' => '',
17
+ 'classname' => '',
18
+ 'description' => '',
19
+ 'width' => '',
20
+ 'defaults' => array(),
21
+ 'fields' => array(),
22
+ 'class' => '',
23
+ );
24
+
25
+ public function __construct( $key, $params ) {
26
+
27
+ $widget_ops = array();
28
+ $control_ops = array();
29
+
30
+ $this->unique = $key;
31
+ $this->args = apply_filters( "csf_{$this->unique}_args", wp_parse_args( $params, $this->args ), $this );
32
+
33
+ // Set control options
34
+ if( ! empty( $this->args['width'] ) ) {
35
+ $control_ops['width'] = $this->args['width'];
36
+ }
37
+
38
+ // Set widget options
39
+ if( ! empty( $this->args['description'] ) ) {
40
+ $widget_ops['description'] = $this->args['description'];
41
+ }
42
+
43
+ if( ! empty( $this->args['classname'] ) ) {
44
+ $widget_ops['classname'] = $this->args['classname'];
45
+ }
46
+
47
+ // Set filters
48
+ $widget_ops = apply_filters( "csf_{$this->unique}_widget_ops", $widget_ops, $this );
49
+ $control_ops = apply_filters( "csf_{$this->unique}_control_ops", $control_ops, $this );
50
+
51
+ parent::__construct( $this->unique, $this->args['title'], $widget_ops, $control_ops );
52
+
53
+ }
54
+
55
+ // Register widget with WordPress
56
+ public static function instance( $key, $params = array() ) {
57
+ return new self( $key, $params );
58
+ }
59
+
60
+ // Front-end display of widget.
61
+ public function widget( $args, $instance ) {
62
+ call_user_func( $this->unique, $args, $instance );
63
+ }
64
+
65
+ // get default value
66
+ public function get_default( $field, $options = array() ) {
67
+
68
+ $default = ( isset( $this->args['defaults'][$field['id']] ) ) ? $this->args['defaults'][$field['id']] : null;
69
+ $default = ( isset( $field['default'] ) ) ? $field['default'] : $default;
70
+ $default = ( isset( $options[$field['id']] ) ) ? $options[$field['id']] : $default;
71
+
72
+ return $default;
73
+
74
+ }
75
+
76
+ // Back-end widget form.
77
+ public function form( $instance ) {
78
+
79
+ if( ! empty( $this->args['fields'] ) ) {
80
+
81
+ $class = ( $this->args['class'] ) ? ' '. $this->args['class'] : '';
82
+
83
+ echo '<div class="csf csf-widgets csf-fields'. $class .'">';
84
+
85
+ foreach( $this->args['fields'] as $field ) {
86
+
87
+ $field_value = '';
88
+ $field_unique = '';
89
+
90
+ if( ! empty( $field['id'] ) ) {
91
+
92
+ $field_value = $this->get_default( $field, $instance );
93
+ $field_unique = 'widget-' . $this->unique . '[' . $this->number . ']';
94
+
95
+ if( $field['id'] === 'title' ) {
96
+ $field['attributes']['id'] = 'widget-'. $this->unique .'-'. $this->number .'-title';
97
+ }
98
+
99
+ }
100
+
101
+ CSF::field( $field, $field_value, $field_unique );
102
+
103
+ }
104
+
105
+ echo '</div>';
106
+
107
+ }
108
+
109
+ }
110
+
111
+ // Sanitize widget form values as they are saved.
112
+ public function update( $new_instance, $old_instance ) {
113
+
114
+ // auto sanitize
115
+ foreach( $this->args['fields'] as $field ) {
116
+ if( ! empty( $field['id'] ) && ( ! isset( $new_instance[$field['id']] ) || is_null( $new_instance[$field['id']] ) ) ) {
117
+ $new_instance[$field['id']] = '';
118
+ }
119
+ }
120
+
121
+ $new_instance = apply_filters( "csf_{$this->unique}_save", $new_instance, $this->args, $this );
122
+
123
+ do_action( "csf_{$this->unique}_save_before", $new_instance, $this->args, $this );
124
+
125
+ return $new_instance;
126
+
127
+ }
128
+ }
129
+ }
admin/settings/fields/accordion/accordion.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Field: accordion
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF_Field_accordion' ) ) {
11
+ class CSF_Field_accordion extends CSF_Fields {
12
+
13
+ public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
14
+ parent::__construct( $field, $value, $unique, $where, $parent );
15
+ }
16
+
17
+ public function render() {
18
+
19
+ $unallows = array( 'accordion' );
20
+
21
+ echo $this->field_before();
22
+
23
+ echo '<div class="csf-accordion-items">';
24
+
25
+ foreach ( $this->field['accordions'] as $key => $accordion ) {
26
+
27
+ echo '<div class="csf-accordion-item">';
28
+
29
+ $icon = ( ! empty( $accordion['icon'] ) ) ? 'csf--icon '. $accordion['icon'] : 'csf-accordion-icon fa fa-angle-right';
30
+
31
+ echo '<h4 class="csf-accordion-title">';
32
+ echo '<i class="'. $icon .'"></i>';
33
+ echo $accordion['title'];
34
+ echo '</h4>';
35
+
36
+ echo '<div class="csf-accordion-content">';
37
+
38
+ foreach ( $accordion['fields'] as $field ) {
39
+
40
+ if( in_array( $field['type'], $unallows ) ) { $field['_notice'] = true; }
41
+
42
+ $field_id = ( isset( $field['id'] ) ) ? $field['id'] : '';
43
+ $field_default = ( isset( $field['default'] ) ) ? $field['default'] : '';
44
+ $field_value = ( isset( $this->value[$field_id] ) ) ? $this->value[$field_id] : $field_default;
45
+ $unique_id = ( ! empty( $this->unique ) ) ? $this->unique .'['. $this->field['id'] .']' : $this->field['id'];
46
+
47
+ CSF::field( $field, $field_value, $unique_id, 'field/accordion' );
48
+
49
+ }
50
+
51
+ echo '</div>';
52
+
53
+ echo '</div>';
54
+
55
+ }
56
+
57
+ echo '</div>';
58
+
59
+ echo $this->field_after();
60
+
61
+ }
62
+
63
+ }
64
+ }
admin/settings/fields/background/background.php ADDED
@@ -0,0 +1,332 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Field: background
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF_Field_background' ) ) {
11
+ class CSF_Field_background extends CSF_Fields {
12
+
13
+ public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
14
+ parent::__construct( $field, $value, $unique, $where, $parent );
15
+ }
16
+
17
+ public function render() {
18
+
19
+ $args = wp_parse_args( $this->field, array(
20
+ 'background_color' => true,
21
+ 'background_image' => true,
22
+ 'background_position' => true,
23
+ 'background_repeat' => true,
24
+ 'background_attachment' => true,
25
+ 'background_size' => true,
26
+ 'background_origin' => false,
27
+ 'background_clip' => false,
28
+ 'background_blend_mode' => false,
29
+ 'background_gradient' => false,
30
+ 'background_gradient_color' => true,
31
+ 'background_gradient_direction' => true,
32
+ 'background_image_preview' => true,
33
+ 'background_auto_attributes' => false,
34
+ 'background_image_library' => 'image',
35
+ 'background_image_placeholder' => esc_html__( 'No background selected', 'csf' ),
36
+ ) );
37
+
38
+ $default_value = array(
39
+ 'background-color' => '',
40
+ 'background-image' => '',
41
+ 'background-position' => '',
42
+ 'background-repeat' => '',
43
+ 'background-attachment' => '',
44
+ 'background-size' => '',
45
+ 'background-origin' => '',
46
+ 'background-clip' => '',
47
+ 'background-blend-mode' => '',
48
+ 'background-gradient-color' => '',
49
+ 'background-gradient-direction' => '',
50
+ );
51
+
52
+ $default_value = ( ! empty( $this->field['default'] ) ) ? wp_parse_args( $this->field['default'], $default_value ) : $default_value;
53
+
54
+ $this->value = wp_parse_args( $this->value, $default_value );
55
+
56
+ echo $this->field_before();
57
+
58
+ echo '<div class="csf--background-colors">';
59
+
60
+ //
61
+ // Background Color
62
+ if( ! empty( $args['background_color'] ) ) {
63
+
64
+ echo '<div class="csf--color">';
65
+
66
+ echo ( ! empty( $args['background_gradient'] ) ) ? '<div class="csf--title">'. esc_html__( 'From', 'csf' ) .'</div>' : '';
67
+
68
+ CSF::field( array(
69
+ 'id' => 'background-color',
70
+ 'type' => 'color',
71
+ 'default' => $default_value['background-color'],
72
+ ), $this->value['background-color'], $this->field_name(), 'field/background' );
73
+
74
+ echo '</div>';
75
+
76
+ }
77
+
78
+ //
79
+ // Background Gradient Color
80
+ if( ! empty( $args['background_gradient_color'] ) && ! empty( $args['background_gradient'] ) ) {
81
+
82
+ echo '<div class="csf--color">';
83
+
84
+ echo ( ! empty( $args['background_gradient'] ) ) ? '<div class="csf--title">'. esc_html__( 'To', 'csf' ) .'</div>' : '';
85
+
86
+ CSF::field( array(
87
+ 'id' => 'background-gradient-color',
88
+ 'type' => 'color',
89
+ 'default' => $default_value['background-gradient-color'],
90
+ ), $this->value['background-gradient-color'], $this->field_name(), 'field/background' );
91
+
92
+ echo '</div>';
93
+
94
+ }
95
+
96
+ //
97
+ // Background Gradient Direction
98
+ if( ! empty( $args['background_gradient_direction'] ) && ! empty( $args['background_gradient'] ) ) {
99
+
100
+ echo '<div class="csf--color">';
101
+
102
+ echo ( ! empty( $args['background_gradient'] ) ) ? '<div class="csf---title">'. esc_html__( 'Direction', 'csf' ) .'</div>' : '';
103
+
104
+ CSF::field( array(
105
+ 'id' => 'background-gradient-direction',
106
+ 'type' => 'select',
107
+ 'options' => array(
108
+ '' => esc_html__( 'Gradient Direction', 'csf' ),
109
+ 'to bottom' => esc_html__( '&#8659; top to bottom', 'csf' ),
110
+ 'to right' => esc_html__( '&#8658; left to right', 'csf' ),
111
+ '135deg' => esc_html__( '&#8664; corner top to right', 'csf' ),
112
+ '-135deg' => esc_html__( '&#8665; corner top to left', 'csf' ),
113
+ ),
114
+ ), $this->value['background-gradient-direction'], $this->field_name(), 'field/background' );
115
+
116
+ echo '</div>';
117
+
118
+ }
119
+
120
+ echo '</div>';
121
+
122
+ //
123
+ // Background Image
124
+ if( ! empty( $args['background_image'] ) ) {
125
+
126
+ echo '<div class="csf--background-image">';
127
+
128
+ CSF::field( array(
129
+ 'id' => 'background-image',
130
+ 'type' => 'media',
131
+ 'class' => 'csf-assign-field-background',
132
+ 'library' => $args['background_image_library'],
133
+ 'preview' => $args['background_image_preview'],
134
+ 'placeholder' => $args['background_image_placeholder'],
135
+ 'attributes' => array( 'data-depend-id' => $this->field['id'] ),
136
+ ), $this->value['background-image'], $this->field_name(), 'field/background' );
137
+
138
+ echo '</div>';
139
+
140
+ }
141
+
142
+ $auto_class = ( ! empty( $args['background_auto_attributes'] ) ) ? ' csf--auto-attributes' : '';
143
+ $hidden_class = ( ! empty( $args['background_auto_attributes'] ) && empty( $this->value['background-image']['url'] ) ) ? ' csf--attributes-hidden' : '';
144
+
145
+ echo '<div class="csf--background-attributes'. $auto_class . $hidden_class .'">';
146
+
147
+ //
148
+ // Background Position
149
+ if( ! empty( $args['background_position'] ) ) {
150
+
151
+ CSF::field( array(
152
+ 'id' => 'background-position',
153
+ 'type' => 'select',
154
+ 'options' => array(
155
+ '' => esc_html__( 'Background Position', 'csf' ),
156
+ 'left top' => esc_html__( 'Left Top', 'csf' ),
157
+ 'left center' => esc_html__( 'Left Center', 'csf' ),
158
+ 'left bottom' => esc_html__( 'Left Bottom', 'csf' ),
159
+ 'center top' => esc_html__( 'Center Top', 'csf' ),
160
+ 'center center' => esc_html__( 'Center Center', 'csf' ),
161
+ 'center bottom' => esc_html__( 'Center Bottom', 'csf' ),
162
+ 'right top' => esc_html__( 'Right Top', 'csf' ),
163
+ 'right center' => esc_html__( 'Right Center', 'csf' ),
164
+ 'right bottom' => esc_html__( 'Right Bottom', 'csf' ),
165
+ ),
166
+ ), $this->value['background-position'], $this->field_name(), 'field/background' );
167
+
168
+ }
169
+
170
+ //
171
+ // Background Repeat
172
+ if( ! empty( $args['background_repeat'] ) ) {
173
+
174
+ CSF::field( array(
175
+ 'id' => 'background-repeat',
176
+ 'type' => 'select',
177
+ 'options' => array(
178
+ '' => esc_html__( 'Background Repeat', 'csf' ),
179
+ 'repeat' => esc_html__( 'Repeat', 'csf' ),
180
+ 'no-repeat' => esc_html__( 'No Repeat', 'csf' ),
181
+ 'repeat-x' => esc_html__( 'Repeat Horizontally', 'csf' ),
182
+ 'repeat-y' => esc_html__( 'Repeat Vertically', 'csf' ),
183
+ ),
184
+ ), $this->value['background-repeat'], $this->field_name(), 'field/background' );
185
+
186
+ }
187
+
188
+ //
189
+ // Background Attachment
190
+ if( ! empty( $args['background_attachment'] ) ) {
191
+
192
+ CSF::field( array(
193
+ 'id' => 'background-attachment',
194
+ 'type' => 'select',
195
+ 'options' => array(
196
+ '' => esc_html__( 'Background Attachment', 'csf' ),
197
+ 'scroll' => esc_html__( 'Scroll', 'csf' ),
198
+ 'fixed' => esc_html__( 'Fixed', 'csf' ),
199
+ ),
200
+ ), $this->value['background-attachment'], $this->field_name(), 'field/background' );
201
+
202
+ }
203
+
204
+ //
205
+ // Background Size
206
+ if( ! empty( $args['background_size'] ) ) {
207
+
208
+ CSF::field( array(
209
+ 'id' => 'background-size',
210
+ 'type' => 'select',
211
+ 'options' => array(
212
+ '' => esc_html__( 'Background Size', 'csf' ),
213
+ 'cover' => esc_html__( 'Cover', 'csf' ),
214
+ 'contain' => esc_html__( 'Contain', 'csf' ),
215
+ ),
216
+ ), $this->value['background-size'], $this->field_name(), 'field/background' );
217
+
218
+ }
219
+
220
+ //
221
+ // Background Origin
222
+ if( ! empty( $args['background_origin'] ) ) {
223
+
224
+ CSF::field( array(
225
+ 'id' => 'background-origin',
226
+ 'type' => 'select',
227
+ 'options' => array(
228
+ '' => esc_html__( 'Background Origin', 'csf' ),
229
+ 'padding-box' => esc_html__( 'Padding Box', 'csf' ),
230
+ 'border-box' => esc_html__( 'Border Box', 'csf' ),
231
+ 'content-box' => esc_html__( 'Content Box', 'csf' ),
232
+ ),
233
+ ), $this->value['background-origin'], $this->field_name(), 'field/background' );
234
+
235
+ }
236
+
237
+ //
238
+ // Background Clip
239
+ if( ! empty( $args['background_clip'] ) ) {
240
+
241
+ CSF::field( array(
242
+ 'id' => 'background-clip',
243
+ 'type' => 'select',
244
+ 'options' => array(
245
+ '' => esc_html__( 'Background Clip', 'csf' ),
246
+ 'border-box' => esc_html__( 'Border Box', 'csf' ),
247
+ 'padding-box' => esc_html__( 'Padding Box', 'csf' ),
248
+ 'content-box' => esc_html__( 'Content Box', 'csf' ),
249
+ ),
250
+ ), $this->value['background-clip'], $this->field_name(), 'field/background' );
251
+
252
+ }
253
+
254
+ //
255
+ // Background Blend Mode
256
+ if( ! empty( $args['background_blend_mode'] ) ) {
257
+
258
+ CSF::field( array(
259
+ 'id' => 'background-blend-mode',
260
+ 'type' => 'select',
261
+ 'options' => array(
262
+ '' => esc_html__( 'Background Blend Mode', 'csf' ),
263
+ 'normal' => esc_html__( 'Normal', 'csf' ),
264
+ 'multiply' => esc_html__( 'Multiply', 'csf' ),
265
+ 'screen' => esc_html__( 'Screen', 'csf' ),
266
+ 'overlay' => esc_html__( 'Overlay', 'csf' ),
267
+ 'darken' => esc_html__( 'Darken', 'csf' ),
268
+ 'lighten' => esc_html__( 'Lighten', 'csf' ),
269
+ 'color-dodge' => esc_html__( 'Color Dodge', 'csf' ),
270
+ 'saturation' => esc_html__( 'Saturation', 'csf' ),
271
+ 'color' => esc_html__( 'Color', 'csf' ),
272
+ 'luminosity' => esc_html__( 'Luminosity', 'csf' ),
273
+ ),
274
+ ), $this->value['background-blend-mode'], $this->field_name(), 'field/background' );
275
+
276
+ }
277
+
278
+ echo '</div>';
279
+
280
+ echo $this->field_after();
281
+
282
+ }
283
+
284
+ public function output() {
285
+
286
+ $output = '';
287
+ $bg_image = array();
288
+ $important = ( ! empty( $this->field['output_important'] ) ) ? '!important' : '';
289
+ $element = ( is_array( $this->field['output'] ) ) ? join( ',', $this->field['output'] ) : $this->field['output'];
290
+
291
+ // Background image and gradient
292
+ $background_color = ( ! empty( $this->value['background-color'] ) ) ? $this->value['background-color'] : '';
293
+ $background_gd_color = ( ! empty( $this->value['background-gradient-color'] ) ) ? $this->value['background-gradient-color'] : '';
294
+ $background_gd_direction = ( ! empty( $this->value['background-gradient-direction'] ) ) ? $this->value['background-gradient-direction'] : '';
295
+ $background_image = ( ! empty( $this->value['background-image']['url'] ) ) ? $this->value['background-image']['url'] : '';
296
+
297
+
298
+ if( $background_color && $background_gd_color ) {
299
+ $gd_direction = ( $background_gd_direction ) ? $background_gd_direction .',' : '';
300
+ $bg_image[] = 'linear-gradient('. $gd_direction . $background_color .','. $background_gd_color .')';
301
+ }
302
+
303
+ if( $background_image ) {
304
+ $bg_image[] = 'url('. $background_image .')';
305
+ }
306
+
307
+ if( ! empty( $bg_image ) ) {
308
+ $output .= 'background-image:'. implode( ',', $bg_image ) . $important .';';
309
+ }
310
+
311
+ // Common background properties
312
+ $properties = array( 'color', 'position', 'repeat', 'attachment', 'size', 'origin', 'clip', 'blend-mode' );
313
+
314
+ foreach( $properties as $property ) {
315
+ $property = 'background-'. $property;
316
+ if( ! empty( $this->value[$property] ) ) {
317
+ $output .= $property .':'. $this->value[$property] . $important .';';
318
+ }
319
+ }
320
+
321
+ if( $output ) {
322
+ $output = $element .'{'. $output .'}';
323
+ }
324
+
325
+ $this->parent->output_css .= $output;
326
+
327
+ return $output;
328
+
329
+ }
330
+
331
+ }
332
+ }
admin/settings/fields/backup/backup.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Field: backup
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF_Field_backup' ) ) {
11
+ class CSF_Field_backup extends CSF_Fields {
12
+
13
+ public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
14
+ parent::__construct( $field, $value, $unique, $where, $parent );
15
+ }
16
+
17
+ public function render() {
18
+
19
+ $unique = $this->unique;
20
+ $nonce = wp_create_nonce( 'csf_backup_nonce' );
21
+ $export = add_query_arg( array( 'action' => 'csf-export', 'export' => $unique, 'nonce' => $nonce ), admin_url( 'admin-ajax.php' ) );
22
+
23
+ echo $this->field_before();
24
+
25
+ echo '<textarea name="csf_transient[csf_import_data]" class="csf-import-data"></textarea>';
26
+ echo '<button type="submit" class="button button-primary csf-confirm csf-import" data-unique="'. $unique .'" data-nonce="'. $nonce .'">'. esc_html__( 'Import', 'csf' ) .'</button>';
27
+ echo '<small>( '. esc_html__( 'copy-paste your backup string here', 'csf' ).' )</small>';
28
+
29
+ echo '<hr />';
30
+ echo '<textarea readonly="readonly" class="csf-export-data">'. json_encode( get_option( $unique ) ) .'</textarea>';
31
+ echo '<a href="'. esc_url( $export ) .'" class="button button-primary csf-export" target="_blank">'. esc_html__( 'Export and Download Backup', 'csf' ) .'</a>';
32
+
33
+ echo '<hr />';
34
+ echo '<button type="submit" name="csf_transient[csf_reset_all]" value="csf_reset_all" class="button csf-warning-primary csf-confirm csf-reset" data-unique="'. $unique .'" data-nonce="'. $nonce .'">'. esc_html__( 'Reset All', 'csf' ) .'</button>';
35
+ echo '<small class="csf-text-error">'. esc_html__( 'Please be sure for reset all of options.', 'csf' ) .'</small>';
36
+
37
+ echo $this->field_after();
38
+
39
+ }
40
+
41
+ }
42
+ }
admin/settings/fields/border/border.php ADDED
@@ -0,0 +1,178 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Field: border
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF_Field_border' ) ) {
11
+ class CSF_Field_border extends CSF_Fields {
12
+
13
+ public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
14
+ parent::__construct( $field, $value, $unique, $where, $parent );
15
+ }
16
+
17
+ public function render() {
18
+
19
+ $args = wp_parse_args( $this->field, array(
20
+ 'top_icon' => '<i class="fa fa-long-arrow-up"></i>',
21
+ 'left_icon' => '<i class="fa fa-long-arrow-left"></i>',
22
+ 'bottom_icon' => '<i class="fa fa-long-arrow-down"></i>',
23
+ 'right_icon' => '<i class="fa fa-long-arrow-right"></i>',
24
+ 'all_icon' => '<i class="fa fa-arrows"></i>',
25
+ 'top_placeholder' => esc_html__( 'top', 'csf' ),
26
+ 'right_placeholder' => esc_html__( 'right', 'csf' ),
27
+ 'bottom_placeholder' => esc_html__( 'bottom', 'csf' ),
28
+ 'left_placeholder' => esc_html__( 'left', 'csf' ),
29
+ 'all_placeholder' => esc_html__( 'all', 'csf' ),
30
+ 'top' => true,
31
+ 'left' => true,
32
+ 'bottom' => true,
33
+ 'right' => true,
34
+ 'all' => false,
35
+ 'color' => true,
36
+ 'style' => true,
37
+ 'unit' => 'px',
38
+ ) );
39
+
40
+ $default_value = array(
41
+ 'top' => '',
42
+ 'right' => '',
43
+ 'bottom' => '',
44
+ 'left' => '',
45
+ 'color' => '',
46
+ 'style' => 'solid',
47
+ 'all' => '',
48
+ );
49
+
50
+ $border_props = array(
51
+ 'solid' => esc_html__( 'Solid', 'csf' ),
52
+ 'dashed' => esc_html__( 'Dashed', 'csf' ),
53
+ 'dotted' => esc_html__( 'Dotted', 'csf' ),
54
+ 'double' => esc_html__( 'Double', 'csf' ),
55
+ 'inset' => esc_html__( 'Inset', 'csf' ),
56
+ 'outset' => esc_html__( 'Outset', 'csf' ),
57
+ 'groove' => esc_html__( 'Groove', 'csf' ),
58
+ 'ridge' => esc_html__( 'ridge', 'csf' ),
59
+ 'none' => esc_html__( 'None', 'csf' )
60
+ );
61
+
62
+ $default_value = ( ! empty( $this->field['default'] ) ) ? wp_parse_args( $this->field['default'], $default_value ) : $default_value;
63
+
64
+ $value = wp_parse_args( $this->value, $default_value );
65
+
66
+ echo $this->field_before();
67
+
68
+ echo '<div class="csf--inputs">';
69
+
70
+ if( ! empty( $args['all'] ) ) {
71
+
72
+ $placeholder = ( ! empty( $args['all_placeholder'] ) ) ? ' placeholder="'. $args['all_placeholder'] .'"' : '';
73
+
74
+ echo '<div class="csf--input">';
75
+ echo ( ! empty( $args['all_icon'] ) ) ? '<span class="csf--label csf--icon">'. $args['all_icon'] .'</span>' : '';
76
+ echo '<input type="number" name="'. $this->field_name('[all]') .'" value="'. $value['all'] .'"'. $placeholder .' class="csf-input-number csf--is-unit" />';
77
+ echo ( ! empty( $args['unit'] ) ) ? '<span class="csf--label csf--unit">'. $args['unit'] .'</span>' : '';
78
+ echo '</div>';
79
+
80
+ } else {
81
+
82
+ $properties = array();
83
+
84
+ foreach ( array( 'top', 'right', 'bottom', 'left' ) as $prop ) {
85
+ if( ! empty( $args[$prop] ) ) {
86
+ $properties[] = $prop;
87
+ }
88
+ }
89
+
90
+ $properties = ( $properties === array( 'right', 'left' ) ) ? array_reverse( $properties ) : $properties;
91
+
92
+ foreach( $properties as $property ) {
93
+
94
+ $placeholder = ( ! empty( $args[$property.'_placeholder'] ) ) ? ' placeholder="'. $args[$property.'_placeholder'] .'"' : '';
95
+
96
+ echo '<div class="csf--input">';
97
+ echo ( ! empty( $args[$property.'_icon'] ) ) ? '<span class="csf--label csf--icon">'. $args[$property.'_icon'] .'</span>' : '';
98
+ echo '<input type="number" name="'. $this->field_name('['. $property .']') .'" value="'. $value[$property] .'"'. $placeholder .' class="csf-input-number csf--is-unit" />';
99
+ echo ( ! empty( $args['unit'] ) ) ? '<span class="csf--label csf--unit">'. $args['unit'] .'</span>' : '';
100
+ echo '</div>';
101
+
102
+ }
103
+
104
+ }
105
+
106
+ if( ! empty( $args['style'] ) ) {
107
+ echo '<div class="csf--input">';
108
+ echo '<select name="'. $this->field_name('[style]') .'">';
109
+ foreach( $border_props as $border_prop_key => $border_prop_value ) {
110
+ $selected = ( $value['style'] === $border_prop_key ) ? ' selected' : '';
111
+ echo '<option value="'. $border_prop_key .'"'. $selected .'>'. $border_prop_value .'</option>';
112
+ }
113
+ echo '</select>';
114
+ echo '</div>';
115
+ }
116
+
117
+ echo '</div>';
118
+
119
+ if( ! empty( $args['color'] ) ) {
120
+ $default_color_attr = ( ! empty( $default_value['color'] ) ) ? ' data-default-color="'. $default_value['color'] .'"' : '';
121
+ echo '<div class="csf--color">';
122
+ echo '<div class="csf-field-color">';
123
+ echo '<input type="text" name="'. $this->field_name('[color]') .'" value="'. $value['color'] .'" class="csf-color"'. $default_color_attr .' />';
124
+ echo '</div>';
125
+ echo '</div>';
126
+ }
127
+
128
+ echo '<div class="clear"></div>';
129
+
130
+ echo $this->field_after();
131
+
132
+ }
133
+
134
+ public function output() {
135
+
136
+ $output = '';
137
+ $unit = ( ! empty( $this->value['unit'] ) ) ? $this->value['unit'] : 'px';
138
+ $important = ( ! empty( $this->field['output_important'] ) ) ? '!important' : '';
139
+ $element = ( is_array( $this->field['output'] ) ) ? join( ',', $this->field['output'] ) : $this->field['output'];
140
+
141
+ // properties
142
+ $top = ( isset( $this->value['top'] ) && $this->value['top'] !== '' ) ? $this->value['top'] : '';
143
+ $right = ( isset( $this->value['right'] ) && $this->value['right'] !== '' ) ? $this->value['right'] : '';
144
+ $bottom = ( isset( $this->value['bottom'] ) && $this->value['bottom'] !== '' ) ? $this->value['bottom'] : '';
145
+ $left = ( isset( $this->value['left'] ) && $this->value['left'] !== '' ) ? $this->value['left'] : '';
146
+ $style = ( isset( $this->value['style'] ) && $this->value['style'] !== '' ) ? $this->value['style'] : '';
147
+ $color = ( isset( $this->value['color'] ) && $this->value['color'] !== '' ) ? $this->value['color'] : '';
148
+ $all = ( isset( $this->value['all'] ) && $this->value['all'] !== '' ) ? $this->value['all'] : '';
149
+
150
+ if( ! empty( $this->field['all'] ) && ( $all !== '' || $color !== '' ) ) {
151
+
152
+ $output = $element .'{';
153
+ $output .= ( $all !== '' ) ? 'border-width:'. $all . $unit . $important .';' : '';
154
+ $output .= ( $color !== '' ) ? 'border-color:'. $color . $important .';' : '';
155
+ $output .= ( $style !== '' ) ? 'border-style:'. $style . $important .';' : '';
156
+ $output .= '}';
157
+
158
+ } else if( $top !== '' || $right !== '' || $bottom !== '' || $left !== '' || $color !== '' ) {
159
+
160
+ $output = $element .'{';
161
+ $output .= ( $top !== '' ) ? 'border-top-width:'. $top . $unit . $important .';' : '';
162
+ $output .= ( $right !== '' ) ? 'border-right-width:'. $right . $unit . $important .';' : '';
163
+ $output .= ( $bottom !== '' ) ? 'border-bottom-width:'. $bottom . $unit . $important .';' : '';
164
+ $output .= ( $left !== '' ) ? 'border-left-width:'. $left . $unit . $important .';' : '';
165
+ $output .= ( $color !== '' ) ? 'border-color:'. $color . $important .';' : '';
166
+ $output .= ( $style !== '' ) ? 'border-style:'. $style . $important .';' : '';
167
+ $output .= '}';
168
+
169
+ }
170
+
171
+ $this->parent->output_css .= $output;
172
+
173
+ return $output;
174
+
175
+ }
176
+
177
+ }
178
+ }
admin/settings/fields/button_set/button_set.php ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Field: button_set
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF_Field_button_set' ) ) {
11
+ class CSF_Field_button_set extends CSF_Fields {
12
+
13
+ public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
14
+ parent::__construct( $field, $value, $unique, $where, $parent );
15
+ }
16
+
17
+ public function render() {
18
+
19
+ $args = wp_parse_args( $this->field, array(
20
+ 'multiple' => false,
21
+ 'options' => array(),
22
+ ) );
23
+
24
+ $value = ( is_array( $this->value ) ) ? $this->value : array_filter( (array) $this->value );
25
+
26
+ echo $this->field_before();
27
+
28
+ if( ! empty( $args['options'] ) ) {
29
+
30
+ echo '<div class="csf-siblings csf--button-group" data-multiple="'. $args['multiple'] .'">';
31
+
32
+ foreach( $args['options'] as $key => $option ) {
33
+
34
+ $type = ( $args['multiple'] ) ? 'checkbox' : 'radio';
35
+ $extra = ( $args['multiple'] ) ? '[]' : '';
36
+ $active = ( in_array( $key, $value ) || ( empty( $value ) && empty( $key ) ) ) ? ' csf--active' : '';
37
+ $checked = ( in_array( $key, $value ) || ( empty( $value ) && empty( $key ) ) ) ? ' checked' : '';
38
+
39
+ echo '<div class="csf--sibling csf--button'. $active .'">';
40
+ echo '<input type="'. $type .'" name="'. $this->field_name( $extra ) .'" value="'. $key .'"'. $this->field_attributes() . $checked .'/>';
41
+ echo $option;
42
+ echo '</div>';
43
+
44
+ }
45
+
46
+ echo '</div>';
47
+
48
+ }
49
+
50
+ echo '<div class="clear"></div>';
51
+
52
+ echo $this->field_after();
53
+
54
+ }
55
+
56
+ }
57
+ }
admin/settings/fields/checkbox/checkbox.php ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Field: checkbox
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF_Field_checkbox' ) ) {
11
+ class CSF_Field_checkbox extends CSF_Fields {
12
+
13
+ public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
14
+ parent::__construct( $field, $value, $unique, $where, $parent );
15
+ }
16
+
17
+ public function render() {
18
+
19
+ $args = wp_parse_args( $this->field, array(
20
+ 'inline' => false,
21
+ 'query_args' => array(),
22
+ ) );
23
+
24
+ $inline_class = ( $args['inline'] ) ? ' class="csf--inline-list"' : '';
25
+
26
+ echo $this->field_before();
27
+
28
+ if( isset( $this->field['options'] ) ) {
29
+
30
+ $value = ( is_array( $this->value ) ) ? $this->value : array_filter( (array) $this->value );
31
+ $options = $this->field['options'];
32
+ $options = ( is_array( $options ) ) ? $options : array_filter( $this->field_data( $options, false, $args['query_args'] ) );
33
+
34
+ if( is_array( $options ) && ! empty( $options ) ) {
35
+
36
+ echo '<ul'. $inline_class .'>';
37
+ foreach ( $options as $option_key => $option_value ) {
38
+
39
+ if( is_array( $option_value ) && ! empty( $option_value ) ) {
40
+
41
+ echo '<li>';
42
+ echo '<ul>';
43
+ echo '<li><strong>'. $option_key .'</strong></li>';
44
+ foreach( $option_value as $sub_key => $sub_value ) {
45
+ $checked = ( in_array( $sub_key, $value ) ) ? ' checked' : '';
46
+ echo '<li><label><input type="checkbox" name="'. $this->field_name( '[]' ) .'" value="'. $sub_key .'"'. $this->field_attributes() . $checked .'/> '. $sub_value .'</label></li>';
47
+ }
48
+ echo '</ul>';
49
+ echo '</li>';
50
+
51
+ } else {
52
+
53
+ $checked = ( in_array( $option_key, $value ) ) ? ' checked' : '';
54
+ echo '<li><label><input type="checkbox" name="'. $this->field_name( '[]' ) .'" value="'. $option_key .'"'. $this->field_attributes() . $checked .'/> '. $option_value .'</label></li>';
55
+
56
+ }
57
+
58
+ }
59
+ echo '</ul>';
60
+
61
+ } else {
62
+
63
+ echo ( ! empty( $this->field['empty_message'] ) ) ? $this->field['empty_message'] : esc_html__( 'No data provided for this option type.', 'csf' );
64
+
65
+ }
66
+
67
+ } else {
68
+
69
+ echo '<label class="csf-checkbox">';
70
+ echo '<input type="hidden" name="'. $this->field_name() .'" value="'. $this->value .'" class="csf--input"'. $this->field_attributes() .'/>';
71
+ echo '<input type="checkbox" name="_pseudo" class="csf--checkbox"'. checked( $this->value, 1, false ) .'/>';
72
+ echo ( ! empty( $this->field['label'] ) ) ? ' '. $this->field['label'] : '';
73
+ echo '</label>';
74
+
75
+ }
76
+
77
+ echo $this->field_after();
78
+
79
+ }
80
+
81
+ }
82
+ }
admin/settings/fields/code_editor/code_editor.php ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Field: code_editor
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF_Field_code_editor' ) ) {
11
+ class CSF_Field_code_editor extends CSF_Fields {
12
+
13
+ public $version = '5.41.0';
14
+ public $cdn_url = 'https://cdn.jsdelivr.net/npm/codemirror@';
15
+
16
+ public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
17
+ parent::__construct( $field, $value, $unique, $where, $parent );
18
+ }
19
+
20
+ public function render() {
21
+
22
+ $default_settings = array(
23
+ 'tabSize' => 2,
24
+ 'lineNumbers' => true,
25
+ 'theme' => 'default',
26
+ 'mode' => 'htmlmixed',
27
+ 'cdnURL' => $this->cdn_url . $this->version,
28
+ );
29
+
30
+ $settings = ( ! empty( $this->field['settings'] ) ) ? $this->field['settings'] : array();
31
+ $settings = wp_parse_args( $settings, $default_settings );
32
+ $encoded = htmlspecialchars( json_encode( $settings ) );
33
+
34
+ echo $this->field_before();
35
+ echo '<textarea name="'. $this->field_name() .'"'. $this->field_attributes() .' data-editor="'. $encoded .'">'. $this->value .'</textarea>';
36
+ echo $this->field_after();
37
+
38
+ }
39
+
40
+ public function enqueue() {
41
+
42
+ // Do not loads CodeMirror in revslider page.
43
+ if( in_array( csf_get_var( 'page' ), array( 'revslider' ) ) ) { return; }
44
+
45
+ if( ! wp_script_is( 'csf-codemirror' ) ) {
46
+ wp_enqueue_script( 'csf-codemirror', $this->cdn_url . $this->version .'/lib/codemirror.min.js', array( 'csf' ), $this->version, true );
47
+ wp_enqueue_script( 'csf-codemirror-loadmode', $this->cdn_url . $this->version .'/addon/mode/loadmode.min.js', array( 'csf-codemirror' ), $this->version, true );
48
+ }
49
+
50
+ if( ! wp_style_is( 'csf-codemirror' ) ) {
51
+ wp_enqueue_style( 'csf-codemirror', $this->cdn_url . $this->version .'/lib/codemirror.min.css', array(), $this->version );
52
+ }
53
+
54
+ }
55
+
56
+ }
57
+ }
admin/settings/fields/color/color.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Field: color
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF_Field_color' ) ) {
11
+ class CSF_Field_color extends CSF_Fields {
12
+
13
+ public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
14
+ parent::__construct( $field, $value, $unique, $where, $parent );
15
+ }
16
+
17
+ public function render() {
18
+
19
+ $default_attr = ( ! empty( $this->field['default'] ) ) ? ' data-default-color="'. $this->field['default'] .'"' : '';
20
+
21
+ echo $this->field_before();
22
+ echo '<input type="text" name="'. $this->field_name() .'" value="'. $this->value .'" class="csf-color"'. $default_attr . $this->field_attributes() .'/>';
23
+ echo $this->field_after();
24
+
25
+ }
26
+
27
+ public function output() {
28
+
29
+ $output = '';
30
+ $elements = ( is_array( $this->field['output'] ) ) ? $this->field['output'] : array_filter( (array) $this->field['output'] );
31
+ $important = ( ! empty( $this->field['output_important'] ) ) ? '!important' : '';
32
+ $mode = ( ! empty( $this->field['output_mode'] ) ) ? $this->field['output_mode'] : 'color';
33
+
34
+ if( ! empty( $elements ) && isset( $this->value ) && $this->value !== '' ) {
35
+ foreach( $elements as $key_property => $element ) {
36
+ if( is_numeric( $key_property ) ) {
37
+ $output = implode( ',', $elements ) .'{'. $mode .':'. $this->value . $important .';}';
38
+ break;
39
+ } else {
40
+ $output .= $element .'{'. $key_property .':'. $this->value . $important .'}';
41
+ }
42
+ }
43
+ }
44
+
45
+ $this->parent->output_css .= $output;
46
+
47
+ return $output;
48
+
49
+ }
50
+
51
+ }
52
+ }
admin/settings/fields/color_group/color_group.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Field: color_group
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF_Field_color_group' ) ) {
11
+ class CSF_Field_color_group extends CSF_Fields {
12
+
13
+ public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
14
+ parent::__construct( $field, $value, $unique, $where, $parent );
15
+ }
16
+
17
+ public function render() {
18
+
19
+ $options = ( ! empty( $this->field['options'] ) ) ? $this->field['options'] : array();
20
+
21
+ echo $this->field_before();
22
+
23
+ if( ! empty( $options ) ) {
24
+ foreach( $options as $key => $option ) {
25
+
26
+ $color_value = ( ! empty( $this->value[$key] ) ) ? $this->value[$key] : '';
27
+ $default_attr = ( ! empty( $this->field['default'][$key] ) ) ? ' data-default-color="'. $this->field['default'][$key] .'"' : '';
28
+
29
+ echo '<div class="csf--left csf-field-color">';
30
+ echo '<div class="csf--title">'. $option .'</div>';
31
+ echo '<input type="text" name="'. $this->field_name('['. $key .']') .'" value="'. $color_value .'" class="csf-color"'. $default_attr . $this->field_attributes() .'/>';
32
+ echo '</div>';
33
+
34
+ }
35
+ }
36
+
37
+ echo '<div class="clear"></div>';
38
+
39
+ echo $this->field_after();
40
+
41
+ }
42
+
43
+ }
44
+ }
admin/settings/fields/content/content.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Field: content
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF_Field_content' ) ) {
11
+ class CSF_Field_content extends CSF_Fields {
12
+
13
+ public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
14
+ parent::__construct( $field, $value, $unique, $where, $parent );
15
+ }
16
+
17
+ public function render() {
18
+ echo $this->field['content'];
19
+ }
20
+
21
+ }
22
+ }
admin/settings/fields/date/date.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Field: date
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF_Field_date' ) ) {
11
+ class CSF_Field_date extends CSF_Fields {
12
+
13
+ public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
14
+ parent::__construct( $field, $value, $unique, $where, $parent );
15
+ }
16
+
17
+ public function render() {
18
+
19
+ $default_settings = array(
20
+ 'dateFormat' => 'mm/dd/yy',
21
+ );
22
+
23
+ $settings = ( ! empty( $this->field['settings'] ) ) ? $this->field['settings'] : array();
24
+ $settings = wp_parse_args( $settings, $default_settings );
25
+
26
+ echo $this->field_before();
27
+
28
+ if( ! empty( $this->field['from_to'] ) ) {
29
+
30
+ $args = wp_parse_args( $this->field, array(
31
+ 'text_from' => esc_html__( 'From', 'csf' ),
32
+ 'text_to' => esc_html__( 'To', 'csf' ),
33
+ ) );
34
+
35
+ $value = wp_parse_args( $this->value, array(
36
+ 'from' => '',
37
+ 'to' => '',
38
+ ) );
39
+
40
+ echo '<label class="csf--from">'. $args['text_from'] .' <input type="text" name="'. $this->field_name('[from]') .'" value="'. $value['from'] .'"'. $this->field_attributes() .'/></label>';
41
+ echo '<label class="csf--to">'. $args['text_to'] .' <input type="text" name="'. $this->field_name('[to]') .'" value="'. $value['to'] .'"'. $this->field_attributes() .'/></label>';
42
+
43
+ } else {
44
+
45
+ echo '<input type="text" name="'. $this->field_name() .'" value="'. $this->value .'"'. $this->field_attributes() .'/>';
46
+
47
+ }
48
+
49
+ echo '<div class="csf-date-settings" data-settings="'. esc_attr( json_encode( $settings ) ) .'"></div>';
50
+
51
+ echo $this->field_after();
52
+
53
+ }
54
+
55
+ public function enqueue() {
56
+
57
+ if( ! wp_script_is( 'jquery-ui-datepicker' ) ) {
58
+ wp_enqueue_script( 'jquery-ui-datepicker' );
59
+ }
60
+
61
+ }
62
+
63
+ }
64
+ }
admin/settings/fields/dimensions/dimensions.php ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Field: dimensions
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF_Field_dimensions' ) ) {
11
+ class CSF_Field_dimensions extends CSF_Fields {
12
+
13
+ public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
14
+ parent::__construct( $field, $value, $unique, $where, $parent );
15
+ }
16
+
17
+ public function render() {
18
+
19
+ $args = wp_parse_args( $this->field, array(
20
+ 'width_icon' => '<i class="fa fa-arrows-h"></i>',
21
+ 'height_icon' => '<i class="fa fa-arrows-v"></i>',
22
+ 'width_placeholder' => esc_html__( 'width', 'csf' ),
23
+ 'height_placeholder' => esc_html__( 'height', 'csf' ),
24
+ 'width' => true,
25
+ 'height' => true,
26
+ 'unit' => true,
27
+ 'show_units' => true,
28
+ 'units' => array( 'px', '%', 'em' )
29
+ ) );
30
+
31
+ $default_values = array(
32
+ 'width' => '',
33
+ 'height' => '',
34
+ 'unit' => 'px',
35
+ );
36
+
37
+ $value = wp_parse_args( $this->value, $default_values );
38
+ $unit = ( count( $args['units'] ) === 1 && ! empty( $args['unit'] ) ) ? $args['units'][0] : '';
39
+ $is_unit = ( ! empty( $unit ) ) ? ' csf--is-unit' : '';
40
+
41
+ echo $this->field_before();
42
+
43
+ echo '<div class="csf--inputs">';
44
+
45
+ if( ! empty( $args['width'] ) ) {
46
+ $placeholder = ( ! empty( $args['width_placeholder'] ) ) ? ' placeholder="'. $args['width_placeholder'] .'"' : '';
47
+ echo '<div class="csf--input">';
48
+ echo ( ! empty( $args['width_icon'] ) ) ? '<span class="csf--label csf--icon">'. $args['width_icon'] .'</span>' : '';
49
+ echo '<input type="number" name="'. $this->field_name('[width]') .'" value="'. $value['width'] .'"'. $placeholder .' class="csf-input-number'. $is_unit .'" />';
50
+ echo ( ! empty( $unit ) ) ? '<span class="csf--label csf--unit">'. $args['units'][0] .'</span>' : '';
51
+ echo '</div>';
52
+ }
53
+
54
+ if( ! empty( $args['height'] ) ) {
55
+ $placeholder = ( ! empty( $args['height_placeholder'] ) ) ? ' placeholder="'. $args['height_placeholder'] .'"' : '';
56
+ echo '<div class="csf--input">';
57
+ echo ( ! empty( $args['height_icon'] ) ) ? '<span class="csf--label csf--icon">'. $args['height_icon'] .'</span>' : '';
58
+ echo '<input type="number" name="'. $this->field_name('[height]') .'" value="'. $value['height'] .'"'. $placeholder .' class="csf-input-number'. $is_unit .'" />';
59
+ echo ( ! empty( $unit ) ) ? '<span class="csf--label csf--unit">'. $args['units'][0] .'</span>' : '';
60
+ echo '</div>';
61
+ }
62
+
63
+ if( ! empty( $args['unit'] ) && ! empty( $args['show_units'] ) && count( $args['units'] ) > 1 ) {
64
+ echo '<div class="csf--input">';
65
+ echo '<select name="'. $this->field_name('[unit]') .'">';
66
+ foreach( $args['units'] as $unit ) {
67
+ $selected = ( $value['unit'] === $unit ) ? ' selected' : '';
68
+ echo '<option value="'. $unit .'"'. $selected .'>'. $unit .'</option>';
69
+ }
70
+ echo '</select>';
71
+ echo '</div>';
72
+ }
73
+
74
+ echo '</div>';
75
+
76
+ echo $this->field_after();
77
+
78
+ }
79
+
80
+ public function output() {
81
+
82
+ $output = '';
83
+ $element = ( is_array( $this->field['output'] ) ) ? join( ',', $this->field['output'] ) : $this->field['output'];
84
+ $prefix = ( ! empty( $this->field['output_prefix'] ) ) ? $this->field['output_prefix'] .'-' : '';
85
+ $important = ( ! empty( $this->field['output_important'] ) ) ? '!important' : '';
86
+ $unit = ( ! empty( $this->value['unit'] ) ) ? $this->value['unit'] : 'px';
87
+ $width = ( isset( $this->value['width'] ) && $this->value['width'] !== '' ) ? $prefix .'width:'. $this->value['width'] . $unit . $important .';' : '';
88
+ $height = ( isset( $this->value['height'] ) && $this->value['width'] !== '' ) ? $prefix .'height:'. $this->value['height'] . $unit . $important .';' : '';
89
+
90
+ if( $width !== '' || $height !== '' ) {
91
+ $output = $element .'{'. $width . $height .'}';
92
+ }
93
+
94
+ $this->parent->output_css .= $output;
95
+
96
+ return $output;
97
+
98
+ }
99
+
100
+ }
101
+ }
admin/settings/fields/fieldset/fieldset.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Field: fieldset
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF_Field_fieldset' ) ) {
11
+ class CSF_Field_fieldset extends CSF_Fields {
12
+
13
+ public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
14
+ parent::__construct( $field, $value, $unique, $where, $parent );
15
+ }
16
+
17
+ public function render() {
18
+
19
+ echo $this->field_before();
20
+
21
+ echo '<div class="csf-fieldset-content">';
22
+
23
+ foreach ( $this->field['fields'] as $field ) {
24
+
25
+ $field_id = ( isset( $field['id'] ) ) ? $field['id'] : '';
26
+ $field_default = ( isset( $field['default'] ) ) ? $field['default'] : '';
27
+ $field_value = ( isset( $this->value[$field_id] ) ) ? $this->value[$field_id] : $field_default;
28
+ $unique_id = ( ! empty( $this->unique ) ) ? $this->unique .'['. $this->field['id'] .']' : $this->field['id'];
29
+
30
+ CSF::field( $field, $field_value, $unique_id, 'field/fieldset' );
31
+
32
+ }
33
+
34
+ echo '</div>';
35
+
36
+ echo $this->field_after();
37
+
38
+ }
39
+
40
+ }
41
+ }
admin/settings/fields/gallery/gallery.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Field: gallery
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF_Field_gallery' ) ) {
11
+ class CSF_Field_gallery extends CSF_Fields {
12
+
13
+ public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
14
+ parent::__construct( $field, $value, $unique, $where, $parent );
15
+ }
16
+
17
+ public function render() {
18
+
19
+ $args = wp_parse_args( $this->field, array(
20
+ 'add_title' => esc_html__( 'Add Gallery', 'csf' ),
21
+ 'edit_title' => esc_html__( 'Edit Gallery', 'csf' ),
22
+ 'clear_title' => esc_html__( 'Clear', 'csf' ),
23
+ ) );
24
+
25
+ $hidden = ( empty( $this->value ) ) ? ' hidden' : '';
26
+
27
+ echo $this->field_before();
28
+
29
+ echo '<ul>';
30
+
31
+ if( ! empty( $this->value ) ) {
32
+
33
+ $values = explode( ',', $this->value );
34
+
35
+ foreach ( $values as $id ) {
36
+ $attachment = wp_get_attachment_image_src( $id, 'thumbnail' );
37
+ echo '<li><img src="'. $attachment[0] .'" /></li>';
38
+ }
39
+
40
+ }
41
+
42
+ echo '</ul>';
43
+ echo '<a href="#" class="button button-primary csf-button">'. $args['add_title'] .'</a>';
44
+ echo '<a href="#" class="button csf-edit-gallery'. $hidden .'">'. $args['edit_title'] .'</a>';
45
+ echo '<a href="#" class="button csf-warning-primary csf-clear-gallery'. $hidden .'">'. $args['clear_title'] .'</a>';
46
+ echo '<input type="text" name="'. $this->field_name() .'" value="'. $this->value .'"'. $this->field_attributes() .'/>';
47
+
48
+ echo $this->field_after();
49
+
50
+ }
51
+
52
+ }
53
+ }
admin/settings/fields/group/group.php ADDED
@@ -0,0 +1,145 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Field: group
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF_Field_group' ) ) {
11
+ class CSF_Field_group extends CSF_Fields {
12
+
13
+ public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
14
+ parent::__construct( $field, $value, $unique, $where, $parent );
15
+ }
16
+
17
+ public function render() {
18
+
19
+ $args = wp_parse_args( $this->field, array(
20
+ 'max' => 0,
21
+ 'min' => 0,
22
+ 'fields' => array(),
23
+ 'button_title' => esc_html__( 'Add New', 'csf' ),
24
+ 'accordion_title_prefix' => '',
25
+ 'accordion_title_number' => false,
26
+ 'accordion_title_auto' => true,
27
+ ) );
28
+
29
+ $title_prefix = ( ! empty( $args['accordion_title_prefix'] ) ) ? $args['accordion_title_prefix'] : '';
30
+ $title_number = ( ! empty( $args['accordion_title_number'] ) ) ? true : false;
31
+ $title_auto = ( ! empty( $args['accordion_title_auto'] ) ) ? true : false;
32
+
33
+ if( ! empty( $this->parent ) && preg_match( '/'. preg_quote( '['. $this->field['id'] .']' ) .'/', $this->parent ) ) {
34
+
35
+ echo '<div class="csf-notice csf-notice-danger">'. esc_html__( 'Error: Nested field id can not be same with another nested field id.', 'csf' ) .'</div>';
36
+
37
+ } else {
38
+
39
+ echo $this->field_before();
40
+
41
+ echo '<div class="csf-cloneable-item csf-cloneable-hidden">';
42
+
43
+ echo '<div class="csf-cloneable-helper">';
44
+ echo '<i class="csf-cloneable-sort fa fa-arrows"></i>';
45
+ echo '<i class="csf-cloneable-clone fa fa-clone"></i>';
46
+ echo '<i class="csf-cloneable-remove csf-confirm fa fa-times" data-confirm="'. esc_html__( 'Are you sure to delete this item?', 'csf' ) .'"></i>';
47
+ echo '</div>';
48
+
49
+ echo '<h4 class="csf-cloneable-title">';
50
+ echo '<span class="csf-cloneable-text">';
51
+ echo ( $title_number ) ? '<span class="csf-cloneable-title-number"></span>' : '';
52
+ echo ( $title_prefix ) ? '<span class="csf-cloneable-title-prefix">'. $title_prefix .'</span>' : '';
53
+ echo ( $title_auto ) ? '<span class="csf-cloneable-value"><span class="csf-cloneable-placeholder"></span></span>' : '';
54
+ echo '</span>';
55
+ echo '</h4>';
56
+
57
+ echo '<div class="csf-cloneable-content">';
58
+ foreach ( $this->field['fields'] as $field ) {
59
+
60
+ $field_parent = $this->parent .'['. $this->field['id'] .']';
61
+ $field_default = ( isset( $field['default'] ) ) ? $field['default'] : '';
62
+
63
+ CSF::field( $field, $field_default, '_nonce', 'field/group', $field_parent );
64
+
65
+ }
66
+ echo '</div>';
67
+
68
+ echo '</div>';
69
+
70
+ echo '<div class="csf-cloneable-wrapper csf-data-wrapper" data-title-number="'. $title_number .'" data-unique-id="'. $this->unique .'" data-field-id="['. $this->field['id'] .']" data-max="'. $args['max'] .'" data-min="'. $args['min'] .'">';
71
+
72
+ if( ! empty( $this->value ) ) {
73
+
74
+ $num = 0;
75
+
76
+ foreach ( $this->value as $value ) {
77
+
78
+ $first_id = ( isset( $this->field['fields'][0]['id'] ) ) ? $this->field['fields'][0]['id'] : '';
79
+ $first_value = ( isset( $value[$first_id] ) ) ? $value[$first_id] : '';
80
+
81
+ echo '<div class="csf-cloneable-item">';
82
+
83
+ echo '<div class="csf-cloneable-helper">';
84
+ echo '<i class="csf-cloneable-sort fa fa-arrows"></i>';
85
+ echo '<i class="csf-cloneable-clone fa fa-clone"></i>';
86
+ echo '<i class="csf-cloneable-remove csf-confirm fa fa-times" data-confirm="'. esc_html__( 'Are you sure to delete this item?', 'csf' ) .'"></i>';
87
+ echo '</div>';
88
+
89
+ echo '<h4 class="csf-cloneable-title">';
90
+ echo '<span class="csf-cloneable-text">';
91
+ echo ( $title_number ) ? '<span class="csf-cloneable-title-number">'. ( $num+1 ) .'.</span>' : '';
92
+ echo ( $title_prefix ) ? '<span class="csf-cloneable-title-prefix">'. $title_prefix .'</span>' : '';
93
+ echo ( $title_auto ) ? '<span class="csf-cloneable-value">' . $first_value .'</span>' : '';
94
+ echo '</span>';
95
+ echo '</h4>';
96
+
97
+ echo '<div class="csf-cloneable-content">';
98
+
99
+ foreach ( $this->field['fields'] as $field ) {
100
+
101
+ $field_parent = $this->parent .'['. $this->field['id'] .']';
102
+ $field_unique = ( ! empty( $this->unique ) ) ? $this->unique .'['. $this->field['id'] .']['. $num .']' : $this->field['id'] .'['. $num .']';
103
+ $field_value = ( isset( $field['id'] ) && isset( $value[$field['id']] ) ) ? $value[$field['id']] : '';
104
+
105
+ CSF::field( $field, $field_value, $field_unique, 'field/group', $field_parent );
106
+
107
+ }
108
+
109
+ echo '</div>';
110
+
111
+ echo '</div>';
112
+
113
+ $num++;
114
+
115
+ }
116
+
117
+ }
118
+
119
+ echo '</div>';
120
+
121
+ echo '<div class="csf-cloneable-alert csf-cloneable-max">'. esc_html__( 'You can not add more than', 'csf' ) .' '. $args['max'] .'</div>';
122
+ echo '<div class="csf-cloneable-alert csf-cloneable-min">'. esc_html__( 'You can not remove less than', 'csf' ) .' '. $args['min'] .'</div>';
123
+
124
+ echo '<a href="#" class="button button-primary csf-cloneable-add">'. $args['button_title'] .'</a>';
125
+
126
+ echo $this->field_after();
127
+
128
+ }
129
+
130
+ }
131
+
132
+ public function enqueue() {
133
+
134
+ if( ! wp_script_is( 'jquery-ui-accordion' ) ) {
135
+ wp_enqueue_script( 'jquery-ui-accordion' );
136
+ }
137
+
138
+ if( ! wp_script_is( 'jquery-ui-sortable' ) ) {
139
+ wp_enqueue_script( 'jquery-ui-sortable' );
140
+ }
141
+
142
+ }
143
+
144
+ }
145
+ }
admin/settings/fields/heading/heading.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Field: heading
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF_Field_heading' ) ) {
11
+ class CSF_Field_heading extends CSF_Fields {
12
+
13
+ public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
14
+ parent::__construct( $field, $value, $unique, $where, $parent );
15
+ }
16
+
17
+ public function render() {
18
+
19
+ echo ( ! empty( $this->field['content'] ) ) ? $this->field['content'] : '';
20
+
21
+ }
22
+
23
+ }
24
+ }
admin/settings/fields/icon/default-icons.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ //
3
+ //
4
+ // Default Icons
5
+ // We are using Font-awesome icons as default
6
+ //
7
+ //
8
+ function csf_get_default_icons() {
9
+ return array( array(
10
+ 'title' => 'Font Awesome',
11
+ 'icons' => array( 'fa fa-glass','fa fa-music','fa fa-search','fa fa-envelope-o','fa fa-heart','fa fa-star','fa fa-star-o','fa fa-user','fa fa-film','fa fa-th-large','fa fa-th','fa fa-th-list','fa fa-check','fa fa-times','fa fa-search-plus','fa fa-search-minus','fa fa-power-off','fa fa-signal','fa fa-cog','fa fa-trash-o','fa fa-home','fa fa-file-o','fa fa-clock-o','fa fa-road','fa fa-download','fa fa-arrow-circle-o-down','fa fa-arrow-circle-o-up','fa fa-inbox','fa fa-play-circle-o','fa fa-repeat','fa fa-refresh','fa fa-list-alt','fa fa-lock','fa fa-flag','fa fa-headphones','fa fa-volume-off','fa fa-volume-down','fa fa-volume-up','fa fa-qrcode','fa fa-barcode','fa fa-tag','fa fa-tags','fa fa-book','fa fa-bookmark','fa fa-print','fa fa-camera','fa fa-font','fa fa-bold','fa fa-italic','fa fa-text-height','fa fa-text-width','fa fa-align-left','fa fa-align-center','fa fa-align-right','fa fa-align-justify','fa fa-list','fa fa-outdent','fa fa-indent','fa fa-video-camera','fa fa-picture-o','fa fa-pencil','fa fa-map-marker','fa fa-adjust','fa fa-tint','fa fa-pencil-square-o','fa fa-share-square-o','fa fa-check-square-o','fa fa-arrows','fa fa-step-backward','fa fa-fast-backward','fa fa-backward','fa fa-play','fa fa-pause','fa fa-stop','fa fa-forward','fa fa-fast-forward','fa fa-step-forward','fa fa-eject','fa fa-chevron-left','fa fa-chevron-right','fa fa-plus-circle','fa fa-minus-circle','fa fa-times-circle','fa fa-check-circle','fa fa-question-circle','fa fa-info-circle','fa fa-crosshairs','fa fa-times-circle-o','fa fa-check-circle-o','fa fa-ban','fa fa-arrow-left','fa fa-arrow-right','fa fa-arrow-up','fa fa-arrow-down','fa fa-share','fa fa-expand','fa fa-compress','fa fa-plus','fa fa-minus','fa fa-asterisk','fa fa-exclamation-circle','fa fa-gift','fa fa-leaf','fa fa-fire','fa fa-eye','fa fa-eye-slash','fa fa-exclamation-triangle','fa fa-plane','fa fa-calendar','fa fa-random','fa fa-comment','fa fa-magnet','fa fa-chevron-up','fa fa-chevron-down','fa fa-retweet','fa fa-shopping-cart','fa fa-folder','fa fa-folder-open','fa fa-arrows-v','fa fa-arrows-h','fa fa-bar-chart','fa fa-twitter-square','fa fa-facebook-square','fa fa-camera-retro','fa fa-key','fa fa-cogs','fa fa-comments','fa fa-thumbs-o-up','fa fa-thumbs-o-down','fa fa-star-half','fa fa-heart-o','fa fa-sign-out','fa fa-linkedin-square','fa fa-thumb-tack','fa fa-external-link','fa fa-sign-in','fa fa-trophy','fa fa-github-square','fa fa-upload','fa fa-lemon-o','fa fa-phone','fa fa-square-o','fa fa-bookmark-o','fa fa-phone-square','fa fa-twitter','fa fa-facebook','fa fa-github','fa fa-unlock','fa fa-credit-card','fa fa-rss','fa fa-hdd-o','fa fa-bullhorn','fa fa-bell','fa fa-certificate','fa fa-hand-o-right','fa fa-hand-o-left','fa fa-hand-o-up','fa fa-hand-o-down','fa fa-arrow-circle-left','fa fa-arrow-circle-right','fa fa-arrow-circle-up','fa fa-arrow-circle-down','fa fa-globe','fa fa-wrench','fa fa-tasks','fa fa-filter','fa fa-briefcase','fa fa-arrows-alt','fa fa-users','fa fa-link','fa fa-cloud','fa fa-flask','fa fa-scissors','fa fa-files-o','fa fa-paperclip','fa fa-floppy-o','fa fa-square','fa fa-bars','fa fa-list-ul','fa fa-list-ol','fa fa-strikethrough','fa fa-underline','fa fa-table','fa fa-magic','fa fa-truck','fa fa-pinterest','fa fa-pinterest-square','fa fa-google-plus-square','fa fa-google-plus','fa fa-money','fa fa-caret-down','fa fa-caret-up','fa fa-caret-left','fa fa-caret-right','fa fa-columns','fa fa-sort','fa fa-sort-desc','fa fa-sort-asc','fa fa-envelope','fa fa-linkedin','fa fa-undo','fa fa-gavel','fa fa-tachometer','fa fa-comment-o','fa fa-comments-o','fa fa-bolt','fa fa-sitemap','fa fa-umbrella','fa fa-clipboard','fa fa-lightbulb-o','fa fa-exchange','fa fa-cloud-download','fa fa-cloud-upload','fa fa-user-md','fa fa-stethoscope','fa fa-suitcase','fa fa-bell-o','fa fa-coffee','fa fa-cutlery','fa fa-file-text-o','fa fa-building-o','fa fa-hospital-o','fa fa-ambulance','fa fa-medkit','fa fa-fighter-jet','fa fa-beer','fa fa-h-square','fa fa-plus-square','fa fa-angle-double-left','fa fa-angle-double-right','fa fa-angle-double-up','fa fa-angle-double-down','fa fa-angle-left','fa fa-angle-right','fa fa-angle-up','fa fa-angle-down','fa fa-desktop','fa fa-laptop','fa fa-tablet','fa fa-mobile','fa fa-circle-o','fa fa-quote-left','fa fa-quote-right','fa fa-spinner','fa fa-circle','fa fa-reply','fa fa-github-alt','fa fa-folder-o','fa fa-folder-open-o','fa fa-smile-o','fa fa-frown-o','fa fa-meh-o','fa fa-gamepad','fa fa-keyboard-o','fa fa-flag-o','fa fa-flag-checkered','fa fa-terminal','fa fa-code','fa fa-reply-all','fa fa-star-half-o','fa fa-location-arrow','fa fa-crop','fa fa-code-fork','fa fa-chain-broken','fa fa-question','fa fa-info','fa fa-exclamation','fa fa-superscript','fa fa-subscript','fa fa-eraser','fa fa-puzzle-piece','fa fa-microphone','fa fa-microphone-slash','fa fa-shield','fa fa-calendar-o','fa fa-fire-extinguisher','fa fa-rocket','fa fa-maxcdn','fa fa-chevron-circle-left','fa fa-chevron-circle-right','fa fa-chevron-circle-up','fa fa-chevron-circle-down','fa fa-html5','fa fa-css3','fa fa-anchor','fa fa-unlock-alt','fa fa-bullseye','fa fa-ellipsis-h','fa fa-ellipsis-v','fa fa-rss-square','fa fa-play-circle','fa fa-ticket','fa fa-minus-square','fa fa-minus-square-o','fa fa-level-up','fa fa-level-down','fa fa-check-square','fa fa-pencil-square','fa fa-external-link-square','fa fa-share-square','fa fa-compass','fa fa-caret-square-o-down','fa fa-caret-square-o-up','fa fa-caret-square-o-right','fa fa-eur','fa fa-gbp','fa fa-usd','fa fa-inr','fa fa-jpy','fa fa-rub','fa fa-krw','fa fa-btc','fa fa-file','fa fa-file-text','fa fa-sort-alpha-asc','fa fa-sort-alpha-desc','fa fa-sort-amount-asc','fa fa-sort-amount-desc','fa fa-sort-numeric-asc','fa fa-sort-numeric-desc','fa fa-thumbs-up','fa fa-thumbs-down','fa fa-youtube-square','fa fa-youtube','fa fa-xing','fa fa-xing-square','fa fa-youtube-play','fa fa-dropbox','fa fa-stack-overflow','fa fa-instagram','fa fa-flickr','fa fa-adn','fa fa-bitbucket','fa fa-bitbucket-square','fa fa-tumblr','fa fa-tumblr-square','fa fa-long-arrow-down','fa fa-long-arrow-up','fa fa-long-arrow-left','fa fa-long-arrow-right','fa fa-apple','fa fa-windows','fa fa-android','fa fa-linux','fa fa-dribbble','fa fa-skype','fa fa-foursquare','fa fa-trello','fa fa-female','fa fa-male','fa fa-gratipay','fa fa-sun-o','fa fa-moon-o','fa fa-archive','fa fa-bug','fa fa-vk','fa fa-weibo','fa fa-renren','fa fa-pagelines','fa fa-stack-exchange','fa fa-arrow-circle-o-right','fa fa-arrow-circle-o-left','fa fa-caret-square-o-left','fa fa-dot-circle-o','fa fa-wheelchair','fa fa-vimeo-square','fa fa-try','fa fa-plus-square-o','fa fa-space-shuttle','fa fa-slack','fa fa-envelope-square','fa fa-wordpress','fa fa-openid','fa fa-university','fa fa-graduation-cap','fa fa-yahoo','fa fa-google','fa fa-reddit','fa fa-reddit-square','fa fa-stumbleupon-circle','fa fa-stumbleupon','fa fa-delicious','fa fa-digg','fa fa-pied-piper-pp','fa fa-pied-piper-alt','fa fa-drupal','fa fa-joomla','fa fa-language','fa fa-fax','fa fa-building','fa fa-child','fa fa-paw','fa fa-spoon','fa fa-cube','fa fa-cubes','fa fa-behance','fa fa-behance-square','fa fa-steam','fa fa-steam-square','fa fa-recycle','fa fa-car','fa fa-taxi','fa fa-tree','fa fa-spotify','fa fa-deviantart','fa fa-soundcloud','fa fa-database','fa fa-file-pdf-o','fa fa-file-word-o','fa fa-file-excel-o','fa fa-file-powerpoint-o','fa fa-file-image-o','fa fa-file-archive-o','fa fa-file-audio-o','fa fa-file-video-o','fa fa-file-code-o','fa fa-vine','fa fa-codepen','fa fa-jsfiddle','fa fa-life-ring','fa fa-circle-o-notch','fa fa-rebel','fa fa-empire','fa fa-git-square','fa fa-git','fa fa-hacker-news','fa fa-tencent-weibo','fa fa-qq','fa fa-weixin','fa fa-paper-plane','fa fa-paper-plane-o','fa fa-history','fa fa-circle-thin','fa fa-header','fa fa-paragraph','fa fa-sliders','fa fa-share-alt','fa fa-share-alt-square','fa fa-bomb','fa fa-futbol-o','fa fa-tty','fa fa-binoculars','fa fa-plug','fa fa-slideshare','fa fa-twitch','fa fa-yelp','fa fa-newspaper-o','fa fa-wifi','fa fa-calculator','fa fa-paypal','fa fa-google-wallet','fa fa-cc-visa','fa fa-cc-mastercard','fa fa-cc-discover','fa fa-cc-amex','fa fa-cc-paypal','fa fa-cc-stripe','fa fa-bell-slash','fa fa-bell-slash-o','fa fa-trash','fa fa-copyright','fa fa-at','fa fa-eyedropper','fa fa-paint-brush','fa fa-birthday-cake','fa fa-area-chart','fa fa-pie-chart','fa fa-line-chart','fa fa-lastfm','fa fa-lastfm-square','fa fa-toggle-off','fa fa-toggle-on','fa fa-bicycle','fa fa-bus','fa fa-ioxhost','fa fa-angellist','fa fa-cc','fa fa-ils','fa fa-meanpath','fa fa-buysellads','fa fa-connectdevelop','fa fa-dashcube','fa fa-forumbee','fa fa-leanpub','fa fa-sellsy','fa fa-shirtsinbulk','fa fa-simplybuilt','fa fa-skyatlas','fa fa-cart-plus','fa fa-cart-arrow-down','fa fa-diamond','fa fa-ship','fa fa-user-secret','fa fa-motorcycle','fa fa-street-view','fa fa-heartbeat','fa fa-venus','fa fa-mars','fa fa-mercury','fa fa-transgender','fa fa-transgender-alt','fa fa-venus-double','fa fa-mars-double','fa fa-venus-mars','fa fa-mars-stroke','fa fa-mars-stroke-v','fa fa-mars-stroke-h','fa fa-neuter','fa fa-genderless','fa fa-facebook-official','fa fa-pinterest-p','fa fa-whatsapp','fa fa-server','fa fa-user-plus','fa fa-user-times','fa fa-bed','fa fa-viacoin','fa fa-train','fa fa-subway','fa fa-medium','fa fa-y-combinator','fa fa-optin-monster','fa fa-opencart','fa fa-expeditedssl','fa fa-battery-full','fa fa-battery-three-quarters','fa fa-battery-half','fa fa-battery-quarter','fa fa-battery-empty','fa fa-mouse-pointer','fa fa-i-cursor','fa fa-object-group','fa fa-object-ungroup','fa fa-sticky-note','fa fa-sticky-note-o','fa fa-cc-jcb','fa fa-cc-diners-club','fa fa-clone','fa fa-balance-scale','fa fa-hourglass-o','fa fa-hourglass-start','fa fa-hourglass-half','fa fa-hourglass-end','fa fa-hourglass','fa fa-hand-rock-o','fa fa-hand-paper-o','fa fa-hand-scissors-o','fa fa-hand-lizard-o','fa fa-hand-spock-o','fa fa-hand-pointer-o','fa fa-hand-peace-o','fa fa-trademark','fa fa-registered','fa fa-creative-commons','fa fa-gg','fa fa-gg-circle','fa fa-tripadvisor','fa fa-odnoklassniki','fa fa-odnoklassniki-square','fa fa-get-pocket','fa fa-wikipedia-w','fa fa-safari','fa fa-chrome','fa fa-firefox','fa fa-opera','fa fa-internet-explorer','fa fa-television','fa fa-contao','fa fa-500px','fa fa-amazon','fa fa-calendar-plus-o','fa fa-calendar-minus-o','fa fa-calendar-times-o','fa fa-calendar-check-o','fa fa-industry','fa fa-map-pin','fa fa-map-signs','fa fa-map-o','fa fa-map','fa fa-commenting','fa fa-commenting-o','fa fa-houzz','fa fa-vimeo','fa fa-black-tie','fa fa-fonticons','fa fa-reddit-alien','fa fa-edge','fa fa-credit-card-alt','fa fa-codiepie','fa fa-modx','fa fa-fort-awesome','fa fa-usb','fa fa-product-hunt','fa fa-mixcloud','fa fa-scribd','fa fa-pause-circle','fa fa-pause-circle-o','fa fa-stop-circle','fa fa-stop-circle-o','fa fa-shopping-bag','fa fa-shopping-basket','fa fa-hashtag','fa fa-bluetooth','fa fa-bluetooth-b','fa fa-percent','fa fa-gitlab','fa fa-wpbeginner','fa fa-wpforms','fa fa-envira','fa fa-universal-access','fa fa-wheelchair-alt','fa fa-question-circle-o','fa fa-blind','fa fa-audio-description','fa fa-volume-control-phone','fa fa-braille','fa fa-assistive-listening-systems','fa fa-american-sign-language-interpreting','fa fa-deaf','fa fa-glide','fa fa-glide-g','fa fa-sign-language','fa fa-low-vision','fa fa-viadeo','fa fa-viadeo-square','fa fa-snapchat','fa fa-snapchat-ghost','fa fa-snapchat-square','fa fa-pied-piper','fa fa-first-order','fa fa-yoast','fa fa-themeisle','fa fa-google-plus-official','fa fa-font-awesome','fa fa-handshake-o','fa fa-envelope-open','fa fa-envelope-open-o','fa fa-linode','fa fa-address-book','fa fa-address-book-o','fa fa-address-card','fa fa-address-card-o','fa fa-user-circle','fa fa-user-circle-o','fa fa-user-o','fa fa-id-badge','fa fa-id-card','fa fa-id-card-o','fa fa-quora','fa fa-free-code-camp','fa fa-telegram','fa fa-thermometer-full','fa fa-thermometer-three-quarters','fa fa-thermometer-half','fa fa-thermometer-quarter','fa fa-thermometer-empty','fa fa-shower','fa fa-bath','fa fa-podcast','fa fa-window-maximize','fa fa-window-minimize','fa fa-window-restore','fa fa-window-close','fa fa-window-close-o','fa fa-bandcamp','fa fa-grav','fa fa-etsy','fa fa-imdb','fa fa-ravelry','fa fa-eercast','fa fa-microchip','fa fa-snowflake-o','fa fa-superpowers','fa fa-wpexplorer','fa fa-meetup' )
12
+ ) );
13
+ }
admin/settings/fields/icon/icon.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Field: icon
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF_Field_icon' ) ) {
11
+ class CSF_Field_icon extends CSF_Fields {
12
+
13
+ public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
14
+ parent::__construct( $field, $value, $unique, $where, $parent );
15
+ }
16
+
17
+ public function render() {
18
+
19
+ $args = wp_parse_args( $this->field, array(
20
+ 'button_title' => esc_html__( 'Add Icon', 'csf' ),
21
+ 'remove_title' => esc_html__( 'Remove Icon', 'csf' ),
22
+ ) );
23
+
24
+ echo $this->field_before();
25
+
26
+ $nonce = wp_create_nonce( 'csf_icon_nonce' );
27
+ $hidden = ( empty( $this->value ) ) ? ' hidden' : '';
28
+
29
+ echo '<div class="csf-icon-select">';
30
+ echo '<span class="csf-icon-preview'. $hidden .'"><i class="'. $this->value .'"></i></span>';
31
+ echo '<a href="#" class="button button-primary csf-icon-add" data-nonce="'. $nonce .'">'. $args['button_title'] .'</a>';
32
+ echo '<a href="#" class="button csf-warning-primary csf-icon-remove'. $hidden .'">'. $args['remove_title'] .'</a>';
33
+ echo '<input type="text" name="'. $this->field_name() .'" value="'. $this->value .'" class="csf-icon-value"'. $this->field_attributes() .' />';
34
+ echo '</div>';
35
+
36
+ echo $this->field_after();
37
+
38
+ }
39
+
40
+ }
41
+ }
admin/settings/fields/image_select/image_select.php ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Field: image_select
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF_Field_image_select' ) ) {
11
+ class CSF_Field_image_select extends CSF_Fields {
12
+
13
+ public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
14
+ parent::__construct( $field, $value, $unique, $where, $parent );
15
+ }
16
+
17
+ public function render() {
18
+
19
+ $args = wp_parse_args( $this->field, array(
20
+ 'multiple' => false,
21
+ 'options' => array(),
22
+ ) );
23
+
24
+ $value = ( is_array( $this->value ) ) ? $this->value : array_filter( (array) $this->value );
25
+
26
+ echo $this->field_before();
27
+
28
+ if( ! empty( $args['options'] ) ) {
29
+
30
+ echo '<div class="csf-siblings csf--image-group" data-multiple="'. $args['multiple'] .'">';
31
+
32
+ $num = 1;
33
+
34
+ foreach( $args['options'] as $key => $option ) {
35
+
36
+ $type = ( $args['multiple'] ) ? 'checkbox' : 'radio';
37
+ $extra = ( $args['multiple'] ) ? '[]' : '';
38
+ $active = ( in_array( $key, $value ) ) ? ' csf--active' : '';
39
+ $checked = ( in_array( $key, $value ) ) ? ' checked' : '';
40
+
41
+ echo '<div class="csf--sibling csf--image'. $active .'">';
42
+ echo '<img src="'. $option .'" alt="img-'. $num++ .'" />';
43
+ echo '<input type="'. $type .'" name="'. $this->field_name( $extra ) .'" value="'. $key .'"'. $this->field_attributes() . $checked .'/>';
44
+ echo '</div>';
45
+
46
+ }
47
+
48
+ echo '</div>';
49
+
50
+ }
51
+
52
+ echo '<div class="clear"></div>';
53
+
54
+ echo $this->field_after();
55
+
56
+ }
57
+
58
+ public function output() {
59
+
60
+ $output = '';
61
+ $bg_image = array();
62
+ $important = ( ! empty( $this->field['output_important'] ) ) ? '!important' : '';
63
+ $elements = ( is_array( $this->field['output'] ) ) ? join( ',', $this->field['output'] ) : $this->field['output'];
64
+
65
+ if( ! empty( $elements ) && isset( $this->value ) && $this->value !== '' ) {
66
+ $output = $elements .'{background-image:url('. $this->value .')'. $important .';}';
67
+ }
68
+
69
+ $this->parent->output_css .= $output;
70
+
71
+ return $output;
72
+
73
+ }
74
+
75
+ }
76
+ }
admin/settings/fields/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden.
admin/settings/fields/link_color/link_color.php ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Field: link_color
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF_Field_link_color' ) ) {
11
+ class CSF_Field_link_color extends CSF_Fields {
12
+
13
+ public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
14
+ parent::__construct( $field, $value, $unique, $where, $parent );
15
+ }
16
+
17
+ public function render() {
18
+
19
+ $args = wp_parse_args( $this->field, array(
20
+ 'color' => true,
21
+ 'hover' => true,
22
+ 'active' => false,
23
+ 'visited' => false,
24
+ 'focus' => false,
25
+ ) );
26
+
27
+ $default_values = array(
28
+ 'color' => '',
29
+ 'hover' => '',
30
+ 'active' => '',
31
+ 'visited' => '',
32
+ 'focus' => '',
33
+ );
34
+
35
+ $color_props = array(
36
+ 'color' => esc_html__( 'Normal', 'csf' ),
37
+ 'hover' => esc_html__( 'Hover', 'csf' ),
38
+ 'active' => esc_html__( 'Active', 'csf' ),
39
+ 'visited' => esc_html__( 'Visited', 'csf' ),
40
+ 'focus' => esc_html__( 'Focus', 'csf' )
41
+ );
42
+
43
+ $value = wp_parse_args( $this->value, $default_values );
44
+
45
+ echo $this->field_before();
46
+
47
+ foreach ( $color_props as $color_prop_key => $color_prop_value ) {
48
+
49
+ if( ! empty( $args[$color_prop_key] ) ) {
50
+
51
+ $default_attr = ( ! empty( $this->field['default'][$color_prop_key] ) ) ? ' data-default-color="'. $this->field['default'][$color_prop_key] .'"' : '';
52
+
53
+ echo '<div class="csf--left csf-field-color">';
54
+ echo '<div class="csf--title">'. $color_prop_value .'</div>';
55
+ echo '<input type="text" name="'. $this->field_name('['. $color_prop_key .']') .'" value="'. $value[$color_prop_key] .'" class="csf-color"'. $default_attr . $this->field_attributes() .'/>';
56
+ echo '</div>';
57
+
58
+ }
59
+
60
+ }
61
+
62
+ echo $this->field_after();
63
+
64
+ }
65
+
66
+ public function output() {
67
+
68
+ $output = '';
69
+ $elements = ( is_array( $this->field['output'] ) ) ? $this->field['output'] : array_filter( (array) $this->field['output'] );
70
+ $important = ( ! empty( $this->field['output_important'] ) ) ? '!important' : '';
71
+
72
+ if( ! empty( $elements ) && isset( $this->value ) && $this->value !== '' ) {
73
+ foreach( $elements as $element ) {
74
+
75
+ if( isset( $this->value['color'] ) && $this->value['color'] !== '' ) { $output .= $element .'{color:'. $this->value['color'] . $important .';}'; }
76
+ if( isset( $this->value['hover'] ) && $this->value['hover'] !== '' ) { $output .= $element .':hover{color:'. $this->value['hover'] . $important .';}'; }
77
+ if( isset( $this->value['active'] ) && $this->value['active'] !== '' ) { $output .= $element .':active{color:'. $this->value['active'] . $important .';}'; }
78
+ if( isset( $this->value['visited'] ) && $this->value['visited'] !== '' ) { $output .= $element .':visited{color:'. $this->value['visited'] . $important .';}'; }
79
+ if( isset( $this->value['focus'] ) && $this->value['focus'] !== '' ) { $output .= $element .':focus{color:'. $this->value['focus'] . $important .';}'; }
80
+
81
+ }
82
+ }
83
+
84
+ $this->parent->output_css .= $output;
85
+
86
+ return $output;
87
+
88
+ }
89
+
90
+ }
91
+ }
admin/settings/fields/map/map.php ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Field: map
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF_Field_map' ) ) {
11
+ class CSF_Field_map extends CSF_Fields {
12
+
13
+ public $version = '1.5.1';
14
+ public $cdn_url = 'https://cdn.jsdelivr.net/npm/leaflet@';
15
+
16
+ public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
17
+ parent::__construct( $field, $value, $unique, $where, $parent );
18
+ }
19
+
20
+ public function render() {
21
+
22
+ $args = wp_parse_args( $this->field, array(
23
+ 'placeholder' => esc_html__( 'Search your address...', 'csf' ),
24
+ 'latitude_text' => esc_html__( 'Latitude', 'csf' ),
25
+ 'longitude_text' => esc_html__( 'Longitude', 'csf' ),
26
+ 'address_field' => '',
27
+ 'height' => '',
28
+ ) );
29
+
30
+ $value = wp_parse_args( $this->value, array(
31
+ 'address' => '',
32
+ 'latitude' => '20',
33
+ 'longitude' => '0',
34
+ 'zoom' => '2',
35
+ ) );
36
+
37
+ $default_settings = array(
38
+ 'center' => array( $value['latitude'], $value['longitude'] ),
39
+ 'zoom' => $value['zoom'],
40
+ 'scrollWheelZoom' => false,
41
+ );
42
+
43
+ $settings = ( ! empty( $this->field['settings'] ) ) ? $this->field['settings'] : array();
44
+ $settings = wp_parse_args( $settings, $default_settings );
45
+ $encoded = htmlspecialchars( json_encode( $settings ) );
46
+
47
+ $style_attr = ( ! empty( $args['height'] ) ) ? ' style="min-height:'. $args['height'] .';"' : '';
48
+ $placeholder = ( ! empty( $args['placeholder'] ) ) ? array( 'placeholder' => $args['placeholder'] ) : '';
49
+
50
+ echo $this->field_before();
51
+
52
+ if( empty( $args['address_field'] ) ) {
53
+ echo '<div class="csf--map-search">';
54
+ echo '<input type="text" name="'. $this->field_name('[address]') .'" value="'. $value['address'] .'"'. $this->field_attributes( $placeholder ) .' />';
55
+ echo '</div>';
56
+ } else {
57
+ echo '<div class="csf--address-field" data-address-field="'. $args['address_field'] .'"></div>';
58
+ }
59
+
60
+ echo '<div class="csf--map-osm-wrap"><div class="csf--map-osm" data-map="'. $encoded .'"'. $style_attr .'></div></div>';
61
+
62
+ echo '<div class="csf--map-inputs">';
63
+
64
+ echo '<div class="csf--map-input">';
65
+ echo '<label>'. $args['latitude_text'] .'</label>';
66
+ echo '<input type="text" name="'. $this->field_name('[latitude]') .'" value="'. $value['latitude'] .'" class="csf--latitude" />';
67
+ echo '</div>';
68
+
69
+ echo '<div class="csf--map-input">';
70
+ echo '<label>'. $args['longitude_text'] .'</label>';
71
+ echo '<input type="text" name="'. $this->field_name('[longitude]') .'" value="'. $value['longitude'] .'" class="csf--longitude" />';
72
+ echo '</div>';
73
+
74
+ echo '</div>';
75
+
76
+ echo '<input type="hidden" name="'. $this->field_name('[zoom]') .'" value="'. $value['zoom'] .'" class="csf--zoom" />';
77
+
78
+ echo $this->field_after();
79
+
80
+ }
81
+
82
+ public function enqueue() {
83
+
84
+ if( ! wp_script_is( 'csf-leaflet' ) ) {
85
+ wp_enqueue_script( 'csf-leaflet', $this->cdn_url . $this->version .'/dist/leaflet.js', array( 'csf' ), $this->version, true );
86
+ }
87
+
88
+ if( ! wp_style_is( 'csf-leaflet' ) ) {
89
+ wp_enqueue_style( 'csf-leaflet', $this->cdn_url . $this->version .'/dist/leaflet.css', array(), $this->version );
90
+ }
91
+
92
+ if( ! wp_script_is( 'jquery-ui-autocomplete' ) ) {
93
+ wp_enqueue_script( 'jquery-ui-autocomplete' );
94
+ }
95
+
96
+ }
97
+
98
+ }
99
+ }
admin/settings/fields/media/media.php ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Field: media
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF_Field_media' ) ) {
11
+ class CSF_Field_media extends CSF_Fields {
12
+
13
+ public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
14
+ parent::__construct( $field, $value, $unique, $where, $parent );
15
+ }
16
+
17
+ public function render() {
18
+
19
+ $args = wp_parse_args( $this->field, array(
20
+ 'url' => true,
21
+ 'preview' => true,
22
+ 'library' => array(),
23
+ 'button_title' => esc_html__( 'Upload', 'csf' ),
24
+ 'remove_title' => esc_html__( 'Remove', 'csf' ),
25
+ 'preview_size' => 'thumbnail',
26
+ ) );
27
+
28
+ $default_values = array(
29
+ 'url' => '',
30
+ 'id' => '',
31
+ 'width' => '',
32
+ 'height' => '',
33
+ 'thumbnail' => '',
34
+ 'alt' => '',
35
+ 'title' => '',
36
+ 'description' => ''
37
+ );
38
+
39
+ // fallback
40
+ if( is_numeric( $this->value ) ) {
41
+
42
+ $this->value = array(
43
+ 'id' => $this->value,
44
+ 'url' => wp_get_attachment_url( $this->value ),
45
+ 'thumbnail' => wp_get_attachment_image_src( $this->value, 'thumbnail', true )[0],
46
+ );
47
+
48
+ }
49
+
50
+ $this->value = wp_parse_args( $this->value, $default_values );
51
+
52
+ $library = ( is_array( $args['library'] ) ) ? $args['library'] : array_filter( (array) $args['library'] );
53
+ $library = ( ! empty( $library ) ) ? implode(',', $library ) : '';
54
+ $preview_src = ( $args['preview_size'] !== 'thumbnail' ) ? $this->value['url'] : $this->value['thumbnail'];
55
+ $hidden_url = ( empty( $args['url'] ) ) ? ' hidden' : '';
56
+ $hidden_auto = ( empty( $this->value['url'] ) ) ? ' hidden' : '';
57
+ $placeholder = ( empty( $this->field['placeholder'] ) ) ? ' placeholder="'. esc_html__( 'No media selected', 'csf' ) .'"' : '';
58
+
59
+ echo $this->field_before();
60
+
61
+ if( ! empty( $args['preview'] ) ) {
62
+ echo '<div class="csf--preview'. $hidden_auto .'">';
63
+ echo '<div class="csf-image-preview"><a href="#" class="csf--remove fa fa-times"></a><img src="'. $preview_src .'" class="csf--src" /></div>';
64
+ echo '</div>';
65
+ }
66
+
67
+ echo '<div class="csf--placeholder">';
68
+ echo '<input type="text" name="'. $this->field_name('[url]') .'" value="'. $this->value['url'] .'" class="csf--url'. $hidden_url .'" readonly="readonly"'. $this->field_attributes() . $placeholder .' />';
69
+ echo '<a href="#" class="button button-primary csf--button" data-library="'. esc_attr( $library ) .'" data-preview-size="'. esc_attr( $args['preview_size'] ) .'">'. $args['button_title'] .'</a>';
70
+ echo ( empty( $args['preview'] ) ) ? '<a href="#" class="button button-secondary csf-warning-primary csf--remove'. $hidden_auto .'">'. $args['remove_title'] .'</a>' : '';
71
+ echo '</div>';
72
+
73
+ echo '<input type="hidden" name="'. $this->field_name('[id]') .'" value="'. $this->value['id'] .'" class="csf--id"/>';
74
+ echo '<input type="hidden" name="'. $this->field_name('[width]') .'" value="'. $this->value['width'] .'" class="csf--width"/>';
75
+ echo '<input type="hidden" name="'. $this->field_name('[height]') .'" value="'. $this->value['height'] .'" class="csf--height"/>';
76
+ echo '<input type="hidden" name="'. $this->field_name('[thumbnail]') .'" value="'. $this->value['thumbnail'] .'" class="csf--thumbnail"/>';
77
+ echo '<input type="hidden" name="'. $this->field_name('[alt]') .'" value="'. $this->value['alt'] .'" class="csf--alt"/>';
78
+ echo '<input type="hidden" name="'. $this->field_name('[title]') .'" value="'. $this->value['title'] .'" class="csf--title"/>';
79
+ echo '<input type="hidden" name="'. $this->field_name('[description]') .'" value="'. $this->value['description'] .'" class="csf--description"/>';
80
+
81
+ echo $this->field_after();
82
+
83
+ }
84
+
85
+ }
86
+ }
admin/settings/fields/notice/notice.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Field: notice
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF_Field_notice' ) ) {
11
+ class CSF_Field_notice extends CSF_Fields {
12
+
13
+ public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
14
+ parent::__construct( $field, $value, $unique, $where, $parent );
15
+ }
16
+
17
+ public function render() {
18
+
19
+ $style = ( ! empty( $this->field['style'] ) ) ? $this->field['style'] : 'normal';
20
+
21
+ echo ( ! empty( $this->field['content'] ) ) ? '<div class="csf-notice csf-notice-'. $style .'">'. $this->field['content'] .'</div>' : '';
22
+
23
+ }
24
+
25
+ }
26
+ }
admin/settings/fields/number/number.php ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Field: number
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF_Field_number' ) ) {
11
+ class CSF_Field_number extends CSF_Fields {
12
+
13
+ public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
14
+ parent::__construct( $field, $value, $unique, $where, $parent );
15
+ }
16
+
17
+ public function render() {
18
+
19
+ $args = wp_parse_args( $this->field, array(
20
+ 'unit' => '',
21
+ ) );
22
+
23
+ echo $this->field_before();
24
+ echo '<div class="csf--wrap">';
25
+ echo '<input type="number" name="'. $this->field_name() .'" value="'. $this->value .'"'. $this->field_attributes( array( 'class' => 'csf-input-number' ) ) .'/>';
26
+ echo ( ! empty( $args['unit'] ) ) ? '<span class="csf--unit">'. $args['unit'] .'</span>' : '';
27
+ echo '</div>';
28
+ echo '<div class="clear"></div>';
29
+ echo $this->field_after();
30
+
31
+ }
32
+
33
+ public function output() {
34
+
35
+ $output = '';
36
+ $elements = ( is_array( $this->field['output'] ) ) ? $this->field['output'] : array_filter( (array) $this->field['output'] );
37
+ $important = ( ! empty( $this->field['output_important'] ) ) ? '!important' : '';
38
+ $mode = ( ! empty( $this->field['output_mode'] ) ) ? $this->field['output_mode'] : 'width';
39
+ $unit = ( ! empty( $this->field['unit'] ) ) ? $this->field['unit'] : 'px';
40
+
41
+ if( ! empty( $elements ) && isset( $this->value ) && $this->value !== '' ) {
42
+ foreach( $elements as $key_property => $element ) {
43
+ if( is_numeric( $key_property ) ) {
44
+ if( $mode ) {
45
+ $output = implode( ',', $elements ) .'{'. $mode .':'. $this->value . $unit . $important .';}';
46
+ }
47
+ break;
48
+ } else {
49
+ $output .= $element .'{'. $key_property .':'. $this->value . $unit . $important .'}';
50
+ }
51
+ }
52
+ }
53
+
54
+ $this->parent->output_css .= $output;
55
+
56
+ return $output;
57
+
58
+ }
59
+
60
+ }
61
+ }
admin/settings/fields/palette/palette.php ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Field: palette
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF_Field_palette' ) ) {
11
+ class CSF_Field_palette extends CSF_Fields {
12
+
13
+ public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
14
+ parent::__construct( $field, $value, $unique, $where, $parent );
15
+ }
16
+
17
+ public function render() {
18
+
19
+ $palette = ( ! empty( $this->field['options'] ) ) ? $this->field['options'] : array();
20
+
21
+ echo $this->field_before();
22
+
23
+ if( ! empty( $palette ) ) {
24
+
25
+ echo '<div class="csf-siblings csf--palettes">';
26
+
27
+ foreach ( $palette as $key => $colors ) {
28
+
29
+ $active = ( $key === $this->value ) ? ' csf--active' : '';
30
+ $checked = ( $key === $this->value ) ? ' checked' : '';
31
+
32
+ echo '<div class="csf--sibling csf--palette'. $active .'">';
33
+
34
+ if( ! empty( $colors ) ) {
35
+
36
+ foreach( $colors as $color ) {
37
+
38
+ echo '<span style="background-color: '. $color .';"></span>';
39
+
40
+ }
41
+
42
+ }
43
+
44
+ echo '<input type="radio" name="'. $this->field_name() .'" value="'. $key .'"'. $this->field_attributes() . $checked .'/>';
45
+ echo '</div>';
46
+
47
+ }
48
+
49
+ echo '</div>';
50
+
51
+ }
52
+
53
+ echo '<div class="clear"></div>';
54
+
55
+ echo $this->field_after();
56
+
57
+ }
58
+
59
+ }
60
+ }
admin/settings/fields/radio/radio.php ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Field: radio
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF_Field_radio' ) ) {
11
+ class CSF_Field_radio extends CSF_Fields {
12
+
13
+ public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
14
+ parent::__construct( $field, $value, $unique, $where, $parent );
15
+ }
16
+
17
+ public function render() {
18
+
19
+ $args = wp_parse_args( $this->field, array(
20
+ 'inline' => false,
21
+ 'query_args' => array(),
22
+ ) );
23
+
24
+ $inline_class = ( $args['inline'] ) ? ' class="csf--inline-list"' : '';
25
+
26
+ echo $this->field_before();
27
+
28
+ if( isset( $this->field['options'] ) ) {
29
+
30
+ $options = $this->field['options'];
31
+ $options = ( is_array( $options ) ) ? $options : array_filter( $this->field_data( $options, false, $args['query_args'] ) );
32
+
33
+ if( is_array( $options ) && ! empty( $options ) ) {
34
+
35
+ echo '<ul'. $inline_class .'>';
36
+ foreach ( $options as $option_key => $option_value ) {
37
+
38
+ if( is_array( $option_value ) && ! empty( $option_value ) ) {
39
+
40
+ echo '<li>';
41
+ echo '<ul>';
42
+ echo '<li><strong>'. $option_key .'</strong></li>';
43
+ foreach( $option_value as $sub_key => $sub_value ) {
44
+ $checked = ( $sub_key == $this->value ) ? ' checked' : '';
45
+ echo '<li><label><input type="radio" name="'. $this->field_name() .'" value="'. $sub_key .'"'. $this->field_attributes() . $checked .'/> '. $sub_value .'</label></li>';
46
+ }
47
+ echo '</ul>';
48
+ echo '</li>';
49
+
50
+ } else {
51
+
52
+ $checked = ( $option_key == $this->value ) ? ' checked' : '';
53
+ echo '<li><label><input type="radio" name="'. $this->field_name() .'" value="'. $option_key .'"'. $this->field_attributes() . $checked .'/> '. $option_value .'</label></li>';
54
+
55
+ }
56
+
57
+ }
58
+ echo '</ul>';
59
+
60
+ } else {
61
+
62
+ echo ( ! empty( $this->field['empty_message'] ) ) ? $this->field['empty_message'] : esc_html__( 'No data provided for this option type.', 'csf' );
63
+
64
+ }
65
+
66
+ } else {
67
+ $label = ( isset( $this->field['label'] ) ) ? $this->field['label'] : '';
68
+ echo '<label><input type="radio" name="'. $this->field_name() .'" value="1"'. $this->field_attributes() . checked( $this->value, 1, false ) .'/> '. $label .'</label>';
69
+ }
70
+
71
+ echo $this->field_after();
72
+
73
+ }
74
+
75
+ }
76
+ }
admin/settings/fields/repeater/repeater.php ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Field: repeater
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF_Field_repeater' ) ) {
11
+ class CSF_Field_repeater extends CSF_Fields {
12
+
13
+ public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
14
+ parent::__construct( $field, $value, $unique, $where, $parent );
15
+ }
16
+
17
+ public function render() {
18
+
19
+ $args = wp_parse_args( $this->field, array(
20
+ 'max' => 0,
21
+ 'min' => 0,
22
+ 'button_title' => '<i class="fa fa-plus-circle"></i>',
23
+ ) );
24
+
25
+ $fields = $this->field['fields'];
26
+ $unique_id = ( ! empty( $this->unique ) ) ? $this->unique : $this->field['id'];
27
+
28
+ if( $this->parent && preg_match( '/'. preg_quote( '['. $this->field['id'] .']' ) .'/', $this->parent ) ) {
29
+
30
+ echo '<div class="csf-notice csf-notice-danger">'. esc_html__( 'Error: Nested field id can not be same with another nested field id.', 'csf' ) .'</div>';
31
+
32
+ } else {
33
+
34
+ echo $this->field_before();
35
+
36
+ echo '<div class="csf-repeater-item csf-repeater-hidden">';
37
+ echo '<div class="csf-repeater-content">';
38
+ foreach ( $fields as $field ) {
39
+
40
+ $field_parent = $this->parent .'['. $this->field['id'] .']';
41
+ $field_default = ( isset( $field['default'] ) ) ? $field['default'] : '';
42
+
43
+ CSF::field( $field, $field_default, '_nonce', 'field/repeater', $field_parent );
44
+
45
+ }
46
+ echo '</div>';
47
+ echo '<div class="csf-repeater-helper">';
48
+ echo '<div class="csf-repeater-helper-inner">';
49
+ echo '<i class="csf-repeater-sort fa fa-arrows"></i>';
50
+ echo '<i class="csf-repeater-clone fa fa-clone"></i>';
51
+ echo '<i class="csf-repeater-remove csf-confirm fa fa-times" data-confirm="'. esc_html__( 'Are you sure to delete this item?', 'csf' ) .'"></i>';
52
+ echo '</div>';
53
+ echo '</div>';
54
+ echo '</div>';
55
+
56
+ echo '<div class="csf-repeater-wrapper csf-data-wrapper" data-unique-id="'. $this->unique .'" data-field-id="['. $this->field['id'] .']" data-max="'. $args['max'] .'" data-min="'. $args['min'] .'">';
57
+
58
+ if( ! empty( $this->value ) ) {
59
+
60
+ $num = 0;
61
+
62
+ foreach ( $this->value as $key => $value ) {
63
+
64
+ echo '<div class="csf-repeater-item">';
65
+
66
+ echo '<div class="csf-repeater-content">';
67
+ foreach ( $fields as $field ) {
68
+
69
+ $field_parent = $this->parent .'['. $this->field['id'] .']';
70
+ $field_unique = ( ! empty( $this->unique ) ) ? $this->unique .'['. $this->field['id'] .']['. $num .']' : $this->field['id'] .'['. $num .']';
71
+ $field_value = ( isset( $field['id'] ) && isset( $this->value[$key][$field['id']] ) ) ? $this->value[$key][$field['id']] : '';
72
+
73
+ CSF::field( $field, $field_value, $field_unique, 'field/repeater', $field_parent );
74
+
75
+ }
76
+ echo '</div>';
77
+
78
+ echo '<div class="csf-repeater-helper">';
79
+ echo '<div class="csf-repeater-helper-inner">';
80
+ echo '<i class="csf-repeater-sort fa fa-arrows"></i>';
81
+ echo '<i class="csf-repeater-clone fa fa-clone"></i>';
82
+ echo '<i class="csf-repeater-remove csf-confirm fa fa-times" data-confirm="'. esc_html__( 'Are you sure to delete this item?', 'csf' ) .'"></i>';
83
+ echo '</div>';
84
+ echo '</div>';
85
+
86
+ echo '</div>';
87
+
88
+ $num++;
89
+
90
+ }
91
+
92
+ }
93
+
94
+ echo '</div>';
95
+
96
+ echo '<div class="csf-repeater-alert csf-repeater-max">'. esc_html__( 'You can not add more than', 'csf' ) .' '. $args['max'] .'</div>';
97
+ echo '<div class="csf-repeater-alert csf-repeater-min">'. esc_html__( 'You can not remove less than', 'csf' ) .' '. $args['min'] .'</div>';
98
+
99
+ echo '<a href="#" class="button button-primary csf-repeater-add">'. $args['button_title'] .'</a>';
100
+
101
+ echo $this->field_after();
102
+
103
+ }
104
+
105
+ }
106
+
107
+ public function enqueue() {
108
+
109
+ if( ! wp_script_is( 'jquery-ui-sortable' ) ) {
110
+ wp_enqueue_script( 'jquery-ui-sortable' );
111
+ }
112
+
113
+ }
114
+
115
+ }
116
+ }
admin/settings/fields/select/select.php ADDED
@@ -0,0 +1,131 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Field: select
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF_Field_select' ) ) {
11
+ class CSF_Field_select extends CSF_Fields {
12
+
13
+ public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
14
+ parent::__construct( $field, $value, $unique, $where, $parent );
15
+ }
16
+
17
+ public function render() {
18
+
19
+ $args = wp_parse_args( $this->field, array(
20
+ 'placeholder' => '',
21
+ 'chosen' => false,
22
+ 'multiple' => false,
23
+ 'sortable' => false,
24
+ 'ajax' => false,
25
+ 'settings' => array(),
26
+ 'query_args' => array(),
27
+ ) );
28
+
29
+ $this->value = ( is_array( $this->value ) ) ? $this->value : array_filter( (array) $this->value );
30
+
31
+ echo $this->field_before();
32
+
33
+ if( isset( $this->field['options'] ) ) {
34
+
35
+ if( ! empty( $args['ajax'] ) ) {
36
+ $args['settings']['data']['type'] = $args['options'];
37
+ $args['settings']['data']['nonce'] = wp_create_nonce( 'csf_chosen_ajax_nonce' );
38
+ if( ! empty( $args['query_args'] ) ) {
39
+ $args['settings']['data']['query_args'] = $args['query_args'];
40
+ }
41
+ }
42
+
43
+ $chosen_rtl = ( is_rtl() ) ? ' chosen-rtl' : '';
44
+ $multiple_name = ( $args['multiple'] ) ? '[]' : '';
45
+ $multiple_attr = ( $args['multiple'] ) ? ' multiple="multiple"' : '';
46
+ $chosen_sortable = ( $args['chosen'] && $args['sortable'] ) ? ' csf-chosen-sortable' : '';
47
+ $chosen_ajax = ( $args['chosen'] && $args['ajax'] ) ? ' csf-chosen-ajax' : '';
48
+ $placeholder_attr = ( $args['chosen'] && $args['placeholder'] ) ? ' data-placeholder="'. $args['placeholder'] .'"' : '';
49
+ $field_class = ( $args['chosen'] ) ? ' class="csf-chosen'. $chosen_rtl . $chosen_sortable . $chosen_ajax .'"' : '';
50
+ $field_name = $this->field_name( $multiple_name );
51
+ $field_attr = $this->field_attributes();
52
+ $maybe_options = $this->field['options'];
53
+ $chosen_data_attr = ( $args['chosen'] && ! empty( $args['settings'] ) ) ? ' data-chosen-settings="'. esc_attr( json_encode( $args['settings'] ) ) .'"' : '';
54
+
55
+ if( is_string( $maybe_options ) && ! empty( $args['chosen'] ) && ! empty( $args['ajax'] ) ) {
56
+ $options = $this->field_wp_query_data_title( $maybe_options, $this->value );
57
+ } else if( is_string( $maybe_options ) ) {
58
+ $options = $this->field_data( $maybe_options, false, $args['query_args'] );
59
+ } else {
60
+ $options = $maybe_options;
61
+ }
62
+
63
+ if( ( is_array( $options ) && ! empty( $options ) ) || ( ! empty( $args['chosen'] ) && ! empty( $args['ajax'] ) ) ) {
64
+
65
+ if( ! empty( $args['chosen'] ) && ! empty( $args['multiple'] ) ) {
66
+
67
+ echo '<select name="'. $field_name .'" class="csf-hidden-select csf-hidden"'. $multiple_attr . $field_attr .'>';
68
+ foreach( $this->value as $option_key ) {
69
+ echo '<option value="'. $option_key .'" selected>'. $option_key .'</option>';
70
+ }
71
+ echo '</select>';
72
+
73
+ $field_name = '_pseudo';
74
+ $field_attr = '';
75
+
76
+ }
77
+
78
+ echo '<select name="'. $field_name .'"'. $field_class . $multiple_attr . $placeholder_attr . $field_attr . $chosen_data_attr .'>';
79
+
80
+ if( $args['placeholder'] && empty( $args['multiple'] ) ) {
81
+ if( ! empty( $args['chosen'] ) ) {
82
+ echo '<option value=""></option>';
83
+ } else {
84
+ echo '<option value="">'. $args['placeholder'] .'</option>';
85
+ }
86
+ }
87
+
88
+ foreach( $options as $option_key => $option ) {
89
+
90
+ if( is_array( $option ) && ! empty( $option ) ) {
91
+
92
+ echo '<optgroup label="'. $option_key .'">';
93
+
94
+ foreach( $option as $sub_key => $sub_value ) {
95
+ $selected = ( in_array( $sub_key, $this->value ) ) ? ' selected' : '';
96
+ echo '<option value="'. $sub_key .'" '. $selected .'>'. $sub_value .'</option>';
97
+ }
98
+
99
+ echo '</optgroup>';
100
+
101
+ } else {
102
+ $selected = ( in_array( $option_key, $this->value ) ) ? ' selected' : '';
103
+ echo '<option value="'. $option_key .'" '. $selected .'>'. $option .'</option>';
104
+ }
105
+
106
+ }
107
+
108
+ echo '</select>';
109
+
110
+ } else {
111
+
112
+ echo ( ! empty( $this->field['empty_message'] ) ) ? $this->field['empty_message'] : esc_html__( 'No data provided for this option type.', 'csf' );
113
+
114
+ }
115
+
116
+ }
117
+
118
+ echo $this->field_after();
119
+
120
+ }
121
+
122
+ public function enqueue() {
123
+
124
+ if( ! wp_script_is( 'jquery-ui-sortable' ) ) {
125
+ wp_enqueue_script( 'jquery-ui-sortable' );
126
+ }
127
+
128
+ }
129
+
130
+ }
131
+ }
admin/settings/fields/slider/slider.php ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Field: slider
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF_Field_slider' ) ) {
11
+ class CSF_Field_slider extends CSF_Fields {
12
+
13
+ public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
14
+ parent::__construct( $field, $value, $unique, $where, $parent );
15
+ }
16
+
17
+ public function render() {
18
+
19
+ $args = wp_parse_args( $this->field, array(
20
+ 'max' => 100,
21
+ 'min' => 0,
22
+ 'step' => 1,
23
+ 'unit' => '',
24
+ ) );
25
+
26
+ $is_unit = ( ! empty( $args['unit'] ) ) ? ' csf--is-unit' : '';
27
+
28
+ echo $this->field_before();
29
+
30
+ echo '<div class="csf--wrap">';
31
+ echo '<div class="csf-slider-ui"></div>';
32
+ echo '<div class="csf--input">';
33
+ echo '<input type="number" name="'. $this->field_name() .'" value="'. $this->value .'"'. $this->field_attributes( array( 'class' => 'csf-input-number'. $is_unit ) ) .' data-max="'. $args['max'] .'" data-min="'. $args['min'] .'" data-step="'. $args['step'] .'" />';
34
+ echo ( ! empty( $args['unit'] ) ) ? '<span class="csf--unit">'. $args['unit'] .'</span>' : '';
35
+ echo '</div>';
36
+ echo '</div>';
37
+
38
+ echo $this->field_after();
39
+
40
+ }
41
+
42
+ public function enqueue() {
43
+
44
+ if( ! wp_script_is( 'jquery-ui-slider' ) ) {
45
+ wp_enqueue_script( 'jquery-ui-slider' );
46
+ }
47
+
48
+ }
49
+
50
+ public function output() {
51
+
52
+ $output = '';
53
+ $elements = ( is_array( $this->field['output'] ) ) ? $this->field['output'] : array_filter( (array) $this->field['output'] );
54
+ $important = ( ! empty( $this->field['output_important'] ) ) ? '!important' : '';
55
+ $mode = ( ! empty( $this->field['output_mode'] ) ) ? $this->field['output_mode'] : 'width';
56
+ $unit = ( ! empty( $this->field['unit'] ) ) ? $this->field['unit'] : 'px';
57
+
58
+ if( ! empty( $elements ) && isset( $this->value ) && $this->value !== '' ) {
59
+ foreach( $elements as $key_property => $element ) {
60
+ if( is_numeric( $key_property ) ) {
61
+ if( $mode ) {
62
+ $output = implode( ',', $elements ) .'{'. $mode .':'. $this->value . $unit . $important .';}';
63
+ }
64
+ break;
65
+ } else {
66
+ $output .= $element .'{'. $key_property .':'. $this->value . $unit . $important .'}';
67
+ }
68
+ }
69
+ }
70
+
71
+ $this->parent->output_css .= $output;
72
+
73
+ return $output;
74
+
75
+ }
76
+
77
+ }
78
+ }
admin/settings/fields/sortable/sortable.php ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Field: sortable
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF_Field_sortable' ) ) {
11
+ class CSF_Field_sortable extends CSF_Fields {
12
+
13
+ public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
14
+ parent::__construct( $field, $value, $unique, $where, $parent );
15
+ }
16
+
17
+ public function render() {
18
+
19
+ echo $this->field_before();
20
+
21
+ echo '<div class="csf--sortable">';
22
+
23
+ $pre_sortby = array();
24
+ $pre_fields = array();
25
+
26
+ // Add array-keys to defined fields for sort by
27
+ foreach( $this->field['fields'] as $key => $field ) {
28
+ $pre_fields[$field['id']] = $field;
29
+ }
30
+
31
+ // Set sort by by saved-value or default-value
32
+ if( ! empty( $this->value ) ) {
33
+
34
+ foreach( $this->value as $key => $value ) {
35
+ $pre_sortby[$key] = $pre_fields[$key];
36
+ }
37
+
38
+ } else {
39
+
40
+ foreach( $pre_fields as $key => $value ) {
41
+ $pre_sortby[$key] = $value;
42
+ }
43
+
44
+ }
45
+
46
+ foreach( $pre_sortby as $key => $field ) {
47
+
48
+ echo '<div class="csf--sortable-item">';
49
+
50
+ echo '<div class="csf--sortable-content">';
51
+
52
+ $field_default = ( isset( $this->field['default'][$key] ) ) ? $this->field['default'][$key] : '';
53
+ $field_value = ( isset( $this->value[$key] ) ) ? $this->value[$key] : $field_default;
54
+ $unique_id = ( ! empty( $this->unique ) ) ? $this->unique .'['. $this->field['id'] .']' : $this->field['id'];
55
+
56
+ CSF::field( $field, $field_value, $unique_id, 'field/sortable' );
57
+
58
+ echo '</div>';
59
+
60
+ echo '<div class="csf--sortable-helper"><i class="fa fa-arrows"></i></div>';
61
+
62
+ echo '</div>';
63
+
64
+ }
65
+
66
+ echo '</div>';
67
+
68
+ echo $this->field_after();
69
+
70
+ }
71
+
72
+ public function enqueue() {
73
+
74
+ if( ! wp_script_is( 'jquery-ui-sortable' ) ) {
75
+ wp_enqueue_script( 'jquery-ui-sortable' );
76
+ }
77
+
78
+ }
79
+
80
+ }
81
+ }
admin/settings/fields/sorter/sorter.php ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Field: sorter
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF_Field_sorter' ) ) {
11
+ class CSF_Field_sorter extends CSF_Fields {
12
+
13
+ public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
14
+ parent::__construct( $field, $value, $unique, $where, $parent );
15
+ }
16
+
17
+ public function render() {
18
+
19
+ $args = wp_parse_args( $this->field, array(
20
+ 'disabled' => true,
21
+ 'enabled_title' => esc_html__( 'Enabled', 'csf' ),
22
+ 'disabled_title' => esc_html__( 'Disabled', 'csf' ),
23
+ ) );
24
+
25
+ echo $this->field_before();
26
+
27
+ $this->value = ( ! empty( $this->value ) ) ? $this->value : $this->field['default'];
28
+ $enabled_options = ( ! empty( $this->value['enabled'] ) ) ? $this->value['enabled'] : array();
29
+ $disabled_options = ( ! empty( $this->value['disabled'] ) ) ? $this->value['disabled'] : array();
30
+
31
+ echo ( $args['disabled'] ) ? '<div class="csf-modules">' : '';
32
+
33
+ echo ( ! empty( $args['enabled_title'] ) ) ? '<div class="csf-sorter-title">'. $args['enabled_title'] .'</div>' : '';
34
+ echo '<ul class="csf-enabled">';
35
+ if( ! empty( $enabled_options ) ) {
36
+ foreach( $enabled_options as $key => $value ) {
37
+ echo '<li><input type="hidden" name="'. $this->field_name( '[enabled]['. $key .']' ) .'" value="'. $value .'"/><label>'. $value .'</label></li>';
38
+ }
39
+ }
40
+ echo '</ul>';
41
+
42
+ // Check for hide/show disabled section
43
+ if( $args['disabled'] ) {
44
+
45
+ echo '</div>';
46
+
47
+ echo '<div class="csf-modules">';
48
+ echo ( ! empty( $args['disabled_title'] ) ) ? '<div class="csf-sorter-title">'. $args['disabled_title'] .'</div>' : '';
49
+ echo '<ul class="csf-disabled">';
50
+ if( ! empty( $disabled_options ) ) {
51
+ foreach( $disabled_options as $key => $value ) {
52
+ echo '<li><input type="hidden" name="'. $this->field_name( '[disabled]['. $key .']' ) .'" value="'. $value .'"/><label>'. $value .'</label></li>';
53
+ }
54
+ }
55
+ echo '</ul>';
56
+ echo '</div>';
57
+
58
+ }
59
+
60
+ echo '<div class="clear"></div>';
61
+
62
+ echo $this->field_after();
63
+
64
+ }
65
+
66
+ public function enqueue() {
67
+
68
+ if( ! wp_script_is( 'jquery-ui-sortable' ) ) {
69
+ wp_enqueue_script( 'jquery-ui-sortable' );
70
+ }
71
+
72
+ }
73
+
74
+ }
75
+ }
admin/settings/fields/spacing/spacing.php ADDED
@@ -0,0 +1,150 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Field: spacing
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF_Field_spacing' ) ) {
11
+ class CSF_Field_spacing extends CSF_Fields {
12
+
13
+ public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
14
+ parent::__construct( $field, $value, $unique, $where, $parent );
15
+ }
16
+
17
+ public function render() {
18
+
19
+ $args = wp_parse_args( $this->field, array(
20
+ 'top_icon' => '<i class="fa fa-long-arrow-up"></i>',
21
+ 'right_icon' => '<i class="fa fa-long-arrow-right"></i>',
22
+ 'bottom_icon' => '<i class="fa fa-long-arrow-down"></i>',
23
+ 'left_icon' => '<i class="fa fa-long-arrow-left"></i>',
24
+ 'all_icon' => '<i class="fa fa-arrows"></i>',
25
+ 'top_placeholder' => esc_html__( 'top', 'csf' ),
26
+ 'right_placeholder' => esc_html__( 'right', 'csf' ),
27
+ 'bottom_placeholder' => esc_html__( 'bottom', 'csf' ),
28
+ 'left_placeholder' => esc_html__( 'left', 'csf' ),
29
+ 'all_placeholder' => esc_html__( 'all', 'csf' ),
30
+ 'top' => true,
31
+ 'left' => true,
32
+ 'bottom' => true,
33
+ 'right' => true,
34
+ 'unit' => true,
35
+ 'show_units' => true,
36
+ 'all' => false,
37
+ 'units' => array( 'px', '%', 'em' )
38
+ ) );
39
+
40
+ $default_values = array(
41
+ 'top' => '',
42
+ 'right' => '',
43
+ 'bottom' => '',
44
+ 'left' => '',
45
+ 'all' => '',
46
+ 'unit' => 'px',
47
+ );
48
+
49
+ $value = wp_parse_args( $this->value, $default_values );
50
+ $unit = ( count( $args['units'] ) === 1 && ! empty( $args['unit'] ) ) ? $args['units'][0] : '';
51
+ $is_unit = ( ! empty( $unit ) ) ? ' csf--is-unit' : '';
52
+
53
+ echo $this->field_before();
54
+
55
+ echo '<div class="csf--inputs">';
56
+
57
+ if( ! empty( $args['all'] ) ) {
58
+
59
+ $placeholder = ( ! empty( $args['all_placeholder'] ) ) ? ' placeholder="'. $args['all_placeholder'] .'"' : '';
60
+
61
+ echo '<div class="csf--input">';
62
+ echo ( ! empty( $args['all_icon'] ) ) ? '<span class="csf--label csf--icon">'. $args['all_icon'] .'</span>' : '';
63
+ echo '<input type="number" name="'. $this->field_name('[all]') .'" value="'. $value['all'] .'"'. $placeholder .' class="csf-input-number'. $is_unit .'" />';
64
+ echo ( $unit ) ? '<span class="csf--label csf--unit">'. $args['units'][0] .'</span>' : '';
65
+ echo '</div>';
66
+
67
+ } else {
68
+
69
+ $properties = array();
70
+
71
+ foreach ( array( 'top', 'right', 'bottom', 'left' ) as $prop ) {
72
+ if( ! empty( $args[$prop] ) ) {
73
+ $properties[] = $prop;
74
+ }
75
+ }
76
+
77
+ $properties = ( $properties === array( 'right', 'left' ) ) ? array_reverse( $properties ) : $properties;
78
+
79
+ foreach( $properties as $property ) {
80
+
81
+ $placeholder = ( ! empty( $args[$property.'_placeholder'] ) ) ? ' placeholder="'. $args[$property.'_placeholder'] .'"' : '';
82
+
83
+ echo '<div class="csf--input">';
84
+ echo ( ! empty( $args[$property.'_icon'] ) ) ? '<span class="csf--label csf--icon">'. $args[$property.'_icon'] .'</span>' : '';
85
+ echo '<input type="number" name="'. $this->field_name('['. $property .']') .'" value="'. $value[$property] .'"'. $placeholder .' class="csf-input-number'. $is_unit .'" />';
86
+ echo ( $unit ) ? '<span class="csf--label csf--unit">'. $args['units'][0] .'</span>' : '';
87
+ echo '</div>';
88
+
89
+ }
90
+
91
+ }
92
+
93
+ if( ! empty( $args['unit'] ) && ! empty( $args['show_units'] ) && count( $args['units'] ) > 1 ) {
94
+ echo '<div class="csf--input">';
95
+ echo '<select name="'. $this->field_name('[unit]') .'">';
96
+ foreach( $args['units'] as $unit ) {
97
+ $selected = ( $value['unit'] === $unit ) ? ' selected' : '';
98
+ echo '<option value="'. $unit .'"'. $selected .'>'. $unit .'</option>';
99
+ }
100
+ echo '</select>';
101
+ echo '</div>';
102
+ }
103
+
104
+ echo '</div>';
105
+
106
+ echo $this->field_after();
107
+
108
+ }
109
+
110
+ public function output() {
111
+
112
+ $output = '';
113
+ $element = ( is_array( $this->field['output'] ) ) ? join( ',', $this->field['output'] ) : $this->field['output'];
114
+ $important = ( ! empty( $this->field['output_important'] ) ) ? '!important' : '';
115
+ $unit = ( ! empty( $this->value['unit'] ) ) ? $this->value['unit'] : 'px';
116
+
117
+ $mode = ( ! empty( $this->field['output_mode'] ) ) ? $this->field['output_mode'] : 'padding';
118
+ $mode = ( $mode === 'relative' || $mode === 'absolute' || $mode === 'none' ) ? '' : $mode;
119
+ $mode = ( ! empty( $mode ) ) ? $mode .'-' : '';
120
+
121
+ if( ! empty( $this->field['all'] ) && isset( $this->value['all'] ) && $this->value['all'] !== '' ) {
122
+
123
+ $output = $element .'{';
124
+ $output .= $mode .'top:'. $this->value['all'] . $unit . $important .';';
125
+ $output .= $mode .'right:'. $this->value['all'] . $unit . $important .';';
126
+ $output .= $mode .'bottom:'. $this->value['all'] . $unit . $important .';';
127
+ $output .= $mode .'left:'. $this->value['all'] . $unit . $important .';';
128
+ $output .= '}';
129
+
130
+ } else {
131
+
132
+ $top = ( isset( $this->value['top'] ) && $this->value['top'] !== '' ) ? $mode .'top:'. $this->value['top'] . $unit . $important .';' : '';
133
+ $right = ( isset( $this->value['right'] ) && $this->value['right'] !== '' ) ? $mode .'right:'. $this->value['right'] . $unit . $important .';' : '';
134
+ $bottom = ( isset( $this->value['bottom'] ) && $this->value['bottom'] !== '' ) ? $mode .'bottom:'. $this->value['bottom'] . $unit . $important .';' : '';
135
+ $left = ( isset( $this->value['left'] ) && $this->value['left'] !== '' ) ? $mode .'left:'. $this->value['left'] . $unit . $important .';' : '';
136
+
137
+ if( $top !== '' || $right !== '' || $bottom !== '' || $left !== '' ) {
138
+ $output = $element .'{'. $top . $right . $bottom . $left .'}';
139
+ }
140
+
141
+ }
142
+
143
+ $this->parent->output_css .= $output;
144
+
145
+ return $output;
146
+
147
+ }
148
+
149
+ }
150
+ }
admin/settings/fields/spinner/spinner.php ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Field: spinner
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF_Field_spinner' ) ) {
11
+ class CSF_Field_spinner extends CSF_Fields {
12
+
13
+ public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
14
+ parent::__construct( $field, $value, $unique, $where, $parent );
15
+ }
16
+
17
+ public function render() {
18
+
19
+ $args = wp_parse_args( $this->field, array(
20
+ 'max' => 100,
21
+ 'min' => 0,
22
+ 'step' => 1,
23
+ 'unit' => '',
24
+ ) );
25
+
26
+ echo $this->field_before();
27
+ echo '<div class="csf--spin"><input type="number" name="'. $this->field_name() .'" value="'. $this->value .'"'. $this->field_attributes( array( 'class' => 'csf-input-number' ) ) .' data-max="'. $args['max'] .'" data-min="'. $args['min'] .'" data-step="'. $args['step'] .'" data-unit="'. $args['unit'] .'"/></div>';
28
+ echo $this->field_after();
29
+
30
+ }
31
+
32
+ public function enqueue() {
33
+
34
+ if( ! wp_script_is( 'jquery-ui-spinner' ) ) {
35
+ wp_enqueue_script( 'jquery-ui-spinner' );
36
+ }
37
+
38
+ }
39
+
40
+ public function output() {
41
+
42
+ $output = '';
43
+ $elements = ( is_array( $this->field['output'] ) ) ? $this->field['output'] : array_filter( (array) $this->field['output'] );
44
+ $important = ( ! empty( $this->field['output_important'] ) ) ? '!important' : '';
45
+ $mode = ( ! empty( $this->field['output_mode'] ) ) ? $this->field['output_mode'] : 'width';
46
+ $unit = ( ! empty( $this->field['unit'] ) ) ? $this->field['unit'] : 'px';
47
+
48
+ if( ! empty( $elements ) && isset( $this->value ) && $this->value !== '' ) {
49
+ foreach( $elements as $key_property => $element ) {
50
+ if( is_numeric( $key_property ) ) {
51
+ if( $mode ) {
52
+ $output = implode( ',', $elements ) .'{'. $mode .':'. $this->value . $unit . $important .';}';
53
+ }
54
+ break;
55
+ } else {
56
+ $output .= $element .'{'. $key_property .':'. $this->value . $unit . $important .'}';
57
+ }
58
+ }
59
+ }
60
+
61
+ $this->parent->output_css .= $output;
62
+
63
+ return $output;
64
+
65
+ }
66
+
67
+ }
68
+ }
admin/settings/fields/subheading/subheading.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Field: subheading
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF_Field_subheading' ) ) {
11
+ class CSF_Field_subheading extends CSF_Fields {
12
+
13
+ public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
14
+ parent::__construct( $field, $value, $unique, $where, $parent );
15
+ }
16
+
17
+ public function render() {
18
+
19
+ echo ( ! empty( $this->field['content'] ) ) ? $this->field['content'] : '';
20
+
21
+ }
22
+
23
+ }
24
+ }
admin/settings/fields/submessage/submessage.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Field: submessage
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF_Field_submessage' ) ) {
11
+ class CSF_Field_submessage extends CSF_Fields {
12
+
13
+ public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
14
+ parent::__construct( $field, $value, $unique, $where, $parent );
15
+ }
16
+
17
+ public function render() {
18
+
19
+ $style = ( ! empty( $this->field['style'] ) ) ? $this->field['style'] : 'normal';
20
+
21
+ echo '<div class="csf-submessage csf-submessage-'. $style .'">'. $this->field['content'] .'</div>';
22
+
23
+ }
24
+
25
+ }
26
+ }
admin/settings/fields/switcher/switcher.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Field: switcher
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF_Field_switcher' ) ) {
11
+ class CSF_Field_switcher extends CSF_Fields {
12
+
13
+ public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
14
+ parent::__construct( $field, $value, $unique, $where, $parent );
15
+ }
16
+
17
+ public function render() {
18
+
19
+ $active = ( ! empty( $this->value ) ) ? ' csf--active' : '';
20
+ $text_on = ( ! empty( $this->field['text_on'] ) ) ? $this->field['text_on'] : esc_html__( 'On', 'csf' );
21
+ $text_off = ( ! empty( $this->field['text_off'] ) ) ? $this->field['text_off'] : esc_html__( 'Off', 'csf' );
22
+ $text_width = ( ! empty( $this->field['text_width'] ) ) ? ' style="width: '. $this->field['text_width'] .'px;"': '';
23
+
24
+ echo $this->field_before();
25
+
26
+ echo '<div class="csf--switcher'. $active .'"'. $text_width .'>';
27
+ echo '<span class="csf--on">'. $text_on .'</span>';
28
+ echo '<span class="csf--off">'. $text_off .'</span>';
29
+ echo '<span class="csf--ball"></span>';
30
+ echo '<input type="text" name="'. $this->field_name() .'" value="'. $this->value .'"'. $this->field_attributes() .' />';
31
+ echo '</div>';
32
+
33
+ echo ( ! empty( $this->field['label'] ) ) ? '<span class="csf--label">'. $this->field['label'] . '</span>' : '';
34
+
35
+ echo '<div class="clear"></div>';
36
+
37
+ echo $this->field_after();
38
+
39
+ }
40
+
41
+ }
42
+ }
admin/settings/fields/tabbed/tabbed.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Field: tabbed
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF_Field_tabbed' ) ) {
11
+ class CSF_Field_tabbed extends CSF_Fields {
12
+
13
+ public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
14
+ parent::__construct( $field, $value, $unique, $where, $parent );
15
+ }
16
+
17
+ public function render() {
18
+
19
+ $unallows = array( 'tabbed' );
20
+
21
+ echo $this->field_before();
22
+
23
+ echo '<div class="csf-tabbed-nav">';
24
+ foreach ( $this->field['tabs'] as $key => $tab ) {
25
+
26
+ $tabbed_icon = ( ! empty( $tab['icon'] ) ) ? '<i class="csf--icon '. $tab['icon'] .'"></i>' : '';
27
+ $tabbed_active = ( empty( $key ) ) ? ' class="csf-tabbed-active"' : '';
28
+
29
+ echo '<a href="#"'. $tabbed_active .'>'. $tabbed_icon . $tab['title'] .'</a>';
30
+
31
+ }
32
+ echo '</div>';
33
+
34
+ echo '<div class="csf-tabbed-sections">';
35
+ foreach ( $this->field['tabs'] as $key => $tab ) {
36
+
37
+ $tabbed_hidden = ( ! empty( $key ) ) ? ' hidden' : '';
38
+
39
+ echo '<div class="csf-tabbed-section'. $tabbed_hidden .'">';
40
+
41
+ foreach ( $tab['fields'] as $field ) {
42
+
43
+ if( in_array( $field['type'], $unallows ) ) { $field['_notice'] = true; }
44
+
45
+ $field_id = ( isset( $field['id'] ) ) ? $field['id'] : '';
46
+ $field_default = ( isset( $field['default'] ) ) ? $field['default'] : '';
47
+ $field_value = ( isset( $this->value[$field_id] ) ) ? $this->value[$field_id] : $field_default;
48
+ $unique_id = ( ! empty( $this->unique ) ) ? $this->unique .'['. $this->field['id'] .']' : $this->field['id'];
49
+
50
+ CSF::field( $field, $field_value, $unique_id, 'field/tabbed' );
51
+
52
+ }
53
+
54
+ echo '</div>';
55
+
56
+ }
57
+ echo '</div>';
58
+
59
+ echo $this->field_after();
60
+
61
+ }
62
+
63
+ }
64
+ }
admin/settings/fields/text/text.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Field: text
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF_Field_text' ) ) {
11
+ class CSF_Field_text extends CSF_Fields {
12
+
13
+ public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
14
+ parent::__construct( $field, $value, $unique, $where, $parent );
15
+ }
16
+
17
+ public function render() {
18
+
19
+ $type = ( ! empty( $this->field['attributes']['type'] ) ) ? $this->field['attributes']['type'] : 'text';
20
+
21
+ echo $this->field_before();
22
+
23
+ echo '<input type="'. $type .'" name="'. $this->field_name() .'" value="'. $this->value .'"'. $this->field_attributes() .' />';
24
+
25
+ echo $this->field_after();
26
+
27
+ }
28
+
29
+ }
30
+ }
admin/settings/fields/textarea/textarea.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Field: textarea
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF_Field_textarea' ) ) {
11
+ class CSF_Field_textarea extends CSF_Fields {
12
+
13
+ public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
14
+ parent::__construct( $field, $value, $unique, $where, $parent );
15
+ }
16
+
17
+ public function render() {
18
+
19
+ echo $this->field_before();
20
+ echo $this->shortcoder();
21
+ echo '<textarea name="'. $this->field_name() .'"'. $this->field_attributes() .'>'. $this->value .'</textarea>';
22
+ echo $this->field_after();
23
+
24
+ }
25
+
26
+ public function shortcoder() {
27
+
28
+ if( ! empty( $this->field['shortcoder'] ) ) {
29
+
30
+ $shortcoders = ( is_array( $this->field['shortcoder'] ) ) ? $this->field['shortcoder'] : array_filter( (array) $this->field['shortcoder'] );
31
+
32
+ foreach( $shortcoders as $shortcode_id ) {
33
+
34
+ if( isset( CSF::$args['shortcoders'][$shortcode_id] ) ) {
35
+
36
+ $setup_args = CSF::$args['shortcoders'][$shortcode_id];
37
+ $button_title = ( ! empty( $setup_args['button_title'] ) ) ? $setup_args['button_title'] : esc_html__( 'Add Shortcode', 'csf' );
38
+
39
+ echo '<a href="#" class="button button-primary csf-shortcode-button" data-modal-id="'. $shortcode_id .'">'. $button_title .'</a>';
40
+
41
+ }
42
+
43
+ }
44
+
45
+ }
46
+
47
+ }
48
+ }
49
+ }
admin/settings/fields/typography/google-fonts.php ADDED
@@ -0,0 +1,981 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+
3
+ if( ! function_exists( 'csf_get_google_fonts' ) ) {
4
+ function csf_get_google_fonts() {
5
+ return [
6
+ 'ABeeZee'=>[['normal','italic'],['latin']],
7
+ 'Abel'=>[['normal'],['latin']],
8
+ 'Abhaya Libre'=>[['normal','500','600','700','800'],['latin-ext','latin','sinhala']],
9
+ 'Abril Fatface'=>[['normal'],['latin-ext','latin']],
10
+ 'Aclonica'=>[['normal'],['latin']],
11
+ 'Acme'=>[['normal'],['latin']],
12
+ 'Actor'=>[['normal'],['latin']],
13
+ 'Adamina'=>[['normal'],['latin']],
14
+ 'Advent Pro'=>[['100','200','300','normal','500','600','700'],['latin-ext','greek','latin']],
15
+ 'Aguafina Script'=>[['normal'],['latin-ext','latin']],
16
+ 'Akronim'=>[['normal'],['latin-ext','latin']],
17
+ 'Aladin'=>[['normal'],['latin-ext','latin']],
18
+ 'Alata'=>[['normal'],['latin-ext','latin','vietnamese']],
19
+ 'Alatsi'=>[['normal'],['latin-ext','latin','vietnamese']],
20
+ 'Aldrich'=>[['normal'],['latin']],
21
+ 'Alef'=>[['normal','700'],['hebrew','latin']],
22
+ 'Alegreya'=>[['normal','italic','500','500italic','700','700italic','800','800italic','900','900italic'],['cyrillic-ext','cyrillic','greek-ext','latin-ext','greek','latin','vietnamese']],
23
+ 'Alegreya SC'=>[['normal','italic','500','500italic','700','700italic','800','800italic','900','900italic'],['cyrillic-ext','cyrillic','greek-ext','latin-ext','greek','latin','vietnamese']],
24
+ 'Alegreya Sans'=>[['100','100italic','300','300italic','normal','italic','500','500italic','700','700italic','800','800italic','900','900italic'],['cyrillic-ext','cyrillic','greek-ext','latin-ext','greek','latin','vietnamese']],
25
+ 'Alegreya Sans SC'=>[['100','100italic','300','300italic','normal','italic','500','500italic','700','700italic','800','800italic','900','900italic'],['cyrillic-ext','cyrillic','greek-ext','latin-ext','greek','latin','vietnamese']],
26
+ 'Aleo'=>[['300','300italic','normal','italic','700','700italic'],['latin-ext','latin']],
27
+ 'Alex Brush'=>[['normal'],['latin-ext','latin']],
28
+ 'Alfa Slab One'=>[['normal'],['latin-ext','latin','vietnamese']],
29
+ 'Alice'=>[['normal'],['cyrillic-ext','cyrillic','latin']],
30
+ 'Alike'=>[['normal'],['latin']],
31
+ 'Alike Angular'=>[['normal'],['latin']],
32
+ 'Allan'=>[['normal','700'],['latin-ext','latin']],
33
+ 'Allerta'=>[['normal'],['latin']],
34
+ 'Allerta Stencil'=>[['normal'],['latin']],
35
+ 'Allura'=>[['normal'],['latin-ext','latin']],
36
+ 'Almarai'=>[['300','normal','700','800'],['arabic']],
37
+ 'Almendra'=>[['normal','italic','700','700italic'],['latin-ext','latin']],
38
+ 'Almendra Display'=>[['normal'],['latin-ext','latin']],
39
+ 'Almendra SC'=>[['normal'],['latin']],
40
+ 'Amarante'=>[['normal'],['latin-ext','latin']],
41
+ 'Amaranth'=>[['normal','italic','700','700italic'],['latin']],
42
+ 'Amatic SC'=>[['normal','700'],['cyrillic','latin-ext','hebrew','latin','vietnamese']],
43
+ 'Amethysta'=>[['normal'],['latin']],
44
+ 'Amiko'=>[['normal','600','700'],['latin-ext','devanagari','latin']],
45
+ 'Amiri'=>[['normal','italic','700','700italic'],['arabic','latin-ext','latin']],
46
+ 'Amita'=>[['normal','700'],['latin-ext','devanagari','latin']],
47
+ 'Anaheim'=>[['normal'],['latin-ext','latin']],
48
+ 'Andada'=>[['normal'],['latin-ext','latin']],
49
+ 'Andika'=>[['normal'],['cyrillic-ext','cyrillic','latin-ext','latin','vietnamese']],
50
+ 'Angkor'=>[['normal'],['khmer']],
51
+ 'Annie Use Your Telescope'=>[['normal'],['latin']],
52
+ 'Anonymous Pro'=>[['normal','italic','700','700italic'],['cyrillic','latin-ext','greek','latin']],
53
+ 'Antic'=>[['normal'],['latin']],
54
+ 'Antic Didone'=>[['normal'],['latin']],
55
+ 'Antic Slab'=>[['normal'],['latin']],
56
+ 'Anton'=>[['normal'],['latin-ext','latin','vietnamese']],
57
+ 'Arapey'=>[['normal','italic'],['latin']],
58
+ 'Arbutus'=>[['normal'],['latin-ext','latin']],
59
+ 'Arbutus Slab'=>[['normal'],['latin-ext','latin']],
60
+ 'Architects Daughter'=>[['normal'],['latin']],
61
+ 'Archivo'=>[['normal','italic','500','500italic','600','600italic','700','700italic'],['latin-ext','latin','vietnamese']],
62
+ 'Archivo Black'=>[['normal'],['latin-ext','latin']],
63
+ 'Archivo Narrow'=>[['normal','italic','500','500italic','600','600italic','700','700italic'],['latin-ext','latin','vietnamese']],
64
+ 'Aref Ruqaa'=>[['normal','700'],['arabic','latin']],
65
+ 'Arima Madurai'=>[['100','200','300','normal','500','700','800','900'],['latin-ext','latin','vietnamese','tamil']],
66
+ 'Arimo'=>[['normal','italic','700','700italic'],['cyrillic-ext','cyrillic','greek-ext','latin-ext','hebrew','greek','latin','vietnamese']],
67
+ 'Arizonia'=>[['normal'],['latin-ext','latin']],
68
+ 'Armata'=>[['normal'],['latin-ext','latin']],
69
+ 'Arsenal'=>[['normal','italic','700','700italic'],['cyrillic-ext','cyrillic','latin-ext','latin','vietnamese']],
70
+ 'Artifika'=>[['normal'],['latin']],
71
+ 'Arvo'=>[['normal','italic','700','700italic'],['latin']],
72
+ 'Arya'=>[['normal','700'],['latin-ext','devanagari','latin']],
73
+ 'Asap'=>[['normal','italic','500','500italic','600','600italic','700','700italic'],['latin-ext','latin','vietnamese']],
74
+ 'Asap Condensed'=>[['normal','italic','500','500italic','600','600italic','700','700italic'],['latin-ext','latin','vietnamese']],
75
+ 'Asar'=>[['normal'],['latin-ext','devanagari','latin']],
76
+ 'Asset'=>[['normal'],['latin']],
77
+ 'Assistant'=>[['200','300','normal','600','700','800'],['hebrew','latin']],
78
+ 'Astloch'=>[['normal','700'],['latin']],
79
+ 'Asul'=>[['normal','700'],['latin']],
80
+ 'Athiti'=>[['200','300','normal','500','600','700'],['latin-ext','latin','thai','vietnamese']],
81
+ 'Atma'=>[['300','normal','500','600','700'],['bengali','latin-ext','latin']],
82
+ 'Atomic Age'=>[['normal'],['latin']],
83
+ 'Aubrey'=>[['normal'],['latin']],
84
+ 'Audiowide'=>[['normal'],['latin-ext','latin']],
85
+ 'Autour One'=>[['normal'],['latin-ext','latin']],
86
+ 'Average'=>[['normal'],['latin-ext','latin']],
87
+ 'Average Sans'=>[['normal'],['latin-ext','latin']],
88
+ 'Averia Gruesa Libre'=>[['normal'],['latin-ext','latin']],
89
+ 'Averia Libre'=>[['300','300italic','normal','italic','700','700italic'],['latin']],
90
+ 'Averia Sans Libre'=>[['300','300italic','normal','italic','700','700italic'],['latin']],
91
+ 'Averia Serif Libre'=>[['300','300italic','normal','italic','700','700italic'],['latin']],
92
+ 'B612'=>[['normal','italic','700','700italic'],['latin']],
93
+ 'B612 Mono'=>[['normal','italic','700','700italic'],['latin']],
94
+ 'Bad Script'=>[['normal'],['cyrillic','latin']],
95
+ 'Bahiana'=>[['normal'],['latin-ext','latin']],
96
+ 'Bahianita'=>[['normal'],['latin-ext','latin','vietnamese']],
97
+ 'Bai Jamjuree'=>[['200','200italic','300','300italic','normal','italic','500','500italic','600','600italic','700','700italic'],['latin-ext','latin','thai','vietnamese']],
98
+ 'Baloo'=>[['normal'],['latin-ext','devanagari','latin','vietnamese']],
99
+ 'Baloo Bhai'=>[['normal'],['latin-ext','latin','vietnamese','gujarati']],
100
+ 'Baloo Bhaijaan'=>[['normal'],['arabic','latin-ext','latin','vietnamese']],
101
+ 'Baloo Bhaina'=>[['normal'],['latin-ext','latin','vietnamese','oriya']],
102
+ 'Baloo Chettan'=>[['normal'],['malayalam','latin-ext','latin','vietnamese']],
103
+ 'Baloo Da'=>[['normal'],['bengali','latin-ext','latin','vietnamese']],
104
+ 'Baloo Paaji'=>[['normal'],['latin-ext','latin','vietnamese','gurmukhi']],
105
+ 'Baloo Tamma'=>[['normal'],['latin-ext','kannada','latin','vietnamese']],
106
+ 'Baloo Tammudu'=>[['normal'],['telugu','latin-ext','latin','vietnamese']],
107
+ 'Baloo Thambi'=>[['normal'],['latin-ext','latin','vietnamese','tamil']],
108
+ 'Balthazar'=>[['normal'],['latin']],
109
+ 'Bangers'=>[['normal'],['latin-ext','latin','vietnamese']],
110
+ 'Barlow'=>[['100','100italic','200','200italic','300','300italic','normal','italic','500','500italic','600','600italic','700','700italic','800','800italic','900','900italic'],['latin-ext','latin','vietnamese']],
111
+ 'Barlow Condensed'=>[['100','100italic','200','200italic','300','300italic','normal','italic','500','500italic','600','600italic','700','700italic','800','800italic','900','900italic'],['latin-ext','latin','vietnamese']],
112
+ 'Barlow Semi Condensed'=>[['100','100italic','200','200italic','300','300italic','normal','italic','500','500italic','600','600italic','700','700italic','800','800italic','900','900italic'],['latin-ext','latin','vietnamese']],
113
+ 'Barriecito'=>[['normal'],['latin-ext','latin','vietnamese']],
114
+ 'Barrio'=>[['normal'],['latin-ext','latin']],
115
+ 'Basic'=>[['normal'],['latin-ext','latin']],
116
+ 'Baskervville'=>[['normal','italic'],['latin-ext','latin']],
117
+ 'Battambang'=>[['normal','700'],['khmer']],
118
+ 'Baumans'=>[['normal'],['latin']],
119
+ 'Bayon'=>[['normal'],['khmer']],
120
+ 'Be Vietnam'=>[['100','100italic','300','300italic','normal','italic','500','500italic','600','600italic','700','700italic','800','800italic'],['latin-ext','latin','vietnamese']],
121
+ 'Bebas Neue'=>[['normal'],['latin-ext','latin']],
122
+ 'Belgrano'=>[['normal'],['latin']],
123
+ 'Bellefair'=>[['normal'],['latin-ext','hebrew','latin']],
124
+ 'Belleza'=>[['normal'],['latin-ext','latin']],
125
+ 'BenchNine'=>[['300','normal','700'],['latin-ext','latin']],
126
+ 'Bentham'=>[['normal'],['latin']],
127
+ 'Berkshire Swash'=>[['normal'],['latin-ext','latin']],
128
+ 'Beth Ellen'=>[['normal'],['latin']],
129
+ 'Bevan'=>[['normal'],['latin-ext','latin','vietnamese']],
130
+ 'Big Shoulders Display'=>[['100','300','normal','500','600','700','800','900'],['latin-ext','latin','vietnamese']],
131
+ 'Big Shoulders Text'=>[['100','300','normal','500','600','700','800','900'],['latin-ext','latin','vietnamese']],
132
+ 'Bigelow Rules'=>[['normal'],['latin-ext','latin']],
133
+ 'Bigshot One'=>[['normal'],['latin']],
134
+ 'Bilbo'=>[['normal'],['latin-ext','latin']],
135
+ 'Bilbo Swash Caps'=>[['normal'],['latin-ext','latin']],
136
+ 'BioRhyme'=>[['200','300','normal','700','800'],['latin-ext','latin']],
137
+ 'BioRhyme Expanded'=>[['200','300','normal','700','800'],['latin-ext','latin']],
138
+ 'Biryani'=>[['200','300','normal','600','700','800','900'],['latin-ext','devanagari','latin']],
139
+ 'Bitter'=>[['normal','italic','700'],['latin-ext','latin']],
140
+ 'Black And White Picture'=>[['normal'],['korean','latin']],
141
+ 'Black Han Sans'=>[['normal'],['korean','latin']],
142
+ 'Black Ops One'=>[['normal'],['latin-ext','latin']],
143
+ 'Blinker'=>[['100','200','300','normal','600','700','800','900'],['latin-ext','latin']],
144
+ 'Bokor'=>[['normal'],['khmer']],
145
+ 'Bonbon'=>[['normal'],['latin']],
146
+ 'Boogaloo'=>[['normal'],['latin']],
147
+ 'Bowlby One'=>[['normal'],['latin']],
148
+ 'Bowlby One SC'=>[['normal'],['latin-ext','latin']],
149
+ 'Brawler'=>[['normal'],['latin']],
150
+ 'Bree Serif'=>[['normal'],['latin-ext','latin']],
151
+ 'Bubblegum Sans'=>[['normal'],['latin-ext','latin']],
152
+ 'Bubbler One'=>[['normal'],['latin-ext','latin']],
153
+ 'Buda'=>[['300'],['latin']],
154
+ 'Buenard'=>[['normal','700'],['latin-ext','latin']],
155
+ 'Bungee'=>[['normal'],['latin-ext','latin','vietnamese']],
156
+ 'Bungee Hairline'=>[['normal'],['latin-ext','latin','vietnamese']],
157
+ 'Bungee Inline'=>[['normal'],['latin-ext','latin','vietnamese']],
158
+ 'Bungee Outline'=>[['normal'],['latin-ext','latin','vietnamese']],
159
+ 'Bungee Shade'=>[['normal'],['latin-ext','latin','vietnamese']],
160
+ 'Butcherman'=>[['normal'],['latin-ext','latin']],
161
+ 'Butterfly Kids'=>[['normal'],['latin-ext','latin']],
162
+ 'Cabin'=>[['normal','italic','500','500italic','600','600italic','700','700italic'],['latin-ext','latin','vietnamese']],
163
+ 'Cabin Condensed'=>[['normal','500','600','700'],['latin-ext','latin','vietnamese']],
164
+ 'Cabin Sketch'=>[['normal','700'],['latin']],
165
+ 'Caesar Dressing'=>[['normal'],['latin']],
166
+ 'Cagliostro'=>[['normal'],['latin']],
167
+ 'Cairo'=>[['200','300','normal','600','700','900'],['arabic','latin-ext','latin']],
168
+ 'Calistoga'=>[['normal'],['latin-ext','latin','vietnamese']],
169
+ 'Calligraffitti'=>[['normal'],['latin']],
170
+ 'Cambay'=>[['normal','italic','700','700italic'],['latin-ext','devanagari','latin']],
171
+ 'Cambo'=>[['normal'],['latin']],
172
+ 'Candal'=>[['normal'],['latin']],
173
+ 'Cantarell'=>[['normal','italic','700','700italic'],['latin']],
174
+ 'Cantata One'=>[['normal'],['latin-ext','latin']],
175
+ 'Cantora One'=>[['normal'],['latin-ext','latin']],
176
+ 'Capriola'=>[['normal'],['latin-ext','latin']],
177
+ 'Cardo'=>[['normal','italic','700'],['greek-ext','latin-ext','greek','latin']],
178
+ 'Carme'=>[['normal'],['latin']],
179
+ 'Carrois Gothic'=>[['normal'],['latin']],
180
+ 'Carrois Gothic SC'=>[['normal'],['latin']],
181
+ 'Carter One'=>[['normal'],['latin']],
182
+ 'Catamaran'=>[['100','200','300','normal','500','600','700','800','900'],['latin-ext','latin','tamil']],
183
+ 'Caudex'=>[['normal','italic','700','700italic'],['greek-ext','latin-ext','greek','latin']],
184
+ 'Caveat'=>[['normal','700'],['cyrillic-ext','cyrillic','latin-ext','latin']],
185
+ 'Caveat Brush'=>[['normal'],['latin-ext','latin']],
186
+ 'Cedarville Cursive'=>[['normal'],['latin']],
187
+ 'Ceviche One'=>[['normal'],['latin-ext','latin']],
188
+ 'Chakra Petch'=>[['300','300italic','normal','italic','500','500italic','600','600italic','700','700italic'],['latin-ext','latin','thai','vietnamese']],
189
+ 'Changa'=>[['200','300','normal','500','600','700','800'],['arabic','latin-ext','latin']],
190
+ 'Changa One'=>[['normal','italic'],['latin']],
191
+ 'Chango'=>[['normal'],['latin-ext','latin']],
192
+ 'Charm'=>[['normal','700'],['latin-ext','latin','thai','vietnamese']],
193
+ 'Charmonman'=>[['normal','700'],['latin-ext','latin','thai','vietnamese']],
194
+ 'Chathura'=>[['100','300','normal','700','800'],['telugu','latin']],
195
+ 'Chau Philomene One'=>[['normal','italic'],['latin-ext','latin']],
196
+ 'Chela One'=>[['normal'],['latin-ext','latin']],
197
+ 'Chelsea Market'=>[['normal'],['latin-ext','latin']],
198
+ 'Chenla'=>[['normal'],['khmer']],
199
+ 'Cherry Cream Soda'=>[['normal'],['latin']],
200
+ 'Cherry Swash'=>[['normal','700'],['latin-ext','latin']],
201
+ 'Chewy'=>[['normal'],['latin']],
202
+ 'Chicle'=>[['normal'],['latin-ext','latin']],
203
+ 'Chilanka'=>[['normal'],['malayalam','latin']],
204
+ 'Chivo'=>[['300','300italic','normal','italic','700','700italic','900','900italic'],['latin-ext','latin']],
205
+ 'Chonburi'=>[['normal'],['latin-ext','latin','thai','vietnamese']],
206
+ 'Cinzel'=>[['normal','700','900'],['latin-ext','latin']],
207
+ 'Cinzel Decorative'=>[['normal','700','900'],['latin']],
208
+ 'Clicker Script'=>[['normal'],['latin-ext','latin']],
209
+ 'Coda'=>[['normal','800'],['latin-ext','latin']],
210
+ 'Coda Caption'=>[['800'],['latin-ext','latin']],
211
+ 'Codystar'=>[['300','normal'],['latin-ext','latin']],
212
+ 'Coiny'=>[['normal'],['latin-ext','latin','vietnamese','tamil']],
213
+ 'Combo'=>[['normal'],['latin-ext','latin']],
214
+ 'Comfortaa'=>[['300','normal','500','600','700'],['cyrillic-ext','cyrillic','latin-ext','greek','latin','vietnamese']],
215
+ 'Coming Soon'=>[['normal'],['latin']],
216
+ 'Concert One'=>[['normal'],['latin-ext','latin']],
217
+ 'Condiment'=>[['normal'],['latin-ext','latin']],
218
+ 'Content'=>[['normal','700'],['khmer']],
219
+ 'Contrail One'=>[['normal'],['latin']],
220
+ 'Convergence'=>[['normal'],['latin']],
221
+ 'Cookie'=>[['normal'],['latin']],
222
+ 'Copse'=>[['normal'],['latin']],
223
+ 'Corben'=>[['normal','700'],['latin-ext','latin']],
224
+ 'Cormorant'=>[['300','300italic','normal','italic','500','500italic','600','600italic','700','700italic'],['cyrillic-ext','cyrillic','latin-ext','latin','vietnamese']],
225
+ 'Cormorant Garamond'=>[['300','300italic','normal','italic','500','500italic','600','600italic','700','700italic'],['cyrillic-ext','cyrillic','latin-ext','latin','vietnamese']],
226
+ 'Cormorant Infant'=>[['300','300italic','normal','italic','500','500italic','600','600italic','700','700italic'],['cyrillic-ext','cyrillic','latin-ext','latin','vietnamese']],
227
+ 'Cormorant SC'=>[['300','normal','500','600','700'],['cyrillic-ext','cyrillic','latin-ext','latin','vietnamese']],
228
+ 'Cormorant Unicase'=>[['300','normal','500','600','700'],['cyrillic-ext','cyrillic','latin-ext','latin','vietnamese']],
229
+ 'Cormorant Upright'=>[['300','normal','500','600','700'],['latin-ext','latin','vietnamese']],
230
+ 'Courgette'=>[['normal'],['latin-ext','latin']],
231
+ 'Cousine'=>[['normal','italic','700','700italic'],['cyrillic-ext','cyrillic','greek-ext','latin-ext','hebrew','greek','latin','vietnamese']],
232
+ 'Coustard'=>[['normal','900'],['latin']],
233
+ 'Covered By Your Grace'=>[['normal'],['latin']],
234
+ 'Crafty Girls'=>[['normal'],['latin']],
235
+ 'Creepster'=>[['normal'],['latin']],
236
+ 'Crete Round'=>[['normal','italic'],['latin-ext','latin']],
237
+ 'Crimson Pro'=>[['200','300','normal','500','600','700','800','900','200italic','300italic','italic','500italic','600italic','700italic','800italic','900italic'],['latin-ext','latin','vietnamese']],
238
+ 'Crimson Text'=>[['normal','italic','600','600italic','700','700italic'],['latin']],
239
+ 'Croissant One'=>[['normal'],['latin-ext','latin']],
240
+ 'Crushed'=>[['normal'],['latin']],
241
+ 'Cuprum'=>[['normal','italic','700','700italic'],['cyrillic-ext','cyrillic','latin-ext','latin','vietnamese']],
242
+ 'Cute Font'=>[['normal'],['korean','latin']],
243
+ 'Cutive'=>[['normal'],['latin-ext','latin']],
244
+ 'Cutive Mono'=>[['normal'],['latin-ext','latin']],
245
+ 'DM Sans'=>[['normal','italic','500','500italic','700','700italic'],['latin-ext','latin']],
246
+ 'DM Serif Display'=>[['normal','italic'],['latin-ext','latin']],
247
+ 'DM Serif Text'=>[['normal','italic'],['latin-ext','latin']],
248
+ 'Damion'=>[['normal'],['latin']],
249
+ 'Dancing Script'=>[['normal','500','600','700'],['latin-ext','latin','vietnamese']],
250
+ 'Dangrek'=>[['normal'],['khmer']],
251
+ 'Darker Grotesque'=>[['300','normal','500','600','700','800','900'],['latin-ext','latin','vietnamese']],
252
+ 'David Libre'=>[['normal','500','700'],['latin-ext','hebrew','latin','vietnamese']],
253
+ 'Dawning of a New Day'=>[['normal'],['latin']],
254
+ 'Days One'=>[['normal'],['latin']],
255
+ 'Dekko'=>[['normal'],['latin-ext','devanagari','latin']],
256
+ 'Delius'=>[['normal'],['latin']],
257
+ 'Delius Swash Caps'=>[['normal'],['latin']],
258
+ 'Delius Unicase'=>[['normal','700'],['latin']],
259
+ 'Della Respira'=>[['normal'],['latin']],
260
+ 'Denk One'=>[['normal'],['latin-ext','latin']],
261
+ 'Devonshire'=>[['normal'],['latin-ext','latin']],
262
+ 'Dhurjati'=>[['normal'],['telugu','latin']],
263
+ 'Didact Gothic'=>[['normal'],['cyrillic-ext','cyrillic','greek-ext','latin-ext','greek','latin']],
264
+ 'Diplomata'=>[['normal'],['latin-ext','latin']],
265
+ 'Diplomata SC'=>[['normal'],['latin-ext','latin']],
266
+ 'Do Hyeon'=>[['normal'],['korean','latin']],
267
+ 'Dokdo'=>[['normal'],['korean','latin']],
268
+ 'Domine'=>[['normal','700'],['latin-ext','latin']],
269
+ 'Donegal One'=>[['normal'],['latin-ext','latin']],
270
+ 'Doppio One'=>[['normal'],['latin-ext','latin']],
271
+ 'Dorsa'=>[['normal'],['latin']],
272
+ 'Dosis'=>[['200','300','normal','500','600','700','800'],['latin-ext','latin','vietnamese']],
273
+ 'Dr Sugiyama'=>[['normal'],['latin-ext','latin']],
274
+ 'Duru Sans'=>[['normal'],['latin-ext','latin']],
275
+ 'Dynalight'=>[['normal'],['latin-ext','latin']],
276
+ 'EB Garamond'=>[['normal','500','600','700','800','italic','500italic','600italic','700italic','800italic'],['cyrillic-ext','cyrillic','greek-ext','latin-ext','greek','latin','vietnamese']],
277
+ 'Eagle Lake'=>[['normal'],['latin-ext','latin']],
278
+ 'East Sea Dokdo'=>[['normal'],['korean','latin']],
279
+ 'Eater'=>[['normal'],['latin-ext','latin']],
280
+ 'Economica'=>[['normal','italic','700','700italic'],['latin-ext','latin']],
281
+ 'Eczar'=>[['normal','500','600','700','800'],['latin-ext','devanagari','latin']],
282
+ 'El Messiri'=>[['normal','500','600','700'],['cyrillic','arabic','latin']],
283
+ 'Electrolize'=>[['normal'],['latin']],
284
+ 'Elsie'=>[['normal','900'],['latin-ext','latin']],
285
+ 'Elsie Swash Caps'=>[['normal','900'],['latin-ext','latin']],
286
+ 'Emblema One'=>[['normal'],['latin-ext','latin']],
287
+ 'Emilys Candy'=>[['normal'],['latin-ext','latin']],
288
+ 'Encode Sans'=>[['100','200','300','normal','500','600','700','800','900'],['latin-ext','latin','vietnamese']],
289
+ 'Encode Sans Condensed'=>[['100','200','300','normal','500','600','700','800','900'],['latin-ext','latin','vietnamese']],
290
+ 'Encode Sans Expanded'=>[['100','200','300','normal','500','600','700','800','900'],['latin-ext','latin','vietnamese']],
291
+ 'Encode Sans Semi Condensed'=>[['100','200','300','normal','500','600','700','800','900'],['latin-ext','latin','vietnamese']],
292
+ 'Encode Sans Semi Expanded'=>[['100','200','300','normal','500','600','700','800','900'],['latin-ext','latin','vietnamese']],
293
+ 'Engagement'=>[['normal'],['latin']],
294
+ 'Englebert'=>[['normal'],['latin-ext','latin']],
295
+ 'Enriqueta'=>[['normal','500','600','700'],['latin-ext','latin']],
296
+ 'Erica One'=>[['normal'],['latin-ext','latin']],
297
+ 'Esteban'=>[['normal'],['latin-ext','latin']],
298
+ 'Euphoria Script'=>[['normal'],['latin-ext','latin']],
299
+ 'Ewert'=>[['normal'],['latin-ext','latin']],
300
+ 'Exo'=>[['100','100italic','200','200italic','300','300italic','normal','italic','500','500italic','600','600italic','700','700italic','800','800italic','900','900italic'],['latin-ext','latin','vietnamese']],
301
+ 'Exo 2'=>[['100','100italic','200','200italic','300','300italic','normal','italic','500','500italic','600','600italic','700','700italic','800','800italic','900','900italic'],['cyrillic-ext','cyrillic','latin-ext','latin','vietnamese']],
302
+ 'Expletus Sans'=>[['normal','italic','500','500italic','600','600italic','700','700italic'],['latin']],
303
+ 'Fahkwang'=>[['200','200italic','300','300italic','normal','italic','500','500italic','600','600italic','700','700italic'],['latin-ext','latin','thai','vietnamese']],
304
+ 'Fanwood Text'=>[['normal','italic'],['latin']],
305
+ 'Farro'=>[['300','normal','500','700'],['latin-ext','latin']],
306
+ 'Farsan'=>[['normal'],['latin-ext','latin','vietnamese','gujarati']],
307
+ 'Fascinate'=>[['normal'],['latin']],
308
+ 'Fascinate Inline'=>[['normal'],['latin']],
309
+ 'Faster One'=>[['normal'],['latin']],
310
+ 'Fasthand'=>[['normal'],['khmer']],
311
+ 'Fauna One'=>[['normal'],['latin-ext','latin']],
312
+ 'Faustina'=>[['normal','italic','500','500italic','600','600italic','700','700italic'],['latin-ext','latin','vietnamese']],
313
+ 'Federant'=>[['normal'],['latin']],
314
+ 'Federo'=>[['normal'],['latin']],
315
+ 'Felipa'=>[['normal'],['latin-ext','latin']],
316
+ 'Fenix'=>[['normal'],['latin-ext','latin']],
317
+ 'Finger Paint'=>[['normal'],['latin']],
318
+ 'Fira Code'=>[['300','normal','500','600','700'],['cyrillic-ext','cyrillic','greek-ext','latin-ext','greek','latin']],
319
+ 'Fira Mono'=>[['normal','500','700'],['cyrillic-ext','cyrillic','greek-ext','latin-ext','greek','latin']],
320
+ 'Fira Sans'=>[['100','100italic','200','200italic','300','300italic','normal','italic','500','500italic','600','600italic','700','700italic','800','800italic','900','900italic'],['cyrillic-ext','cyrillic','greek-ext','latin-ext','greek','latin','vietnamese']],
321
+ 'Fira Sans Condensed'=>[['100','100italic','200','200italic','300','300italic','normal','italic','500','500italic','600','600italic','700','700italic','800','800italic','900','900italic'],['cyrillic-ext','cyrillic','greek-ext','latin-ext','greek','latin','vietnamese']],
322
+ 'Fira Sans Extra Condensed'=>[['100','100italic','200','200italic','300','300italic','normal','italic','500','500italic','600','600italic','700','700italic','800','800italic','900','900italic'],['cyrillic-ext','cyrillic','greek-ext','latin-ext','greek','latin','vietnamese']],
323
+ 'Fjalla One'=>[['normal'],['latin-ext','latin']],
324
+ 'Fjord One'=>[['normal'],['latin']],
325
+ 'Flamenco'=>[['300','normal'],['latin']],
326
+ 'Flavors'=>[['normal'],['latin-ext','latin']],
327
+ 'Fondamento'=>[['normal','italic'],['latin-ext','latin']],
328
+ 'Fontdiner Swanky'=>[['normal'],['latin']],
329
+ 'Forum'=>[['normal'],['cyrillic-ext','cyrillic','latin-ext','latin']],
330
+ 'Francois One'=>[['normal'],['latin-ext','latin','vietnamese']],
331
+ 'Frank Ruhl Libre'=>[['300','normal','500','700','900'],['latin-ext','hebrew','latin']],
332
+ 'Freckle Face'=>[['normal'],['latin-ext','latin']],
333
+ 'Fredericka the Great'=>[['normal'],['latin-ext','latin']],
334
+ 'Fredoka One'=>[['normal'],['latin']],
335
+ 'Freehand'=>[['normal'],['khmer']],
336
+ 'Fresca'=>[['normal'],['latin-ext','latin']],
337
+ 'Frijole'=>[['normal'],['latin']],
338
+ 'Fruktur'=>[['normal'],['latin-ext','latin']],
339
+ 'Fugaz One'=>[['normal'],['latin']],
340
+ 'GFS Didot'=>[['normal'],['greek']],
341
+ 'GFS Neohellenic'=>[['normal','italic','700','700italic'],['greek']],
342
+ 'Gabriela'=>[['normal'],['cyrillic-ext','cyrillic','latin']],
343
+ 'Gaegu'=>[['300','normal','700'],['korean','latin']],
344
+ 'Gafata'=>[['normal'],['latin-ext','latin']],
345
+ 'Galada'=>[['normal'],['bengali','latin']],
346
+ 'Galdeano'=>[['normal'],['latin']],
347
+ 'Galindo'=>[['normal'],['latin-ext','latin']],
348
+ 'Gamja Flower'=>[['normal'],['korean','latin']],
349
+ 'Gayathri'=>[['100','normal','700'],['malayalam','latin']],
350
+ 'Gentium Basic'=>[['normal','italic','700','700italic'],['latin-ext','latin']],
351
+ 'Gentium Book Basic'=>[['normal','italic','700','700italic'],['latin-ext','latin']],
352
+ 'Geo'=>[['normal','italic'],['latin']],
353
+ 'Geostar'=>[['normal'],['latin']],
354
+ 'Geostar Fill'=>[['normal'],['latin']],
355
+ 'Germania One'=>[['normal'],['latin']],
356
+ 'Gidugu'=>[['normal'],['telugu','latin']],
357
+ 'Gilda Display'=>[['normal'],['latin-ext','latin']],
358
+ 'Give You Glory'=>[['normal'],['latin']],
359
+ 'Glass Antiqua'=>[['normal'],['latin-ext','latin']],
360
+ 'Glegoo'=>[['normal','700'],['latin-ext','devanagari','latin']],
361
+ 'Gloria Hallelujah'=>[['normal'],['latin']],
362
+ 'Goblin One'=>[['normal'],['latin']],
363
+ 'Gochi Hand'=>[['normal'],['latin']],
364
+ 'Gorditas'=>[['normal','700'],['latin']],
365
+ 'Gothic A1'=>[['100','200','300','normal','500','600','700','800','900'],['korean','latin']],
366
+ 'Goudy Bookletter 1911'=>[['normal'],['latin']],
367
+ 'Graduate'=>[['normal'],['latin']],
368
+ 'Grand Hotel'=>[['normal'],['latin-ext','latin']],
369
+ 'Gravitas One'=>[['normal'],['latin']],
370
+ 'Great Vibes'=>[['normal'],['latin-ext','latin']],
371
+ 'Grenze'=>[['100','100italic','200','200italic','300','300italic','normal','italic','500','500italic','600','600italic','700','700italic','800','800italic','900','900italic'],['latin-ext','latin','vietnamese']],
372
+ 'Griffy'=>[['normal'],['latin-ext','latin']],
373
+ 'Gruppo'=>[['normal'],['latin-ext','latin']],
374
+ 'Gudea'=>[['normal','italic','700'],['latin-ext','latin']],
375
+ 'Gugi'=>[['normal'],['korean','latin']],
376
+ 'Gupter'=>[['normal','500','700'],['latin']],
377
+ 'Gurajada'=>[['normal'],['telugu','latin']],
378
+ 'Habibi'=>[['normal'],['latin-ext','latin']],
379
+ 'Halant'=>[['300','normal','500','600','700'],['latin-ext','devanagari','latin']],
380
+ 'Hammersmith One'=>[['normal'],['latin-ext','latin']],
381
+ 'Hanalei'=>[['normal'],['latin-ext','latin']],
382
+ 'Hanalei Fill'=>[['normal'],['latin-ext','latin']],
383
+ 'Handlee'=>[['normal'],['latin']],
384
+ 'Hanuman'=>[['normal','700'],['khmer']],
385
+ 'Happy Monkey'=>[['normal'],['latin-ext','latin']],
386
+ 'Harmattan'=>[['normal'],['arabic','latin']],
387
+ 'Headland One'=>[['normal'],['latin-ext','latin']],
388
+ 'Heebo'=>[['100','300','normal','500','700','800','900'],['hebrew','latin']],
389
+ 'Henny Penny'=>[['normal'],['latin']],
390
+ 'Hepta Slab'=>[['100','200','300','normal','500','600','700','800','900'],['latin-ext','latin','vietnamese']],
391
+ 'Herr Von Muellerhoff'=>[['normal'],['latin-ext','latin']],
392
+ 'Hi Melody'=>[['normal'],['korean','latin']],
393
+ 'Hind'=>[['300','normal','500','600','700'],['latin-ext','devanagari','latin']],
394
+ 'Hind Guntur'=>[['300','normal','500','600','700'],['telugu','latin-ext','latin']],
395
+ 'Hind Madurai'=>[['300','normal','500','600','700'],['latin-ext','latin','tamil']],
396
+ 'Hind Siliguri'=>[['300','normal','500','600','700'],['bengali','latin-ext','latin']],
397
+ 'Hind Vadodara'=>[['300','normal','500','600','700'],['latin-ext','latin','gujarati']],
398
+ 'Holtwood One SC'=>[['normal'],['latin']],
399
+ 'Homemade Apple'=>[['normal'],['latin']],
400
+ 'Homenaje'=>[['normal'],['latin']],
401
+ 'IBM Plex Mono'=>[['100','100italic','200','200italic','300','300italic','normal','italic','500','500italic','600','600italic','700','700italic'],['cyrillic-ext','cyrillic','latin-ext','latin','vietnamese']],
402
+ 'IBM Plex Sans'=>[['100','100italic','200','200italic','300','300italic','normal','italic','500','500italic','600','600italic','700','700italic'],['cyrillic-ext','cyrillic','latin-ext','greek','latin','vietnamese']],
403
+ 'IBM Plex Sans Condensed'=>[['100','100italic','200','200italic','300','300italic','normal','italic','500','500italic','600','600italic','700','700italic'],['latin-ext','latin','vietnamese']],
404
+ 'IBM Plex Serif'=>[['100','100italic','200','200italic','300','300italic','normal','italic','500','500italic','600','600italic','700','700italic'],['cyrillic-ext','cyrillic','latin-ext','latin','vietnamese']],
405
+ 'IM Fell DW Pica'=>[['normal','italic'],['latin']],
406
+ 'IM Fell DW Pica SC'=>[['normal'],['latin']],
407
+ 'IM Fell Double Pica'=>[['normal','italic'],['latin']],
408
+ 'IM Fell Double Pica SC'=>[['normal'],['latin']],
409
+ 'IM Fell English'=>[['normal','italic'],['latin']],
410
+ 'IM Fell English SC'=>[['normal'],['latin']],
411
+ 'IM Fell French Canon'=>[['normal','italic'],['latin']],
412
+ 'IM Fell French Canon SC'=>[['normal'],['latin']],
413
+ 'IM Fell Great Primer'=>[['normal','italic'],['latin']],
414
+ 'IM Fell Great Primer SC'=>[['normal'],['latin']],
415
+ 'Ibarra Real Nova'=>[['normal','italic','600','600italic','700','700italic'],['latin-ext','latin']],
416
+ 'Iceberg'=>[['normal'],['latin']],
417
+ 'Iceland'=>[['normal'],['latin']],
418
+ 'Imprima'=>[['normal'],['latin-ext','latin']],
419
+ 'Inconsolata'=>[['normal','700'],['latin-ext','latin','vietnamese']],
420
+ 'Inder'=>[['normal'],['latin-ext','latin']],
421
+ 'Indie Flower'=>[['normal'],['latin']],
422
+ 'Inika'=>[['normal','700'],['latin-ext','latin']],
423
+ 'Inknut Antiqua'=>[['300','normal','500','600','700','800','900'],['latin-ext','devanagari','latin']],
424
+ 'Irish Grover'=>[['normal'],['latin']],
425
+ 'Istok Web'=>[['normal','italic','700','700italic'],['cyrillic-ext','cyrillic','latin-ext','latin']],
426
+ 'Italiana'=>[['normal'],['latin']],
427
+ 'Italianno'=>[['normal'],['latin-ext','latin']],
428
+ 'Itim'=>[['normal'],['latin-ext','latin','thai','vietnamese']],
429
+ 'Jacques Francois'=>[['normal'],['latin']],
430
+ 'Jacques Francois Shadow'=>[['normal'],['latin']],
431
+ 'Jaldi'=>[['normal','700'],['latin-ext','devanagari','latin']],
432
+ 'Jim Nightshade'=>[['normal'],['latin-ext','latin']],
433
+ 'Jockey One'=>[['normal'],['latin-ext','latin']],
434
+ 'Jolly Lodger'=>[['normal'],['latin-ext','latin']],
435
+ 'Jomhuria'=>[['normal'],['arabic','latin-ext','latin']],
436
+ 'Jomolhari'=>[['normal'],['tibetan','latin']],
437
+ 'Josefin Sans'=>[['100','100italic','300','300italic','normal','italic','600','600italic','700','700italic'],['latin-ext','latin','vietnamese']],
438
+ 'Josefin Slab'=>[['100','100italic','300','300italic','normal','italic','600','600italic','700','700italic'],['latin']],
439
+ 'Joti One'=>[['normal'],['latin-ext','latin']],
440
+ 'Jua'=>[['normal'],['korean','latin']],
441
+ 'Judson'=>[['normal','italic','700'],['latin-ext','latin','vietnamese']],
442
+ 'Julee'=>[['normal'],['latin']],
443
+ 'Julius Sans One'=>[['normal'],['latin-ext','latin']],
444
+ 'Junge'=>[['normal'],['latin']],
445
+ 'Jura'=>[['300','normal','500','600','700'],['cyrillic-ext','cyrillic','greek-ext','latin-ext','greek','latin','vietnamese']],
446
+ 'Just Another Hand'=>[['normal'],['latin']],
447
+ 'Just Me Again Down Here'=>[['normal'],['latin-ext','latin']],
448
+ 'K2D'=>[['100','100italic','200','200italic','300','300italic','normal','italic','500','500italic','600','600italic','700','700italic','800','800italic'],['latin-ext','latin','thai','vietnamese']],
449
+ 'Kadwa'=>[['normal','700'],['devanagari','latin']],
450
+ 'Kalam'=>[['300','normal','700'],['latin-ext','devanagari','latin']],
451
+ 'Kameron'=>[['normal','700'],['latin']],
452
+ 'Kanit'=>[['100','100italic','200','200italic','300','300italic','normal','italic','500','500italic','600','600italic','700','700italic','800','800italic','900','900italic'],['latin-ext','latin','thai','vietnamese']],
453
+ 'Kantumruy'=>[['300','normal','700'],['khmer']],
454
+ 'Karla'=>[['normal','italic','700','700italic'],['latin-ext','latin']],
455
+ 'Karma'=>[['300','normal','500','600','700'],['latin-ext','devanagari','latin']],
456
+ 'Katibeh'=>[['normal'],['arabic','latin-ext','latin']],
457
+ 'Kaushan Script'=>[['normal'],['latin-ext','latin']],
458
+ 'Kavivanar'=>[['normal'],['latin-ext','latin','tamil']],
459
+ 'Kavoon'=>[['normal'],['latin-ext','latin']],
460
+ 'Kdam Thmor'=>[['normal'],['khmer']],
461
+ 'Keania One'=>[['normal'],['latin-ext','latin']],
462
+ 'Kelly Slab'=>[['normal'],['cyrillic','latin-ext','latin']],
463
+ 'Kenia'=>[['normal'],['latin']],
464
+ 'Khand'=>[['300','normal','500','600','700'],['latin-ext','devanagari','latin']],
465
+ 'Khmer'=>[['normal'],['khmer']],
466
+ 'Khula'=>[['300','normal','600','700','800'],['latin-ext','devanagari','latin']],
467
+ 'Kirang Haerang'=>[['normal'],['korean','latin']],
468
+ 'Kite One'=>[['normal'],['latin']],
469
+ 'Knewave'=>[['normal'],['latin-ext','latin']],
470
+ 'KoHo'=>[['200','200italic','300','300italic','normal','italic','500','500italic','600','600italic','700','700italic'],['latin-ext','latin','thai','vietnamese']],
471
+ 'Kodchasan'=>[['200','200italic','300','300italic','normal','italic','500','500italic','600','600italic','700','700italic'],['latin-ext','latin','thai','vietnamese']],
472
+ 'Kosugi'=>[['normal'],['cyrillic','latin','japanese']],
473
+ 'Kosugi Maru'=>[['normal'],['cyrillic','latin','japanese']],
474
+ 'Kotta One'=>[['normal'],['latin-ext','latin']],
475
+ 'Koulen'=>[['normal'],['khmer']],
476
+ 'Kranky'=>[['normal'],['latin']],
477
+ 'Kreon'=>[['300','normal','500','600','700'],['latin-ext','latin']],
478
+ 'Kristi'=>[['normal'],['latin']],
479
+ 'Krona One'=>[['normal'],['latin-ext','latin']],
480
+ 'Krub'=>[['200','200italic','300','300italic','normal','italic','500','500italic','600','600italic','700','700italic'],['latin-ext','latin','thai','vietnamese']],
481
+ 'Kulim Park'=>[['200','200italic','300','300italic','normal','italic','600','600italic','700','700italic'],['latin-ext','latin']],
482
+ 'Kumar One'=>[['normal'],['latin-ext','latin','gujarati']],
483
+ 'Kumar One Outline'=>[['normal'],['latin-ext','latin','gujarati']],
484
+ 'Kurale'=>[['normal'],['cyrillic-ext','cyrillic','latin-ext','devanagari','latin']],
485
+ 'La Belle Aurore'=>[['normal'],['latin']],
486
+ 'Lacquer'=>[['normal'],['latin']],
487
+ 'Laila'=>[['300','normal','500','600','700'],['latin-ext','devanagari','latin']],
488
+ 'Lakki Reddy'=>[['normal'],['telugu','latin']],
489
+ 'Lalezar'=>[['normal'],['arabic','latin-ext','latin','vietnamese']],
490
+ 'Lancelot'=>[['normal'],['latin-ext','latin']],
491
+ 'Lateef'=>[['normal'],['arabic','latin']],
492
+ 'Lato'=>[['100','100italic','300','300italic','normal','italic','700','700italic','900','900italic'],['latin-ext','latin']],
493
+ 'League Script'=>[['normal'],['latin']],
494
+ 'Leckerli One'=>[['normal'],['latin']],
495
+ 'Ledger'=>[['normal'],['cyrillic','latin-ext','latin']],
496
+ 'Lekton'=>[['normal','italic','700'],['latin-ext','latin']],
497
+ 'Lemon'=>[['normal'],['latin']],
498
+ 'Lemonada'=>[['300','normal','500','600','700'],['arabic','latin-ext','latin','vietnamese']],
499
+ 'Lexend Deca'=>[['normal'],['latin-ext','latin','vietnamese']],
500
+ 'Lexend Exa'=>[['normal'],['latin-ext','latin','vietnamese']],
501
+ 'Lexend Giga'=>[['normal'],['latin-ext','latin','vietnamese']],
502
+ 'Lexend Mega'=>[['normal'],['latin-ext','latin','vietnamese']],
503
+ 'Lexend Peta'=>[['normal'],['latin-ext','latin','vietnamese']],
504
+ 'Lexend Tera'=>[['normal'],['latin-ext','latin','vietnamese']],
505
+ 'Lexend Zetta'=>[['normal'],['latin-ext','latin','vietnamese']],
506
+ 'Libre Barcode 128'=>[['normal'],['latin']],
507
+ 'Libre Barcode 128 Text'=>[['normal'],['latin']],
508
+ 'Libre Barcode 39'=>[['normal'],['latin']],
509
+ 'Libre Barcode 39 Extended'=>[['normal'],['latin']],
510
+ 'Libre Barcode 39 Extended Text'=>[['normal'],['latin']],
511
+ 'Libre Barcode 39 Text'=>[['normal'],['latin']],
512
+ 'Libre Baskerville'=>[['normal','italic','700'],['latin-ext','latin']],
513
+ 'Libre Caslon Display'=>[['normal'],['latin-ext','latin']],
514
+ 'Libre Caslon Text'=>[['normal','italic','700'],['latin-ext','latin']],
515
+ 'Libre Franklin'=>[['100','100italic','200','200italic','300','300italic','normal','italic','500','500italic','600','600italic','700','700italic','800','800italic','900','900italic'],['latin-ext','latin']],
516
+ 'Life Savers'=>[['normal','700','800'],['latin-ext','latin']],
517
+ 'Lilita One'=>[['normal'],['latin-ext','latin']],
518
+ 'Lily Script One'=>[['normal'],['latin-ext','latin']],
519
+ 'Limelight'=>[['normal'],['latin-ext','latin']],
520
+ 'Linden Hill'=>[['normal','italic'],['latin']],
521
+ 'Literata'=>[['normal','500','600','700','italic','500italic','600italic','700italic'],['cyrillic','greek-ext','latin-ext','greek','latin','vietnamese']],
522
+ 'Liu Jian Mao Cao'=>[['normal'],['chinese-simplified','latin']],
523
+ 'Livvic'=>[['100','100italic','200','200italic','300','300italic','normal','italic','500','500italic','600','600italic','700','700italic','900','900italic'],['latin-ext','latin','vietnamese']],
524
+ 'Lobster'=>[['normal'],['cyrillic-ext','cyrillic','latin-ext','latin','vietnamese']],
525
+ 'Lobster Two'=>[['normal','italic','700','700italic'],['latin']],
526
+ 'Londrina Outline'=>[['normal'],['latin']],
527
+ 'Londrina Shadow'=>[['normal'],['latin']],
528
+ 'Londrina Sketch'=>[['normal'],['latin']],
529
+ 'Londrina Solid'=>[['100','300','normal','900'],['latin']],
530
+ 'Long Cang'=>[['normal'],['chinese-simplified','latin']],
531
+ 'Lora'=>[['normal','italic','700','700italic'],['cyrillic-ext','cyrillic','latin-ext','latin','vietnamese']],
532
+ 'Love Ya Like A Sister'=>[['normal'],['latin']],
533
+ 'Loved by the King'=>[['normal'],['latin']],
534
+ 'Lovers Quarrel'=>[['normal'],['latin-ext','latin']],
535
+ 'Luckiest Guy'=>[['normal'],['latin']],
536
+ 'Lusitana'=>[['normal','700'],['latin']],
537
+ 'Lustria'=>[['normal'],['latin']],
538
+ 'M PLUS 1p'=>[['100','300','normal','500','700','800','900'],['cyrillic-ext','cyrillic','greek-ext','latin-ext','hebrew','greek','latin','vietnamese','japanese']],
539
+ 'M PLUS Rounded 1c'=>[['100','300','normal','500','700','800','900'],['cyrillic-ext','cyrillic','greek-ext','latin-ext','hebrew','greek','latin','vietnamese','japanese']],
540
+ 'Ma Shan Zheng'=>[['normal'],['chinese-simplified','latin']],
541
+ 'Macondo'=>[['normal'],['latin']],
542
+ 'Macondo Swash Caps'=>[['normal'],['latin']],
543
+ 'Mada'=>[['200','300','normal','500','600','700','900'],['arabic','latin']],
544
+ 'Magra'=>[['normal','700'],['latin-ext','latin']],
545
+ 'Maiden Orange'=>[['normal'],['latin']],
546
+ 'Maitree'=>[['200','300','normal','500','600','700'],['latin-ext','latin','thai','vietnamese']],
547
+ 'Major Mono Display'=>[['normal'],['latin-ext','latin','vietnamese']],
548
+ 'Mako'=>[['normal'],['latin']],
549
+ 'Mali'=>[['200','200italic','300','300italic','normal','italic','500','500italic','600','600italic','700','700italic'],['latin-ext','latin','thai','vietnamese']],
550
+ 'Mallanna'=>[['normal'],['telugu','latin']],
551
+ 'Mandali'=>[['normal'],['telugu','latin']],
552
+ 'Manjari'=>[['100','normal','700'],['malayalam','latin']],
553
+ 'Mansalva'=>[['normal'],['latin']],
554
+ 'Manuale'=>[['normal','italic','500','500italic','600','600italic','700','700italic'],['latin-ext','latin','vietnamese']],
555
+ 'Marcellus'=>[['normal'],['latin-ext','latin']],
556
+ 'Marcellus SC'=>[['normal'],['latin-ext','latin']],
557
+ 'Marck Script'=>[['normal'],['cyrillic','latin-ext','latin']],
558
+ 'Margarine'=>[['normal'],['latin-ext','latin']],
559
+ 'Markazi Text'=>[['normal','500','600','700'],['arabic','latin-ext','latin','vietnamese']],
560
+ 'Marko One'=>[['normal'],['latin']],
561
+ 'Marmelad'=>[['normal'],['cyrillic','latin-ext','latin']],
562
+ 'Martel'=>[['200','300','normal','600','700','800','900'],['latin-ext','devanagari','latin']],
563
+ 'Martel Sans'=>[['200','300','normal','600','700','800','900'],['latin-ext','devanagari','latin']],
564
+ 'Marvel'=>[['normal','italic','700','700italic'],['latin']],
565
+ 'Mate'=>[['normal','italic'],['latin']],
566
+ 'Mate SC'=>[['normal'],['latin']],
567
+ 'Maven Pro'=>[['normal','500','700','900'],['latin-ext','latin','vietnamese']],
568
+ 'McLaren'=>[['normal'],['latin-ext','latin']],
569
+ 'Meddon'=>[['normal'],['latin']],
570
+ 'MedievalSharp'=>[['normal'],['latin-ext','latin']],
571
+ 'Medula One'=>[['normal'],['latin']],
572
+ 'Meera Inimai'=>[['normal'],['latin','tamil']],
573
+ 'Megrim'=>[['normal'],['latin']],
574
+ 'Meie Script'=>[['normal'],['latin-ext','latin']],
575
+ 'Merienda'=>[['normal','700'],['latin-ext','latin']],
576
+ 'Merienda One'=>[['normal'],['latin']],
577
+ 'Merriweather'=>[['300','300italic','normal','italic','700','700italic','900','900italic'],['cyrillic-ext','cyrillic','latin-ext','latin','vietnamese']],
578
+ 'Merriweather Sans'=>[['300','300italic','normal','italic','700','700italic','800','800italic'],['latin-ext','latin']],
579
+ 'Metal'=>[['normal'],['khmer']],
580
+ 'Metal Mania'=>[['normal'],['latin-ext','latin']],
581
+ 'Metamorphous'=>[['normal'],['latin-ext','latin']],
582
+ 'Metrophobic'=>[['normal'],['latin-ext','latin','vietnamese']],
583
+ 'Michroma'=>[['normal'],['latin']],
584
+ 'Milonga'=>[['normal'],['latin-ext','latin']],
585
+ 'Miltonian'=>[['normal'],['latin']],
586
+ 'Miltonian Tattoo'=>[['normal'],['latin']],
587
+ 'Mina'=>[['normal','700'],['bengali','latin-ext','latin']],
588
+ 'Miniver'=>[['normal'],['latin']],
589
+ 'Miriam Libre'=>[['normal','700'],['latin-ext','hebrew','latin']],
590
+ 'Mirza'=>[['normal','500','600','700'],['arabic','latin-ext','latin']],
591
+ 'Miss Fajardose'=>[['normal'],['latin-ext','latin']],
592
+ 'Mitr'=>[['200','300','normal','500','600','700'],['latin-ext','latin','thai','vietnamese']],
593
+ 'Modak'=>[['normal'],['latin-ext','devanagari','latin']],
594
+ 'Modern Antiqua'=>[['normal'],['latin-ext','latin']],
595
+ 'Mogra'=>[['normal'],['latin-ext','latin','gujarati']],
596
+ 'Molengo'=>[['normal'],['latin-ext','latin']],
597
+ 'Molle'=>[['italic'],['latin-ext','latin']],
598
+ 'Monda'=>[['normal','700'],['latin-ext','latin']],
599
+ 'Monofett'=>[['normal'],['latin']],
600
+ 'Monoton'=>[['normal'],['latin']],
601
+ 'Monsieur La Doulaise'=>[['normal'],['latin-ext','latin']],
602
+ 'Montaga'=>[['normal'],['latin']],
603
+ 'Montez'=>[['normal'],['latin']],
604
+ 'Montserrat'=>[['100','100italic','200','200italic','300','300italic','normal','italic','500','500italic','600','600italic','700','700italic','800','800italic','900','900italic'],['cyrillic-ext','cyrillic','latin-ext','latin','vietnamese']],
605
+ 'Montserrat Alternates'=>[['100','100italic','200','200italic','300','300italic','normal','italic','500','500italic','600','600italic','700','700italic','800','800italic','900','900italic'],['cyrillic-ext','cyrillic','latin-ext','latin','vietnamese']],
606
+ 'Montserrat Subrayada'=>[['normal','700'],['latin']],
607
+ 'Moul'=>[['normal'],['khmer']],
608
+ 'Moulpali'=>[['normal'],['khmer']],
609
+ 'Mountains of Christmas'=>[['normal','700'],['latin']],
610
+ 'Mouse Memoirs'=>[['normal'],['latin-ext','latin']],
611
+ 'Mr Bedfort'=>[['normal'],['latin-ext','latin']],
612
+ 'Mr Dafoe'=>[['normal'],['latin-ext','latin']],
613
+ 'Mr De Haviland'=>[['normal'],['latin-ext','latin']],
614
+ 'Mrs Saint Delafield'=>[['normal'],['latin-ext','latin']],
615
+ 'Mrs Sheppards'=>[['normal'],['latin-ext','latin']],
616
+ 'Mukta'=>[['200','300','normal','500','600','700','800'],['latin-ext','devanagari','latin']],
617
+ 'Mukta Mahee'=>[['200','300','normal','500','600','700','800'],['latin-ext','latin','gurmukhi']],
618
+ 'Mukta Malar'=>[['200','300','normal','500','600','700','800'],['latin-ext','latin','tamil']],
619
+ 'Mukta Vaani'=>[['200','300','normal','500','600','700','800'],['latin-ext','latin','gujarati']],
620
+ 'Muli'=>[['200','300','normal','500','600','700','800','900','200italic','300italic','italic','500italic','600italic','700italic','800italic','900italic'],['latin-ext','latin','vietnamese']],
621
+ 'Mystery Quest'=>[['normal'],['latin-ext','latin']],
622
+ 'NTR'=>[['normal'],['telugu','latin']],
623
+ 'Nanum Brush Script'=>[['normal'],['korean','latin']],
624
+ 'Nanum Gothic'=>[['normal','700','800'],['korean','latin']],
625
+ 'Nanum Gothic Coding'=>[['normal','700'],['korean','latin']],
626
+ 'Nanum Myeongjo'=>[['normal','700','800'],['korean','latin']],
627
+ 'Nanum Pen Script'=>[['normal'],['korean','latin']],
628
+ 'Neucha'=>[['normal'],['cyrillic','latin']],
629
+ 'Neuton'=>[['200','300','normal','italic','700','800'],['latin-ext','latin']],
630
+ 'New Rocker'=>[['normal'],['latin-ext','latin']],
631
+ 'News Cycle'=>[['normal','700'],['latin-ext','latin']],
632
+ 'Niconne'=>[['normal'],['latin-ext','latin']],
633
+ 'Niramit'=>[['200','200italic','300','300italic','normal','italic','500','500italic','600','600italic','700','700italic'],['latin-ext','latin','thai','vietnamese']],
634
+ 'Nixie One'=>[['normal'],['latin']],
635
+ 'Nobile'=>[['normal','italic','500','500italic','700','700italic'],['latin-ext','latin']],
636
+ 'Nokora'=>[['normal','700'],['khmer']],
637
+ 'Norican'=>[['normal'],['latin-ext','latin']],
638
+ 'Nosifer'=>[['normal'],['latin-ext','latin']],
639
+ 'Notable'=>[['normal'],['latin']],
640
+ 'Nothing You Could Do'=>[['normal'],['latin']],
641
+ 'Noticia Text'=>[['normal','italic','700','700italic'],['latin-ext','latin','vietnamese']],
642
+ 'Noto Sans'=>[['normal','italic','700','700italic'],['cyrillic-ext','cyrillic','greek-ext','latin-ext','devanagari','greek','latin','vietnamese']],
643
+ 'Noto Sans HK'=>[['100','300','normal','500','700','900'],['chinese-hongkong','latin']],
644
+ 'Noto Sans JP'=>[['100','300','normal','500','700','900'],['latin','japanese']],
645
+ 'Noto Sans KR'=>[['100','300','normal','500','700','900'],['korean','latin']],
646
+ 'Noto Sans SC'=>[['100','300','normal','500','700','900'],['cyrillic','chinese-simplified','latin','vietnamese']],
647
+ 'Noto Sans TC'=>[['100','300','normal','500','700','900'],['chinese-traditional','latin']],
648
+ 'Noto Serif'=>[['normal','italic','700','700italic'],['cyrillic-ext','cyrillic','greek-ext','latin-ext','greek','latin','vietnamese']],
649
+ 'Noto Serif JP'=>[['200','300','normal','500','600','700','900'],['latin','japanese']],
650
+ 'Noto Serif KR'=>[['200','300','normal','500','600','700','900'],['korean','latin']],
651
+ 'Noto Serif SC'=>[['200','300','normal','500','600','700','900'],['cyrillic','chinese-simplified','latin','vietnamese']],
652
+ 'Noto Serif TC'=>[['200','300','normal','500','600','700','900'],['cyrillic','chinese-traditional','latin','vietnamese']],
653
+ 'Nova Cut'=>[['normal'],['latin']],
654
+ 'Nova Flat'=>[['normal'],['latin']],
655
+ 'Nova Mono'=>[['normal'],['greek','latin']],
656
+ 'Nova Oval'=>[['normal'],['latin']],
657
+ 'Nova Round'=>[['normal'],['latin']],
658
+ 'Nova Script'=>[['normal'],['latin']],
659
+ 'Nova Slim'=>[['normal'],['latin']],
660
+ 'Nova Square'=>[['normal'],['latin']],
661
+ 'Numans'=>[['normal'],['latin']],
662
+ 'Nunito'=>[['200','200italic','300','300italic','normal','italic','600','600italic','700','700italic','800','800italic','900','900italic'],['cyrillic-ext','cyrillic','latin-ext','latin','vietnamese']],
663
+ 'Nunito Sans'=>[['200','200italic','300','300italic','normal','italic','600','600italic','700','700italic','800','800italic','900','900italic'],['latin-ext','latin','vietnamese']],
664
+ 'Odibee Sans'=>[['normal'],['latin']],
665
+ 'Odor Mean Chey'=>[['normal'],['khmer']],
666
+ 'Offside'=>[['normal'],['latin']],
667
+ 'Old Standard TT'=>[['normal','italic','700'],['cyrillic-ext','cyrillic','latin-ext','latin','vietnamese']],
668
+ 'Oldenburg'=>[['normal'],['latin-ext','latin']],
669
+ 'Oleo Script'=>[['normal','700'],['latin-ext','latin']],
670
+ 'Oleo Script Swash Caps'=>[['normal','700'],['latin-ext','latin']],
671
+ 'Open Sans'=>[['300','300italic','normal','italic','600','600italic','700','700italic','800','800italic'],['cyrillic-ext','cyrillic','greek-ext','latin-ext','greek','latin','vietnamese']],
672
+ 'Open Sans Condensed'=>[['300','300italic','700'],['cyrillic-ext','cyrillic','greek-ext','latin-ext','greek','latin','vietnamese']],
673
+ 'Oranienbaum'=>[['normal'],['cyrillic-ext','cyrillic','latin-ext','latin']],
674
+ 'Orbitron'=>[['normal','500','600','700','800','900'],['latin']],
675
+ 'Oregano'=>[['normal','italic'],['latin-ext','latin']],
676
+ 'Orienta'=>[['normal'],['latin-ext','latin']],
677
+ 'Original Surfer'=>[['normal'],['latin']],
678
+ 'Oswald'=>[['200','300','normal','500','600','700'],['cyrillic-ext','cyrillic','latin-ext','latin','vietnamese']],
679
+ 'Over the Rainbow'=>[['normal'],['latin']],
680
+ 'Overlock'=>[['normal','italic','700','700italic','900','900italic'],['latin-ext','latin']],
681
+ 'Overlock SC'=>[['normal'],['latin-ext','latin']],
682
+ 'Overpass'=>[['100','100italic','200','200italic','300','300italic','normal','italic','600','600italic','700','700italic','800','800italic','900','900italic'],['latin-ext','latin']],
683
+ 'Overpass Mono'=>[['300','normal','600','700'],['latin-ext','latin']],
684
+ 'Ovo'=>[['normal'],['latin']],
685
+ 'Oxygen'=>[['300','normal','700'],['latin-ext','latin']],
686
+ 'Oxygen Mono'=>[['normal'],['latin-ext','latin']],
687
+ 'PT Mono'=>[['normal'],['cyrillic-ext','cyrillic','latin-ext','latin']],
688
+ 'PT Sans'=>[['normal','italic','700','700italic'],['cyrillic-ext','cyrillic','latin-ext','latin']],
689
+ 'PT Sans Caption'=>[['normal','700'],['cyrillic-ext','cyrillic','latin-ext','latin']],
690
+ 'PT Sans Narrow'=>[['normal','700'],['cyrillic-ext','cyrillic','latin-ext','latin']],
691
+ 'PT Serif'=>[['normal','italic','700','700italic'],['cyrillic-ext','cyrillic','latin-ext','latin']],
692
+ 'PT Serif Caption'=>[['normal','italic'],['cyrillic-ext','cyrillic','latin-ext','latin']],
693
+ 'Pacifico'=>[['normal'],['cyrillic-ext','cyrillic','latin-ext','latin','vietnamese']],
694
+ 'Padauk'=>[['normal','700'],['myanmar','latin']],
695
+ 'Palanquin'=>[['100','200','300','normal','500','600','700'],['latin-ext','devanagari','latin']],
696
+ 'Palanquin Dark'=>[['normal','500','600','700'],['latin-ext','devanagari','latin']],
697
+ 'Pangolin'=>[['normal'],['cyrillic-ext','cyrillic','latin-ext','latin','vietnamese']],
698
+ 'Paprika'=>[['normal'],['latin']],
699
+ 'Parisienne'=>[['normal'],['latin-ext','latin']],
700
+ 'Passero One'=>[['normal'],['latin-ext','latin']],
701
+ 'Passion One'=>[['normal','700','900'],['latin-ext','latin']],
702
+ 'Pathway Gothic One'=>[['normal'],['latin-ext','latin']],
703
+ 'Patrick Hand'=>[['normal'],['latin-ext','latin','vietnamese']],
704
+ 'Patrick Hand SC'=>[['normal'],['latin-ext','latin','vietnamese']],
705
+ 'Pattaya'=>[['normal'],['cyrillic','latin-ext','latin','thai','vietnamese']],
706
+ 'Patua One'=>[['normal'],['latin']],
707
+ 'Pavanam'=>[['normal'],['latin-ext','latin','tamil']],
708
+ 'Paytone One'=>[['normal'],['latin-ext','latin','vietnamese']],
709
+ 'Peddana'=>[['normal'],['telugu','latin']],
710
+ 'Peralta'=>[['normal'],['latin-ext','latin']],
711
+ 'Permanent Marker'=>[['normal'],['latin']],
712
+ 'Petit Formal Script'=>[['normal'],['latin-ext','latin']],
713
+ 'Petrona'=>[['normal'],['latin']],
714
+ 'Philosopher'=>[['normal','italic','700','700italic'],['cyrillic-ext','cyrillic','latin','vietnamese']],
715
+ 'Piedra'=>[['normal'],['latin-ext','latin']],
716
+ 'Pinyon Script'=>[['normal'],['latin']],
717
+ 'Pirata One'=>[['normal'],['latin-ext','latin']],
718
+ 'Plaster'=>[['normal'],['latin-ext','latin']],
719
+ 'Play'=>[['normal','700'],['cyrillic-ext','cyrillic','latin-ext','greek','latin','vietnamese']],
720
+ 'Playball'=>[['normal'],['latin-ext','latin']],
721
+ 'Playfair Display'=>[['normal','italic','700','700italic','900','900italic'],['cyrillic','latin-ext','latin','vietnamese']],
722
+ 'Playfair Display SC'=>[['normal','italic','700','700italic','900','900italic'],['cyrillic','latin-ext','latin','vietnamese']],
723
+ 'Podkova'=>[['normal','500','600','700','800'],['cyrillic-ext','cyrillic','latin-ext','latin','vietnamese']],
724
+ 'Poiret One'=>[['normal'],['cyrillic','latin-ext','latin']],
725
+ 'Poller One'=>[['normal'],['latin']],
726
+ 'Poly'=>[['normal','italic'],['latin']],
727
+ 'Pompiere'=>[['normal'],['latin']],
728
+ 'Pontano Sans'=>[['normal'],['latin-ext','latin']],
729
+ 'Poor Story'=>[['normal'],['korean','latin']],
730
+ 'Poppins'=>[['100','100italic','200','200italic','300','300italic','normal','italic','500','500italic','600','600italic','700','700italic','800','800italic','900','900italic'],['latin-ext','devanagari','latin']],
731
+ 'Port Lligat Sans'=>[['normal'],['latin']],
732
+ 'Port Lligat Slab'=>[['normal'],['latin']],
733
+ 'Pragati Narrow'=>[['normal','700'],['latin-ext','devanagari','latin']],
734
+ 'Prata'=>[['normal'],['cyrillic-ext','cyrillic','latin','vietnamese']],
735
+ 'Preahvihear'=>[['normal'],['khmer']],
736
+ 'Press Start 2P'=>[['normal'],['cyrillic-ext','cyrillic','latin-ext','greek','latin']],
737
+ 'Pridi'=>[['200','300','normal','500','600','700'],['latin-ext','latin','thai','vietnamese']],
738
+ 'Princess Sofia'=>[['normal'],['latin-ext','latin']],
739
+ 'Prociono'=>[['normal'],['latin']],
740
+ 'Prompt'=>[['100','100italic','200','200italic','300','300italic','normal','italic','500','500italic','600','600italic','700','700italic','800','800italic','900','900italic'],['latin-ext','latin','thai','vietnamese']],
741
+ 'Prosto One'=>[['normal'],['cyrillic','latin-ext','latin']],
742
+ 'Proza Libre'=>[['normal','italic','500','500italic','600','600italic','700','700italic','800','800italic'],['latin-ext','latin']],
743
+ 'Public Sans'=>[['100','200','300','normal','500','600','700','800','900','100italic','200italic','300italic','italic','500italic','600italic','700italic','800italic','900italic'],['latin-ext','latin']],
744
+ 'Puritan'=>[['normal','italic','700','700italic'],['latin']],
745
+ 'Purple Purse'=>[['normal'],['latin-ext','latin']],
746
+ 'Quando'=>[['normal'],['latin-ext','latin']],
747
+ 'Quantico'=>[['normal','italic','700','700italic'],['latin']],
748
+ 'Quattrocento'=>[['normal','700'],['latin-ext','latin']],
749
+ 'Quattrocento Sans'=>[['normal','italic','700','700italic'],['latin-ext','latin']],
750
+ 'Questrial'=>[['normal'],['latin']],
751
+ 'Quicksand'=>[['300','normal','500','600','700'],['latin-ext','latin','vietnamese']],
752
+ 'Quintessential'=>[['normal'],['latin-ext','latin']],
753
+ 'Qwigley'=>[['normal'],['latin-ext','latin']],
754
+ 'Racing Sans One'=>[['normal'],['latin-ext','latin']],
755
+ 'Radley'=>[['normal','italic'],['latin-ext','latin']],
756
+ 'Rajdhani'=>[['300','normal','500','600','700'],['latin-ext','devanagari','latin']],
757
+ 'Rakkas'=>[['normal'],['arabic','latin-ext','latin']],
758
+ 'Raleway'=>[['100','100italic','200','200italic','300','300italic','normal','italic','500','500italic','600','600italic','700','700italic','800','800italic','900','900italic'],['latin-ext','latin']],
759
+ 'Raleway Dots'=>[['normal'],['latin-ext','latin']],
760
+ 'Ramabhadra'=>[['normal'],['telugu','latin']],
761
+ 'Ramaraja'=>[['normal'],['telugu','latin']],
762
+ 'Rambla'=>[['normal','italic','700','700italic'],['latin-ext','latin']],
763
+ 'Rammetto One'=>[['normal'],['latin-ext','latin']],
764
+ 'Ranchers'=>[['normal'],['latin-ext','latin']],
765
+ 'Rancho'=>[['normal'],['latin']],
766
+ 'Ranga'=>[['normal','700'],['latin-ext','devanagari','latin']],
767
+ 'Rasa'=>[['300','normal','500','600','700'],['latin-ext','latin','gujarati']],
768
+ 'Rationale'=>[['normal'],['latin']],
769
+ 'Ravi Prakash'=>[['normal'],['telugu','latin']],
770
+ 'Red Hat Display'=>[['normal','italic','500','500italic','700','700italic','900','900italic'],['latin-ext','latin']],
771
+ 'Red Hat Text'=>[['normal','italic','500','500italic','700','700italic'],['latin-ext','latin']],
772
+ 'Redressed'=>[['normal'],['latin']],
773
+ 'Reem Kufi'=>[['normal'],['arabic','latin']],
774
+ 'Reenie Beanie'=>[['normal'],['latin']],
775
+ 'Revalia'=>[['normal'],['latin-ext','latin']],
776
+ 'Rhodium Libre'=>[['normal'],['latin-ext','devanagari','latin']],
777
+ 'Ribeye'=>[['normal'],['latin-ext','latin']],
778
+ 'Ribeye Marrow'=>[['normal'],['latin-ext','latin']],
779
+ 'Righteous'=>[['normal'],['latin-ext','latin']],
780
+ 'Risque'=>[['normal'],['latin-ext','latin']],
781
+ 'Roboto'=>[['100','100italic','300','300italic','normal','italic','500','500italic','700','700italic','900','900italic'],['cyrillic-ext','cyrillic','greek-ext','latin-ext','greek','latin','vietnamese']],
782
+ 'Roboto Condensed'=>[['300','300italic','normal','italic','700','700italic'],['cyrillic-ext','cyrillic','greek-ext','latin-ext','greek','latin','vietnamese']],
783
+ 'Roboto Mono'=>[['100','100italic','300','300italic','normal','italic','500','500italic','700','700italic'],['cyrillic-ext','cyrillic','greek-ext','latin-ext','greek','latin','vietnamese']],
784
+ 'Roboto Slab'=>[['100','200','300','normal','500','600','700','800','900'],['cyrillic-ext','cyrillic','greek-ext','latin-ext','greek','latin','vietnamese']],
785
+ 'Rochester'=>[['normal'],['latin']],
786
+ 'Rock Salt'=>[['normal'],['latin']],
787
+ 'Rokkitt'=>[['100','200','300','normal','500','600','700','800','900'],['latin-ext','latin','vietnamese']],
788
+ 'Romanesco'=>[['normal'],['latin-ext','latin']],
789
+ 'Ropa Sans'=>[['normal','italic'],['latin-ext','latin']],
790
+ 'Rosario'=>[['300','normal','500','600','700','300italic','italic','500italic','600italic','700italic'],['latin-ext','latin','vietnamese']],
791
+ 'Rosarivo'=>[['normal','italic'],['latin-ext','latin']],
792
+ 'Rouge Script'=>[['normal'],['latin']],
793
+ 'Rozha One'=>[['normal'],['latin-ext','devanagari','latin']],
794
+ 'Rubik'=>[['300','300italic','normal','italic','500','500italic','700','700italic','900','900italic'],['cyrillic','latin-ext','hebrew','latin']],
795
+ 'Rubik Mono One'=>[['normal'],['cyrillic','latin-ext','latin']],
796
+ 'Ruda'=>[['normal','700','900'],['latin-ext','latin']],
797
+ 'Rufina'=>[['normal','700'],['latin-ext','latin']],
798
+ 'Ruge Boogie'=>[['normal'],['latin-ext','latin']],
799
+ 'Ruluko'=>[['normal'],['latin-ext','latin']],
800
+ 'Rum Raisin'=>[['normal'],['latin-ext','latin']],
801
+ 'Ruslan Display'=>[['normal'],['cyrillic','latin-ext','latin']],
802
+ 'Russo One'=>[['normal'],['cyrillic','latin-ext','latin']],
803
+ 'Ruthie'=>[['normal'],['latin-ext','latin']],
804
+ 'Rye'=>[['normal'],['latin-ext','latin']],
805
+ 'Sacramento'=>[['normal'],['latin-ext','latin']],
806
+ 'Sahitya'=>[['normal','700'],['devanagari','latin']],
807
+ 'Sail'=>[['normal'],['latin-ext','latin']],
808
+ 'Saira'=>[['100','200','300','normal','500','600','700','800','900'],['latin-ext','latin','vietnamese']],
809
+ 'Saira Condensed'=>[['100','200','300','normal','500','600','700','800','900'],['latin-ext','latin','vietnamese']],
810
+ 'Saira Extra Condensed'=>[['100','200','300','normal','500','600','700','800','900'],['latin-ext','latin','vietnamese']],
811
+ 'Saira Semi Condensed'=>[['100','200','300','normal','500','600','700','800','900'],['latin-ext','latin','vietnamese']],
812
+ 'Saira Stencil One'=>[['normal'],['latin-ext','latin','vietnamese']],
813
+ 'Salsa'=>[['normal'],['latin']],
814
+ 'Sanchez'=>[['normal','italic'],['latin-ext','latin']],
815
+ 'Sancreek'=>[['normal'],['latin-ext','latin']],
816
+ 'Sansita'=>[['normal','italic','700','700italic','800','800italic','900','900italic'],['latin-ext','latin']],
817
+ 'Sarabun'=>[['100','100italic','200','200italic','300','300italic','normal','italic','500','500italic','600','600italic','700','700italic','800','800italic'],['latin-ext','latin','thai','vietnamese']],
818
+ 'Sarala'=>[['normal','700'],['latin-ext','devanagari','latin']],
819
+ 'Sarina'=>[['normal'],['latin-ext','latin']],
820
+ 'Sarpanch'=>[['normal','500','600','700','800','900'],['latin-ext','devanagari','latin']],
821
+ 'Satisfy'=>[['normal'],['latin']],
822
+ 'Sawarabi Gothic'=>[['normal'],['cyrillic','latin-ext','latin','vietnamese','japanese']],
823
+ 'Sawarabi Mincho'=>[['normal'],['latin-ext','latin','japanese']],
824
+ 'Scada'=>[['normal','italic','700','700italic'],['cyrillic-ext','cyrillic','latin-ext','latin']],
825
+ 'Scheherazade'=>[['normal','700'],['arabic','latin']],
826
+ 'Schoolbell'=>[['normal'],['latin']],
827
+ 'Scope One'=>[['normal'],['latin-ext','latin']],
828
+ 'Seaweed Script'=>[['normal'],['latin-ext','latin']],
829
+ 'Secular One'=>[['normal'],['latin-ext','hebrew','latin']],
830
+ 'Sedgwick Ave'=>[['normal'],['latin-ext','latin','vietnamese']],
831
+ 'Sedgwick Ave Display'=>[['normal'],['latin-ext','latin','vietnamese']],
832
+ 'Sevillana'=>[['normal'],['latin-ext','latin']],
833
+ 'Seymour One'=>[['normal'],['cyrillic','latin-ext','latin']],
834
+ 'Shadows Into Light'=>[['normal'],['latin']],
835
+ 'Shadows Into Light Two'=>[['normal'],['latin-ext','latin']],
836
+ 'Shanti'=>[['normal'],['latin']],
837
+ 'Share'=>[['normal','italic','700','700italic'],['latin-ext','latin']],
838
+ 'Share Tech'=>[['normal'],['latin']],
839
+ 'Share Tech Mono'=>[['normal'],['latin']],
840
+ 'Shojumaru'=>[['normal'],['latin-ext','latin']],
841
+ 'Short Stack'=>[['normal'],['latin']],
842
+ 'Shrikhand'=>[['normal'],['latin-ext','latin','gujarati']],
843
+ 'Siemreap'=>[['normal'],['khmer']],
844
+ 'Sigmar One'=>[['normal'],['latin-ext','latin','vietnamese']],
845
+ 'Signika'=>[['300','normal','600','700'],['latin-ext','latin']],
846
+ 'Signika Negative'=>[['300','normal','600','700'],['latin-ext','latin']],
847
+ 'Simonetta'=>[['normal','italic','900','900italic'],['latin-ext','latin']],
848
+ 'Single Day'=>[['normal'],['korean']],
849
+ 'Sintony'=>[['normal','700'],['latin-ext','latin']],
850
+ 'Sirin Stencil'=>[['normal'],['latin']],
851
+ 'Six Caps'=>[['normal'],['latin']],
852
+ 'Skranji'=>[['normal','700'],['latin-ext','latin']],
853
+ 'Slabo 13px'=>[['normal'],['latin-ext','latin']],
854
+ 'Slabo 27px'=>[['normal'],['latin-ext','latin']],
855
+ 'Slackey'=>[['normal'],['latin']],
856
+ 'Smokum'=>[['normal'],['latin']],
857
+ 'Smythe'=>[['normal'],['latin']],
858
+ 'Sniglet'=>[['normal','800'],['latin-ext','latin']],
859
+ 'Snippet'=>[['normal'],['latin']],
860
+ 'Snowburst One'=>[['normal'],['latin-ext','latin']],
861
+ 'Sofadi One'=>[['normal'],['latin']],
862
+ 'Sofia'=>[['normal'],['latin']],
863
+ 'Solway'=>[['300','normal','500','700','800'],['latin']],
864
+ 'Song Myung'=>[['normal'],['korean','latin']],
865
+ 'Sonsie One'=>[['normal'],['latin-ext','latin']],
866
+ 'Sorts Mill Goudy'=>[['normal','italic'],['latin-ext','latin']],
867
+ 'Source Code Pro'=>[['200','200italic','300','300italic','normal','italic','500','500italic','600','600italic','700','700italic','900','900italic'],['cyrillic-ext','cyrillic','latin-ext','greek','latin','vietnamese']],
868
+ 'Source Sans Pro'=>[['200','200italic','300','300italic','normal','italic','600','600italic','700','700italic','900','900italic'],['cyrillic-ext','cyrillic','greek-ext','latin-ext','greek','latin','vietnamese']],
869
+ 'Source Serif Pro'=>[['normal','600','700'],['latin-ext','latin']],
870
+ 'Space Mono'=>[['normal','italic','700','700italic'],['latin-ext','latin','vietnamese']],
871
+ 'Special Elite'=>[['normal'],['latin']],
872
+ 'Spectral'=>[['200','200italic','300','300italic','normal','italic','500','500italic','600','600italic','700','700italic','800','800italic'],['cyrillic','latin-ext','latin','vietnamese']],
873
+ 'Spectral SC'=>[['200','200italic','300','300italic','normal','italic','500','500italic','600','600italic','700','700italic','800','800italic'],['cyrillic','latin-ext','latin','vietnamese']],
874
+ 'Spicy Rice'=>[['normal'],['latin']],
875
+ 'Spinnaker'=>[['normal'],['latin-ext','latin']],
876
+ 'Spirax'=>[['normal'],['latin']],
877
+ 'Squada One'=>[['normal'],['latin']],
878
+ 'Sree Krushnadevaraya'=>[['normal'],['telugu','latin']],
879
+ 'Sriracha'=>[['normal'],['latin-ext','latin','thai','vietnamese']],
880
+ 'Srisakdi'=>[['normal','700'],['latin-ext','latin','thai','vietnamese']],
881
+ 'Staatliches'=>[['normal'],['latin-ext','latin']],
882
+ 'Stalemate'=>[['normal'],['latin-ext','latin']],
883
+ 'Stalinist One'=>[['normal'],['cyrillic','latin-ext','latin']],
884
+ 'Stardos Stencil'=>[['normal','700'],['latin']],
885
+ 'Stint Ultra Condensed'=>[['normal'],['latin-ext','latin']],
886
+ 'Stint Ultra Expanded'=>[['normal'],['latin-ext','latin']],
887
+ 'Stoke'=>[['300','normal'],['latin-ext','latin']],
888
+ 'Strait'=>[['normal'],['latin']],
889
+ 'Stylish'=>[['normal'],['korean','latin']],
890
+ 'Sue Ellen Francisco'=>[['normal'],['latin']],
891
+ 'Suez One'=>[['normal'],['latin-ext','hebrew','latin']],
892
+ 'Sulphur Point'=>[['300','normal','700'],['latin-ext','latin']],
893
+ 'Sumana'=>[['normal','700'],['latin-ext','devanagari','latin']],
894
+ 'Sunflower'=>[['300','500','700'],['korean','latin']],
895
+ 'Sunshiney'=>[['normal'],['latin']],
896
+ 'Supermercado One'=>[['normal'],['latin']],
897
+ 'Sura'=>[['normal','700'],['latin-ext','devanagari','latin']],
898
+ 'Suranna'=>[['normal'],['telugu','latin']],
899
+ 'Suravaram'=>[['normal'],['telugu','latin']],
900
+ 'Suwannaphum'=>[['normal'],['khmer']],
901
+ 'Swanky and Moo Moo'=>[['normal'],['latin']],
902
+ 'Syncopate'=>[['normal','700'],['latin']],
903
+ 'Tajawal'=>[['200','300','normal','500','700','800','900'],['arabic','latin']],
904
+ 'Tangerine'=>[['normal','700'],['latin']],
905
+ 'Taprom'=>[['normal'],['khmer']],
906
+ 'Tauri'=>[['normal'],['latin-ext','latin']],
907
+ 'Taviraj'=>[['100','100italic','200','200italic','300','300italic','normal','italic','500','500italic','600','600italic','700','700italic','800','800italic','900','900italic'],['latin-ext','latin','thai','vietnamese']],
908
+ 'Teko'=>[['300','normal','500','600','700'],['latin-ext','devanagari','latin']],
909
+ 'Telex'=>[['normal'],['latin-ext','latin']],
910
+ 'Tenali Ramakrishna'=>[['normal'],['telugu','latin']],
911
+ 'Tenor Sans'=>[['normal'],['cyrillic','latin-ext','latin']],
912
+ 'Text Me One'=>[['normal'],['latin-ext','latin']],
913
+ 'Thasadith'=>[['normal','italic','700','700italic'],['latin-ext','latin','thai','vietnamese']],
914
+ 'The Girl Next Door'=>[['normal'],['latin']],
915
+ 'Tienne'=>[['normal','700','900'],['latin']],
916
+ 'Tillana'=>[['normal','500','600','700','800'],['latin-ext','devanagari','latin']],
917
+ 'Timmana'=>[['normal'],['telugu','latin']],
918
+ 'Tinos'=>[['normal','italic','700','700italic'],['cyrillic-ext','cyrillic','greek-ext','latin-ext','hebrew','greek','latin','vietnamese']],
919
+ 'Titan One'=>[['normal'],['latin-ext','latin']],
920
+ 'Titillium Web'=>[['200','200italic','300','300italic','normal','italic','600','600italic','700','700italic','900'],['latin-ext','latin']],
921
+ 'Tomorrow'=>[['100','100italic','200','200italic','300','300italic','normal','italic','500','500italic','600','600italic','700','700italic','800','800italic','900','900italic'],['latin-ext','latin']],
922
+ 'Trade Winds'=>[['normal'],['latin']],
923
+ 'Trirong'=>[['100','100italic','200','200italic','300','300italic','normal','italic','500','500italic','600','600italic','700','700italic','800','800italic','900','900italic'],['latin-ext','latin','thai','vietnamese']],
924
+ 'Trocchi'=>[['normal'],['latin-ext','latin']],
925
+ 'Trochut'=>[['normal','italic','700'],['latin']],
926
+ 'Trykker'=>[['normal'],['latin-ext','latin']],
927
+ 'Tulpen One'=>[['normal'],['latin']],
928
+ 'Turret Road'=>[['200','300','normal','500','700','800'],['latin-ext','latin']],
929
+ 'Ubuntu'=>[['300','300italic','normal','italic','500','500italic','700','700italic'],['cyrillic-ext','cyrillic','greek-ext','latin-ext','greek','latin']],
930
+ 'Ubuntu Condensed'=>[['normal'],['cyrillic-ext','cyrillic','greek-ext','latin-ext','greek','latin']],
931
+ 'Ubuntu Mono'=>[['normal','italic','700','700italic'],['cyrillic-ext','cyrillic','greek-ext','latin-ext','greek','latin']],
932
+ 'Ultra'=>[['normal'],['latin']],
933
+ 'Uncial Antiqua'=>[['normal'],['latin']],
934
+ 'Underdog'=>[['normal'],['cyrillic','latin-ext','latin']],
935
+ 'Unica One'=>[['normal'],['latin-ext','latin']],
936
+ 'UnifrakturCook'=>[['700'],['latin']],
937
+ 'UnifrakturMaguntia'=>[['normal'],['latin']],
938
+ 'Unkempt'=>[['normal','700'],['latin']],
939
+ 'Unlock'=>[['normal'],['latin']],
940
+ 'Unna'=>[['normal','italic','700','700italic'],['latin-ext','latin']],
941
+ 'VT323'=>[['normal'],['latin-ext','latin','vietnamese']],
942
+ 'Vampiro One'=>[['normal'],['latin-ext','latin']],
943
+ 'Varela'=>[['normal'],['latin-ext','latin']],
944
+ 'Varela Round'=>[['normal'],['latin-ext','hebrew','latin','vietnamese']],
945
+ 'Vast Shadow'=>[['normal'],['latin']],
946
+ 'Vesper Libre'=>[['normal','500','700','900'],['latin-ext','devanagari','latin']],
947
+ 'Vibes'=>[['normal'],['arabic','latin']],
948
+ 'Vibur'=>[['normal'],['latin']],
949
+ 'Vidaloka'=>[['normal'],['latin']],
950
+ 'Viga'=>[['normal'],['latin-ext','latin']],
951
+ 'Voces'=>[['normal'],['latin-ext','latin']],
952
+ 'Volkhov'=>[['normal','italic','700','700italic'],['latin']],
953
+ 'Vollkorn'=>[['normal','italic','600','600italic','700','700italic','900','900italic'],['cyrillic-ext','cyrillic','latin-ext','greek','latin','vietnamese']],
954
+ 'Vollkorn SC'=>[['normal','600','700','900'],['cyrillic-ext','cyrillic','latin-ext','latin','vietnamese']],
955
+ 'Voltaire'=>[['normal'],['latin']],
956
+ 'Waiting for the Sunrise'=>[['normal'],['latin']],
957
+ 'Wallpoet'=>[['normal'],['latin']],
958
+ 'Walter Turncoat'=>[['normal'],['latin']],
959
+ 'Warnes'=>[['normal'],['latin-ext','latin']],
960
+ 'Wellfleet'=>[['normal'],['latin-ext','latin']],
961
+ 'Wendy One'=>[['normal'],['latin-ext','latin']],
962
+ 'Wire One'=>[['normal'],['latin']],
963
+ 'Work Sans'=>[['100','200','300','normal','500','600','700','800','900'],['latin-ext','latin']],
964
+ 'Yanone Kaffeesatz'=>[['200','300','normal','700'],['cyrillic','latin-ext','latin','vietnamese']],
965
+ 'Yantramanav'=>[['100','300','normal','500','700','900'],['latin-ext','devanagari','latin']],
966
+ 'Yatra One'=>[['normal'],['latin-ext','devanagari','latin']],
967
+ 'Yellowtail'=>[['normal'],['latin']],
968
+ 'Yeon Sung'=>[['normal'],['korean','latin']],
969
+ 'Yeseva One'=>[['normal'],['cyrillic-ext','cyrillic','latin-ext','latin','vietnamese']],
970
+ 'Yesteryear'=>[['normal'],['latin']],
971
+ 'Yrsa'=>[['300','normal','500','600','700'],['latin-ext','latin']],
972
+ 'ZCOOL KuaiLe'=>[['normal'],['chinese-simplified','latin']],
973
+ 'ZCOOL QingKe HuangYou'=>[['normal'],['chinese-simplified','latin']],
974
+ 'ZCOOL XiaoWei'=>[['normal'],['chinese-simplified','latin']],
975
+ 'Zeyada'=>[['normal'],['latin']],
976
+ 'Zhi Mang Xing'=>[['normal'],['chinese-simplified','latin']],
977
+ 'Zilla Slab'=>[['300','300italic','normal','italic','500','500italic','600','600italic','700','700italic'],['latin-ext','latin']],
978
+ 'Zilla Slab Highlight'=>[['normal','700'],['latin-ext','latin']]
979
+ ];
980
+ }
981
+ }
admin/settings/fields/typography/typography.php ADDED
@@ -0,0 +1,527 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Field: typography
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF_Field_typography' ) ) {
11
+ class CSF_Field_typography extends CSF_Fields {
12
+
13
+ public $chosen = false;
14
+
15
+ public $value = array();
16
+
17
+ public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
18
+ parent::__construct( $field, $value, $unique, $where, $parent );
19
+ }
20
+
21
+ public function render() {
22
+
23
+ echo $this->field_before();
24
+
25
+ $args = wp_parse_args( $this->field, array(
26
+ 'font_family' => true,
27
+ 'font_weight' => true,
28
+ 'font_style' => true,
29
+ 'font_size' => true,
30
+ 'line_height' => true,
31
+ 'letter_spacing' => true,
32
+ 'text_align' => true,
33
+ 'text_transform' => true,
34
+ 'color' => true,
35
+ 'chosen' => true,
36
+ 'preview' => true,
37
+ 'subset' => true,
38
+ 'multi_subset' => false,
39
+ 'extra_styles' => false,
40
+ 'backup_font_family' => false,
41
+ 'font_variant' => false,
42
+ 'word_spacing' => false,
43
+ 'text_decoration' => false,
44
+ 'custom_style' => false,
45
+ 'exclude' => '',
46
+ 'unit' => 'px',
47
+ 'preview_text' => 'The quick brown fox jumps over the lazy dog',
48
+ ) );
49
+
50
+ $default_value = array(
51
+ 'font-family' => '',
52
+ 'font-weight' => '',
53
+ 'font-style' => '',
54
+ 'font-variant' => '',
55
+ 'font-size' => '',
56
+ 'line-height' => '',
57
+ 'letter-spacing' => '',
58
+ 'word-spacing' => '',
59
+ 'text-align' => '',
60
+ 'text-transform' => '',
61
+ 'text-decoration' => '',
62
+ 'backup-font-family' => '',
63
+ 'color' => '',
64
+ 'custom-style' => '',
65
+ 'type' => '',
66
+ 'subset' => '',
67
+ 'extra-styles' => array(),
68
+ );
69
+
70
+ $default_value = ( ! empty( $this->field['default'] ) ) ? wp_parse_args( $this->field['default'], $default_value ) : $default_value;
71
+ $this->value = wp_parse_args( $this->value, $default_value );
72
+ $this->chosen = $args['chosen'];
73
+ $chosen_class = ( $this->chosen ) ? ' csf--chosen' : '';
74
+
75
+ echo '<div class="csf--typography'. $chosen_class .'" data-unit="'. $args['unit'] .'" data-exclude="'. $args['exclude'] .'">';
76
+
77
+ echo '<div class="csf--blocks csf--blocks-selects">';
78
+
79
+ //
80
+ // Font Family
81
+ if( ! empty( $args['font_family'] ) ) {
82
+ echo '<div class="csf--block">';
83
+ echo '<div class="csf--title">'. esc_html__( 'Font Family', 'csf' ) .'</div>';
84
+ echo $this->create_select( array( $this->value['font-family'] => $this->value['font-family'] ), 'font-family', esc_html__( 'Select a font', 'csf' ) );
85
+ echo '</div>';
86
+ }
87
+
88
+ //
89
+ // Backup Font Family
90
+ if( ! empty( $args['backup_font_family'] ) ) {
91
+ echo '<div class="csf--block csf--block-backup-font-family hidden">';
92
+ echo '<div class="csf--title">'. esc_html__( 'Backup Font Family', 'csf' ) .'</div>';
93
+ echo $this->create_select( apply_filters( 'csf_field_typography_backup_font_family', array(
94
+ 'Arial, Helvetica, sans-serif',
95
+ "'Arial Black', Gadget, sans-serif",
96
+ "'Comic Sans MS', cursive, sans-serif",
97
+ 'Impact, Charcoal, sans-serif',
98
+ "'Lucida Sans Unicode', 'Lucida Grande', sans-serif",
99
+ 'Tahoma, Geneva, sans-serif',
100
+ "'Trebuchet MS', Helvetica, sans-serif'",
101
+ 'Verdana, Geneva, sans-serif',
102
+ "'Courier New', Courier, monospace",
103
+ "'Lucida Console', Monaco, monospace",
104
+ 'Georgia, serif',
105
+ 'Palatino Linotype'
106
+ ) ), 'backup-font-family', esc_html__( 'Default', 'csf' ) );
107
+ echo '</div>';
108
+ }
109
+
110
+ //
111
+ // Font Style and Extra Style Select
112
+ if( ! empty( $args['font_weight'] ) || ! empty( $args['font_style'] ) ) {
113
+
114
+ //
115
+ // Font Style Select
116
+ echo '<div class="csf--block csf--block-font-style hidden">';
117
+ echo '<div class="csf--title">'. esc_html__( 'Font Style', 'csf') .'</div>';
118
+ echo '<select class="csf--font-style-select" data-placeholder="Default">';
119
+ echo '<option value="">'. ( ! $this->chosen ? esc_html__( 'Default', 'csf' ) : '' ) .'</option>';
120
+ if( ! empty( $this->value['font-weight'] ) || ! empty( $this->value['font-style'] ) ) {
121
+ echo '<option value="'. strtolower( $this->value['font-weight'] . $this->value['font-style'] ) .'" selected></option>';
122
+ }
123
+ echo '</select>';
124
+ echo '<input type="hidden" name="'. $this->field_name( '[font-weight]' ) .'" class="csf--font-weight" value="'. $this->value['font-weight'] .'" />';
125
+ echo '<input type="hidden" name="'. $this->field_name( '[font-style]' ) .'" class="csf--font-style" value="'. $this->value['font-style'] .'" />';
126
+
127
+ //
128
+ // Extra Font Style Select
129
+ if( ! empty( $args['extra_styles'] ) ) {
130
+ echo '<div class="csf--block-extra-styles hidden">';
131
+ echo ( ! $this->chosen ) ? '<div class="csf--title">'. esc_html__( 'Load Extra Styles', 'csf' ) .'</div>' : '';
132
+ $placeholder = ( $this->chosen ) ? esc_html__( 'Load Extra Styles', 'csf' ) : esc_html__( 'Default', 'csf' );
133
+ echo $this->create_select( $this->value['extra-styles'], 'extra-styles', $placeholder, true );
134
+ echo '</div>';
135
+ }
136
+
137
+ echo '</div>';
138
+
139
+ }
140
+
141
+ //
142
+ // Subset
143
+ if( ! empty( $args['subset'] ) ) {
144
+ echo '<div class="csf--block csf--block-subset hidden">';
145
+ echo '<div class="csf--title">'. esc_html__( 'Subset', 'csf' ) .'</div>';
146
+ $subset = ( is_array( $this->value['subset'] ) ) ? $this->value['subset'] : array_filter( (array) $this->value['subset'] );
147
+ echo $this->create_select( $subset, 'subset', esc_html__( 'Default', 'csf' ), $args['multi_subset'] );
148
+ echo '</div>';
149
+ }
150
+
151
+ //
152
+ // Text Align
153
+ if( ! empty( $args['text_align'] ) ) {
154
+ echo '<div class="csf--block">';
155
+ echo '<div class="csf--title">'. esc_html__( 'Text Align', 'csf' ) .'</div>';
156
+ echo $this->create_select( array(
157
+ 'inherit' => esc_html__( 'Inherit', 'csf' ),
158
+ 'left' => esc_html__( 'Left', 'csf' ),
159
+ 'center' => esc_html__( 'Center', 'csf' ),
160
+ 'right' => esc_html__( 'Right', 'csf' ),
161
+ 'justify' => esc_html__( 'Justify', 'csf' ),
162
+ 'initial' => esc_html__( 'Initial', 'csf' )
163
+ ), 'text-align', esc_html__( 'Default', 'csf' ) );
164
+ echo '</div>';
165
+ }
166
+
167
+ //
168
+ // Font Variant
169
+ if( ! empty( $args['font_variant'] ) ) {
170
+ echo '<div class="csf--block">';
171
+ echo '<div class="csf--title">'. esc_html__( 'Font Variant', 'csf' ) .'</div>';
172
+ echo $this->create_select( array(
173
+ 'normal' => esc_html__( 'Normal', 'csf' ),
174
+ 'small-caps' => esc_html__( 'Small Caps', 'csf' ),
175
+ 'all-small-caps' => esc_html__( 'All Small Caps', 'csf' )
176
+ ), 'font-variant', esc_html__( 'Default', 'csf' ) );
177
+ echo '</div>';
178
+ }
179
+
180
+ //
181
+ // Text Transform
182
+ if( ! empty( $args['text_transform'] ) ) {
183
+ echo '<div class="csf--block">';
184
+ echo '<div class="csf--title">'. esc_html__( 'Text Transform', 'csf' ) .'</div>';
185
+ echo $this->create_select( array(
186
+ 'none' => esc_html__( 'None', 'csf' ),
187
+ 'capitalize' => esc_html__( 'Capitalize', 'csf' ),
188
+ 'uppercase' => esc_html__( 'Uppercase', 'csf' ),
189
+ 'lowercase' => esc_html__( 'Lowercase', 'csf' )
190
+ ), 'text-transform', esc_html__( 'Default', 'csf' ) );
191
+ echo '</div>';
192
+ }
193
+
194
+ //
195
+ // Text Decoration
196
+ if( ! empty( $args['text_decoration'] ) ) {
197
+ echo '<div class="csf--block">';
198
+ echo '<div class="csf--title">'. esc_html__( 'Text Decoration', 'csf' ) .'</div>';
199
+ echo $this->create_select( array(
200
+ 'none' => esc_html__( 'None', 'csf' ),
201
+ 'underline' => esc_html__( 'Solid', 'csf' ),
202
+ 'underline double' => esc_html__( 'Double', 'csf' ),
203
+ 'underline dotted' => esc_html__( 'Dotted', 'csf' ),
204
+ 'underline dashed' => esc_html__( 'Dashed', 'csf' ),
205
+ 'underline wavy' => esc_html__( 'Wavy', 'csf' ),
206
+ 'underline overline' => esc_html__( 'Overline', 'csf' ),
207
+ 'line-through' => esc_html__( 'Line-through', 'csf' )
208
+ ), 'text-decoration', esc_html__( 'Default', 'csf' ) );
209
+ echo '</div>';
210
+ }
211
+
212
+ echo '</div>';
213
+
214
+ echo '<div class="csf--blocks csf--blocks-inputs">';
215
+
216
+ //
217
+ // Font Size
218
+ if( ! empty( $args['font_size'] ) ) {
219
+ echo '<div class="csf--block">';
220
+ echo '<div class="csf--title">'. esc_html__( 'Font Size', 'csf' ) .'</div>';
221
+ echo '<div class="csf--input-wrap">';
222
+ echo '<input type="number" name="'. $this->field_name( '[font-size]' ) .'" class="csf--font-size csf--input csf-input-number" value="'. $this->value['font-size'] .'" />';
223
+ echo '<span class="csf--unit">'. $args['unit'] .'</span>';
224
+ echo '</div>';
225
+ echo '</div>';
226
+ }
227
+
228
+ //
229
+ // Line Height
230
+ if( ! empty( $args['line_height'] ) ) {
231
+ echo '<div class="csf--block">';
232
+ echo '<div class="csf--title">'. esc_html__( 'Line Height', 'csf' ) .'</div>';
233
+ echo '<div class="csf--input-wrap">';
234
+ echo '<input type="number" name="'. $this->field_name( '[line-height]' ) .'" class="csf--line-height csf--input csf-input-number" value="'. $this->value['line-height'] .'" />';
235
+ echo '<span class="csf--unit">'. $args['unit'] .'</span>';
236
+ echo '</div>';
237
+ echo '</div>';
238
+ }
239
+
240
+ //
241
+ // Letter Spacing
242
+ if( ! empty( $args['letter_spacing'] ) ) {
243
+ echo '<div class="csf--block">';
244
+ echo '<div class="csf--title">'. esc_html__( 'Letter Spacing', 'csf' ) .'</div>';
245
+ echo '<div class="csf--input-wrap">';
246
+ echo '<input type="number" name="'. $this->field_name( '[letter-spacing]' ) .'" class="csf--letter-spacing csf--input csf-input-number" value="'. $this->value['letter-spacing'] .'" />';
247
+ echo '<span class="csf--unit">'. $args['unit'] .'</span>';
248
+ echo '</div>';
249
+ echo '</div>';
250
+ }
251
+
252
+ //
253
+ // Word Spacing
254
+ if( ! empty( $args['word_spacing'] ) ) {
255
+ echo '<div class="csf--block">';
256
+ echo '<div class="csf--title">'. esc_html__( 'Word Spacing', 'csf' ) .'</div>';
257
+ echo '<div class="csf--input-wrap">';
258
+ echo '<input type="number" name="'. $this->field_name( '[word-spacing]' ) .'" class="csf--word-spacing csf--input csf-input-number" value="'. $this->value['word-spacing'] .'" />';
259
+ echo '<span class="csf--unit">'. $args['unit'] .'</span>';
260
+ echo '</div>';
261
+ echo '</div>';
262
+ }
263
+
264
+ echo '</div>';
265
+
266
+ //
267
+ // Font Color
268
+ if( ! empty( $args['color'] ) ) {
269
+ $default_color_attr = ( ! empty( $default_value['color'] ) ) ? ' data-default-color="'. $default_value['color'] .'"' : '';
270
+ echo '<div class="csf--block csf--block-font-color">';
271
+ echo '<div class="csf--title">'. esc_html__( 'Font Color', 'csf' ) .'</div>';
272
+ echo '<div class="csf-field-color">';
273
+ echo '<input type="text" name="'. $this->field_name( '[color]' ) .'" class="csf-color csf--color" value="'. $this->value['color'] .'"'. $default_color_attr .' />';
274
+ echo '</div>';
275
+ echo '</div>';
276
+ }
277
+
278
+ //
279
+ // Custom style
280
+ if( ! empty( $args['custom_style'] ) ) {
281
+ echo '<div class="csf--block csf--block-custom-style">';
282
+ echo '<div class="csf--title">'. esc_html__( 'Custom Style', 'csf' ) .'</div>';
283
+ echo '<textarea name="'. $this->field_name( '[custom-style]' ) .'" class="csf--custom-style">'. $this->value['custom-style'] .'</textarea>';
284
+ echo '</div>';
285
+ }
286
+
287
+ //
288
+ // Preview
289
+ $always_preview = ( $args['preview'] !== 'always' ) ? ' hidden' : '';
290
+
291
+ if( ! empty( $args['preview'] ) ) {
292
+ echo '<div class="csf--block csf--block-preview'. $always_preview .'">';
293
+ echo '<div class="csf--toggle fa fa-toggle-off"></div>';
294
+ echo '<div class="csf--preview">'. $args['preview_text'] .'</div>';
295
+ echo '</div>';
296
+ }
297
+
298
+ echo '<input type="hidden" name="'. $this->field_name( '[type]' ) .'" class="csf--type" value="'. $this->value['type'] .'" />';
299
+ echo '<input type="hidden" name="'. $this->field_name( '[unit]' ) .'" class="csf--unit-save" value="'. $args['unit'] .'" />';
300
+
301
+ echo '</div>';
302
+
303
+ echo $this->field_after();
304
+
305
+ }
306
+
307
+ public function create_select( $options, $name, $placeholder = '', $is_multiple = false ) {
308
+
309
+ $multiple_name = ( $is_multiple ) ? '[]' : '';
310
+ $multiple_attr = ( $is_multiple ) ? ' multiple data-multiple="true"' : '';
311
+ $chosen_rtl = ( $this->chosen && is_rtl() ) ? ' chosen-rtl' : '';
312
+
313
+ $output = '<select name="'. $this->field_name( '['. $name .']'. $multiple_name ) .'" class="csf--'. $name . $chosen_rtl .'" data-placeholder="'. $placeholder .'"'. $multiple_attr .'>';
314
+ $output .= ( ! empty( $placeholder ) ) ? '<option value="">'. ( ( ! $this->chosen ) ? $placeholder : '' ) .'</option>' : '';
315
+
316
+ if( ! empty( $options ) ) {
317
+ foreach ( $options as $option_key => $option_value ) {
318
+ if( $is_multiple ) {
319
+ $selected = ( in_array( $option_value, $this->value[$name] ) ) ? ' selected' : '';
320
+ $output .= '<option value="'. $option_value .'"'. $selected .'>'. $option_value .'</option>';
321
+ } else {
322
+ $option_key = ( is_numeric( $option_key ) ) ? $option_value : $option_key;
323
+ $selected = ( $option_key === $this->value[$name] ) ? ' selected' : '';
324
+ $output .= '<option value="'. $option_key .'"'. $selected .'>'. $option_value .'</option>';
325
+ }
326
+ }
327
+ }
328
+
329
+ $output .= '</select>';
330
+
331
+ return $output;
332
+
333
+ }
334
+
335
+ public function enqueue() {
336
+
337
+ if( ! wp_style_is( 'csf-webfont-loader' ) ) {
338
+
339
+ CSF::include_plugin_file( 'fields/typography/google-fonts.php' );
340
+
341
+ wp_enqueue_script( 'csf-webfont-loader', 'https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js', array( 'csf' ), '1.6.28', true );
342
+
343
+ $webfonts = array();
344
+
345
+ $customwebfonts = apply_filters( 'csf_field_typography_customwebfonts', array() );
346
+
347
+ if( ! empty( $customwebfonts ) ) {
348
+ $webfonts['custom'] = array(
349
+ 'label' => esc_html__( 'Custom Web Fonts', 'csf' ),
350
+ 'fonts' => $customwebfonts
351
+ );
352
+ }
353
+
354
+ $webfonts['safe'] = array(
355
+ 'label' => esc_html__( 'Safe Web Fonts', 'csf' ),
356
+ 'fonts' => apply_filters( 'csf_field_typography_safewebfonts', array(
357
+ 'Arial',
358
+ 'Arial Black',
359
+ 'Helvetica',
360
+ 'Times New Roman',
361
+ 'Courier New',
362
+ 'Tahoma',
363
+ 'Verdana',
364
+ 'Impact',
365
+ 'Trebuchet MS',
366
+ 'Comic Sans MS',
367
+ 'Lucida Console',
368
+ 'Lucida Sans Unicode',
369
+ 'Georgia, serif',
370
+ 'Palatino Linotype'
371
+ )
372
+ ) );
373
+
374
+ $webfonts['google'] = array(
375
+ 'label' => esc_html__( 'Google Web Fonts', 'csf' ),
376
+ 'fonts' => apply_filters( 'csf_field_typography_googlewebfonts', csf_get_google_fonts()
377
+ ) );
378
+
379
+ $defaultstyles = apply_filters( 'csf_field_typography_defaultstyles', array( 'normal', 'italic', '700', '700italic' ) );
380
+
381
+ $googlestyles = apply_filters( 'csf_field_typography_googlestyles', array(
382
+ '100' => 'Thin 100',
383
+ '100italic' => 'Thin 100 Italic',
384
+ '200' => 'Extra-Light 200',
385
+ '200italic' => 'Extra-Light 200 Italic',
386
+ '300' => 'Light 300',
387
+ '300italic' => 'Light 300 Italic',
388
+ 'normal' => 'Normal 400',
389
+ 'italic' => 'Normal 400 Italic',
390
+ '500' => 'Medium 500',
391
+ '500italic' => 'Medium 500 Italic',
392
+ '600' => 'Semi-Bold 600',
393
+ '600italic' => 'Semi-Bold 600 Italic',
394
+ '700' => 'Bold 700',
395
+ '700italic' => 'Bold 700 Italic',
396
+ '800' => 'Extra-Bold 800',
397
+ '800italic' => 'Extra-Bold 800 Italic',
398
+ '900' => 'Black 900',
399
+ '900italic' => 'Black 900 Italic'
400
+ ) );
401
+
402
+ $webfonts = apply_filters( 'csf_field_typography_webfonts', $webfonts );
403
+
404
+ wp_localize_script( 'csf', 'csf_typography_json', array(
405
+ 'webfonts' => $webfonts,
406
+ 'defaultstyles' => $defaultstyles,
407
+ 'googlestyles' => $googlestyles
408
+ ) );
409
+
410
+ }
411
+
412
+ }
413
+
414
+ public function enqueue_google_fonts() {
415
+
416
+ $value = $this->value;
417
+ $families = array();
418
+ $is_google = false;
419
+
420
+ if( ! empty( $this->value['type'] ) ) {
421
+ $is_google = ( $this->value['type'] === 'google' ) ? true : false;
422
+ } else {
423
+ CSF::include_plugin_file( 'fields/typography/google-fonts.php' );
424
+ $is_google = ( array_key_exists( $this->value['font-family'], csf_get_google_fonts() ) ) ? true : false;
425
+ }
426
+
427
+ if( $is_google ) {
428
+
429
+ // set style
430
+ $font_weight = ( ! empty( $value['font-weight'] ) ) ? $value['font-weight'] : '';
431
+ $font_style = ( ! empty( $value['font-style'] ) ) ? $value['font-style'] : '';
432
+
433
+ if( $font_weight || $font_style ) {
434
+ $style = $font_weight . $font_style;
435
+ $families['style'][$style] = $style;
436
+ }
437
+
438
+ // set extra styles
439
+ if( ! empty( $value['extra-styles'] ) ) {
440
+ foreach( $value['extra-styles'] as $extra_style ) {
441
+ $families['style'][$extra_style] = $extra_style;
442
+ }
443
+ }
444
+
445
+ // set subsets
446
+ if( ! empty( $value['subset'] ) ) {
447
+ $value['subset'] = ( is_array( $value['subset'] ) ) ? $value['subset'] : array_filter( (array) $value['subset'] );
448
+ foreach( $value['subset'] as $subset ) {
449
+ $families['subset'][$subset] = $subset;
450
+ }
451
+ }
452
+
453
+ $all_styles = ( ! empty( $families['style'] ) ) ? ':'. implode( ',', $families['style'] ) : '';
454
+ $all_subsets = ( ! empty( $families['subset'] ) ) ? ':'. implode( ',', $families['subset'] ) : '';
455
+
456
+ $families = $this->value['font-family'] . str_replace( array( 'normal', 'italic' ), array( 'n', 'i' ), $all_styles ) . $all_subsets;
457
+
458
+ $this->parent->typographies[] = $families;
459
+
460
+ return $families;
461
+
462
+ }
463
+
464
+ return false;
465
+
466
+ }
467
+
468
+ public function output() {
469
+
470
+ $output = '';
471
+ $bg_image = array();
472
+ $important = ( ! empty( $this->field['output_important'] ) ) ? '!important' : '';
473
+ $element = ( is_array( $this->field['output'] ) ) ? join( ',', $this->field['output'] ) : $this->field['output'];
474
+
475
+ $font_family = ( ! empty( $this->value['font-family'] ) ) ? $this->value['font-family'] : '';
476
+ $backup_family = ( ! empty( $this->value['backup-font-family'] ) ) ? ', '. $this->value['backup-font-family'] : '';
477
+
478
+ if( $font_family ) {
479
+ $output .= 'font-family:"'. $font_family .'"'. $backup_family . $important .';';
480
+ }
481
+
482
+ // Common font properties
483
+ $properties = array(
484
+ 'color',
485
+ 'font-weight',
486
+ 'font-style',
487
+ 'font-variant',
488
+ 'text-align',
489
+ 'text-transform',
490
+ 'text-decoration',
491
+ );
492
+
493
+ foreach( $properties as $property ) {
494
+ if( isset( $this->value[$property] ) && $this->value[$property] !== '' ) {
495
+ $output .= $property .':'. $this->value[$property] . $important .';';
496
+ }
497
+ }
498
+
499
+ $properties = array(
500
+ 'font-size',
501
+ 'line-height',
502
+ 'letter-spacing',
503
+ 'word-spacing',
504
+ );
505
+
506
+ $unit = ( ! empty( $this->value['unit'] ) ) ? $this->value['unit'] : '';
507
+
508
+ foreach( $properties as $property ) {
509
+ if( isset( $this->value[$property] ) && $this->value[$property] !== '' ) {
510
+ $output .= $property .':'. $this->value[$property] . $unit . $important .';';
511
+ }
512
+ }
513
+
514
+ $custom_style = ( ! empty( $this->value['custom-style'] ) ) ? $this->value['custom-style'] : '';
515
+
516
+ if( $output ) {
517
+ $output = $element .'{'. $output . $custom_style .'}';
518
+ }
519
+
520
+ $this->parent->output_css .= $output;
521
+
522
+ return $output;
523
+
524
+ }
525
+
526
+ }
527
+ }
admin/settings/fields/upload/upload.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Field: upload
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF_Field_upload' ) ) {
11
+ class CSF_Field_upload extends CSF_Fields {
12
+
13
+ public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
14
+ parent::__construct( $field, $value, $unique, $where, $parent );
15
+ }
16
+
17
+ public function render() {
18
+
19
+ $args = wp_parse_args( $this->field, array(
20
+ 'library' => array(),
21
+ 'button_title' => esc_html__( 'Upload', 'csf' ),
22
+ 'remove_title' => esc_html__( 'Remove', 'csf' ),
23
+ ) );
24
+
25
+ echo $this->field_before();
26
+
27
+ $library = ( is_array( $args['library'] ) ) ? $args['library'] : array_filter( (array) $args['library'] );
28
+ $library = ( ! empty( $library ) ) ? implode(',', $library ) : '';
29
+ $hidden = ( empty( $this->value ) ) ? ' hidden' : '';
30
+
31
+ echo '<div class="csf--wrap">';
32
+ echo '<input type="text" name="'. $this->field_name() .'" value="'. $this->value .'"'. $this->field_attributes() .'/>';
33
+ echo '<a href="#" class="button button-primary csf--button" data-library="'. esc_attr( $library ) .'">'. $args['button_title'] .'</a>';
34
+ echo '<a href="#" class="button button-secondary csf-warning-primary csf--remove'. $hidden .'">'. $args['remove_title'] .'</a>';
35
+ echo '</div>';
36
+
37
+ echo $this->field_after();
38
+
39
+ }
40
+ }
41
+ }
admin/settings/fields/wp_editor/wp_editor.php ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Field: wp_editor
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'CSF_Field_wp_editor' ) ) {
11
+ class CSF_Field_wp_editor extends CSF_Fields {
12
+
13
+ public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
14
+ parent::__construct( $field, $value, $unique, $where, $parent );
15
+ }
16
+
17
+ public function render() {
18
+
19
+ $args = wp_parse_args( $this->field, array(
20
+ 'tinymce' => true,
21
+ 'quicktags' => true,
22
+ 'media_buttons' => true,
23
+ 'height' => '',
24
+ ) );
25
+
26
+ $attributes = array(
27
+ 'rows' => 10,
28
+ 'class' => 'wp-editor-area',
29
+ 'autocomplete' => 'off',
30
+ );
31
+
32
+ $editor_height = ( ! empty( $args['height'] ) ) ? ' style="height:'. $args['height']. ';"' : '';
33
+
34
+ $editor_settings = array(
35
+ 'tinymce' => $args['tinymce'],
36
+ 'quicktags' => $args['quicktags'],
37
+ 'media_buttons' => $args['media_buttons'],
38
+ );
39
+
40
+ echo $this->field_before();
41
+
42
+ echo ( csf_wp_editor_api() ) ? '<div class="csf-wp-editor" data-editor-settings="'. esc_attr( wp_json_encode( $editor_settings ) ) .'">' : '';
43
+
44
+ echo '<textarea name="'. $this->field_name() .'"'. $this->field_attributes( $attributes ) . $editor_height .'>'. $this->value .'</textarea>';
45
+
46
+ echo '<div class="clear"></div>';
47
+
48
+ echo ( csf_wp_editor_api() ) ? '</div>' : '';
49
+
50
+ echo $this->field_after();
51
+
52
+ }
53
+
54
+ public function enqueue() {
55
+
56
+ if( csf_wp_editor_api() && function_exists( 'wp_enqueue_editor' ) ) {
57
+
58
+ wp_enqueue_editor();
59
+
60
+ $this->setup_wp_editor_settings();
61
+
62
+ add_action( 'print_default_editor_scripts', array( &$this, 'setup_wp_editor_media_buttons' ) );
63
+
64
+ }
65
+
66
+ }
67
+
68
+ // Setup wp editor media buttons
69
+ public function setup_wp_editor_media_buttons() {
70
+
71
+ ob_start();
72
+ echo '<div class="wp-media-buttons">';
73
+ do_action( 'media_buttons' );
74
+ echo '</div>';
75
+ $media_buttons = ob_get_clean();
76
+
77
+ echo '<script type="text/javascript">';
78
+ echo 'var csf_media_buttons = '. wp_json_encode( $media_buttons ) .';';
79
+ echo '</script>';
80
+
81
+ }
82
+
83
+ // Setup wp editor settings
84
+ public function setup_wp_editor_settings() {
85
+
86
+ if( csf_wp_editor_api() && class_exists( '_WP_Editors') ) {
87
+
88
+ $defaults = apply_filters( 'csf_wp_editor', array(
89
+ 'tinymce' => array(
90
+ 'wp_skip_init' => true
91
+ ),
92
+ ) );
93
+
94
+ $setup = _WP_Editors::parse_settings( 'csf_wp_editor', $defaults );
95
+
96
+ _WP_Editors::editor_settings( 'csf_wp_editor', $setup );
97
+
98
+ }
99
+
100
+ }
101
+
102
+ }
103
+ }
admin/settings/functions/actions.php ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Get icons from admin ajax
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! function_exists( 'csf_get_icons' ) ) {
11
+ function csf_get_icons() {
12
+
13
+ if( ! empty( $_POST['nonce'] ) && wp_verify_nonce( $_POST['nonce'], 'csf_icon_nonce' ) ) {
14
+
15
+ ob_start();
16
+
17
+ CSF::include_plugin_file( 'fields/icon/default-icons.php' );
18
+
19
+ $icon_lists = apply_filters( 'csf_field_icon_add_icons', csf_get_default_icons() );
20
+
21
+ if( ! empty( $icon_lists ) ) {
22
+
23
+ foreach ( $icon_lists as $list ) {
24
+
25
+ echo ( count( $icon_lists ) >= 2 ) ? '<div class="csf-icon-title">'. $list['title'] .'</div>' : '';
26
+
27
+ foreach ( $list['icons'] as $icon ) {
28
+ echo '<a class="csf-icon-tooltip" data-csf-icon="'. $icon .'" title="'. $icon .'"><span class="csf-icon csf-selector"><i class="'. $icon .'"></i></span></a>';
29
+ }
30
+
31
+ }
32
+
33
+ } else {
34
+
35
+ echo '<div class="csf-text-error">'. esc_html__( 'No data provided by developer', 'csf' ) .'</div>';
36
+
37
+ }
38
+
39
+ wp_send_json_success( array( 'content' => ob_get_clean() ) );
40
+
41
+ } else {
42
+
43
+ wp_send_json_error( array( 'error' => esc_html__( 'Error: Nonce verification has failed. Please try again.', 'csf' ) ) );
44
+
45
+ }
46
+
47
+ }
48
+ add_action( 'wp_ajax_csf-get-icons', 'csf_get_icons' );
49
+ }
50
+
51
+ /**
52
+ *
53
+ * Export
54
+ *
55
+ * @since 1.0.0
56
+ * @version 1.0.0
57
+ *
58
+ */
59
+ if( ! function_exists( 'csf_export' ) ) {
60
+ function csf_export() {
61
+
62
+ if( ! empty( $_GET['export'] ) && ! empty( $_GET['nonce'] ) && wp_verify_nonce( $_GET['nonce'], 'csf_backup_nonce' ) ) {
63
+
64
+ header('Content-Type: application/json');
65
+ header('Content-disposition: attachment; filename=backup-'. gmdate( 'd-m-Y' ) .'.json');
66
+ header('Content-Transfer-Encoding: binary');
67
+ header('Pragma: no-cache');
68
+ header('Expires: 0');
69
+
70
+ echo json_encode( get_option( wp_unslash( $_GET['export'] ) ) );
71
+
72
+ }
73
+
74
+ die();
75
+ }
76
+ add_action( 'wp_ajax_csf-export', 'csf_export' );
77
+ }
78
+
79
+ /**
80
+ *
81
+ * Import Ajax
82
+ *
83
+ * @since 1.0.0
84
+ * @version 1.0.0
85
+ *
86
+ */
87
+ if( ! function_exists( 'csf_import_ajax' ) ) {
88
+ function csf_import_ajax() {
89
+
90
+ if( ! empty( $_POST['import_data'] ) && ! empty( $_POST['unique'] ) && ! empty( $_POST['nonce'] ) && wp_verify_nonce( $_POST['nonce'], 'csf_backup_nonce' ) ) {
91
+
92
+ $import_data = json_decode( wp_unslash( trim( $_POST['import_data'] ) ), true );
93
+
94
+ if( is_array( $import_data ) ) {
95
+
96
+ update_option( wp_unslash( $_POST['unique'] ), wp_unslash( $import_data ) );
97
+ wp_send_json_success();
98
+
99
+ }
100
+
101
+ }
102
+
103
+ wp_send_json_error( array( 'error' => esc_html__( 'Error: Nonce verification has failed. Please try again.', 'csf' ) ) );
104
+
105
+ }
106
+ add_action( 'wp_ajax_csf-import', 'csf_import_ajax' );
107
+ }
108
+
109
+ /**
110
+ *
111
+ * Reset Ajax
112
+ *
113
+ * @since 1.0.0
114
+ * @version 1.0.0
115
+ *
116
+ */
117
+ if( ! function_exists( 'csf_reset_ajax' ) ) {
118
+ function csf_reset_ajax() {
119
+
120
+ if( ! empty( $_POST['unique'] ) && ! empty( $_POST['nonce'] ) && wp_verify_nonce( $_POST['nonce'], 'csf_backup_nonce' ) ) {
121
+ delete_option( wp_unslash( $_POST['unique'] ) );
122
+ wp_send_json_success();
123
+ }
124
+
125
+ wp_send_json_error( array( 'error' => esc_html__( 'Error: Nonce verification has failed. Please try again.', 'csf' ) ) );
126
+
127
+ }
128
+ add_action( 'wp_ajax_csf-reset', 'csf_reset_ajax' );
129
+ }
130
+
131
+ /**
132
+ *
133
+ * Chosen Ajax
134
+ *
135
+ * @since 1.0.0
136
+ * @version 1.0.0
137
+ *
138
+ */
139
+ if( ! function_exists( 'csf_chosen_ajax' ) ) {
140
+ function csf_chosen_ajax() {
141
+
142
+ if( ! empty( $_POST['term'] ) && ! empty( $_POST['type'] ) && ! empty( $_POST['nonce'] ) && wp_verify_nonce( $_POST['nonce'], 'csf_chosen_ajax_nonce' ) ) {
143
+
144
+ $capability = apply_filters( 'csf_chosen_ajax_capability', 'manage_options' );
145
+
146
+ if( current_user_can( $capability ) ) {
147
+
148
+ $type = $_POST['type'];
149
+ $term = $_POST['term'];
150
+ $query_args = ( ! empty( $_POST['query_args'] ) ) ? $_POST['query_args'] : array();
151
+ $options = CSF_Fields::field_data( $type, $term, $query_args );
152
+
153
+ wp_send_json_success( $options );
154
+
155
+ } else {
156
+ wp_send_json_error( array( 'error' => esc_html__( 'You do not have required permissions to access.', 'csf' ) ) );
157
+ }
158
+
159
+ } else {
160
+ wp_send_json_error( array( 'error' => esc_html__( 'Error: Nonce verification has failed. Please try again.', 'csf' ) ) );
161
+ }
162
+
163
+ }
164
+ add_action( 'wp_ajax_csf-chosen', 'csf_chosen_ajax' );
165
+ }
166
+
167
+ /**
168
+ *
169
+ * Set icons for wp dialog
170
+ *
171
+ * @since 1.0.0
172
+ * @version 1.0.0
173
+ *
174
+ */
175
+ if( ! function_exists( 'csf_set_icons' ) ) {
176
+ function csf_set_icons() {
177
+ ?>
178
+ <div id="csf-modal-icon" class="csf-modal csf-modal-icon">
179
+ <div class="csf-modal-table">
180
+ <div class="csf-modal-table-cell">
181
+ <div class="csf-modal-overlay"></div>
182
+ <div class="csf-modal-inner">
183
+ <div class="csf-modal-title">
184
+ <?php esc_html_e( 'Add Icon', 'csf' ); ?>
185
+ <div class="csf-modal-close csf-icon-close"></div>
186
+ </div>
187
+ <div class="csf-modal-header csf-text-center">
188
+ <input type="text" placeholder="<?php esc_html_e( 'Search a Icon...', 'csf' ); ?>" class="csf-icon-search" />
189
+ </div>
190
+ <div class="csf-modal-content">
191
+ <div class="csf-modal-loading"><div class="csf-loading"></div></div>
192
+ <div class="csf-modal-load"></div>
193
+ </div>
194
+ </div>
195
+ </div>
196
+ </div>
197
+ </div>
198
+ <?php
199
+ }
200
+ add_action( 'admin_footer', 'csf_set_icons' );
201
+ add_action( 'customize_controls_print_footer_scripts', 'csf_set_icons' );
202
+ }
admin/settings/functions/customize.php ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * WP Customize custom panel
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if( ! class_exists( 'WP_Customize_Panel_CSF' ) && class_exists( 'WP_Customize_Panel' ) ) {
11
+ class WP_Customize_Panel_CSF extends WP_Customize_Panel {
12
+ public $type = 'csf';
13
+ }
14
+ }
15
+
16
+ /**
17
+ *
18
+ * WP Customize custom section
19
+ *
20
+ * @since 1.0.0
21
+ * @version 1.0.0
22
+ *
23
+ */
24
+ if( ! class_exists( 'WP_Customize_Section_CSF' ) && class_exists( 'WP_Customize_Section' ) ) {
25
+ class WP_Customize_Section_CSF extends WP_Customize_Section {
26
+ public $type = 'csf';
27
+ }
28
+ }
29
+
30
+ /**
31
+ *
32
+ * WP Customize custom control
33
+ *
34
+ * @since 1.0.0
35
+ * @version 1.0.0
36
+ *
37
+ */
38
+ if( ! class_exists( 'WP_Customize_Control_CSF' ) && class_exists( 'WP_Customize_Control' ) ) {
39
+ class WP_Customize_Control_CSF extends WP_Customize_Control {
40
+
41
+ public $type = 'csf';
42
+ public $field = '';
43
+ public $unique = '';
44
+
45
+ protected function render() {
46
+
47
+ $depend = '';
48
+ $hidden = '';
49
+
50
+ if ( ! empty( $this->field['dependency'] ) ) {
51
+ $hidden = ' csf-dependency-control hidden';
52
+ $depend .= ' data-controller="'. $this->field['dependency'][0] .'"';
53
+ $depend .= ' data-condition="'. $this->field['dependency'][1] .'"';
54
+ $depend .= ' data-value="'. $this->field['dependency'][2] .'"';
55
+ }
56
+
57
+ $id = 'customize-control-' . str_replace( array( '[', ']' ), array( '-', '' ), $this->id );
58
+ $class = 'customize-control customize-control-' . $this->type . $hidden;
59
+
60
+ echo '<li id="'. $id .'" class="'. $class .'