Click to Chat for WhatsApp Chat - Version 1.3

Version Description

  • can add pre-filled text
  • style-1 - can change button text.
  • setting page link added in plugins page
  • show / hide is now changed to hide on - based on page types
Download this release

Release Info

Developer bhvreddy
Plugin Icon 128x128 Click to Chat for WhatsApp Chat
Version 1.3
Comparing to
See all releases

Code changes from version 1.1 to 1.3

admin/class-ccw-admin-page-customize-styles.php CHANGED
@@ -103,6 +103,16 @@ class CCW_Admin_Page_Customize_Styles {
103
</div>
104
</div>
105
106
<div class="row hide">
107
<div class="col s6">
108
<p>Icon size</p>
@@ -112,6 +122,8 @@ class CCW_Admin_Page_Customize_Styles {
112
</div>
113
</div>
114
115
</div>
116
</div>
117
</li>
@@ -378,7 +390,7 @@ class CCW_Admin_Page_Customize_Styles {
378
</div>
379
</div>
380
381
- <p class="description">initial add height, width, line-height same values - if feels like icon is not center then adjust 'Line Height' to make icon looks center of the circle</p>
382
383
</div>
384
</div>
@@ -473,7 +485,7 @@ class CCW_Admin_Page_Customize_Styles {
473
</div>
474
</div>
475
476
- <p class="description">initial add height, width, line-height same values - if feels like icon is not center then adjust 'Line Height' to make icon looks center of the box</p>
477
478
479
</div>
103
</div>
104
</div>
105
106
+ <div class="row">
107
+ <div class="col s6">
108
+ <p>Button Text</p>
109
+ </div>
110
+ <div class="input-field col s4">
111
+ <input name="ccw_options_cs[s1_btn_text]" value="<?php echo esc_attr( $ccw_style_1['s1_btn_text'] ) ?>" type="text" class="" >
112
+ </div>
113
+ </div>
114
+
115
+ <!-- This is hidden row -->
116
<div class="row hide">
117
<div class="col s6">
118
<p>Icon size</p>
122
</div>
123
</div>
124
125
+
126
+
127
</div>
128
</div>
129
</li>
390
</div>
391
</div>
392
393
+ <p class="description">add height, width, line-height same values - if feels like icon is not center then adjust 'Line Height' to make icon looks center of the circle</p>
394
395
</div>
396
</div>
485
</div>
486
</div>
487
488
+ <p class="description">add height, width, line-height same values - if feels like icon is not center then adjust 'Line Height' to make icon looks center of the box</p>
489
490
491
</div>
admin/class-ccw-admin-page.php CHANGED
@@ -24,12 +24,16 @@ class CCW_Admin_Page {
24
add_settings_field( 'ccw_enable_sc', 'Enable ShortCodes', array( $this, 'ccw_enable_sc_cb' ), 'ccw_options_settings', 'ccw_settings' );
25
add_settings_field( 'ccw_return_type', 'Return Type', array( $this, 'ccw_return_type_cb' ), 'ccw_options_settings', 'ccw_settings' );
26
add_settings_field( 'ccw_number', 'WhatsApp Number', array( $this, 'ccw_number_input_cb' ), 'ccw_options_settings', 'ccw_settings' );
27
add_settings_field( 'ccw_group_id', 'Group Id', array( $this, 'ccw_group_id_cb' ), 'ccw_options_settings', 'ccw_settings' );
28
add_settings_field( 'ccw_style', 'Style for Desktops', array( $this, 'ccw_style_cb' ), 'ccw_options_settings', 'ccw_settings' );
29
add_settings_field( 'ccw_style_mobile', 'Style for Mobile Devices', array( $this, 'ccw_style_mobile_cb' ), 'ccw_options_settings', 'ccw_settings' );
30
add_settings_field( 'ccw_position', 'Position to Place', array( $this, 'ccw_position_input_cb' ), 'ccw_options_settings', 'ccw_settings' );
31
add_settings_field( 'ccw_placeholder', 'Text to Display', array( $this, 'ccw_input_placeholder_cb' ), 'ccw_options_settings', 'ccw_settings' );
32
- add_settings_field( 'ccw_checkbox', 'Show / Hide ', array( $this, 'ccw_checkbox_cb' ), 'ccw_options_settings', 'ccw_settings' );
33
add_settings_field( 'ccw_list_id_tohide', 'Posts, Pages Id\'s to Hide', array( $this, 'ccw_list_id_tohide_cb' ), 'ccw_options_settings', 'ccw_settings' );
34
add_settings_field( 'ccw_list_cat_tohide', 'Categorys to Hide', array( $this, 'ccw_list_cat_tohide_cb' ), 'ccw_options_settings', 'ccw_settings' );
35
add_settings_field( 'ccw_custom_shortcode', 'Shortcode name', array( $this, 'ccw_custom_shortcode_cb' ), 'ccw_options_settings', 'ccw_settings' );
@@ -70,7 +74,7 @@ class CCW_Admin_Page {
70
<option value="2" <?php echo esc_attr( $ccw_enable_sc['enable_sc'] ) == 2 ? 'SELECTED' : ''; ?> >Yes</option>
71
</select>
72
<label>enable ShortCodes</label>
73
- <p class="description"> If Selected - No - then Hides Shortcodes and its syntax - <a target="_blank" href="https: //medium.com/clicktochat/enable-disable-styles-84293dca3fbd">more info</a> </p>
74
</div>
75
</div>
76
<?php
@@ -87,7 +91,7 @@ class CCW_Admin_Page {
87
<option value="group_chat" <?php echo esc_attr( $ccw_return_type['return_type'] ) == 'group_chat' ? 'SELECTED' : ''; ?> >Group chat - Invite</option>
88
</select>
89
<label>Default return type - Chat or Group Chat Invite</label>
90
- <p class="description"> Default return type for Floating Style, shortcodes. But for shortcodes can change using shortcode attributes - <a target="_blank" href="https: //medium.com/clicktochat/return-type-451635e320eb">more info</a> </p>
91
</div>
92
</div>
93
<?php
@@ -113,7 +117,9 @@ class CCW_Admin_Page {
113
<option value="0" <?php echo $style_value == 0 ? 'SELECTED' : ''; ?> >Hide on Desktop Devices</option>
114
</select>
115
<label>Select Style for Destops</label>
116
- <p class="description"> - <a target="_blank" href="https: //medium.com/clicktochat/select-styles-48527f73e697">List of syles with images</a> </p>
117
</div>
118
</div>
119
<?php
@@ -151,12 +157,29 @@ class CCW_Admin_Page {
151
<div class="input-field col s12">
152
<input name="ccw_options[number]" value="<?php echo esc_attr( $ccw_number['number'] ) ?>" id="whatsapp_number" type="text" class="validate input-margin">
153
<label for="whatsapp_number">Enter whatsapp number </label>
154
- <p class="description">Enter whatsapp number with country code ( e.g. 916123456789 ) please dont include +, ( here in e.g. 91 is country code 6123456789 is mobile number - <a target="_blank" href="https: //medium.com/clicktochat/whatsapp-number-b155206825c8">more info</a> ) </p>
155
</div>
156
</div>
157
<?php
158
}
159
160
// Group ID
161
function ccw_group_id_cb() {
162
$ccw_group_id = get_option('ccw_options');
@@ -165,13 +188,13 @@ class CCW_Admin_Page {
165
<div class="input-field col s12">
166
<input name="ccw_options[group_id]" value="<?php echo esc_attr( $ccw_group_id['group_id'] ) ?>" id="whatsapp_group_id" type="text" class="validate input-margin">
167
<label for="whatsapp_group_id">whatsapp group ID Extenstion </label>
168
- <p class="description">Enter whatsapp Group Id - <a target="_blank" href="https://medium.com/clicktochat/later">more info</a> ) </p>
169
</div>
170
</div>
171
<?php
172
}
173
174
- // postion
175
function ccw_position_input_cb() {
176
$ccw_position = get_option('ccw_options');
177
$ccw_position_value = esc_attr( $ccw_position['position'] )
@@ -185,7 +208,7 @@ class CCW_Admin_Page {
185
<option value="4" <?php echo $ccw_position_value == 4 ? 'SELECTED' : ''; ?> >top right</option>
186
</select>
187
<label>Fixed position to place</label>
188
- <p class="description"> e.g. 10px - please add css units as suffix, e.g. 10px, 10%, 10rem, 10em .. <a target="_blank" href="https://medium.com/clicktochat/position-to-place-984ac32446e6">more info</a> </p>
189
</div>
190
</div>
191
@@ -246,7 +269,7 @@ class CCW_Admin_Page {
246
<div class="input-field col s12">
247
<input name="ccw_options[input_placeholder]" value="<?php echo esc_attr( $ccw_placeholder['input_placeholder'] ) ?>" id="input_placeholder" type="text" class="validate input-margin">
248
<label for="input_placeholder">placeholder value</label>
249
- <p class="description"> - <a target="_blank" href="https://medium.com/clicktochat/text-to-display-59c478c87167">more info</a> </p>
250
</div>
251
</div>
252
<?php
@@ -258,54 +281,54 @@ class CCW_Admin_Page {
258
259
260
// Single Posts
261
- if ( isset( $ccw_checkbox['showon_posts'] ) ) {
262
?>
263
<p>
264
- <input name="ccw_options[showon_posts]" type="checkbox" value="1" <?php checked( $ccw_checkbox['showon_posts'], 1 ); ?> id="filled-in-box1" />
265
- <label for="filled-in-box1">Posts</label>
266
</p>
267
<?php
268
} else {
269
?>
270
<p>
271
- <input name="ccw_options[showon_posts]" type="checkbox" value="1" id="filled-in-box1" />
272
- <label for="filled-in-box1">Posts</label>
273
</p>
274
<?php
275
}
276
277
278
// Page
279
- if ( isset( $ccw_checkbox['showon_page'] ) ) {
280
?>
281
<p>
282
- <input name="ccw_options[showon_page]" type="checkbox" value="1" <?php checked( $ccw_checkbox['showon_page'], 1 ); ?> id="filled-in-box2" />
283
- <label for="filled-in-box2">Pages</label>
284
</p>
285
<?php
286
} else {
287
?>
288
<p>
289
- <input name="ccw_options[showon_page]" type="checkbox" value="1" id="filled-in-box2" />
290
- <label for="filled-in-box2">Pages</label>
291
</p>
292
<?php
293
}
294
295
296
// Home Page
297
- if ( isset( $ccw_checkbox['showon_homepage'] ) ) {
298
?>
299
<p>
300
- <input name="ccw_options[showon_homepage]" type="checkbox" value="1" <?php checked( $ccw_checkbox['showon_homepage'], 1 ); ?> id="filled-in-box3" />
301
- <label for="filled-in-box3">Home Page</label>
302
</p>
303
<?php
304
} else {
305
?>
306
<p>
307
- <input name="ccw_options[showon_homepage]" type="checkbox" value="1" id="filled-in-box3" />
308
- <label for="filled-in-box3">Home Page</label>
309
</p>
310
<?php
311
}
@@ -314,79 +337,79 @@ class CCW_Admin_Page {
314
A front page is also a home page, but home page is not a front page
315
if front page unchecked - it works on both homepage and fornt page
316
but if home page is unchecked - it works only on home page, not on front page */
317
- if ( isset( $ccw_checkbox['showon_frontpage'] ) ) {
318
?>
319
<p>
320
- <input name="ccw_options[showon_frontpage]" type="checkbox" value="1" <?php checked( $ccw_checkbox['showon_frontpage'], 1 ); ?> id="filled-in-box4" />
321
- <label for="filled-in-box4">Front Page</label>
322
</p>
323
<?php
324
} else {
325
?>
326
<p>
327
- <input name="ccw_options[showon_frontpage]" type="checkbox" value="1" id="filled-in-box4" />
328
- <label for="filled-in-box4">Front Page</label>
329
</p>
330
<?php
331
}
332
333
// Category
334
- if ( isset( $ccw_checkbox['showon_category'] ) ) {
335
?>
336
<p>
337
- <input name="ccw_options[showon_category]" type="checkbox" value="1" <?php checked( $ccw_checkbox['showon_category'], 1 ); ?> id="filled-in-box5" />
338
- <label for="filled-in-box5">Category</label>
339
</p>
340
<?php
341
} else {
342
?>
343
<p>
344
- <input name="ccw_options[showon_category]" type="checkbox" value="1" id="filled-in-box5" />
345
- <label for="filled-in-box5">Category</label>
346
</p>
347
<?php
348
}
349
350
// Archive
351
- if ( isset( $ccw_checkbox['showon_archive'] ) ) {
352
?>
353
<p>
354
- <input name="ccw_options[showon_archive]" type="checkbox" value="1" <?php checked( $ccw_checkbox['showon_archive'], 1 ); ?> id="filled-in-box6" />
355
- <label for="filled-in-box6">Archive</label>
356
</p>
357
<?php
358
} else {
359
?>
360
<p>
361
- <input name="ccw_options[showon_archive]" type="checkbox" value="1" id="filled-in-box6" />
362
- <label for="filled-in-box6">Archive</label>
363
</p>
364
<?php
365
}
366
367
368
// 404 Page
369
- if ( isset( $ccw_checkbox['showon_404'] ) ) {
370
?>
371
<p>
372
- <input name="ccw_options[showon_404]" type="checkbox" value="1" <?php checked( $ccw_checkbox['showon_404'], 1 ); ?> id="filled-in-box7" />
373
- <label for="filled-in-box7">404 Page</label>
374
</p>
375
<?php
376
} else {
377
?>
378
<p>
379
- <input name="ccw_options[showon_404]" type="checkbox" value="1" id="filled-in-box7" />
380
- <label for="filled-in-box7">404 Page</label>
381
</p>
382
<?php
383
}
384
?>
385
- <p class="description"> check to show, uncheck to hide - Show/ Hide - Styles - based on type of the page <a target="_blank" href="https://medium.com/clicktochat/show-hide-styles-based-on-type-of-the-page-4f0542a92909">more info</a> </p>
386
<?php
387
}
388
389
- // ID 's list to hide styles
390
function ccw_list_id_tohide_cb() {
391
$ccw_list_id_tohide = get_option('ccw_options');
392
?>
@@ -394,7 +417,7 @@ class CCW_Admin_Page {
394
<div class="input-field col s12">
395
<input name="ccw_options[list_hideon_pages]" value="<?php echo esc_attr( $ccw_list_id_tohide['list_hideon_pages'] ) ?>" id="ccw_list_id_tohide" type="text" class="validate input-margin">
396
<label for="ccw_list_id_tohide">Id's list to Hide - add ',' after each id </label>
397
- <p class="description"> Add Post, Pages, Media - ID's to hide, can add multiple id's separate with comma ( , ) - <a target="_blank" href="https://medium.com/@bhvreddy/show-hide-styles-based-on-id-bb4cbfa091d7">more info</a> </p>
398
</div>
399
</div>
400
<?php
@@ -408,7 +431,7 @@ class CCW_Admin_Page {
408
<div class="input-field col s12">
409
<input name="ccw_options[list_hideon_cat]" value="<?php echo esc_attr( $ccw_list_cat_tohide['list_hideon_cat'] ) ?>" id="ccw_list_cat_tohide" type="text" class="validate input-margin">
410
<label for="ccw_list_cat_tohide">Category name's to Hide - add ',' after each category name </label>
411
- <p class="description"> Category name's to hide, can add multiple Categories separate with comma ( , ) - <a target="_blank" href="https://medium.com/@bhvreddy/show-hide-styles-based-on-category-52453616cb65">more info</a> </p>
412
</div>
413
</div>
414
<?php
@@ -428,7 +451,7 @@ class CCW_Admin_Page {
428
$shorcode_list .= $key . ', ';
429
}
430
?>
431
- <p class="description"> Default values is 'chat', can customize shortcode name - <a target="_blank" href="https://medium.com/clicktochat/shortcode-name-d90fd531d589">more info</a> </p>
432
<p class="description"> please dont add this already existing shorcode names - <?php echo $shorcode_list ?> </p>
433
</div>
434
</div>
@@ -453,6 +476,9 @@ class CCW_Admin_Page {
453
if( isset( $input['number'] ) )
454
$new_input['number'] = sanitize_text_field( $input['number'] );
455
456
if( isset( $input['input_placeholder'] ) )
457
$new_input['input_placeholder'] = sanitize_text_field( $input['input_placeholder'] );
458
@@ -489,26 +515,26 @@ class CCW_Admin_Page {
489
if( isset( $input['position-4_right'] ) )
490
$new_input['position-4_right'] = sanitize_text_field( $input['position-4_right'] );
491
492
- if( isset( $input['showon_posts'] ) )
493
- $new_input['showon_posts'] = sanitize_text_field( $input['showon_posts'] );
494
495
- if( isset( $input['showon_page'] ) )
496
- $new_input['showon_page'] = sanitize_text_field( $input['showon_page'] );
497
498
- if( isset( $input['showon_homepage'] ) )
499
- $new_input['showon_homepage'] = sanitize_text_field( $input['showon_homepage'] );
500
501
- if( isset( $input['showon_frontpage'] ) )
502
- $new_input['showon_frontpage'] = sanitize_text_field( $input['showon_frontpage'] );
503
504
- if( isset( $input['showon_category'] ) )
505
- $new_input['showon_category'] = sanitize_text_field( $input['showon_category'] );
506
507
- if( isset( $input['showon_archive'] ) )
508
- $new_input['showon_archive'] = sanitize_text_field( $input['showon_archive'] );
509
510
- if( isset( $input['showon_404'] ) )
511
- $new_input['showon_404'] = sanitize_text_field( $input['showon_404'] );
512
513
if( isset( $input['list_hideon_pages'] ) )
514
$new_input['list_hideon_pages'] = sanitize_text_field( $input['list_hideon_pages'] );
24
add_settings_field( 'ccw_enable_sc', 'Enable ShortCodes', array( $this, 'ccw_enable_sc_cb' ), 'ccw_options_settings', 'ccw_settings' );
25
add_settings_field( 'ccw_return_type', 'Return Type', array( $this, 'ccw_return_type_cb' ), 'ccw_options_settings', 'ccw_settings' );
26
add_settings_field( 'ccw_number', 'WhatsApp Number', array( $this, 'ccw_number_input_cb' ), 'ccw_options_settings', 'ccw_settings' );
27
+
28
+ add_settings_field( 'ccw_pre_text', 'Initial Message', array( $this, 'ccw_prefix_message_cb' ), 'ccw_options_settings', 'ccw_settings' );
29
+
30
+
31
add_settings_field( 'ccw_group_id', 'Group Id', array( $this, 'ccw_group_id_cb' ), 'ccw_options_settings', 'ccw_settings' );
32
add_settings_field( 'ccw_style', 'Style for Desktops', array( $this, 'ccw_style_cb' ), 'ccw_options_settings', 'ccw_settings' );
33
add_settings_field( 'ccw_style_mobile', 'Style for Mobile Devices', array( $this, 'ccw_style_mobile_cb' ), 'ccw_options_settings', 'ccw_settings' );
34
add_settings_field( 'ccw_position', 'Position to Place', array( $this, 'ccw_position_input_cb' ), 'ccw_options_settings', 'ccw_settings' );
35
add_settings_field( 'ccw_placeholder', 'Text to Display', array( $this, 'ccw_input_placeholder_cb' ), 'ccw_options_settings', 'ccw_settings' );
36
+ add_settings_field( 'ccw_checkbox', 'Hide Based on post type', array( $this, 'ccw_checkbox_cb' ), 'ccw_options_settings', 'ccw_settings' );
37
add_settings_field( 'ccw_list_id_tohide', 'Posts, Pages Id\'s to Hide', array( $this, 'ccw_list_id_tohide_cb' ), 'ccw_options_settings', 'ccw_settings' );
38
add_settings_field( 'ccw_list_cat_tohide', 'Categorys to Hide', array( $this, 'ccw_list_cat_tohide_cb' ), 'ccw_options_settings', 'ccw_settings' );
39
add_settings_field( 'ccw_custom_shortcode', 'Shortcode name', array( $this, 'ccw_custom_shortcode_cb' ), 'ccw_options_settings', 'ccw_settings' );
74
<option value="2" <?php echo esc_attr( $ccw_enable_sc['enable_sc'] ) == 2 ? 'SELECTED' : ''; ?> >Yes</option>
75
</select>
76
<label>enable ShortCodes</label>
77
+ <p class="description"> If Selected - No - then Hides Shortcodes and its syntax - <a target="_blank" href="https://holithemes.com/whatsapp-chat/enable-disable-styles/">more info</a> </p>
78
</div>
79
</div>
80
<?php
91
<option value="group_chat" <?php echo esc_attr( $ccw_return_type['return_type'] ) == 'group_chat' ? 'SELECTED' : ''; ?> >Group chat - Invite</option>
92
</select>
93
<label>Default return type - Chat or Group Chat Invite</label>
94
+ <p class="description">Default return type for Floating Style, shortcodes. But for shortcodes can change using shortcode attributes - <a target="_blank" href="https://holithemes.com/whatsapp-chat/return-type-chat-or-group-chat/">more info</a> </p>
95
</div>
96
</div>
97
<?php
117
<option value="0" <?php echo $style_value == 0 ? 'SELECTED' : ''; ?> >Hide on Desktop Devices</option>
118
</select>
119
<label>Select Style for Destops</label>
120
+ <p class="description"> - <a target="_blank" href="https://holithemes.com/whatsapp-chat/select-styles/">List of syles with images</a> </p>
121
+ <p class="description"> - <a target="_blank" href="<?php echo admin_url( 'admin.php?page=ccw-edit-styles' ); ?>">Customize Styles</a> </p>
122
+
123
</div>
124
</div>
125
<?php
157
<div class="input-field col s12">
158
<input name="ccw_options[number]" value="<?php echo esc_attr( $ccw_number['number'] ) ?>" id="whatsapp_number" type="text" class="validate input-margin">
159
<label for="whatsapp_number">Enter whatsapp number </label>
160
+ <p class="description">Enter whatsapp number with country code ( e.g. 916123456789 ) please dont include +, ( here in e.g. 91 is country code 6123456789 is mobile number - <a target="_blank" href="https://holithemes.com/whatsapp-chat/whatsapp-number/">more info</a> ) </p>
161
+ </div>
162
+ </div>
163
+ <?php
164
+ }
165
+
166
+
167
+ // prefix - message
168
+ // #todo - link..
169
+ function ccw_prefix_message_cb() {
170
+ $ccw_initial = get_option('ccw_options');
171
+ ?>
172
+ <div class="row">
173
+ <div class="input-field col s12">
174
+ <input name="ccw_options[initial]" value="<?php echo esc_attr( $ccw_initial['initial'] ) ?>" id="whatsapp_initial" type="text" class="validate input-margin">
175
+ <label for="whatsapp_initial">Initial Message</label>
176
+ <p class="description">Initial message ( pre-filled ) <a target="_blank" href="https://holithemes.com/whatsapp-chat/pre-filled-message/">more info</a> </p>
177
</div>
178
</div>
179
<?php
180
}
181
182
+
183
// Group ID
184
function ccw_group_id_cb() {
185
$ccw_group_id = get_option('ccw_options');
188
<div class="input-field col s12">
189
<input name="ccw_options[group_id]" value="<?php echo esc_attr( $ccw_group_id['group_id'] ) ?>" id="whatsapp_group_id" type="text" class="validate input-margin">
190
<label for="whatsapp_group_id">whatsapp group ID Extenstion </label>
191
+ <p class="description">Enter whatsapp Group Id - <a target="_blank" href="https://holithemes.com/whatsapp-chat/find-whatsapp-group-id/">more info</a> ) </p>
192
</div>
193
</div>
194
<?php
195
}
196
197
+ // position
198
function ccw_position_input_cb() {
199
$ccw_position = get_option('ccw_options');
200
$ccw_position_value = esc_attr( $ccw_position['position'] )
208
<option value="4" <?php echo $ccw_position_value == 4 ? 'SELECTED' : ''; ?> >top right</option>
209
</select>
210
<label>Fixed position to place</label>
211
+ <p class="description"> e.g. 10px - please add css units as suffix, e.g. 10px, 10%, 10rem, 10em .. <a target="_blank" href="https://holithemes.com/whatsapp-chat/position-to-place/">more info</a> </p>
212
</div>
213
</div>
214
269
<div class="input-field col s12">
270
<input name="ccw_options[input_placeholder]" value="<?php echo esc_attr( $ccw_placeholder['input_placeholder'] ) ?>" id="input_placeholder" type="text" class="validate input-margin">
271
<label for="input_placeholder">placeholder value</label>
272
+ <p class="description"> - <a target="_blank" href="https://holithemes.com/whatsapp-chat/text-to-display/">more info</a> </p>
273
</div>
274
</div>
275
<?php
281
282
283
// Single Posts
284
+ if ( isset( $ccw_checkbox['hideon_posts'] ) ) {
285
?>
286
<p>
287
+ <input name="ccw_options[hideon_posts]" type="checkbox" value="1" <?php checked( $ccw_checkbox['hideon_posts'], 1 ); ?> id="filled-in-box1" />
288
+ <label for="filled-in-box1">Hide on - Posts</label>
289
</p>
290
<?php
291
} else {
292
?>
293
<p>
294
+ <input name="ccw_options[hideon_posts]" type="checkbox" value="1" id="filled-in-box1" />
295
+ <label for="filled-in-box1">Hide on - Posts</label>
296
</p>
297
<?php
298
}
299
300
301
// Page
302
+ if ( isset( $ccw_checkbox['hideon_page'] ) ) {
303
?>
304
<p>
305
+ <input name="ccw_options[hideon_page]" type="checkbox" value="1" <?php checked( $ccw_checkbox['hideon_page'], 1 ); ?> id="filled-in-box2" />
306
+ <label for="filled-in-box2">Hide on - Pages</label>
307
</p>
308
<?php
309
} else {
310
?>
311
<p>
312
+ <input name="ccw_options[hideon_page]" type="checkbox" value="1" id="filled-in-box2" />
313
+ <label for="filled-in-box2">Hide on - Pages</label>
314
</p>
315
<?php
316
}
317
318
319
// Home Page
320
+ if ( isset( $ccw_checkbox['hideon_homepage'] ) ) {
321
?>
322
<p>
323
+ <input name="ccw_options[hideon_homepage]" type="checkbox" value="1" <?php checked( $ccw_checkbox['hideon_homepage'], 1 ); ?> id="filled-in-box3" />
324
+ <label for="filled-in-box3">Hide on - Home Page</label>
325
</p>
326
<?php
327
} else {
328
?>
329
<p>
330
+ <input name="ccw_options[hideon_homepage]" type="checkbox" value="1" id="filled-in-box3" />
331
+ <label for="filled-in-box3">Hide on - Home Page</label>
332
</p>
333
<?php
334
}
337
A front page is also a home page, but home page is not a front page
338
if front page unchecked - it works on both homepage and fornt page
339
but if home page is unchecked - it works only on home page, not on front page */
340
+ if ( isset( $ccw_checkbox['hideon_frontpage'] ) ) {
341
?>
342
<p>
343
+ <input name="ccw_options[hideon_frontpage]" type="checkbox" value="1" <?php checked( $ccw_checkbox['hideon_frontpage'], 1 ); ?> id="filled-in-box4" />
344
+ <label for="filled-in-box4">Hide on - Front Page</label>
345
</p>
346
<?php
347
} else {
348
?>
349
<p>
350
+ <input name="ccw_options[hideon_frontpage]" type="checkbox" value="1" id="filled-in-box4" />
351
+ <label for="filled-in-box4">Hide on - Front Page</label>
352
</p>
353
<?php
354
}
355
356
// Category
357
+ if ( isset( $ccw_checkbox['hideon_category'] ) ) {
358
?>
359
<p>
360
+ <input name="ccw_options[hideon_category]" type="checkbox" value="1" <?php checked( $ccw_checkbox['hideon_category'], 1 ); ?> id="filled-in-box5" />
361
+ <label for="filled-in-box5">Hide on - Category</label>
362
</p>
363
<?php
364
} else {
365
?>
366
<p>
367
+ <input name="ccw_options[hideon_category]" type="checkbox" value="1" id="filled-in-box5" />
368
+ <label for="filled-in-box5">Hide on - Category</label>
369
</p>
370
<?php
371
}
372
373
// Archive
374
+ if ( isset( $ccw_checkbox['hideon_archive'] ) ) {
375
?>
376
<p>
377
+ <input name="ccw_options[hideon_archive]" type="checkbox" value="1" <?php checked( $ccw_checkbox['hideon_archive'], 1 ); ?> id="filled-in-box6" />
378
+ <label for="filled-in-box6">Hide on - Archive</label>
379
</p>
380
<?php
381
} else {
382
?>
383
<p>
384
+ <input name="ccw_options[hideon_archive]" type="checkbox" value="1" id="filled-in-box6" />
385
+ <label for="filled-in-box6">Hide on - Archive</label>
386
</p>
387
<?php
388
}
389
390
391
// 404 Page
392
+ if ( isset( $ccw_checkbox['hideon_404'] ) ) {
393
?>
394
<p>
395
+ <input name="ccw_options[hideon_404]" type="checkbox" value="1" <?php checked( $ccw_checkbox['hideon_404'], 1 ); ?> id="filled-in-box7" />
396
+ <label for="filled-in-box7">Hide on - 404 Page</label>
397
</p>
398
<?php
399
} else {
400
?>
401
<p>
402
+ <input name="ccw_options[hideon_404]" type="checkbox" value="1" id="filled-in-box7" />
403
+ <label for="filled-in-box7">Hide on - 404 Page</label>
404
</p>
405
<?php
406
}
407
?>
408
+ <p class="description">Check to hide - Hide - Styles - based on type of the page <a target="_blank" href="https://holithemes.com/whatsapp-chat/show-hide-styles-based-on-type-of-the-page/">more info</a> </p>
409
<?php
410
}
411
412
+ // ID's list to hide styles
413
function ccw_list_id_tohide_cb() {
414
$ccw_list_id_tohide = get_option('ccw_options');
415
?>
417
<div class="input-field col s12">
418
<input name="ccw_options[list_hideon_pages]" value="<?php echo esc_attr( $ccw_list_id_tohide['list_hideon_pages'] ) ?>" id="ccw_list_id_tohide" type="text" class="validate input-margin">
419
<label for="ccw_list_id_tohide">Id's list to Hide - add ',' after each id </label>
420
+ <p class="description"> Add Post, Pages, Media - ID's to hide, can add multiple id's separate with comma ( , ) - <a target="_blank" href="https://holithemes.com/whatsapp-chat/show-hide-styles-based-on-id/">more info</a> </p>
421
</div>
422
</div>
423
<?php
431
<div class="input-field col s12">
432
<input name="ccw_options[list_hideon_cat]" value="<?php echo esc_attr( $ccw_list_cat_tohide['list_hideon_cat'] ) ?>" id="ccw_list_cat_tohide" type="text" class="validate input-margin">
433
<label for="ccw_list_cat_tohide">Category name's to Hide - add ',' after each category name </label>
434
+ <p class="description"> Category name's to hide, can add multiple Categories separate with comma ( , ) - <a target="_blank" href="https://holithemes.com/whatsapp-chat/hide-styles-based-on-category/">more info</a> </p>
435
</div>
436
</div>
437
<?php
451
$shorcode_list .= $key . ', ';
452
}
453
?>
454
+ <p class="description"> Default values is 'chat', can customize shortcode name - <a target="_blank" href="https://holithemes.com/whatsapp-chat/change-shortcode-name/">more info</a> </p>
455
<p class="description"> please dont add this already existing shorcode names - <?php echo $shorcode_list ?> </p>
456
</div>
457
</div>
476
if( isset( $input['number'] ) )
477
$new_input['number'] = sanitize_text_field( $input['number'] );
478
479
+ if( isset( $input['initial'] ) )
480
+ $new_input['initial'] = sanitize_text_field( $input['initial'] );
481
+
482
if( isset( $input['input_placeholder'] ) )
483
$new_input['input_placeholder'] = sanitize_text_field( $input['input_placeholder'] );
484
515
if( isset( $input['position-4_right'] ) )
516
$new_input['position-4_right'] = sanitize_text_field( $input['position-4_right'] );
517
518
+ if( isset( $input['hideon_posts'] ) )
519
+ $new_input['hideon_posts'] = sanitize_text_field( $input['hideon_posts'] );
520
521
+ if( isset( $input['hideon_page'] ) )
522
+ $new_input['hideon_page'] = sanitize_text_field( $input['hideon_page'] );
523
524
+ if( isset( $input['hideon_homepage'] ) )
525
+ $new_input['hideon_homepage'] = sanitize_text_field( $input['hideon_homepage'] );
526
527
+ if( isset( $input['hideon_frontpage'] ) )
528
+ $new_input['hideon_frontpage'] = sanitize_text_field( $input['hideon_frontpage'] );
529
530
+ if( isset( $input['hideon_category'] ) )
531
+ $new_input['hideon_category'] = sanitize_text_field( $input['hideon_category'] );
532
533
+ if( isset( $input['hideon_archive'] ) )
534
+ $new_input['hideon_archive'] = sanitize_text_field( $input['hideon_archive'] );
535
536
+ if( isset( $input['hideon_404'] ) )
537
+ $new_input['hideon_404'] = sanitize_text_field( $input['hideon_404'] );
538
539
if( isset( $input['list_hideon_pages'] ) )
540
$new_input['list_hideon_pages'] = sanitize_text_field( $input['list_hideon_pages'] );
admin/default-values.php CHANGED
@@ -14,23 +14,18 @@
14
if ( ! defined( 'ABSPATH' ) ) exit;
15
16
17
- // plugin details
18
- $plugin_details = array(
19
- 'version' => '1.1',
20
- );
21
-
22
- // Always use update_option - override new values .. don't preseve already existing values
23
- update_option( 'ccw_plugin_details', $plugin_details );
24
-
25
-
26
-
27
-
28
-
29
- // top level options page
30
$values = array(
31
'enable' => '2',
32
'enable_sc' => '2',
33
'number' => '918897606725',
34
'input_placeholder' => 'WhatsApp us',
35
'position' => '1',
36
'style' => '1',
@@ -43,21 +38,54 @@ $values = array(
43
'position-3_left' => '10px',
44
'position-4_top' => '10px',
45
'position-4_right' => '10px',
46
- 'showon_posts' => '1',
47
- 'showon_page' => '1',
48
- 'showon_homepage' => '1',
49
- 'showon_frontpage' => '1',
50
- 'showon_category' => '1',
51
- 'showon_archive' => '1',
52
- 'showon_404' => '1',
53
'list_hideon_pages' => '',
54
'list_hideon_cat' => '',
55
'shortcode' => 'chat',
56
-
57
'return_type' => 'chat', // chat or group_chat
58
'group_id' => 'DuEZlyOo94A1QirOX42zKr',
59
);
60
61
// update_option( 'ccw_options', $values );
62
// add_option( 'ccw_options', $values );
63
@@ -69,8 +97,11 @@ update_option('ccw_options', $update_values);
69
70
71
72
-
73
- // customize styles - options page
74
$values_cs = array(
75
's1_text_color' => '#9e9e9e',
76
's1_text_color_onfocus' => '#26a69a',
@@ -79,6 +110,7 @@ $values_cs = array(
79
's1_submit_btn_color' => '#26a69a',
80
's1_submit_btn_text_and_icon_color' => '#fff',
81
's1_width' => 'auto',
82
83
's2_text_color' => 'initial',
84
's2_text_color_onhover' => 'initial',
@@ -128,6 +160,10 @@ $update_values_cs = array_merge($values_cs, $db_values_cs);
128
update_option('ccw_options_cs', $update_values_cs);
129
130
131
132
-
133
-
14
if ( ! defined( 'ABSPATH' ) ) exit;
15
16
17
+ /**
18
+ * table name: ccw_options
19
+ *
20
+ * top level options page - values
21
+ *
22
+ * initial - default / inital text
23
+ */
24
$values = array(
25
'enable' => '2',
26
'enable_sc' => '2',
27
'number' => '918897606725',
28
+ 'initial' => '',
29
'input_placeholder' => 'WhatsApp us',
30
'position' => '1',
31
'style' => '1',
38
'position-3_left' => '10px',
39
'position-4_top' => '10px',
40
'position-4_right' => '10px',
41
'list_hideon_pages' => '',
42
'list_hideon_cat' => '',
43
'shortcode' => 'chat',
44
'return_type' => 'chat', // chat or group_chat
45
'group_id' => 'DuEZlyOo94A1QirOX42zKr',
46
);
47
48
+ /**
49
+ * for version before 1.3
50
+ * has things changed - showon is changed to hideon
51
+ * as its checkboxes
52
+ * handled in this way..
53
+ */
54
+ $showon = get_option( 'ccw_options' );
55
+ $p_ver = get_option('ccw_plugin_details');
56
+
57
+ if ( $p_ver['version'] < '1.3' ) {
58
+
59
+ if( !isset( $showon['showon_posts'] ) ) {
60
+ $values[hideon_posts] = '1';
61
+ }
62
+
63
+ if( !isset( $showon['showon_page'] ) ) {
64
+ $values[hideon_page] = '1';
65
+ }
66
+
67
+ if( !isset( $showon['showon_homepage'] ) ) {
68
+ $values[hideon_homepage] = '1';
69
+ }
70
+
71
+ if( !isset( $showon['showon_frontpage'] ) ) {
72
+ $values[hideon_frontpage] = '1';
73
+ }
74
+
75
+ if( !isset( $showon['showon_category'] ) ) {
76
+ $values[hideon_category] = '1';
77
+ }
78
+
79
+ if( !isset( $showon['showon_archive'] ) ) {
80
+ $values[hideon_archive] = '1';
81
+ }
82
+
83
+ if( !isset( $showon['showon_404'] ) ) {
84
+ $values[hideon_404] = '1';
85
+ }
86
+ }
87
+
88
+
89
// update_option( 'ccw_options', $values );
90
// add_option( 'ccw_options', $values );
91
97
98
99
100
+ /**
101
+ * table name - ccw_options_cs
102
+ *
103
+ * customize styles - options page
104
+ */
105
$values_cs = array(
106
's1_text_color' => '#9e9e9e',
107
's1_text_color_onfocus' => '#26a69a',
110
's1_submit_btn_color' => '#26a69a',
111
's1_submit_btn_text_and_icon_color' => '#fff',
112
's1_width' => 'auto',
113
+ 's1_btn_text' => 'Submit',
114
115
's2_text_color' => 'initial',
116
's2_text_color_onhover' => 'initial',
160
update_option('ccw_options_cs', $update_values_cs);
161
162
163
+ // plugin details
164
+ $plugin_details = array(
165
+ 'version' => CCW_VERSION,
166
+ );
167
168
+ // Always use update_option - override new values .. don't preseve already existing values
169
+ update_option( 'ccw_plugin_details', $plugin_details );
admin/settings_page.php CHANGED
@@ -14,18 +14,101 @@ if ( ! defined( 'ABSPATH' ) ) exit;
14
15
<div class="wrap">
16
17
- <?php settings_errors(); ?>
18
19
- <div class="row">
20
- <div class="col s12 m12 xl6">
21
- <form action="options.php" method="post" class="col s12">
22
- <?php settings_fields( 'ccw_settings_group' ); ?>
23
- <?php do_settings_sections( 'ccw_options_settings' ) ?>
24
- <?php submit_button() ?>
25
- </form>
26
- </div>
27
- <div class="col admin_guide">
28
- </div>
29
</div>
30
31
</div>
14
15
<div class="wrap">
16
17
+ <?php settings_errors(); ?>
18
19
+ <div class="row">
20
+ <div class="col s12 m12 xl6 options">
21
+ <form action="options.php" method="post" class="col s12">
22
+ <?php settings_fields( 'ccw_settings_group' ); ?>
23
+ <?php do_settings_sections( 'ccw_options_settings' ) ?>
24
+ <?php submit_button() ?>
25
+ </form>
26
</div>
27
+ <div class="col admin_guide">
28
+ </div>
29
+ </div>
30
31
+ <hr> <br> <br>
32
+
33
+
34
+ <div class="row">
35
+
36
+ <div class="col s12 m12 l12 xl9">
37
+
38
+ <div class="row">
39
+
40
+ <div class="col s12 m6">
41
+ <div class="card blue-grey darken-1">
42
+ <div class="card-content white-text">
43
+ <span class="card-title">Issues / Support</span>
44
+ <br>
45
+ <p>In case any issue, please rise a ticket </p>
46
+ <br>
47
+ <p>WordPress Support forum is Recommend</p>
48
+ </div>
49
+ <div class="card-action">
50
+ <a target="_blank" href="https://wordpress.org/support/plugin/click-to-chat-for-whatsapp">@WordPress</a>
51
+ <a target="_blank" href="https://www.messenger.com/t/holithemes">Private</a>
52
+ </div>
53
+ </div>
54
+ </div>
55
+
56
+ <div class="col s12 m6">
57
+ <div class="card blue-grey darken-1">
58
+ <div class="card-content white-text">
59
+ <span class="card-title">Plugin Review</span>
60
+ <br>
61
+ <p>If you like the plugin, and have time to write review</p>
62
+ <br>
63
+ <p>please write an awesome review</p>
64
+ </div>
65
+ <div class="card-action">
66
+ <a target="_blank" href="https://wordpress.org/support/plugin/click-to-chat-for-whatsapp/reviews/#new-post">Plugin Review</a>
67
+ </div>
68
+ </div>
69
+ </div>
70
+
71
+ </div>
72
+
73
+ <div class="row">
74
+
75
+ <div class="col s12 m6">
76
+ <div class="card blue-grey darken-1">
77
+ <div class="card-content white-text">
78
+ <span class="card-title">Pay Donation</span>
79
+ <br>
80
+ <p>This is free plugin, no need to pay any thing.</p>
81
+ <br>
82
+ <p>Support on other sites is much appreciate</p>
83
+ </div>
84
+ <div class="card-action">
85
+ <a target="_blank" href="https://holithemes.com/whatsapp-chat/pay/">is that ok</a>
86
+ </div>
87
+ </div>
88
+ </div>
89
+
90
+ <div class="col s12 m6">
91
+ <div class="card blue-grey darken-1">
92
+ <div class="card-content white-text">
93
+ <span class="card-title">Web / Social</span>
94
+ <br>
95
+ <p>HoliThemes on Web</p>
96
+ <br>
97
+ <p>Post new relases, tips, tricks, much more</p>
98
+ </div>
99
+ <div class="card-action">
100
+ <a target="_blank" href="https://holithemes.com/">HoliThemes</a>
101
+ <a target="_blank" href="https://www.facebook.com/holithemes/">Facebook</a>
102
+ <!-- <a target="_blank" href="#">Twitter</a> -->
103
+ </div>
104
+ </div>
105
+ </div>
106
+
107
+ </div>
108
+
109
+ </div>
110
+
111
+ </div>
112
+
113
+
114
</div>
admin/sp_customize_styles.php CHANGED
@@ -19,7 +19,7 @@ if ( ! defined( 'ABSPATH' ) ) exit;
19
<?php settings_errors(); ?>
20
21
<div class="row">
22
- <div class="col s12 m12 xl6">
23
<form action="options.php" method="post" class="col s12">
24
<?php settings_fields( 'ccw_settings_group_cs' ); ?>
25
<?php do_settings_sections( 'ccw_options_settings_cs' ) ?>
19
<?php settings_errors(); ?>
20
21
<div class="row">
22
+ <div class="col s12 m12 xl6 options">
23
<form action="options.php" method="post" class="col s12">
24
<?php settings_fields( 'ccw_settings_group_cs' ); ?>
25
<?php do_settings_sections( 'ccw_options_settings_cs' ) ?>
assets/css/admin_main.css CHANGED
@@ -1,11 +1,4 @@
1
- /*
2
- * Materializecss
3
- * custom Code
4
- */
5
-
6
-
7
- /* Materializecss - http://materializecss.com/ */
8
-
9
.materialize-red {
10
background-color: #e51c23 !important; }
11
@@ -1990,7 +1983,7 @@ a {
1990
.z-depth-0 {
1991
box-shadow: none !important; }
1992
1993
- .z-depth-1, .btn, .btn-large, .btn-floating, .dropdown-content, .collapsible {
1994
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2); }
1995
1996
.z-depth-1-half, .btn:hover, .btn-large:hover, .btn-floating:hover {
@@ -3192,6 +3185,130 @@ small {
3192
.flow-text {
3193
font-size: 1.2rem; } }
3194
3195
.btn, .btn-large,
3196
.btn-flat {
3197
border: none;
@@ -4747,11 +4864,8 @@ input[type=range]:focus::-ms-fill-lower {
4747
input[type=range]:focus::-ms-fill-upper {
4748
background: #ccc; }
4749
4750
-
4751
-
4752
-
4753
/* custom styles */
4754
-
4755
.display-none {
4756
display: none; }
4757
@@ -4763,3 +4877,8 @@ input.input-margin {
4763
4764
.select-margin .select-1 input {
4765
margin: 0 0 3px 0 !important; }
1
+ /* Materializecss */
2
.materialize-red {
3
background-color: #e51c23 !important; }
4
1983
.z-depth-0 {
1984
box-shadow: none !important; }
1985
1986
+ .z-depth-1, .card-panel, .card, .btn, .btn-large, .btn-floating, .dropdown-content, .collapsible {
1987
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2); }
1988
1989
.z-depth-1-half, .btn:hover, .btn-large:hover, .btn-floating:hover {
3185
.flow-text {
3186
font-size: 1.2rem; } }
3187
3188
+ .card-panel {
3189
+ transition: box-shadow .25s;
3190
+ padding: 24px;
3191
+ margin: 0.5rem 0 1rem 0;
3192
+ border-radius: 2px;
3193
+ background-color: #fff; }
3194
+
3195
+ .card {
3196
+ position: relative;
3197
+ margin: 0.5rem 0 1rem 0;
3198
+ background-color: #fff;
3199
+ transition: box-shadow .25s;
3200
+ border-radius: 2px; }
3201
+ .card .card-title {
3202
+ font-size: 24px;
3203
+ font-weight: 300; }
3204
+ .card .card-title.activator {
3205
+ cursor: pointer; }
3206
+ .card.small, .card.medium, .card.large {
3207
+ position: relative; }
3208
+ .card.small .card-image, .card.medium .card-image, .card.large .card-image {
3209
+ max-height: 60%;
3210
+ overflow: hidden; }
3211
+ .card.small .card-image + .card-content, .card.medium .card-image + .card-content, .card.large .card-image + .card-content {
3212
+ max-height: 40%; }
3213
+ .card.small .card-content, .card.medium .card-content, .card.large .card-content {
3214
+ max-height: 100%;
3215
+ overflow: hidden; }
3216
+ .card.small .card-action, .card.medium .card-action, .card.large .card-action {
3217
+ position: absolute;
3218
+ bottom: 0;
3219
+ left: 0;
3220
+ right: 0; }
3221
+ .card.small {
3222
+ height: 300px; }
3223
+ .card.medium {
3224
+ height: 400px; }
3225
+ .card.large {
3226
+ height: 500px; }
3227
+ .card.horizontal {
3228
+ display: flex; }
3229
+ .card.horizontal.small .card-image, .card.horizontal.medium .card-image, .card.horizontal.large .card-image {
3230
+ height: 100%;
3231
+ max-height: none;
3232
+ overflow: visible; }
3233
+ .card.horizontal.small .card-image img, .card.horizontal.medium .card-image img, .card.horizontal.large .card-image img {
3234
+ height: 100%; }
3235
+ .card.horizontal .card-image {
3236
+ max-width: 50%; }
3237
+ .card.horizontal .card-image img {
3238
+ border-radius: 2px 0 0 2px;
3239
+ max-width: 100%;
3240
+ width: auto; }
3241
+ .card.horizontal .card-stacked {
3242
+ display: flex;
3243
+ flex-direction: column;
3244
+ flex: 1;
3245
+ position: relative; }
3246
+ .card.horizontal .card-stacked .card-content {
3247
+ flex-grow: 1; }
3248
+ .card.sticky-action .card-action {
3249
+ z-index: 2; }
3250
+ .card.sticky-action .card-reveal {
3251
+ z-index: 1;
3252
+ padding-bottom: 64px; }
3253
+ .card .card-image {
3254
+ position: relative; }
3255
+ .card .card-image img {
3256
+ display: block;
3257
+ border-radius: 2px 2px 0 0;
3258
+ position: relative;
3259
+ left: 0;
3260
+ right: 0;
3261
+ top: 0;
3262
+ bottom: 0;
3263
+ width: 100%; }
3264
+ .card .card-image .card-title {
3265
+ color: #fff;
3266
+ position: absolute;
3267
+ bottom: 0;
3268
+ left: 0;
3269
+ max-width: 100%;
3270
+ padding: 24px; }
3271
+ .card .card-content {
3272
+ padding: 24px;
3273
+ border-radius: 0 0 2px 2px; }
3274
+ .card .card-content p {
3275
+ margin: 0;
3276
+ color: inherit; }
3277
+ .card .card-content .card-title {
3278
+ display: block;
3279
+ line-height: 32px;
3280
+ margin-bottom: 8px; }
3281
+ .card .card-content .card-title i {
3282
+ line-height: 32px; }
3283
+ .card .card-action {
3284
+ position: relative;
3285
+ background-color: inherit;
3286
+ border-top: 1px solid rgba(160, 160, 160, 0.2);
3287
+ padding: 16px 24px; }
3288
+ .card .card-action:last-child {
3289
+ border-radius: 0 0 2px 2px; }
3290
+ .card .card-action a:not(.btn):not(.btn-large):not(.btn-large):not(.btn-floating) {
3291
+ color: #ffab40;
3292
+ margin-right: 24px;
3293
+ transition: color .3s ease;
3294
+ text-transform: uppercase; }
3295
+ .card .card-action a:not(.btn):not(.btn-large):not(.btn-large):not(.btn-floating):hover {
3296
+ color: #ffd8a6; }
3297
+ .card .card-reveal {
3298
+ padding: 24px;
3299
+ position: absolute;
3300
+ background-color: #fff;
3301
+ width: 100%;
3302
+ overflow-y: auto;
3303
+ left: 0;
3304
+ top: 100%;
3305
+ height: 100%;
3306
+ z-index: 3;
3307
+ display: none; }
3308
+ .card .card-reveal .card-title {
3309
+ cursor: pointer;
3310
+ display: block; }
3311
+
3312
.btn, .btn-large,
3313
.btn-flat {
3314
border: none;
4864
input[type=range]:focus::-ms-fill-upper {
4865
background: #ccc; }
4866
4867
+ /* material icons font */
4868
/* custom styles */
4869
.display-none {
4870
display: none; }
4871
4877
4878
.select-margin .select-1 input {
4879
margin: 0 0 3px 0 !important; }
4880
+
4881
+ .options .submit {
4882
+ position: sticky !important;
4883
+ bottom: 1px;
4884
+ float: right; }
assets/css/main.css CHANGED
@@ -1,11 +1,3 @@
1
- /*
2
- * icons set
3
- * Materializecss
4
- * custom Code
5
- */
6
-
7
-
8
- /* ==== custom icons set ==== */
9
@font-face {
10
font-family: 'ccw';
11
src: url(../fonts/ccw.eot);
@@ -45,16 +37,224 @@
45
.icon-whatsapp:before {
46
content: "\EA93";
47
}
48
-
49
- /* ==== Materializecss ==== */
50
-
51
- /*
52
- * Materilizecss - http://materializecss.com/
53
- * To Make this Framework not to conflict with your Theme style,
54
- * we wrap Materilizecss class with `css_plugin`,
55
- * that's like adding a root 'ccw_plugin' node on every style
56
*/
57
-
58
.ccw_plugin .materialize-red {
59
background-color: #e51c23 !important; }
60
.ccw_plugin .materialize-red-text {
@@ -1296,7 +1496,7 @@
1296
clear: both; }
1297
.ccw_plugin .z-depth-0 {
1298
box-shadow: none !important; }
1299
- .ccw_plugin .z-depth-1, .ccw_plugin .btn, .ccw_plugin .btn-large, .ccw_plugin .btn-floating, .ccw_plugin .dropdown-content, .ccw_plugin .collapsible {
1300
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2); }
1301
.ccw_plugin .z-depth-1-half, .ccw_plugin .btn:hover, .ccw_plugin .btn-large:hover, .ccw_plugin .btn-floating:hover {
1302
box-shadow: 0 3px 3px 0 rgba(0, 0, 0, 0.14), 0 1px 7px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -1px rgba(0, 0, 0, 0.2); }
@@ -2411,6 +2611,128 @@
2411
@media only screen and (max-width: 360px) {
2412
.ccw_plugin .flow-text {
2413
font-size: 1.2rem; } }
2414
.ccw_plugin .btn, .ccw_plugin .btn-large,
2415
.ccw_plugin .btn-flat {
2416
border: none;
@@ -3685,11 +4007,7 @@
3685
.ccw_plugin input[type=range]:focus::-ms-fill-upper {
3686
background: #ccc; }
3687
3688
-
3689
-
3690
-
3691
/* ==== custom styles ==== */
3692
-
3693
div.ccw_plugin,
3694
.inline {
3695
display: inline; }
1
@font-face {
2
font-family: 'ccw';
3
src: url(../fonts/ccw.eot);
37
.icon-whatsapp:before {
38
content: "\EA93";
39
}
40
+ /*
41
+ * icons set
42
+ * Materializecss
43
+ * custom Code
44
*/
45
+ /* ==== custom icons set ==== */
46
+ /* ==== Materializecss ==== */
47
+ .ccw_plugin {
48
+ /*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */
49
+ /**
50
+ * 1. Set default font family to sans-serif.
51
+ * 2. Prevent iOS and IE text size adjust after device orientation change,
52
+ * without disabling user zoom.
53
+ */
54
+ /**
55
+ * Remove default margin.
56
+ */
57
+ /* HTML5 display definitions
58
+ ========================================================================== */
59
+ /**
60
+ * Correct `block` display not defined for any HTML5 element in IE 8/9.
61
+ * Correct `block` display not defined for `details` or `summary` in IE 10/11
62
+ * and Firefox.
63
+ * Correct `block` display not defined for `main` in IE 11.
64
+ */
65
+ /**
66
+ * 1. Correct `inline-block` display not defined in IE 8/9.
67
+ * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.
68
+ */
69
+ /**
70
+ * Prevent modern browsers from displaying `audio` without controls.
71
+ * Remove excess height in iOS 5 devices.
72
+ */
73
+ /**
74
+ * Address `[hidden]` styling not present in IE 8/9/10.
75
+ * Hide the `template` element in IE 8/9/10/11, Safari, and Firefox < 22.
76
+ */
77
+ /* Links
78
+ ========================================================================== */
79
+ /**
80
+ * Remove the gray background color from active links in IE 10.
81
+ */
82
+ /**
83
+ * Improve readability of focused elements when they are also in an
84
+ * active/hover state.
85
+ */
86
+ /* Text-level semantics
87
+ ========================================================================== */
88
+ /**
89
+ * Address styling not present in IE 8/9/10/11, Safari, and Chrome.
90
+ */
91
+ /**
92
+ * Address style set to `bolder` in Firefox 4+, Safari, and Chrome.
93
+ */
94
+ /**
95
+ * Address styling not present in Safari and Chrome.
96
+ */
97
+ /**
98
+ * Address variable `h1` font-size and margin within `section` and `article`
99
+ * contexts in Firefox 4+, Safari, and Chrome.
100
+ */
101
+ /**
102
+ * Address styling not present in IE 8/9.
103
+ */
104
+ /**
105
+ * Address inconsistent and variable font size in all browsers.
106
+ */
107
+ /**
108
+ * Prevent `sub` and `sup` affecting `line-height` in all browsers.
109
+ */
110
+ /* Embedded content
111
+ ========================================================================== */
112
+ /**
113
+ * Remove border when inside `a` element in IE 8/9/10.
114
+ */
115
+ /**
116
+ * Correct overflow not hidden in IE 9/10/11.
117
+ */
118
+ /* Grouping content
119
+ ========================================================================== */
120
+ /**
121
+ * Address margin not present in IE 8/9 and Safari.
122
+ */
123
+ /**
124
+ * Address differences between Firefox and other browsers.
125
+ */
126
+ /**
127
+ * Contain overflow in all browsers.
128
+ */
129
+ /**
130
+ * Address odd `em`-unit font size rendering in all browsers.
131
+ */
132
+ /* Forms
133
+ ========================================================================== */
134
+ /**
135
+ * Known limitation: by default, Chrome and Safari on OS X allow very limited
136
+ * styling of `select`, unless a `border` property is set.
137
+ */
138
+ /**
139
+ * 1. Correct color not being inherited.
140
+ * Known issue: affects color of disabled elements.
141
+ * 2. Correct font properties not being inherited.
142
+ * 3. Address margins set differently in Firefox 4+, Safari, and Chrome.
143
+ */
144
+ /**
145
+ * Address `overflow` set to `hidden` in IE 8/9/10/11.
146
+ */
147
+ /**
148
+ * Address inconsistent `text-transform` inheritance for `button` and `select`.
149
+ * All other form control elements do not inherit `text-transform` values.
150
+ * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.
151
+ * Correct `select` style inheritance in Firefox.
152
+ */
153
+ /**
154
+ * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
155
+ * and `video` controls.
156
+ * 2. Correct inability to style clickable `input` types in iOS.
157
+ * 3. Improve usability and consistency of cursor style between image-type
158
+ * `input` and others.
159
+ */
160
+ /**
161
+ * Re-set default cursor for disabled elements.
162
+ */
163
+ /**
164
+ * Remove inner padding and border in Firefox 4+.
165
+ */
166
+ /**
167
+ * Address Firefox 4+ setting `line-height` on `input` using `!important` in
168
+ * the UA stylesheet.
169
+ */
170
+ /**
171
+ * It's recommended that you don't attempt to style these elements.
172
+ * Firefox's implementation doesn't respect box-sizing, padding, or width.
173
+ *
174
+ * 1. Address box sizing set to `content-box` in IE 8/9/10.
175
+ * 2. Remove excess padding in IE 8/9/10.
176
+ */
177
+ /**
178
+ * Fix the cursor style for Chrome's increment/decrement buttons. For certain
179
+ * `font-size` values of the `input`, it causes the cursor style of the
180
+ * decrement button to change from `default` to `text`.
181
+ */
182
+ /**
183
+ * 1. Address `appearance` set to `searchfield` in Safari and Chrome.
184
+ * 2. Address `box-sizing` set to `border-box` in Safari and Chrome.
185
+ */
186
+ /**
187
+ * Remove inner padding and search cancel button in Safari and Chrome on OS X.
188
+ * Safari (but not Chrome) clips the cancel button when the search input has
189
+ * padding (and `textfield` appearance).
190
+ */
191
+ /**
192
+ * Define consistent border, margin, and padding.
193
+ */
194
+ /**
195
+ * 1. Correct `color` not being inherited in IE 8/9/10/11.
196
+ * 2. Remove padding so people aren't caught out if they zero out fieldsets.
197
+ */
198
+ /**
199
+ * Remove default vertical scrollbar in IE 8/9/10/11.
200
+ */
201
+ /**
202
+ * Don't inherit the `font-weight` (applied by a rule above).
203
+ * NOTE: the default cannot safely be changed in Chrome and Safari on OS X.
204
+ */
205
+ /* Tables
206
+ ========================================================================== */
207
+ /**
208
+ * Remove most spacing between table cells.
209
+ */
210
+ /*********************
211
+ Transition Classes
212
+ **********************/
213
+ /*********************
214
+ Media Query Classes
215
+ **********************/
216
+ /*******************
217
+ Utility Classes
218
+ *******************/
219
+ /* This is needed for some mobile phones to display the Google Icon font properly */
220
+ /*!
221
+ * Waves v0.6.0
222
+ * http://fian.my.id/Waves
223
+ *
224
+ * Copyright 2014 Alfiana E. Sibuea and other contributors
225
+ * Released under the MIT license
226
+ * https://github.com/fians/Waves/blob/master/LICENSE
227
+ */
228
+ /* Firefox Bug: link not triggered */
229
+ /* Text Inputs + Textarea
230
+ ========================================================================== */
231
+ /* Style Placeholders */
232
+ /* Text inputs */
233
+ /* Validation Sass Placeholders */
234
+ /* Search Field */
235
+ /* Textarea */
236
+ /* Autocomplete */
237
+ /* Radio Buttons
238
+ ========================================================================== */
239
+ /* Unchecked styles */
240
+ /* Checked styles */
241
+ /* Radio With gap */
242
+ /* Focused styles */
243
+ /* Disabled Radio With gap */
244
+ /* Disabled style */
245
+ /* Checkboxes
246
+ ========================================================================== */
247
+ /* CUSTOM CSS CHECKBOXES */
248
+ /* Remove default checkbox */
249
+ /* Indeterminate checkbox */
250
+ /* Switch
251
+ ========================================================================== */
252
+ /* Select Field
253
+ ========================================================================== */
254
+ /* File Input
255
+ ========================================================================== */
256
+ /* Range
257
+ ========================================================================== */ }
258
.ccw_plugin .materialize-red {
259
background-color: #e51c23 !important; }
260
.ccw_plugin .materialize-red-text {
1496
clear: both; }
1497
.ccw_plugin .z-depth-0 {
1498
box-shadow: none !important; }
1499
+ .ccw_plugin .z-depth-1, .ccw_plugin .card-panel, .ccw_plugin .card, .ccw_plugin .btn, .ccw_plugin .btn-large, .ccw_plugin .btn-floating, .ccw_plugin .dropdown-content, .ccw_plugin .collapsible {
1500
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2); }
1501
.ccw_plugin .z-depth-1-half, .ccw_plugin .btn:hover, .ccw_plugin .btn-large:hover, .ccw_plugin .btn-floating:hover {
1502
box-shadow: 0 3px 3px 0 rgba(0, 0, 0, 0.14), 0 1px 7px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -1px rgba(0, 0, 0, 0.2); }
2611
@media only screen and (max-width: 360px) {
2612
.ccw_plugin .flow-text {
2613
font-size: 1.2rem; } }
2614
+ .ccw_plugin .card-panel {
2615
+ transition: box-shadow .25s;
2616
+ padding: 24px;
2617
+ margin: 0.5rem 0 1rem 0;
2618
+ border-radius: 2px;
2619
+ background-color: #fff; }
2620
+ .ccw_plugin .card {
2621
+ position: relative;
2622
+ margin: 0.5rem 0 1rem 0;
2623
+ background-color: #fff;
2624
+ transition: box-shadow .25s;
2625
+ border-radius: 2px; }
2626
+ .ccw_plugin .card .card-title {
2627
+ font-size: 24px;
2628
+ font-weight: 300; }
2629
+ .ccw_plugin .card .card-title.activator {
2630
+ cursor: pointer; }
2631
+ .ccw_plugin .card.small, .ccw_plugin .card.medium, .ccw_plugin .card.large {
2632
+ position: relative; }
2633
+ .ccw_plugin .card.small .card-image, .ccw_plugin .card.medium .card-image, .ccw_plugin .card.large .card-image {
2634
+ max-height: 60%;
2635
+ overflow: hidden; }
2636
+ .ccw_plugin .card.small .card-image + .card-content, .ccw_plugin .card.medium .card-image + .card-content, .ccw_plugin .card.large .card-image + .card-content {
2637
+ max-height: 40%; }
2638
+ .ccw_plugin .card.small .card-content, .ccw_plugin .card.medium .card-content, .ccw_plugin .card.large .card-content {
2639
+ max-height: 100%;
2640
+ overflow: hidden; }
2641
+ .ccw_plugin .card.small .card-action, .ccw_plugin .card.medium .card-action, .ccw_plugin .card.large .card-action {
2642
+ position: absolute;
2643
+ bottom: 0;
2644
+ left: 0;
2645
+ right: 0; }
2646
+ .ccw_plugin .card.small {
2647
+ height: 300px; }
2648
+ .ccw_plugin .card.medium {
2649
+ height: 400px; }
2650
+ .ccw_plugin .card.large {
2651
+ height: 500px; }
2652
+ .ccw_plugin .card.horizontal {
2653
+ display: flex; }
2654
+ .ccw_plugin .card.horizontal.small .card-image, .ccw_plugin .card.horizontal.medium .card-image, .ccw_plugin .card.horizontal.large .card-image {
2655
+ height: 100%;
2656
+ max-height: none;
2657
+ overflow: visible; }
2658
+ .ccw_plugin .card.horizontal.small .card-image img, .ccw_plugin .card.horizontal.medium .card-image img, .ccw_plugin .card.horizontal.large .card-image img {
2659
+ height: 100%; }
2660
+ .ccw_plugin .card.horizontal .card-image {
2661
+ max-width: 50%; }
2662
+ .ccw_plugin .card.horizontal .card-image img {
2663
+ border-radius: 2px 0 0 2px;
2664
+ max-width: 100%;
2665
+ width: auto; }
2666
+ .ccw_plugin .card.horizontal .card-stacked {
2667
+ display: flex;
2668
+ flex-direction: column;
2669
+ flex: 1;
2670
+ position: relative; }
2671
+ .ccw_plugin .card.horizontal .card-stacked .card-content {
2672
+ flex-grow: 1; }
2673
+ .ccw_plugin .card.sticky-action .card-action {
2674
+ z-index: 2; }
2675
+ .ccw_plugin .card.sticky-action .card-reveal {
2676
+ z-index: 1;
2677
+ padding-bottom: 64px; }
2678
+ .ccw_plugin .card .card-image {
2679
+ position: relative; }
2680
+ .ccw_plugin .card .card-image img {
2681
+ display: block;
2682
+ border-radius: 2px 2px 0 0;
2683
+ position: relative;
2684
+ left: 0;
2685
+ right: 0;
2686
+ top: 0;
2687
+ bottom: 0;
2688
+ width: 100%; }
2689
+ .ccw_plugin .card .card-image .card-title {
2690
+ color: #fff;
2691
+ position: absolute;
2692
+ bottom: 0;
2693
+ left: 0;
2694
+ max-width: 100%;
2695
+ padding: 24px; }
2696
+ .ccw_plugin .card .card-content {
2697
+ padding: 24px;
2698
+ border-radius: 0 0 2px 2px; }
2699
+ .ccw_plugin .card .card-content p {
2700
+ margin: 0;
2701
+ color: inherit; }
2702
+ .ccw_plugin .card .card-content .card-title {
2703
+ display: block;
2704
+ line-height: 32px;
2705
+ margin-bottom: 8px; }
2706
+ .ccw_plugin .card .card-content .card-title i {
2707
+ line-height: 32px; }
2708
+ .ccw_plugin .card .card-action {
2709
+ position: relative;
2710
+ background-color: inherit;
2711
+ border-top: 1px solid rgba(160, 160, 160, 0.2);
2712
+ padding: 16px 24px; }
2713
+ .ccw_plugin .card .card-action:last-child {
2714
+ border-radius: 0 0 2px 2px; }
2715
+ .ccw_plugin .card .card-action a:not(.btn):not(.ccw_plugin .btn-large):not(.btn-large):not(.btn-floating) {
2716
+ color: #ffab40;
2717
+ margin-right: 24px;
2718
+ transition: color .3s ease;
2719
+ text-transform: uppercase; }
2720
+ .ccw_plugin .card .card-action a:not(.btn):not(.ccw_plugin .btn-large):not(.btn-large):not(.btn-floating):hover {
2721
+ color: #ffd8a6; }
2722
+ .ccw_plugin .card .card-reveal {
2723
+ padding: 24px;
2724
+ position: absolute;
2725
+ background-color: #fff;
2726
+ width: 100%;
2727
+ overflow-y: auto;
2728
+ left: 0;
2729
+ top: 100%;
2730
+ height: 100%;
2731
+ z-index: 3;
2732
+ display: none; }
2733
+ .ccw_plugin .card .card-reveal .card-title {
2734
+ cursor: pointer;
2735
+ display: block; }
2736
.ccw_plugin .btn, .ccw_plugin .btn-large,
2737
.ccw_plugin .btn-flat {
2738
border: none;
4007
.ccw_plugin input[type=range]:focus::-ms-fill-upper {
4008
background: #ccc; }
4009
4010
/* ==== custom styles ==== */
4011
div.ccw_plugin,
4012
.inline {
4013
display: inline; }
assets/js/app.js CHANGED
@@ -1,1370 +1,1370 @@
1
- /******/ (function(modules) { // webpackBootstrap
2
- /******/ // The module cache
3
- /******/ var installedModules = {};
4
- /******/
5
- /******/ // The require function
6
- /******/ function __webpack_require__(moduleId) {
7
- /******/
8
- /******/ // Check if module is in cache
9
- /******/ if(installedModules[moduleId]) {
10
- /******/ return installedModules[moduleId].exports;
11
- /******/ }
12
- /******/ // Create a new module (and put it into the cache)
13
- /******/ var module = installedModules[moduleId] = {
14
- /******/ i: moduleId,
15
- /******/ l: false,
16
- /******/ exports: {}
17
- /******/ };
18
- /******/
19
- /******/ // Execute the module function
20
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
21
- /******/
22
- /******/ // Flag the module as loaded
23
- /******/ module.l = true;
24
- /******/
25
- /******/ // Return the exports of the module
26
- /******/ return module.exports;
27
- /******/ }
28
- /******/
29
- /******/
30
- /******/ // expose the modules object (__webpack_modules__)
31
- /******/ __webpack_require__.m = modules;
32
- /******/
33
- /******/ // expose the module cache
34
- /******/ __webpack_require__.c = installedModules;
35
- /******/
36
- /******/ // define getter function for harmony exports
37
- /******/ __webpack_require__.d = function(exports, name, getter) {
38
- /******/ if(!__webpack_require__.o(exports, name)) {
39
- /******/ Object.defineProperty(exports, name, {
40
- /******/ configurable: false,
41
- /******/ enumerable: true,
42
- /******/ get: getter
43
- /******/ });
44
- /******/ }
45
- /******/ };
46
- /******/
47
- /******/ // getDefaultExport function for compatibility with non-harmony modules
48
- /******/ __webpack_require__.n = function(module) {
49
- /******/ var getter = module && module.__esModule ?
50
- /******/ function getDefault() { return module['default']; } :
51
- /******/ function getModuleExports() { return module; };
52
- /******/ __webpack_require__.d(getter, 'a', getter);
53
- /******/ return getter;
54
- /******/ };
55
- /******/
56
- /******/ // Object.prototype.hasOwnProperty.call
57
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
58
- /******/
59
- /******/ // __webpack_public_path__
60
- /******/ __webpack_require__.p = "";
61
- /******/
62
- /******/ // Load entry module and return exports
63
- /******/ return __webpack_require__(__webpack_require__.s = 1);
64
- /******/ })
65
- /************************************************************************/
66
- /******/ ([
67
- /* 0 */,
68
- /* 1 */
69
- /***/ (function(module, exports, __webpack_require__) {
70
-
71
- "use strict";
72
-
73
-
74
- __webpack_require__(2);
75
-
76
- __webpack_require__(3);
77
-
78
- __webpack_require__(4);
79
-
80
- // import "materialize-css/js/waves";
81
-
82
-
83
- // jQuery(document).ready(function ($) {
84
- jQuery(document).ready(function () {
85
-
86
- // jQuery('.an').hover( add , remove );
87
-
88
- // function add() {
89
- // // jQuery(this).addClass('animated tada infinite');
90
- // jQuery(this).addClass('animated tada');
91
- // }
92
-
93
- // function remove() {
94
- // jQuery(this).removeClass('animated tada');
95
- // }
96
-
97
-
98
- // jQuery('.img-icon-sc').on('click', ()=>{
99
- // // let x = num;
100
- // // window.location.href = 'https://web.whatsapp.com/send?phone='+x+'&text=';
101
- // // window.open('https://web.whatsapp.com/send?phone='+x+'&text=', '_blank');
102
- // });
103
-
104
- jQuery(".inline_issue").prev("p").css("display", "inline");
105
- }); // import "materialize-css/dist/js/materialize";
106
-
107
- /***/ }),
108
- /* 2 */
109
- /***/ (function(module, exports) {
110
-
111
- // Required for Meteor package, the use of window prevents export by Meteor
112
- (function(window){
113
- if(window.Package){
114
- Materialize = {};
115
- } else {
116
- window.Materialize = {};
117
- }
118
- })(window);
119
-
120
-
121
- /*
122
- * raf.js
123
- * https://github.com/ngryman/raf.js
124
- *
125
- * original requestAnimationFrame polyfill by Erik Möller
126
- * inspired from paul_irish gist and post
127
- *
128
- * Copyright (c) 2013 ngryman
129
- * Licensed under the MIT license.
130
- */
131
- (function(window) {
132
- var lastTime = 0,
133
- vendors = ['webkit', 'moz'],
134
- requestAnimationFrame = window.requestAnimationFrame,
135
- cancelAnimationFrame = window.cancelAnimationFrame,
136
- i = vendors.length;
137
-
138
- // try to un-prefix existing raf
139
- while (--i >= 0 && !requestAnimationFrame) {
140
- requestAnimationFrame = window[vendors[i] + 'RequestAnimationFrame'];
141
- cancelAnimationFrame = window[vendors[i] + 'CancelRequestAnimationFrame'];
142
- }
143
-
144
- // polyfill with setTimeout fallback
145
- // heavily inspired from @darius gist mod: https://gist.github.com/paulirish/1579671#comment-837945
146
- if (!requestAnimationFrame || !cancelAnimationFrame) {
147
- requestAnimationFrame = function(callback) {
148
- var now = +Date.now(),
149
- nextTime = Math.max(lastTime + 16, now);
150
- return setTimeout(function() {
151
- callback(lastTime = nextTime);
152
- }, nextTime - now);
153
- };
154
-
155
- cancelAnimationFrame = clearTimeout;
156
- }
157
-
158
- // export to window
159
- window.requestAnimationFrame = requestAnimationFrame;
160
- window.cancelAnimationFrame = cancelAnimationFrame;
161
- }(window));
162
-
163
-
164
- /**
165
- * Generate approximated selector string for a jQuery object
166
- * @param {jQuery} obj jQuery object to be parsed
167
- * @returns {string}
168
- */
169
- Materialize.objectSelectorString = function(obj) {
170
- var tagStr = obj.prop('tagName') || '';
171
- var idStr = obj.attr('id') || '';
172
- var classStr = obj.attr('class') || '';
173
- return (tagStr + idStr + classStr).replace(/\s/g,'');
174
- };
175
-
176
-
177
- // Unique Random ID
178
- Materialize.guid = (function() {
179
- function s4() {
180
- return Math.floor((1 + Math.random()) * 0x10000)
181
- .toString(16)
182
- .substring(1);
183
- }
184
- return function() {
185
- return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
186
- s4() + '-' + s4() + s4() + s4();
187
- };
188
- })();
189
-
190
- /**
191
- * Escapes hash from special characters
192
- * @param {string} hash String returned from this.hash
193
- * @returns {string}
194
- */
195
- Materialize.escapeHash = function(hash) {
196
- return hash.replace( /(:|\.|\[|\]|,|=)/g, "\\$1" );
197
- };
198
-
199
- Materialize.elementOrParentIsFixed = function(element) {
200
- var $element = $(element);
201
- var $checkElements = $element.add($element.parents());
202
- var isFixed = false;
203
- $checkElements.each(function(){
204
- if ($(this).css("position") === "fixed") {
205
- isFixed = true;
206
- return false;
207
- }
208
- });
209
- return isFixed;
210
- };
211
-
212
-
213
- /**
214
- * Get time in ms
215
- * @license https://raw.github.com/jashkenas/underscore/master/LICENSE
216
- * @type {function}
217
- * @return {number}
218
- */
219
- var getTime = (Date.now || function () {
220
- return new Date().getTime();
221
- });
222
-
223
-
224
- /**
225
- * Returns a function, that, when invoked, will only be triggered at most once
226
- * during a given window of time. Normally, the throttled function will run
227
- * as much as it can, without ever going more than once per `wait` duration;
228
- * but if you'd like to disable the execution on the leading edge, pass
229
- * `{leading: false}`. To disable execution on the trailing edge, ditto.
230
- * @license https://raw.github.com/jashkenas/underscore/master/LICENSE
231
- * @param {function} func
232
- * @param {number} wait
233
- * @param {Object=} options
234
- * @returns {Function}
235
- */
236
- Materialize.throttle = function(func, wait, options) {
237
- var context, args, result;
238
- var timeout = null;
239
- var previous = 0;
240
- options || (options = {});
241
- var later = function () {
242
- previous = options.leading === false ? 0 : getTime();
243
- timeout = null;
244
- result = func.apply(context, args);
245
- context = args = null;
246
- };
247
- return function () {
248
- var now = getTime();
249
- if (!previous && options.leading === false) previous = now;
250
- var remaining = wait - (now - previous);
251
- context = this;
252
- args = arguments;
253
- if (remaining <= 0) {
254
- clearTimeout(timeout);
255
- timeout = null;
256
- previous = now;
257
- result = func.apply(context, args);
258
- context = args = null;
259
- } else if (!timeout && options.trailing !== false) {
260
- timeout = setTimeout(later, remaining);
261
- }
262
- return result;
263
- };
264
- };
265
-
266
-
267
- // Velocity has conflicts when loaded with jQuery, this will check for it
268
- // First, check if in noConflict mode
269
- var Vel;
270
- if (jQuery) {
271
- Vel = jQuery.Velocity;
272
- } else if ($) {
273
- Vel = $.Velocity;
274
- } else {
275
- Vel = Velocity;
276
- }
277
-
278
-
279
- /***/ }),
280
- /* 3 */
281
- /***/ (function(module, exports) {
282
-
283
- (function ($) {
284
- $(document).ready(function() {
285
-
286
- // Function to update labels of text fields
287
- Materialize.updateTextFields = function() {
288
- var input_selector = 'input[type=text], input[type=password], input[type=email], input[type=url], input[type=tel], input[type=number], input[type=search], textarea';
289
- $(input_selector).each(function(index, element) {
290
- var $this = $(this);
291
- if ($(element).val().length > 0 || $(element).is(':focus') || element.autofocus || $this.attr('placeholder') !== undefined) {
292
- $this.siblings('label').addClass('active');
293
- } else if ($(element)[0].validity) {
294
- $this.siblings('label').toggleClass('active', $(element)[0].validity.badInput === true);
295
- } else {
296
- $this.siblings('label').removeClass('active');
297
- }
298
- });
299
- };
300
-
301
- // Text based inputs
302
- var input_selector = 'input[type=text], input[type=password], input[type=email], input[type=url], input[type=tel], input[type=number], input[type=search], textarea';
303
-
304
- // Add active if form auto complete
305
- $(document).on('change', input_selector, function () {
306
- if($(this).val().length !== 0 || $(this).attr('placeholder') !== undefined) {
307
- $(this).siblings('label').addClass('active');
308
- }
309
- validate_field($(this));
310
- });
311
-
312
- // Add active if input element has been pre-populated on document ready
313
- $(document).ready(function() {
314
- Materialize.updateTextFields();
315
- });
316
-
317
- // HTML DOM FORM RESET handling
318
- $(document).on('reset', function(e) {
319
- var formReset = $(e.target);
320
- if (formReset.is('form')) {
321
- formReset.find(input_selector).removeClass('valid').removeClass('invalid');
322
- formReset.find(input_selector).each(function () {
323
- if ($(this).attr('value') === '') {
324
- $(this).siblings('label').removeClass('active');
325
- }
326
- });
327
-
328
- // Reset select
329
- formReset.find('select.initialized').each(function () {
330
- var reset_text = formReset.find('option[selected]').text();
331
- formReset.siblings('input.select-dropdown').val(reset_text);
332
- });
333
- }
334
- });
335
-
336
- // Add active when element has focus
337
- $(document).on('focus', input_selector, function () {
338
- $(this).siblings('label, .prefix').addClass('active');
339
- });
340
-
341
- $(document).on('blur', input_selector, function () {
342
- var $inputElement = $(this);
343
- var selector = ".prefix";
344
-
345
- if ($inputElement.val().length === 0 && $inputElement[0].validity.badInput !== true && $inputElement.attr('placeholder') === undefined) {
346
- selector += ", label";
347
- }
348
-
349
- $inputElement.siblings(selector).removeClass('active');
350
-
351
- validate_field($inputElement);
352
- });
353
-
354
- window.validate_field = function(object) {
355
- var hasLength = object.attr('data-length') !== undefined;
356
- var lenAttr = parseInt(object.attr('data-length'));
357
- var len = object.val().length;
358
-
359
- if (object.val().length === 0 && object[0].validity.badInput === false && !object.is(':required')) {
360
- if (object.hasClass('validate')) {
361
- object.removeClass('valid');
362
- object.removeClass('invalid');
363
- }
364
- }
365
- else {
366
- if (object.hasClass('validate')) {
367
- // Check for character counter attributes
368
- if ((object.is(':valid') && hasLength && (len <= lenAttr)) || (object.is(':valid') && !hasLength)) {
369
- object.removeClass('invalid');
370
- object.addClass('valid');
371
- }
372
- else {
373
- object.removeClass('valid');
374
- object.addClass('invalid');
375
- }
376
- }
377
- }
378
- };
379
-
380
- // Radio and Checkbox focus class
381
- var radio_checkbox = 'input[type=radio], input[type=checkbox]';
382
- $(document).on('keyup.radio', radio_checkbox, function(e) {
383
- // TAB, check if tabbing to radio or checkbox.
384
- if (e.which === 9) {
385
- $(this).addClass('tabbed');
386
- var $this = $(this);
387
- $this.one('blur', function(e) {
388
-
389
- $(this).removeClass('tabbed');
390
- });
391
- return;
392
- }
393
- });
394
-
395
- // Textarea Auto Resize
396
- var hiddenDiv = $('.hiddendiv').first();
397
- if (!hiddenDiv.length) {
398
- hiddenDiv = $('<div class="hiddendiv common"></div>');
399
- $('body').append(hiddenDiv);
400
- }
401
- var text_area_selector = '.materialize-textarea';
402
-
403
- function textareaAutoResize($textarea) {
404
- // Set font properties of hiddenDiv
405
-
406
- var fontFamily = $textarea.css('font-family');
407
- var fontSize = $textarea.css('font-size');
408
- var lineHeight = $textarea.css('line-height');
409
- var padding = $textarea.css('padding');
410
-
411
- if (fontSize) { hiddenDiv.css('font-size', fontSize); }
412
- if (fontFamily) { hiddenDiv.css('font-family', fontFamily); }
413
- if (lineHeight) { hiddenDiv.css('line-height', lineHeight); }
414
- if (padding) { hiddenDiv.css('padding', padding); }
415
-
416
- // Set original-height, if none
417
- if (!$textarea.data('original-height')) {
418
- $textarea.data('original-height', $textarea.height());
419
- }
420
-
421
- if ($textarea.attr('wrap') === 'off') {
422
- hiddenDiv.css('overflow-wrap', 'normal')
423
- .css('white-space', 'pre');
424
- }
425
-
426
- hiddenDiv.text($textarea.val() + '\n');
427
- var content = hiddenDiv.html().replace(/\n/g, '<br>');
428
- hiddenDiv.html(content);
429
-
430
-
431
- // When textarea is hidden, width goes crazy.
432
- // Approximate with half of window size
433
-
434
- if ($textarea.is(':visible')) {
435
- hiddenDiv.css('width', $textarea.width());
436
- }
437
- else {
438
- hiddenDiv.css('width', $(window).width()/2);
439
- }
440
-
441
-
442
- /**
443
- * Resize if the new height is greater than the
444
- * original height of the textarea
445
- */
446
- if ($textarea.data('original-height') <= hiddenDiv.height()) {
447
- $textarea.css('height', hiddenDiv.height());
448
- } else if ($textarea.val().length < $textarea.data('previous-length')) {
449
- /**
450
- * In case the new height is less than original height, it
451
- * means the textarea has less text than before
452
- * So we set the height to the original one
453
- */
454
- $textarea.css('height', $textarea.data('original-height'));
455
- }
456
- $textarea.data('previous-length', $textarea.val().length);
457
- }
458
-
459
- $(text_area_selector).each(function () {
460
- var $textarea = $(this);
461
- /**
462
- * Instead of resizing textarea on document load,
463
- * store the original height and the original length
464
- */
465
- $textarea.data('original-height', $textarea.height());
466
- $textarea.data('previous-length', $textarea.val().length);
467
- });
468
-
469
- $('body').on('keyup keydown autoresize', text_area_selector, function () {
470
- textareaAutoResize($(this));
471
- });
472
-
473
- // File Input Path
474
- $(document).on('change', '.file-field input[type="file"]', function () {
475
- var file_field = $(this).closest('.file-field');
476
- var path_input = file_field.find('input.file-path');
477
- var files = $(this)[0].files;
478
- var file_names = [];
479
- for (var i = 0; i < files.length; i++) {
480
- file_names.push(files[i].name);
481
- }
482
- path_input.val(file_names.join(", "));
483
- path_input.trigger('change');
484
- });
485
-
486
- /****************
487
- * Range Input *
488
- ****************/
489
-
490
- var range_type = 'input[type=range]';
491
- var range_mousedown = false;
492
- var left;
493
-
494
- $(range_type).each(function () {
495
- var thumb = $('<span class="thumb"><span class="value"></span></span>');
496
- $(this).after(thumb);
497
- });
498
-
499
- var showRangeBubble = function(thumb) {
500
- var paddingLeft = parseInt(thumb.parent().css('padding-left'));
501
- var marginLeft = (-7 + paddingLeft) + 'px';
502
- thumb.velocity({ height: "30px", width: "30px", top: "-30px", marginLeft: marginLeft}, { duration: 300, easing: 'easeOutExpo' });
503
- };
504
-
505
- var calcRangeOffset = function(range) {
506
- var width = range.width() - 15;
507
- var max = parseFloat(range.attr('max'));
508
- var min = parseFloat(range.attr('min'));
509
- var percent = (parseFloat(range.val()) - min) / (max - min);
510
- return percent * width;
511
- }
512
-
513
- var range_wrapper = '.range-field';
514
- $(document).on('change', range_type, function(e) {
515
- var thumb = $(this).siblings('.thumb');
516
- thumb.find('.value').html($(this).val());
517
-
518
- if (!thumb.hasClass('active')) {
519
- showRangeBubble(thumb);
520
- }
521
-
522
- var offsetLeft = calcRangeOffset($(this));
523
- thumb.addClass('active').css('left', offsetLeft);
524
- });
525
-
526
- $(document).on('mousedown touchstart', range_type, function(e) {
527
- var thumb = $(this).siblings('.thumb');
528
-
529
- // If thumb indicator does not exist yet, create it
530
- if (thumb.length <= 0) {
531
- thumb = $('<span class="thumb"><span class="value"></span></span>');
532
- $(this).after(thumb);
533
- }
534
-
535
- // Set indicator value
536
- thumb.find('.value').html($(this).val());
537
-
538
- range_mousedown = true;
539
- $(this).addClass('active');
540
-
541
- if (!thumb.hasClass('active')) {
542
- showRangeBubble(thumb);
543
- }
544
-
545
- if (e.type !== 'input') {
546
- var offsetLeft = calcRangeOffset($(this));
547
- thumb.addClass('active').css('left', offsetLeft);
548
- }
549
- });
550
-
551
- $(document).on('mouseup touchend', range_wrapper, function() {
552
- range_mousedown = false;
553
- $(this).removeClass('active');
554
- });
555
-
556
- $(document).on('input mousemove touchmove', range_wrapper, function(e) {
557
- var thumb = $(this).children('.thumb');
558
- var left;
559
- var input = $(this).find(range_type);
560
-
561
- if (range_mousedown) {
562
- if (!thumb.hasClass('active')) {
563
- showRangeBubble(thumb);
564
- }
565
-
566
- var offsetLeft = calcRangeOffset(input);
567
- thumb.addClass('active').css('left', offsetLeft);
568
- thumb.find('.value').html(thumb.siblings(range_type).val());
569
- }
570
- });
571
-
572
- $(document).on('mouseout touchleave', range_wrapper, function() {
573
- if (!range_mousedown) {
574
-
575
- var thumb = $(this).children('.thumb');
576
- var paddingLeft = parseInt($(this).css('padding-left'));
577
- var marginLeft = (7 + paddingLeft) + 'px';
578
-
579
- if (thumb.hasClass('active')) {
580
- thumb.velocity({ height: '0', width: '0', top: '10px', marginLeft: marginLeft}, { duration: 100 });
581
- }
582
- thumb.removeClass('active');
583
- }
584
- });
585
-
586
- /**************************
587
- * Auto complete plugin *
588
- *************************/
589
- $.fn.autocomplete = function (options) {
590
- // Defaults
591
- var defaults = {
592
- data: {},
593
- limit: Infinity,
594
- onAutocomplete: null,
595
- minLength: 1
596
- };
597
-
598
- options = $.extend(defaults, options);
599
-
600
- return this.each(function() {
601
- var $input = $(this);
602
- var data = options.data,
603
- count = 0,
604
- activeIndex = -1,
605
- oldVal,
606
- $inputDiv = $input.closest('.input-field'); // Div to append on
607
-
608
- // Check if data isn't empty
609
- if (!$.isEmptyObject(data)) {
610
- var $autocomplete = $('<ul class="autocomplete-content dropdown-content"></ul>');
611
- var $oldAutocomplete;
612
-
613
- // Append autocomplete element.
614
- // Prevent double structure init.
615
- if ($inputDiv.length) {
616
- $oldAutocomplete = $inputDiv.children('.autocomplete-content.dropdown-content').first();
617
- if (!$oldAutocomplete.length) {
618
- $inputDiv.append($autocomplete); // Set ul in body
619
- }
620
- } else {
621
- $oldAutocomplete = $input.next('.autocomplete-content.dropdown-content');
622
- if (!$oldAutocomplete.length) {
623
- $input.after($autocomplete);
624
- }
625
- }
626
- if ($oldAutocomplete.length) {
627
- $autocomplete = $oldAutocomplete;
628
- }
629
-
630
- // Highlight partial match.
631
- var highlight = function(string, $el) {
632
- var img = $el.find('img');
633
- var matchStart = $el.text().toLowerCase().indexOf("" + string.toLowerCase() + ""),
634
- matchEnd = matchStart + string.length - 1,
635
- beforeMatch = $el.text().slice(0, matchStart),
636
- matchText = $el.text().slice(matchStart, matchEnd + 1),
637
- afterMatch = $el.text().slice(matchEnd + 1);
638
- $el.html("<span>" + beforeMatch + "<span class='highlight'>" + matchText + "</span>" + afterMatch + "</span>");
639
- if (img.length) {
640
- $el.prepend(img);
641
- }
642
- };
643
-
644
- // Reset current element position
645
- var resetCurrentElement = function() {
646
- activeIndex = -1;
647
- $autocomplete.find('.active').removeClass('active');
648
- }
649
-
650
- // Remove autocomplete elements
651
- var removeAutocomplete = function() {
652
- $autocomplete.empty();
653
- resetCurrentElement();
654
- oldVal = undefined;
655
- };
656
-
657
- $input.off('blur.autocomplete').on('blur.autocomplete', function() {
658
- removeAutocomplete();
659
- });
660
-
661
- // Perform search
662
- $input.off('keyup.autocomplete focus.autocomplete').on('keyup.autocomplete focus.autocomplete', function (e) {
663
- // Reset count.
664
- count = 0;
665
- var val = $input.val().toLowerCase();
666
-
667
- // Don't capture enter or arrow key usage.
668
- if (e.which === 13 ||
669
- e.which === 38 ||
670
- e.which === 40) {
671
- return;
672
- }
673
-
674
-
675
- // Check if the input isn't empty
676
- if (oldVal !== val) {
677
- removeAutocomplete();
678
-
679
- if (val.length >= options.minLength) {
680
- for(var key in data) {
681
- if (data.hasOwnProperty(key) &&
682
- key.toLowerCase().indexOf(val) !== -1) {
683
- // Break if past limit
684
- if (count >= options.limit) {
685
- break;
686
- }
687
-
688
- var autocompleteOption = $('<li></li>');
689
- if (!!data[key]) {
690
- autocompleteOption.append('<img src="'+ data[key] +'" class="right circle"><span>'+ key +'</span>');
691
- } else {
692
- autocompleteOption.append('<span>'+ key +'</span>');
693
- }
694
-
695
- $autocomplete.append(autocompleteOption);
696
- highlight(val, autocompleteOption);
697
- count++;
698
- }
699
- }
700
- }
701
- }
702
-
703
- // Update oldVal
704
- oldVal = val;
705
- });
706
-
707
- $input.off('keydown.autocomplete').on('keydown.autocomplete', function (e) {
708
- // Arrow keys and enter key usage
709
- var keyCode = e.which,
710
- liElement,
711
- numItems = $autocomplete.children('li').length,
712
- $active = $autocomplete.children('.active').first();
713
-
714
- // select element on Enter
715
- if (keyCode === 13 && activeIndex >= 0) {
716
- liElement = $autocomplete.children('li').eq(activeIndex);
717
- if (liElement.length) {
718
- liElement.trigger('mousedown.autocomplete');
719
- e.preventDefault();
720
- }
721
- return;
722
- }
723
-
724
- // Capture up and down key
725
- if ( keyCode === 38 || keyCode === 40 ) {
726
- e.preventDefault();
727
-
728
- if (keyCode === 38 &&
729
- activeIndex > 0) {
730
- activeIndex--;
731
- }
732
-
733
- if (keyCode === 40 &&
734
- activeIndex < (numItems - 1)) {
735
- activeIndex++;
736
- }
737
-
738
- $active.removeClass('active');
739
- if (activeIndex >= 0) {
740
- $autocomplete.children('li').eq(activeIndex).addClass('active');
741
- }
742
- }
743
- });
744
-
745
- // Set input value
746
- $autocomplete.off('mousedown.autocomplete touchstart.autocomplete').on('mousedown.autocomplete touchstart.autocomplete', 'li', function () {
747
- var text = $(this).text().trim();
748
- $input.val(text);
749
- $input.trigger('change');
750
- removeAutocomplete();
751
-
752
- // Handle onAutocomplete callback.
753
- if (typeof(options.onAutocomplete) === "function") {
754
- options.onAutocomplete.call(this, text);
755
- }
756
- });
757
-
758
- // Empty data
759
- } else {
760
- $input.off('keyup.autocomplete focus.autocomplete');
761
- }
762
- });
763
- };
764
-
765
- }); // End of $(document).ready
766
-
767
- /*******************
768
- * Select Plugin *
769
- ******************/
770
- $.fn.material_select = function (callback) {
771
- $(this).each(function(){
772
- var $select = $(this);
773
-
774
- if ($select.hasClass('browser-default')) {
775
- return; // Continue to next (return false breaks out of entire loop)
776
- }
777
-
778
- var multiple = $select.attr('multiple') ? true : false,
779
- lastID = $select.attr('data-select-id'); // Tear down structure if Select needs to be rebuilt
780
-
781
- if (lastID) {
782
- $select.parent().find('span.caret').remove();
783
- $select.parent().find('input').remove();
784
-
785
- $select.unwrap();
786
- $('ul#select-options-'+lastID).remove();
787
- }
788
-
789
- // If destroying the select, remove the selelct-id and reset it to it's uninitialized state.
790
- if(callback === 'destroy') {
791
- $select.removeAttr('data-select-id').removeClass('initialized');
792
- $(window).off('click.select');
793
- return;
794
- }
795
-
796
- var uniqueID = Materialize.guid();
797
- $select.attr('data-select-id', uniqueID);
798
- var wrapper = $('<div class="select-wrapper"></div>');
799
- wrapper.addClass($select.attr('class'));
800
- if ($select.is(':disabled'))
801
- wrapper.addClass('disabled');
802
- var options = $('<ul id="select-options-' + uniqueID +'" class="dropdown-content select-dropdown ' + (multiple ? 'multiple-select-dropdown' : '') + '"></ul>'),
803
- selectChildren = $select.children('option, optgroup'),
804
- valuesSelected = [],
805
- optionsHover = false;
806
-
807
- var label = $select.find('option:selected').html() || $select.find('option:first').html() || "";
808
-
809
- // Function that renders and appends the option taking into
810
- // account type and possible image icon.
811
- var appendOptionWithIcon = function(select, option, type) {
812
- // Add disabled attr if disabled
813
- var disabledClass = (option.is(':disabled')) ? 'disabled ' : '';
814
- var optgroupClass = (type === 'optgroup-option') ? 'optgroup-option ' : '';
815
- var multipleCheckbox = multiple ? '<input type="checkbox"' + disabledClass + '/><label></label>' : '';
816
-
817
- // add icons
818
- var icon_url = option.data('icon');
819
- var classes = option.attr('class');
820
- if (!!icon_url) {
821
- var classString = '';
822
- if (!!classes) classString = ' class="' + classes + '"';
823
-
824
- // Check for multiple type.
825
- options.append($('<li class="' + disabledClass + optgroupClass + '"><img alt="" src="' + icon_url + '"' + classString + '><span>' + multipleCheckbox + option.html() + '</span></li>'));
826
- return true;
827
- }
828
-
829
- // Check for multiple type.
830
- options.append($('<li class="' + disabledClass + optgroupClass + '"><span>' + multipleCheckbox + option.html() + '</span></li>'));
831
- };
832
-
833
- /* Create dropdown structure. */
834
- if (selectChildren.length) {
835
- selectChildren.each(function() {
836
- if ($(this).is('option')) {
837
- // Direct descendant option.
838
- if (multiple) {
839
- appendOptionWithIcon($select, $(this), 'multiple');
840
-
841
- } else {
842
- appendOptionWithIcon($select, $(this));
843
- }
844
- } else if ($(this).is('optgroup')) {
845
- // Optgroup.
846
- var selectOptions = $(this).children('option');
847
- options.append($('<li class="optgroup"><span>' + $(this).attr('label') + '</span></li>'));
848
-
849
- selectOptions.each(function() {
850
- appendOptionWithIcon($select, $(this), 'optgroup-option');
851
- });
852
- }
853
- });
854
- }
855
-
856
- options.find('li:not(.optgroup)').each(function (i) {
857
- $(this).click(function (e) {
858
- // Check if option element is disabled
859
- if (!$(this).hasClass('disabled') && !$(this).hasClass('optgroup')) {
860
- var selected = true;
861
-
862
- if (multiple) {
863
- $('input[type="checkbox"]', this).prop('checked', function(i, v) { return !v; });
864
- selected = toggleEntryFromArray(valuesSelected, i, $select);
865
- $newSelect.trigger('focus');
866
- } else {
867
- options.find('li').removeClass('active');
868
- $(this).toggleClass('active');
869
- $newSelect.val($(this).text());
870
- }
871
-
872
- activateOption(options, $(this));
873
- $select.find('option').eq(i).prop('selected', selected);
874
- // Trigger onchange() event
875
- $select.trigger('change');
876
- if (typeof callback !== 'undefined') callback();
877
- }
878
-
879
- e.stopPropagation();
880
- });
881
- });
882
-
883
- // Wrap Elements
884
- $select.wrap(wrapper);
885
- // Add Select Display Element
886
- var dropdownIcon = $('<span class="caret">&#9660;</span>');
887
-
888
- // escape double quotes
889
- var sanitizedLabelHtml = label.replace(/"/g, '&quot;');
890
-
891
- var $newSelect = $('<input type="text" class="select-dropdown" readonly="true" ' + (($select.is(':disabled')) ? 'disabled' : '') + ' data-activates="select-options-' + uniqueID +'" value="'+ sanitizedLabelHtml +'"/>');
892
- $select.before($newSelect);
893
- $newSelect.before(dropdownIcon);
894
-
895
- $newSelect.after(options);
896
- // Check if section element is disabled
897
- if (!$select.is(':disabled')) {
898
- $newSelect.dropdown({'hover': false});
899
- }
900
-
901
- // Copy tabindex
902
- if ($select.attr('tabindex')) {
903
- $($newSelect[0]).attr('tabindex', $select.attr('tabindex'));
904
- }
905
-
906
- $select.addClass('initialized');
907
-
908
- $newSelect.on({
909
- 'focus': function (){
910
- if ($('ul.select-dropdown').not(options[0]).is(':visible')) {
911
- $('input.select-dropdown').trigger('close');
912
- $(window).off('click.select');
913
- }
914
- if (!options.is(':visible')) {
915
- $(this).trigger('open', ['focus']);
916
- var label = $(this).val();
917
- if (multiple && label.indexOf(',') >= 0) {
918
- label = label.split(',')[0];
919
- }
920
-
921
- var selectedOption = options.find('li').filter(function() {
922
- return $(this).text().toLowerCase() === label.toLowerCase();
923
- })[0];
924
- activateOption(options, selectedOption, true);
925
-
926
- $(window).off('click.select').on('click.select', function () {
927
- multiple && (optionsHover || $newSelect.trigger('close'));
928
- $(window).off('click.select');
929
- });
930
- }
931
- },
932
- 'click': function (e){
933
- e.stopPropagation();
934
- }
935
- });
936
-
937
- $newSelect.on('blur', function() {
938
- if (!multiple) {
939
- $(this).trigger('close');
940
- $(window).off('click.select');
941
- }
942
- options.find('li.selected').removeClass('selected');
943
- });
944
-
945
- options.hover(function() {
946
- optionsHover = true;
947
- }, function () {
948
- optionsHover = false;
949
- });
950
-
951
- // Add initial multiple selections.
952
- if (multiple) {
953
- $select.find("option:selected:not(:disabled)").each(function () {
954
- var index = $(this).index();
955
-
956
- toggleEntryFromArray(valuesSelected, index, $select);
957
- options.find("li").eq(index).find(":checkbox").prop("checked", true);
958
- });
959
- }
960
-
961
- /**
962
- * Make option as selected and scroll to selected position
963
- * @param {jQuery} collection Select options jQuery element
964
- * @param {Element} newOption element of the new option
965
- * @param {Boolean} firstActivation If on first activation of select
966
- */
967
- var activateOption = function(collection, newOption, firstActivation) {
968
- if (newOption) {
969
- collection.find('li.selected').removeClass('selected');
970
- var option = $(newOption);
971
- option.addClass('selected');
972
- if (!multiple || !!firstActivation) {
973
- options.scrollTo(option);
974
- }
975
- }
976
- };
977
-
978
- // Allow user to search by typing
979
- // this array is cleared after 1 second
980
- var filterQuery = [],
981
- onKeyDown = function(e){
982
- // TAB - switch to another input
983
- if(e.which == 9){
984
- $newSelect.trigger('close');
985
- return;
986
- }
987
-
988
- // ARROW DOWN WHEN SELECT IS CLOSED - open select options
989
- if(e.which == 40 && !options.is(':visible')){
990
- $newSelect.trigger('open');
991
- return;
992
- }
993
-
994
- // ENTER WHEN SELECT IS CLOSED - submit form
995
- if(e.which == 13 && !options.is(':visible')){
996
- return;
997
- }
998
-
999
- e.preventDefault();
1000
-
1001
- // CASE WHEN USER TYPE LETTERS
1002
- var letter = String.fromCharCode(e.which).toLowerCase(),
1003
- nonLetters = [9,13,27,38,40];
1004
- if (letter && (nonLetters.indexOf(e.which) === -1)) {
1005
- filterQuery.push(letter);
1006
-
1007
- var string = filterQuery.join(''),
1008
- newOption = options.find('li').filter(function() {
1009
- return $(this).text().toLowerCase().indexOf(string) === 0;
1010
- })[0];
1011
-
1012
- if (newOption) {
1013
- activateOption(options, newOption);
1014
- }
1015
- }
1016
-
1017
- // ENTER - select option and close when select options are opened
1018
- if (e.which == 13) {
1019
- var activeOption = options.find('li.selected:not(.disabled)')[0];
1020
- if(activeOption){
1021
- $(activeOption).trigger('click');
1022
- if (!multiple) {
1023
- $newSelect.trigger('close');
1024
- }
1025
- }
1026
- }
1027
-
1028
- // ARROW DOWN - move to next not disabled option
1029
- if (e.which == 40) {
1030
- if (options.find('li.selected').length) {
1031
- newOption = options.find('li.selected').next('li:not(.disabled)')[0];
1032
- } else {
1033
- newOption = options.find('li:not(.disabled)')[0];
1034
- }
1035
- activateOption(options, newOption);
1036
- }
1037
-
1038
- // ESC - close options
1039
- if (e.which == 27) {
1040
- $newSelect.trigger('close');
1041
- }
1042
-
1043
- // ARROW UP - move to previous not disabled option
1044
- if (e.which == 38) {
1045
- newOption = options.find('li.selected').prev('li:not(.disabled)')[0];
1046
- if(newOption)
1047
- activateOption(options, newOption);
1048
- }
1049
-
1050
- // Automaticaly clean filter query so user can search again by starting letters
1051
- setTimeout(function(){ filterQuery = []; }, 1000);
1052
- };
1053
-
1054
- $newSelect.on('keydown', onKeyDown);
1055
- });
1056
-
1057
- function toggleEntryFromArray(entriesArray, entryIndex, select) {
1058
- var index = entriesArray.indexOf(entryIndex),
1059
- notAdded = index === -1;
1060
-
1061
- if (notAdded) {
1062
- entriesArray.push(entryIndex);
1063
- } else {
1064
- entriesArray.splice(index, 1);
1065
- }
1066
-
1067
- select.siblings('ul.dropdown-content').find('li:not(.optgroup)').eq(entryIndex).toggleClass('active');
1068
-
1069
- // use notAdded instead of true (to detect if the option is selected or not)
1070
- select.find('option').eq(entryIndex).prop('selected', notAdded);
1071
- setValueToInput(entriesArray, select);
1072
-
1073
- return notAdded;
1074
- }
1075
-
1076
- function setValueToInput(entriesArray, select) {
1077
- var value = '';
1078
-
1079
- for (var i = 0, count = entriesArray.length; i < count; i++) {
1080
- var text = select.find('option').eq(entriesArray[i]).text();
1081
-
1082
- i === 0 ? value += text : value += ', ' + text;
1083
- }
1084
-
1085
- if (value === '') {
1086
- value = select.find('option:disabled').eq(0).text();
1087
- }
1088
-
1089
- select.siblings('input.select-dropdown').val(value);
1090
- }
1091
- };
1092
-
1093
- }( jQuery ));
1094
-
1095
-
1096
- /***/ }),
1097
- /* 4 */
1098
- /***/ (function(module, exports) {
1099
-
1100
- (function ($) {
1101
- $(document).ready(function() {
1102
-
1103
- // jQuery reverse
1104
- $.fn.reverse = [].reverse;
1105
-
1106
- // Hover behaviour: make sure this doesn't work on .click-to-toggle FABs!
1107
- $(document).on('mouseenter.fixedActionBtn', '.fixed-action-btn:not(.click-to-toggle):not(.toolbar)', function(e) {
1108
- var $this = $(this);
1109
- openFABMenu($this);
1110
- });
1111
- $(document).on('mouseleave.fixedActionBtn', '.fixed-action-btn:not(.click-to-toggle):not(.toolbar)', function(e) {
1112
- var $this = $(this);
1113
- closeFABMenu($this);
1114
- });
1115
-
1116
- // Toggle-on-click behaviour.
1117
- $(document).on('click.fabClickToggle', '.fixed-action-btn.click-to-toggle > a', function(e) {
1118
- var $this = $(this);
1119
- var $menu = $this.parent();
1120
- if ($menu.hasClass('active')) {
1121
- closeFABMenu($menu);
1122
- } else {
1123
- openFABMenu($menu);
1124
- }
1125
- });
1126
-
1127
- // Toolbar transition behaviour.
1128
- $(document).on('click.fabToolbar', '.fixed-action-btn.toolbar > a', function(e) {
1129
- var $this = $(this);
1130
- var $menu = $this.parent();
1131
- FABtoToolbar($menu);
1132
- });
1133
-
1134
- });
1135